This commit is contained in:
552
server/AyaNova/DataList/WorkOrderItemLaborDataList.cs
Normal file
552
server/AyaNova/DataList/WorkOrderItemLaborDataList.cs
Normal file
@@ -0,0 +1,552 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class WorkOrderItemLaborDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public WorkOrderItemLaborDataList()
|
||||
{
|
||||
DefaultListAType = AyaType.WorkOrder;
|
||||
SQLFrom = "from aworkorder "
|
||||
+ "left join aworkorderstatus on (aworkorder.laststatusid = aworkorderstatus.id) "
|
||||
+ "left join acustomer on (aworkorder.customerid=acustomer.id) "
|
||||
+ "left join aheadoffice on (acustomer.headofficeid=aheadoffice.id) "
|
||||
+ "left join aproject on (aworkorder.projectid=aproject.id) "
|
||||
+ "left join acontract on (aworkorder.contractid=acontract.id)"
|
||||
+ "left join aworkorderitem on aworkorder.id=aworkorderitem.workorderid "
|
||||
+ "left join aworkorderitemstatus on (aworkorderitem.workorderitemstatusid = aworkorderitemstatus.id) "
|
||||
+ "left join aworkorderitempriority on (aworkorderitem.workorderitempriorityid = aworkorderitempriority.id) "
|
||||
|
||||
//workorder item labor
|
||||
+ "left join aworkorderitemlabor on aworkorderitem.id=aworkorderitemlabor.workorderitemid "
|
||||
+ "left join auser on (aworkorderitemlabor.userid=auser.id) "
|
||||
+ "left join aservicerate on (aworkorderitemlabor.servicerateid=aservicerate.id) "
|
||||
|
||||
;
|
||||
|
||||
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
DefaultColumns = new List<string>() {
|
||||
"WorkOrderSerialNumber",
|
||||
"WorkOrderItemSequence",
|
||||
"WorkOrderItemSummary",
|
||||
"Customer",
|
||||
"WorkOrderServiceDate",
|
||||
"WorkOrderItemLaborUserID",
|
||||
"WorkOrderItemLaborServiceRateQuantity",
|
||||
"WorkOrderItemLaborServiceRateID"
|
||||
|
||||
};
|
||||
DefaultSortBy = new Dictionary<string, string>() { { "WorkOrderSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemLaborUserID", "+" } };
|
||||
FieldDefinitions = new List<DataListFieldDefinition>();
|
||||
|
||||
/*
|
||||
██╗ █████╗ ██████╗ ██████╗ ██████╗
|
||||
██║ ██╔══██╗██╔══██╗██╔═══██╗██╔══██╗
|
||||
██║ ███████║██████╔╝██║ ██║██████╔╝
|
||||
██║ ██╔══██║██╔══██╗██║ ██║██╔══██╗
|
||||
███████╗██║ ██║██████╔╝╚██████╔╝██║ ██║
|
||||
╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
*/
|
||||
#region WorkOrderItemLabor fields
|
||||
/*
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceStartDate", FieldKey = "WorkOrderItemLaborServiceStartDate", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceStopDate", FieldKey = "WorkOrderItemLaborServiceStopDate", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceRateQuantity", FieldKey = "WorkOrderItemLaborServiceRateQuantity", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceRateID", FieldKey = "WorkOrderItemLaborServiceRateID", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceDetails", FieldKey = "WorkOrderItemLaborServiceDetails", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborUserID", FieldKey = "WorkOrderItemLaborUserID", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborNoChargeQuantity", FieldKey = "WorkOrderItemLaborNoChargeQuantity", TKeySection = "WorkOrderItemLabors" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLaborTaxRateSaleID", FieldKey = "WorkOrderItemLaborTaxRateSaleID", TKeySection = "WorkOrderItemLabors" });
|
||||
|
||||
"CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMP, servicestopdate TIMESTAMP, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
*/
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborUserID",
|
||||
FieldKey = "WorkOrderItemLaborUserID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemLabor,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "auser.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborServiceRateQuantity",
|
||||
FieldKey = "WorkOrderItemLaborServiceRateQuantity",
|
||||
AType = (int)AyaType.WorkOrderItemLabor,
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "aworkorderitemlabor.serviceratequantity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborServiceRateID",
|
||||
FieldKey = "WorkOrderItemLaborServiceRateID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.ServiceRate,
|
||||
SqlIdColumnName = "aworkorderitemlabor.servicerateid",
|
||||
SqlValueColumnName = "aservicerate.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborServiceStartDate",
|
||||
FieldKey = "WorkOrderItemLaborServiceStartDate",
|
||||
AType = (int)AyaType.WorkOrderItemLabor,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "aworkorderitemlabor.servicestartdate",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborServiceStopDate",
|
||||
FieldKey = "WorkOrderItemLaborServiceStopDate",
|
||||
AType = (int)AyaType.WorkOrderItemLabor,
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "aworkorderitemlabor.servicestopdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborServiceDetails",
|
||||
FieldKey = "WorkOrderItemLaborServiceDetails",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorderitemlabor.servicedetails"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemLaborNoChargeQuantity",
|
||||
FieldKey = "WorkOrderItemLaborNoChargeQuantity",
|
||||
AType = (int)AyaType.WorkOrderItemLabor,
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "aworkorderitemlabor.nochargequantity"
|
||||
});
|
||||
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metawoitemlaborid",
|
||||
UiFieldDataType = (int)UiFieldDataType.InternalId,
|
||||
SqlIdColumnName = "aworkorderitemlabor.id",
|
||||
SqlValueColumnName = "aworkorderitemlabor.id",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗████████╗███████╗███╗ ███╗███████╗
|
||||
██║╚══██╔══╝██╔════╝████╗ ████║██╔════╝
|
||||
██║ ██║ █████╗ ██╔████╔██║███████╗
|
||||
██║ ██║ ██╔══╝ ██║╚██╔╝██║╚════██║
|
||||
██║ ██║ ███████╗██║ ╚═╝ ██║███████║
|
||||
╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝
|
||||
*/
|
||||
#region WorkOrderItem fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemSummary",
|
||||
FieldKey = "WorkOrderItemSummary",
|
||||
AType = (int)AyaType.WorkOrderItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aworkorderitem.id",
|
||||
SqlValueColumnName = "aworkorderitem.notes",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Sequence",
|
||||
FieldKey = "WorkOrderItemSequence",
|
||||
AType = (int)AyaType.WorkOrderItem,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "aworkorderitem.id",
|
||||
SqlValueColumnName = "aworkorderitem.sequence"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemTechNotes",
|
||||
FieldKey = "WorkOrderItemTechNotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorderitem.technotes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "WorkOrderItemTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aworkorderitem.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWorkOrderStatusID",
|
||||
FieldKey = "WorkOrderItemWorkOrderStatusID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "aworkorderitem.workorderitemstatusid",
|
||||
SqlColorColumnName = "aworkorderitemstatus.color",
|
||||
SqlValueColumnName = "aworkorderitemstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPriorityID",
|
||||
FieldKey = "WorkOrderItemPriorityID",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderItemStatus,
|
||||
SqlIdColumnName = "aworkorderitem.workorderitempriorityid",
|
||||
SqlColorColumnName = "aworkorderitempriority.color",
|
||||
SqlValueColumnName = "aworkorderitempriority.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemRequestDate",
|
||||
FieldKey = "WorkOrderItemRequestDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aworkorderitem.requestdate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemWarrantyService",
|
||||
FieldKey = "WorkOrderItemWarrantyService",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aworkorderitem.warrantyservice"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom1", FieldKey = "workorderitemcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom2", FieldKey = "workorderitemcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom3", FieldKey = "workorderitemcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom4", FieldKey = "workorderitemcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom5", FieldKey = "workorderitemcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom6", FieldKey = "workorderitemcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom7", FieldKey = "workorderitemcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom8", FieldKey = "workorderitemcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom9", FieldKey = "workorderitemcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom10", FieldKey = "workorderitemcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom11", FieldKey = "workorderitemcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom12", FieldKey = "workorderitemcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom13", FieldKey = "workorderitemcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom14", FieldKey = "workorderitemcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom15", FieldKey = "workorderitemcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderItemCustom16", FieldKey = "workorderitemcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorderitem.customfields", TKeySection = "WorkOrderItem" });
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion workorderitem fields
|
||||
|
||||
|
||||
|
||||
/*
|
||||
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗
|
||||
██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗
|
||||
██║ █╗ ██║██║ ██║██████╔╝█████╔╝█████╗██║ ██║██████╔╝██║ ██║█████╗ ██████╔╝
|
||||
██║███╗██║██║ ██║██╔══██╗██╔═██╗╚════╝██║ ██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗
|
||||
╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║
|
||||
╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
|
||||
*/
|
||||
#region WorkOrder Header fields
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSerialNumber",
|
||||
FieldKey = "WorkOrderSerialNumber",
|
||||
AType = (int)AyaType.WorkOrder,
|
||||
UiFieldDataType = (int)UiFieldDataType.Integer,
|
||||
SqlIdColumnName = "aworkorder.id",
|
||||
SqlValueColumnName = "aworkorder.serial"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Customer",
|
||||
TKey = "Customer",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Customer,
|
||||
SqlIdColumnName = "acustomer.id",
|
||||
SqlValueColumnName = "acustomer.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "HeadOffice",
|
||||
FieldKey = "workorderheadoffice",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.HeadOffice,
|
||||
SqlIdColumnName = "aheadoffice.id",
|
||||
SqlValueColumnName = "aheadoffice.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderStatus",
|
||||
FieldKey = "WorkOrderStatus",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.WorkOrderStatus,
|
||||
SqlIdColumnName = "aworkorder.laststatusid",
|
||||
SqlColorColumnName = "aworkorderstatus.color",
|
||||
SqlValueColumnName = "aworkorderstatus.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderSummary",
|
||||
FieldKey = "workordernotes",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "workordertags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aworkorder.tags"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
FieldKey = "Project",
|
||||
TKey = "Project",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.User,
|
||||
SqlIdColumnName = "aproject.id",
|
||||
SqlValueColumnName = "aproject.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "Contract",
|
||||
FieldKey = "Contract",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
AType = (int)AyaType.Contract,
|
||||
SqlIdColumnName = "acontract.id",
|
||||
SqlValueColumnName = "acontract.name"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInternalReferenceNumber",
|
||||
FieldKey = "WorkOrderInternalReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.internalreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerReferenceNumber",
|
||||
FieldKey = "WorkOrderCustomerReferenceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.customerreferencenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCustomerContactName",
|
||||
FieldKey = "WorkOrderCustomerContactName",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.customercontactname"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderServiceDate",
|
||||
FieldKey = "WorkOrderServiceDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aworkorder.servicedate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCloseByDate",
|
||||
FieldKey = "WorkOrderCloseByDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aworkorder.completebydate"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderInvoiceNumber",
|
||||
FieldKey = "WorkOrderInvoiceNumber",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.invoicenumber"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderOnsite",
|
||||
FieldKey = "WorkOrderOnsite",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aworkorder.onsite"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalDeliveryAddress",
|
||||
FieldKey = "workorderpostaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.postaddress"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCity",
|
||||
FieldKey = "workorderpostcity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.postcity"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalStateProv",
|
||||
FieldKey = "workorderpostregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.postregion"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalCountry",
|
||||
FieldKey = "workorderpostcountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.postcountry"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressPostalPostal",
|
||||
FieldKey = "workorderpostcode",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.postcode"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressDeliveryAddress",
|
||||
FieldKey = "workorderaddress",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.address"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCity",
|
||||
FieldKey = "workordercity",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.city"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressStateProv",
|
||||
FieldKey = "workorderregion",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.region"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressCountry",
|
||||
FieldKey = "workordercountry",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "aworkorder.country"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLatitude",
|
||||
FieldKey = "workorderlatitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "aworkorder.latitude"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "AddressLongitude",
|
||||
FieldKey = "workorderlongitude",
|
||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||
SqlValueColumnName = "aworkorder.longitude"
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, "
|
||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT NOT NULL REFERENCES acustomer (id), "
|
||||
+ "projectid BIGINT REFERENCES aproject, contractid BIGINT NULL, internalreferencenumber text, customerreferencenumber text, customercontactname text, "
|
||||
+ "servicedate TIMESTAMP, completebydate TIMESTAMP, invoicenumber TEXT, customersignature TEXT, customersignaturename TEXT, customersignaturecaptured TIMESTAMP, "
|
||||
+ "techsignature TEXT, techsignaturename TEXT, techsignaturecaptured TIMESTAMP, durationtocompleted INTERVAL NOT NULL, onsite BOOL NOT NULL, contract TEXT, "
|
||||
+ "postaddress TEXT, postcity TEXT, postregion TEXT, postcountry TEXT, postcode TEXT, address TEXT, city TEXT, region TEXT, country TEXT, latitude DECIMAL(9,6), longitude DECIMAL(9,6) "
|
||||
+ ")");//n
|
||||
*/
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderCloseByDate",
|
||||
FieldKey = "WorkOrderCloseByDate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "aworkorder.closebydate"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom1", FieldKey = "workordercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom2", FieldKey = "workordercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom3", FieldKey = "workordercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom4", FieldKey = "workordercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom5", FieldKey = "workordercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom6", FieldKey = "workordercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom7", FieldKey = "workordercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom8", FieldKey = "workordercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom9", FieldKey = "workordercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom10", FieldKey = "workordercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom11", FieldKey = "workordercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom12", FieldKey = "workordercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom13", FieldKey = "workordercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom14", FieldKey = "workordercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom15", FieldKey = "workordercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WorkOrderCustom16", FieldKey = "workordercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aworkorder.customfields" });
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
public List<DataListFilterOption> DataListInternalCriteria(long currentUserId, AuthorizationRoles userRoles, string clientCriteria)
|
||||
{
|
||||
//This is required to filter out rows where there are no matching scheduled user otherwise we'd get all workorders and items regardless
|
||||
List<DataListFilterOption> ret = new List<DataListFilterOption>();
|
||||
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metawoitemlaborid" };
|
||||
FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual });
|
||||
ret.Add(FilterOption);
|
||||
return ret;
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
@@ -57,24 +57,7 @@ namespace AyaNova.DataList
|
||||
*/
|
||||
|
||||
#region WorkOrderItemPartRequest fields
|
||||
/*
|
||||
l.Add(new FormField { TKey = "WorkOrderItemPartRequestPartID", FieldKey = "WorkOrderItemPartRequestPartID", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemPartRequestPartWarehouseID", FieldKey = "WorkOrderItemPartRequestPartWarehouseID", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemPartRequestQuantity", FieldKey = "WorkOrderItemPartRequestQuantity", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "PartUPC", FieldKey = "PartRequestPartUPC", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "PurchaseOrder", FieldKey = "WorkOrderItemPartRequestPurchaseOrder", TKeySection = "WorkOrderItemPartRequests" });
|
||||
|
||||
l.Add(new FormField { TKey = "PurchaseOrderExpectedReceiveDate", FieldKey = "WorkOrderItemPartRequestExpectedReceiveDate", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "PurchaseOrderOrderedDate", FieldKey = "WorkOrderItemPartRequestOrderedDate", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemPartRequestOnOrder", FieldKey = "WorkOrderItemPartRequestOnOrder", TKeySection = "WorkOrderItemPartRequests" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemPartRequestReceived", FieldKey = "WorkOrderItemPartRequestReceived", TKeySection = "WorkOrderItemPartRequests" });
|
||||
|
||||
"CREATE TABLE aworkorderitempartrequest (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "partid BIGINT NOT NULL REFERENCES apart, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse, quantity DECIMAL(19,5) NOT NULL default 0, received DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "purchaseorderitemid BIGINT NULL REFERENCES apurchaseorderitem"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
TKey = "WorkOrderItemPartRequestPartID",
|
||||
|
||||
@@ -53,19 +53,6 @@ namespace AyaNova.DataList
|
||||
|
||||
#region WorkOrderItemScheduledUser fields
|
||||
|
||||
/*
|
||||
"CREATE TABLE aworkorderitemscheduleduser (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, startdate TIMESTAMP, stopdate TIMESTAMP, servicerateid BIGINT REFERENCES aservicerate, "
|
||||
+ "estimatedquantity DECIMAL(19,5) NOT NULL default 0"
|
||||
|
||||
l.Add(new FormField { TKey = "WorkOrderItemScheduledUserEstimatedQuantity", FieldKey = "WorkOrderItemScheduledUserEstimatedQuantity", TKeySection = "WorkOrderItemScheduledUser" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemScheduledUserServiceRateID", FieldKey = "WorkOrderItemScheduledUserServiceRateID", TKeySection = "WorkOrderItemScheduledUser" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemScheduledUserStartDate", FieldKey = "WorkOrderItemScheduledUserStartDate", TKeySection = "WorkOrderItemScheduledUser" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemScheduledUserStopDate", FieldKey = "WorkOrderItemScheduledUserStopDate", TKeySection = "WorkOrderItemScheduledUser" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemScheduledUserUserID", FieldKey = "WorkOrderItemScheduledUserUserID", TKeySection = "WorkOrderItemScheduledUser" });
|
||||
|
||||
*/
|
||||
|
||||
//no natural text field for link opener so using every other field besides the linked ones instead
|
||||
//also considered just using the record id itself, still might do that if this is fucky
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
|
||||
@@ -52,17 +52,7 @@ namespace AyaNova.DataList
|
||||
*/
|
||||
|
||||
#region WorkOrderItemTask fields
|
||||
/*
|
||||
l.Add(new FormField { TKey = "Sequence", FieldKey = "WorkOrderItemTaskSequence", TKeySection = "WorkOrderItemTask" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemTaskTaskID", FieldKey = "WorkOrderItemTaskTaskID", TKeySection = "WorkOrderItemTask" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemTaskWorkOrderItemTaskCompletionType", FieldKey = "WorkOrderItemTaskWorkOrderItemTaskCompletionType", TKeySection = "WorkOrderItemTask" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemTaskUser", FieldKey = "WorkOrderItemTaskUser", TKeySection = "WorkOrderItemTask" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemTaskCompletedDate", FieldKey = "WorkOrderItemTaskCompletedDate", TKeySection = "WorkOrderItemTask" });
|
||||
|
||||
"CREATE TABLE aworkorderitemtask (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "sequence INTEGER NOT NULL DEFAULT 0, task text NOT NULL, status INTEGER NOT NULL DEFAULT 1, completedbyuserid BIGINT REFERENCES auser, completeddate TIMESTAMP"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
FieldDefinitions.Add(new DataListFieldDefinition
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user