diff --git a/server/AyaNova/DataList/WorkOrderItemLaborDataList.cs b/server/AyaNova/DataList/WorkOrderItemLaborDataList.cs index bbe350a6..97ea4795 100644 --- a/server/AyaNova/DataList/WorkOrderItemLaborDataList.cs +++ b/server/AyaNova/DataList/WorkOrderItemLaborDataList.cs @@ -52,19 +52,6 @@ namespace AyaNova.DataList */ #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 diff --git a/server/AyaNova/DataList/WorkOrderItemTravelDataList.cs b/server/AyaNova/DataList/WorkOrderItemTravelDataList.cs new file mode 100644 index 00000000..be16d084 --- /dev/null +++ b/server/AyaNova/DataList/WorkOrderItemTravelDataList.cs @@ -0,0 +1,549 @@ +using System.Collections.Generic; +using AyaNova.Biz; +using AyaNova.Models; + +namespace AyaNova.DataList +{ + internal class WorkOrderItemTravelDataList : DataListProcessingBase, IDataListInternalCriteria + { + public WorkOrderItemTravelDataList() + { + 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 travel + + "left join aworkorderitemtravel on aworkorderitem.id=aworkorderitemtravel.workorderitemid " + + "left join auser on (aworkorderitemtravel.userid=auser.id) " + + ; + + var RoleSet = BizRoles.GetRoleSet(DefaultListAType); + AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; + DefaultColumns = new List() { + "WorkOrderSerialNumber", + "WorkOrderItemSequence", + "WorkOrderItemSummary", + "Customer", + "WorkOrderServiceDate", + "WorkOrderItemTravelUserID", + "WorkOrderItemTravelTravelRateQuantity", + "WorkOrderItemTravelTravelRateID" + + }; + DefaultSortBy = new Dictionary() { { "WorkOrderSerialNumber", "-" }, { "WorkOrderItemSequence", "+" }, { "WorkOrderItemTravelUserID", "+" } }; + FieldDefinitions = new List(); + + /* + ████████╗██████╗ █████╗ ██╗ ██╗███████╗██╗ + ╚══██╔══╝██╔══██╗██╔══██╗██║ ██║██╔════╝██║ + ██║ ██████╔╝███████║██║ ██║█████╗ ██║ + ██║ ██╔══██╗██╔══██║╚██╗ ██╔╝██╔══╝ ██║ + ██║ ██║ ██║██║ ██║ ╚████╔╝ ███████╗███████╗ + ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚══════╝ + */ + #region WorkOrderItemTravel fields + /* +l.Add(new FormField { TKey = "WorkOrderItemTravelStartDate", FieldKey = "WorkOrderItemTravelStartDate", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelStopDate", FieldKey = "WorkOrderItemTravelStopDate", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelRateQuantity", FieldKey = "WorkOrderItemTravelRateQuantity", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelServiceRateID", FieldKey = "WorkOrderItemTravelServiceRateID", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelDetails", FieldKey = "WorkOrderItemTravelDetails", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelUserID", FieldKey = "WorkOrderItemTravelUserID", TKeySection = "WorkOrderItemTravels" }); +l.Add(new FormField { TKey = "WorkOrderItemTravelNoChargeQuantity", FieldKey = "WorkOrderItemTravelNoChargeQuantity", TKeySection = "WorkOrderItemTravels" }); +"CREATE TABLE aworkorderitemtravel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), " ++ "userid BIGINT REFERENCES auser, travelstartdate TIMESTAMP, travelstopdate TIMESTAMP, travelrateid BIGINT REFERENCES atravelrate, traveldetails text, " ++ "travelratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, " ++ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(38,18) " + */ + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelUserID", + FieldKey = "WorkOrderItemTravelUserID", + UiFieldDataType = (int)UiFieldDataType.Text, + AType = (int)AyaType.WorkOrderItemTravel, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "auser.name", + IsRowId = true + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelTravelRateQuantity", + FieldKey = "WorkOrderItemTravelTravelRateQuantity", + AType = (int)AyaType.WorkOrderItemTravel, + UiFieldDataType = (int)UiFieldDataType.Decimal, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "aworkorderitemtravel.serviceratequantity" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelTravelRateID", + FieldKey = "WorkOrderItemTravelTravelRateID", + UiFieldDataType = (int)UiFieldDataType.Text, + AType = (int)AyaType.TravelRate, + SqlIdColumnName = "aworkorderitemtravel.servicerateid", + SqlValueColumnName = "aservicerate.name" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelServiceStartDate", + FieldKey = "WorkOrderItemTravelServiceStartDate", + AType = (int)AyaType.WorkOrderItemTravel, + UiFieldDataType = (int)UiFieldDataType.DateTime, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "aworkorderitemtravel.servicestartdate", + IsRowId = true + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelServiceStopDate", + FieldKey = "WorkOrderItemTravelServiceStopDate", + AType = (int)AyaType.WorkOrderItemTravel, + UiFieldDataType = (int)UiFieldDataType.DateTime, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "aworkorderitemtravel.servicestopdate" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelServiceDetails", + FieldKey = "WorkOrderItemTravelServiceDetails", + UiFieldDataType = (int)UiFieldDataType.Text, + SqlValueColumnName = "aworkorderitemtravel.servicedetails" + }); + + FieldDefinitions.Add(new DataListFieldDefinition + { + TKey = "WorkOrderItemTravelNoChargeQuantity", + FieldKey = "WorkOrderItemTravelNoChargeQuantity", + AType = (int)AyaType.WorkOrderItemTravel, + UiFieldDataType = (int)UiFieldDataType.Decimal, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "aworkorderitemtravel.nochargequantity" + }); + + + //META column + FieldDefinitions.Add(new DataListFieldDefinition + { + FieldKey = "metawoitemtravelid", + UiFieldDataType = (int)UiFieldDataType.InternalId, + SqlIdColumnName = "aworkorderitemtravel.id", + SqlValueColumnName = "aworkorderitemtravel.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 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 ret = new List(); + DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metawoitemtravelid" }; + FilterOption.Items.Add(new DataListColumnFilter() { value = "*NULL*", op = DataListFilterComparisonOperator.NotEqual }); + ret.Add(FilterOption); + return ret; + } + }//eoc +}//eons \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt new file mode 100644 index 00000000..0e8f6723 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt @@ -0,0 +1 @@ +{"Name":"EXAMPLE WO Invoice with derived Net and Grand Total","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\n\t\t\t\t{{#each Items}} \n {{#each Expenses}}\n {{#if ChargeToCustomer}}\t\t\t\n \t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t \n {{else}} {{/if}}\n {{/each}}\n {{#each Loans}}\n \t\t\t\t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Labors}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Parts}}\n \t\t\t\t\n \n \n \n \n {{#if TaxPartSaleId}}{{else}} {{/if}}\n {{#if TaxPartSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Travels}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each OutsideServices}}\n \t\t\t\t\n \n \n {{#if TaxCodeId}}{{else}} {{/if}}\n {{#if TaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n\t\t\t \t{{/each}}\n\t\t\t \n
{{ ayLogo \"small\" }}Internal WO#:{{Serial}}
data from ayReportData shows in greenfont Service Date from WO: {{myDate ServiceDate}}
data derived from Helper or Prepare shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
Service performed for: {{CustomerViz}}
Physical Address where service performed:Postal Address where invoice sent to:
{{Address}}, {{City}}{{PostAddress}}, {{PostCity}}
 
Item:QtyPrice Per:Net:Tax A:Tax B:Line Total:
Expense: {{Name}}{{ayCurrency ChargeAmount}}{{ayCurrency TaxAViz}}{{TaxPaid}}{{ayCurrency TaxBViz}} {{ayCurrency LineTotalViz}}
custom expenses for {{Name}} NOT charged to customer
Loaner: {{LoanUnitViz}} / {{UnitOfMeasureViz}} {{Quantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Service performed at {{ayDateTime ServiceStartDate}} with Service Rate of {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Part: {{PartViz}}{{Quantity}}{{ayCurrency ListPrice}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Travel performed on {{ayDate TravelStartDate}} with Travel rate of {{TravelRateViz}}{{TravelRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Outside Service performed on Unit: {{UnitViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\t\n\t\t\t\t \n \n
Net LaborNet TravelNet PartsNet ExpensesNet LoansNet OutsideTotal NetsTotal Tax ATotal Tax BWO Total
{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllTravelsNetViz}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOAllExpsNetChargeAmount}}{{ayCurrency ThisWOAllLoansNetViz}}{{ayCurrency ThisWOAllOutsidesNetViz}}{{ayCurrency ThisWOTotalNets}}{{ayCurrency ThisWOTotalTaxAs}}{{ayCurrency ThisWOTotalTaxBs}}{{ayCurrency ThisWOTotalGrand}}
 
\n {{/each}}\n\t
\n\n\n","Style":"/* if not using a rule set or specific property it is recommended to comment out or delete fully for report performance*/\n\n.singlePage\n{\npage-break-after: always;\n}\n\ntable { \n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n /* NOTE if this IS here but NOT displaying on subsequent pages (i.e. page 2 of a wo), you NEED to edit your thead so it is NO MORE than approx 20% of the page */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 10pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 8pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 8pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n/* display: table-footer-group; uncomment this if want footer to repeat on every page of a mulit-page report for a single wo AND your tfoot is within the same table as your thead and tbody */\n page-break-inside: avoid; \n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"Handlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format EXAMPLE SHOW: June 9, 2021\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n\n","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":"  this is set in PDF Options  Note this is all pages of report  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt new file mode 100644 index 00000000..903a7a70 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt @@ -0,0 +1 @@ +{"Name":"EXAMPLE WO single line per wo Nets NO TAXES ","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t \n

Nets for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n \n {{/each}}\n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNets
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loan in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder
Totals for all workorders in this report {{ ayCurrency AllWOLaborsNetViz }}$0.00 {{ ayCurrency AllWOPartsNetViz }}$0.00 {{ ayCurrency AllWOTravelsNetViz }}$0.00 {{ ayCurrency AllWOExpsNetChargeAmount }} {{else}} $0.00 {{ ayCurrency AllWOLoansNetViz }}$0.00 {{ ayCurrency AllWOOutsidesNetViz }}$0.00 {{ ayCurrency AllWOTotalNets }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\n}\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt new file mode 100644 index 00000000..94c5e656 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt @@ -0,0 +1 @@ +{"Name":"EXAMPLE WO single line per wo Nets Taxes Totals","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t \n

Nets Taxes and Totals for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxAs }} {{else}} {{/if}} \n {{#if ThisWOTotalTaxBs }} {{else}} {{/if}} \n {{#if ThisWOTotalGrand }} {{else}} {{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n {{#if AllWOTotalTaxAs}} {{else}} {{/if}}\n {{#if AllWOTotalTaxBs }} {{else}} {{/if}}\n {{#if AllWOTotalGrand}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNetsThisWO AllTaxA: ThisWO AllTaxB: ThisWO GrandTotal:
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loans in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder{{ayCurrency ThisWOTotalTaxAs}}no Tax A in this workorder{{ayCurrency ThisWOTotalTaxBs}}no Tax B charges in this workorder{{ayCurrency ThisWOTotalGrand}}no charges in this workorder
Totals for all workorders in this reportAll Labor NetAll Parts NetAll Travel NetAll Exp NetAll Loan NetAll Outside NetAll NetsAll Tax AAll Tax BAll Grand Total
{{ ayCurrency AllWOLaborsNetViz }}$0.00 {{ ayCurrency AllWOPartsNetViz }}$0.00 {{ ayCurrency AllWOTravelsNetViz }}$0.00 {{ ayCurrency AllWOExpsNetChargeAmount }} {{else}} $0.00 {{ ayCurrency AllWOLoansNetViz }}$0.00 {{ ayCurrency AllWOOutsidesNetViz }}$0.00 {{ ayCurrency AllWOTotalNets }}$0.00 {{ ayCurrency AllWOTotalTaxAs }}$0.00 {{ ayCurrency AllWOTotalTaxBs }}$0.00 {{ ayCurrency AllWOTotalGrand }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\n}\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file