This commit is contained in:
@@ -326,8 +326,6 @@ BEGIN
|
||||
-- Object type to table name
|
||||
-- //CoreBizObject add here
|
||||
case ayobjecttype
|
||||
when XX_NONAME return 'LT:XXX';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
when 0 then return 'LT:NoType';
|
||||
when 1 then return 'LT:Global';
|
||||
when 2 then aytable = 'awidget';
|
||||
@@ -347,115 +345,56 @@ BEGIN
|
||||
when 16 then aytable = 'aloanunit';
|
||||
when 17 then aytable = 'afileattachment'; aynamecolumn ='displayfilename';
|
||||
when 18 then aytable = 'adatalistview';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
when XX_COREBIZ then aytable = 'XXX';
|
||||
|
||||
|
||||
|
||||
|
||||
when 25 then aytable = 'aproject';
|
||||
when 33 then aytable = 'avendor';
|
||||
when 19 then aytable = 'aformcustom'; aynamecolumn = 'formkey';
|
||||
when 20 then aytable = 'apart';
|
||||
when 21 then aytable = 'apm'; aynamecolumn ='serial';
|
||||
when 22 then aytable = 'apmitem';
|
||||
when 23 then aytable = 'apmtemplate';
|
||||
when 24 then aytable = 'apmtemplateitem';
|
||||
when 25 then aytable = 'aproject';
|
||||
when 26 then aytable = 'apurchaseorder'; aynamecolumn ='serial';
|
||||
when 27 then aytable = 'aquote'; aynamecolumn ='serial';
|
||||
when 28 then aytable = 'aquoteitem';
|
||||
when 29 then aytable = 'aquotetemplate';
|
||||
when 30 then aytable = 'aquotetemplateitem';
|
||||
when 31 then aytable = 'aunit';
|
||||
when 32 then aytable = 'aunitmodel';
|
||||
when 33 then aytable = 'avendor';
|
||||
when 34 then aytable = 'aworkorder'; aynamecolumn ='serial';
|
||||
when 35 then aytable = 'aworkorderitem';
|
||||
when 36 then aytable = 'aworkorderitemmiscexpense';
|
||||
when 37 then aytable = 'aworkorderitemlabor';
|
||||
when 38 then aytable = 'aworkorderitemloan';
|
||||
when 39 then aytable = 'aworkorderitempart';
|
||||
when 40 then aytable = 'aworkorderitempartrequest';
|
||||
when 41 then aytable = 'aworkorderitemscheduleduser';
|
||||
when 42 then aytable = 'aworkorderitemtask';
|
||||
when 43 then aytable = 'aworkorderitemtravel';
|
||||
when 44 then aytable = 'aworkorderitemunit';
|
||||
when 45 then aytable = 'aworkordertemplate';
|
||||
when 46 then aytable = 'aworkordertemplateitem';
|
||||
when 47 return 'LT:GlobalOps';
|
||||
when 48 return 'LT:BizMetrics';
|
||||
when 49 return 'LT:Backup';
|
||||
when 50 then aytable = 'anotification';
|
||||
when 51 return 'LT:NotifySubscription';
|
||||
when 52 then aytable = 'areminder';
|
||||
when 53 return 'LT:UnitMeterReading';
|
||||
when 54 then aytable = 'acustomerservicerequest';
|
||||
when 55 return 'LT:ServiceBank';
|
||||
when 56 return 'LT:OpsNotificationSettings';
|
||||
when 57 then aytable = 'areport';
|
||||
when 58 return 'LT:DashBoardView';
|
||||
when 59 then aytable = 'acustomernote';
|
||||
when 60 then aytable = 'amemo';
|
||||
when 61 then aytable = 'areview';
|
||||
else
|
||||
RETURN format('??PUBLIC.AYGETNAME-UNKNOWN_TYPE:%S',ayobjecttype);-- This should not happen unless dev forgot to update this
|
||||
end case;
|
||||
EXECUTE format('SELECT %I FROM %I WHERE id = %L', aynamecolumn, aytable, ayobjectid) INTO returnstr;
|
||||
RETURN returnstr;
|
||||
END;
|
||||
$BODY$ LANGUAGE PLPGSQL STABLE /*
|
||||
|
||||
= 9,
|
||||
[CoreBizObject]
|
||||
= 10,
|
||||
= 11,
|
||||
= 12,
|
||||
= 13,
|
||||
= 14,
|
||||
[CoreBizObject]
|
||||
= 15,
|
||||
[CoreBizObject]
|
||||
= 16,
|
||||
= 17, see namefetcher
|
||||
= 18,
|
||||
FormCustom = 19, see namefetcher
|
||||
[CoreBizObject]
|
||||
Part = 20,
|
||||
[CoreBizObject]
|
||||
PM = 21,
|
||||
[CoreBizObject]
|
||||
PMItem = 22,
|
||||
[CoreBizObject]
|
||||
PMTemplate = 23,
|
||||
[CoreBizObject]
|
||||
PMTemplateItem = 24,
|
||||
[CoreBizObject]
|
||||
Project = 25,
|
||||
[CoreBizObject]
|
||||
PurchaseOrder = 26,
|
||||
[CoreBizObject]
|
||||
Quote = 27,
|
||||
[CoreBizObject]
|
||||
QuoteItem = 28,
|
||||
[CoreBizObject]
|
||||
QuoteTemplate = 29,
|
||||
[CoreBizObject]
|
||||
QuoteTemplateItem = 30,
|
||||
[CoreBizObject]
|
||||
Unit = 31,
|
||||
[CoreBizObject]
|
||||
UnitModel = 32,
|
||||
[CoreBizObject]
|
||||
Vendor = 33,
|
||||
//--- WorkOrder
|
||||
[CoreBizObject]
|
||||
WorkOrder = 34,
|
||||
[CoreBizObject]
|
||||
WorkOrderItem = 35,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemExpense = 36,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemLabor = 37,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemLoan = 38,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemPart = 39,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemPartRequest = 40,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemScheduledUser = 41,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemTask = 42,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemTravel = 43,
|
||||
[CoreBizObject]
|
||||
WorkOrderItemUnit = 44,
|
||||
//---
|
||||
[CoreBizObject]
|
||||
WorkOrderTemplate = 45,
|
||||
[CoreBizObject]
|
||||
WorkOrderTemplateItem = 46,
|
||||
GlobalOps = 47,//really only used for rights, not an object type of any kind
|
||||
BizMetrics = 48,//deprecate? Not used for anything as of nov 2020
|
||||
Backup = 49,
|
||||
Notification = 50,
|
||||
NotifySubscription = 51,
|
||||
[CoreBizObject]
|
||||
Reminder = 52,
|
||||
UnitMeterReading = 53,
|
||||
CustomerServiceRequest = 54,
|
||||
ServiceBank = 55,
|
||||
OpsNotificationSettings = 56,
|
||||
Report = 57,
|
||||
DashboardView = 58,
|
||||
[CoreBizObject]
|
||||
CustomerNote = 59,
|
||||
[CoreBizObject]
|
||||
Memo = 60,
|
||||
[CoreBizObject]
|
||||
Review = 61
|
||||
*/");
|
||||
$BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
//Usage: select created, textra, AYGETNAME(aevent.ayid, aevent.ayatype) as name from aevent order by created
|
||||
|
||||
@@ -714,7 +653,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE /*
|
||||
await ExecQueryAsync("CREATE UNIQUE INDEX aproject_name_id_idx ON aproject (id, name);");
|
||||
await ExecQueryAsync("CREATE INDEX aproject_tags ON aproject using GIN(tags)");
|
||||
|
||||
//PURCHASEORDER
|
||||
//PURCHASEORDER
|
||||
//Note don't forget to update name fetcher stored procedure when change this to serial from name
|
||||
await ExecQueryAsync("CREATE TABLE apurchaseorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " +
|
||||
"notes text, wiki text, customfields text, tags varchar(255) ARRAY )");
|
||||
await ExecQueryAsync("CREATE UNIQUE INDEX apurchaseorder_name_id_idx ON apurchaseorder (id, name);");
|
||||
|
||||
Reference in New Issue
Block a user