1 line
35 KiB
Plaintext
1 line
35 KiB
Plaintext
{"Name":"Customer Work Order - custom with engineer name","Active":true,"Notes":"2023-02-28: Customized from stock version to display engineer name from labor collection beneath signature line.\nNote that the only customization changes made are in the Template section and the Prepare function section and are each inside a commented block in each place\n-----\nDisplays small logo if present else displays company name and address as entered in Global Settings. Displays digital Signature fields if present. Heading and Signature lines display once per WO regardless number of pages for the work order. \nPrepare functions to derive nets and grand totals\n","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n <div>\n {{#each ayReportData}}\n <!-- the #each aspect MUST encompass the section where the class is that forces page break -->\n <table class=\"singlePage\">\n <!-- the css to start a new page when a new object - i.e. work order -->\n <!-- note - if DO want aspects to repeat on subsequent pages, place within thead -->\n\n <tbody>\n {{#if ../ayServerMetaData.HasSmallLogo}} <!-- this displays if have uploaded small logo -->\n <tr style=\"background-color:white\">\n <td colspan=\"12\">{{ ayLogo \"small\" }}</td>\n <th colspan=\"8\" class=\"rightlean reporttitle\">{{ayT 'WorkOrderSerialNumber'}}</th>\n <td colspan=\"4\" class=\"rightlean reporttitle\">{{Serial}}</td>\n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"24\"></td>\n </tr>\n\n {{else}} <!-- else this displays if do NOT have small logo -->\n\n <tr style=\"background-color:white\">\n <th colspan=\"12\"class=\"leftlean\">{{../ayServerMetaData.CompanyName}}</th>\n <th colspan=\"8\" class=\"rightlean reporttitle\">{{ayT 'WorkOrderSerialNumber'}}</th>\n <td colspan=\"4\" class=\"rightlean reporttitle\">{{Serial}}</td>\n </tr>\n <tr style=\"background-color:white\">\n <th colspan=\"12\" class=\"leftlean\">{{../ayServerMetaData.CompanyPostAddress}} {{../ayServerMetaData.CompanyPostCity}}</th>\n <td colspan=\"12\"></td>\n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n {{/if}} <!-- this closes this if/else statement -->\n\n \n <tr style=\"background-color:white\">\n <th colspan=\"5\">Service performed for</th>\n <td colspan=\"11\"></td>\n <th colspan=\"4\" class=\"rightlean \">Printed Date</th>\n <td colspan=\"4\" class=\"rightlean\">{{todaysMonthDDYYYYDate}}</td>\n \n </tr>\n <tr style=\"background-color:white\">\n <th colspan=\"1\"></th>\n <td colspan=\"11\"class=\"reporttitle\">{{CustomerViz}}</td>\n <th colspan=\"12\" class=\"rightlean\"></th>\n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"1\"> </td>\n <td colspan=\"11\" class=\"leftlean\">{{Address}}, {{City}}</td>\n <td colspan=\"12\"> </td> \n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"1\"> </td>\n <td colspan=\"11\" class=\"leftlean\">{{CustomerPhone1Viz}}</td>\n <td colspan=\"12\"> </td> \n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n <tr>\n <th colspan=\"8\">{{ayT 'WorkOrderServiceDate'}}</th>\n <th colspan=\"8\">{{ayT 'WorkOrderCustomerReferenceNumber'}}</th>\n <th colspan=\"8\">{{ayT 'WorkOrderInvoiceNumber'}}</th>\n </tr>\n <tr>\n <td colspan=\"8\" class=\"centerlean\">{{myDate ServiceDate}}</td>\n <td colspan=\"8\" class=\"centerlean\">{{CustomerReferenceNumber}}</td>\n <td colspan=\"8\" class=\"centerlean\">{{InvoiceNumber}}</td>\n </tr>\n <tr>\n <td colspan=\"24\"> </td>\n </tr>\n {{#each Items}}\n <tr>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'WorkOrderItemSummary'}}</th>\n <td colspan=\"20\">{{Notes}} </td>\n </tr>\n {{#each Units}}\n <tr>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'Unit'}}</th>\n <td colspan=\"20\">{{UnitViz}} - {{UnitModelNameViz}}</td>\n </tr>\n {{/each}}\n\n <tr>\n <th colspan=\"12\"> </th>\n <th colspan=\"2\">{{ayT 'WorkOrderItemPartQuantity'}}</th>\n <th colspan=\"2\">{{ayT 'Price'}}</th>\n <th colspan=\"2\">{{ayT 'NetPrice'}}</th>\n <th colspan=\"2\">{{ayT 'TaxCodeTaxA'}}</th>\n <th colspan=\"2\">{{ayT 'TaxCodeTaxB'}}</th>\n <th colspan=\"2\">{{ayT 'LineTotal'}}</th>\n </tr>\n\n {{#each Expenses}}\n {{#if ChargeToCustomer}}\n <tr>\n <!-- note the encompassing #each statement which only does this IF ChargeToCustomer is true-->\n <td colspan=\"1\"> </td>\n <td colspan=\"11\">{{ayT 'WorkOrderItemExpenseList'}}: {{Name}}</td>\n <!-- note too the custom Prepare function that WILL NOT include Expense charges in the Net Totals and Grand Total IF ChargeToCustomer is false -->\n <td colspan=\"2\" class=\"centerlean\"></td>\n <td colspan=\"2\" class=\"centerlean\"></td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency ChargeAmount}}</td>\n <!--this is the \"net\" charge -->\n <!--NOTE for tax lines below, checks to see if TaxCode selected. If true, displays derived, otherwise displays TaxPaid -->\n {{#if ChargeTaxCodeId}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxPaid}}</td>{{/if}}\n {{#if ChargeTaxCodeId}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"2\" class=\"centerlean\"> </td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n <!-- NOTE LineTotalViz is derived\n from (\"ChargeAmount\" + \"TaxPaid\") OR if there is a TaxCode selected, then is auto figured out from \"ChargeAmount\" + (TaxCodes% * ChargeAmount)-->\n </tr>{{else}} <tr>\n <td colspan=\"24\">{{ayT 'WorkOrderItemExpenseList'}}: {{Name}} at no charge to customer </td>\n </tr>{{/if}}\n {{/each}}\n {{#each Loans}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"11\">{{ayT 'WorkOrderItemLoanList'}}: {{LoanUnitViz}} / {{UnitOfMeasureViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{Quantity}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency PriceViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency NetViz}}</td>\n {{#if TaxAViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if TaxBViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency 0.00}}</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n </tr>\n {{/each}}\n {{#each Labors}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"11\">{{ayT 'WorkOrderItemLaborList'}} performed {{ayDateTime ServiceStartDate}} with {{ayT 'WorkOrderItemLaborServiceRateID'}} of {{ServiceRateViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ServiceRateQuantity}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency PriceViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency NetViz}}</td>\n {{#if TaxAViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if TaxBViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n </tr>\n {{#if ServiceDetails}}\n <tr>\n <td colspan=\"1\"> </td>\n <th colspan=\"4\">{{ayT 'WorkOrderItemLaborServiceDetails'}}:</th>\n <td colspan=\"19\">{{ServiceDetails}}</td>\n </tr>\n {{else}}{{/if}}\n {{/each}}\n {{#each Parts}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"11\">{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{Quantity}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency PriceViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency NetViz}}</td>\n {{#if TaxAViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if TaxBViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n </tr>\n {{#if Serials}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"23\">{{ayT 'WorkOrderItemPartPartID'}} {{ayT 'PurchaseOrderItemSerialNumbers'}}: {{Serials}}</td>\n </tr>\n {{else}}{{/if}}\n {{/each}}\n {{#each Travels}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"11\">{{ayT 'WorkOrderItemTravelList'}} performed {{ayDate TravelStartDate}} with {{ayT 'WorkOrderItemTravelServiceRateID'}} of {{TravelRateViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{TravelRateQuantity}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency PriceViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency NetViz}}</td>\n {{#if TaxAViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if TaxBViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n </tr>\n {{#if TravelDetails}}\n <tr>\n <td colspan=\"1\"> </td>\n <th colspan=\"4\">{{ayT 'WorkOrderItemTravelDetails'}}:</th>\n <td colspan=\"19\">{{TravelDetails}}</td>\n </tr>\n {{else}}{{/if}}\n {{/each}}\n {{#each OutsideServices}}\n <tr>\n <td colspan=\"1\"> </td>\n <td colspan=\"15\">{{ayT 'WorkOrderItemOutsideService'}} performed on Unit: {{UnitViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayCurrency NetViz}}</td>\n {{#if TaxAViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxAViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if TaxBViz}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency TaxBViz}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n </tr>\n {{/each}}\n <tr>\n <td colspan=\"24\"> </td>\n </tr>\n {{/each}}\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n <tr>\n <!-- <th colspan=\"2\">Nets</th>\n <th colspan=\"2\">Labor</th>\n <th colspan=\"2\">Travel</th>\n <th colspan=\"2\">Parts</th>\n <th colspan=\"2\">Exp</th>\n <th colspan=\"2\">Loans</th>\n <th colspan=\"2\">Outside</th> uncomment and replace th below if you wish to show subtotals broken out-->\n <th colspan=\"14\" class=\"centerlean\"></th>\n <th colspan=\"3\" class=\"centerlean\">Total Nets</th>\n <th colspan=\"2\" class=\"centerlean\">Total TaxA</th>\n <th colspan=\"2\" class=\"centerlean\">Total TaxB</th>\n <th colspan=\"3\" class=\"rightlean \">Grand Total</th>\n </tr>\n <tr>\n <!-- <td colspan=\"2\"></td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllLaborsNetViz}}</td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllTravelsNetViz}}</td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllPartsNetViz}}</td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllExpsNetChargeAmount}}</td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllLoansNetViz}}</td>\n <td colspan=\"2\">{{ayCurrency ThisWOAllOutsidesNetViz}}</td> uncomment and replace td below if you wish to show subtotals broken out-->\n <td colspan=\"14\"></td>\n <td colspan=\"3\" class=\"centerlean\">{{ayCurrency ThisWOTotalNets}}</td>\n {{#if ThisWOTotalTaxAs}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency ThisWOTotalTaxAs}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n {{#if ThisWOTotalTaxBs}}<td colspan=\"2\" class=\"centerlean\">{{ayCurrency ThisWOTotalTaxBs}}</td>{{else}}<td colspan=\"2\" class=\"centerlean\">$0.00</td>{{/if}}\n <td colspan=\"3\" class=\"rightlean \">{{ayCurrency ThisWOTotalGrand}}</td>\n </tr>\n\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n <tr style=\"background-color:white\">\n <th colspan=\"12\" class=\"centerlean \">Thank you for your business!</th>\n <th colspan=\"12\" class=\"centerlean \">Terms: Net 30 days</th>\n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n\n <tr style=\"background-color:white\">\n <th colspan=\"24\" class=\"centerlean \">I acknowledge the satisfactory provision and completion of the above for {{ayT 'WorkOrderSerialNumber'}} {{Serial}}</th>\n </tr>\n <tr style=\"background-color:white\">\n <td colspan=\"24\"> </td>\n </tr>\n <tr style=\"background-color:white\">\n {{#if CustomerSignature}}<th colspan=\"3\">Digital {{ayT 'CustomerSignature'}}</th>{{else}} <th colspan=\"3\">{{ayT 'CustomerSignature'}}</th> {{/if}}\n {{#if CustomerSignature}}<th colspan=\"5\"> <img src=\"{{CustomerSignature}}\" height=\"40px\"/> </th>{{else}} <th colspan=\"5\">___________________</th> {{/if}}\n\n {{#if CustomerSignatureCaptured}}<th colspan=\"3\">Digital Signature Date</th>{{else}} <th colspan=\"3\">Signature Date</th> {{/if}}\n {{#if CustomerSignatureCaptured}}<th colspan=\"5\">{{ayDateTime CustomerSignatureCaptured}}</th>{{else}}<th colspan=\"5\">____________________</th> {{/if}}\n\n {{#if CustomerSignatureName}}<th colspan=\"3\">Digital Print of Name</th>{{else}} <th colspan=\"3\">Print of Name</th> {{/if}}\n {{#if CustomerSignatureName}}<th colspan=\"5\">{{CustomerSignatureName}}</th>{{else}} <th colspan=\"5\">____________________</th> {{/if}}\n </tr>\n\n <!-- Customized display engineer name -->\n {{#if TriStarEngineeerName}}\n <tr>\n <th colspan=\"12\" class=\"leftlean\">Engineer: {{TriStarEngineeerName}}</th> \n </tr>\n {{/if}}\n <!-- end of customization changes for template -->\n\n </tbody>\n <!-- note - if DO want summary area such as totals or signature to repeat on subsequent pages, place within tfoot -->\n\n </table>\n\n\n {{/each}}\n </div>\n\n</body>\n\n</html>","Style":".singlePage\n{\npage-break-after: always;\n}\n\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n} \n\ntable { \n table-layout: fixed; \n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\n\nth {\n height: 20px;\n color: #9e9e9e;\n}\n\ntbody tr {\n height: 10px;\n word-wrap: break-word;\n}\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\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\tawait ayGetTranslations([\"WorkOrderInvoiceNumber\", \"WorkOrderServiceDate\", \"WorkOrderSerialNumber\", \"WorkOrderCustomerReferenceNumber\", \"Unit\", \"WorkOrderItemSummary\", \"WorkOrderItemPartQuantity\", \"Price\", \"NetPrice\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"LineTotal\", \"WorkOrderItemExpenseList\", \"WorkOrderItemLoanList\", \"WorkOrderItemPartPartID\", \"PurchaseOrderItemSerialNumbers\", \"WorkOrderItemLaborList\", \"WorkOrderItemLaborServiceRateID\", \"WorkOrderItemLaborServiceDetails\", \"WorkOrderItemTravelList\", \"WorkOrderItemTravelDetails\", \"WorkOrderItemTravelServiceRateID\", \"WorkOrderItemOutsideService\", \"CustomerSignature\" ]);\n\n\t//below checks if any parts have Serials to remove carriage returns so parts serials display on same line\n for (const EachWO of reportData.ayReportData) {\n for (const Item of EachWO.Items) {\n for (const Part of Item.Parts) {\n if (Part.Serials != null) {\n var s = Part.Serials; \n Part.Serials = s.replace(/[\\n\\r]+/g, ' ');\n }\n }\n }\n }\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 (const 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 (const 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 (const Labor of Item.Labors)\n\t\t\t{\n\t\t\t\t//Customized code block for Tri-Star to capture Engineer name for display beneath signature \n\n\t\t\t\t//capture the first non-empty service technician User name found in the labors collection in any work order item on this work order\n\t\t\t\t//If no labor items or none with a service tech selected then no name is captured and the engineer name line will not be displayed in the template\n\t\t\t\tif(EachWO.TriStarEngineeerName == undefined && Labor.UserViz != null)\n\t\t\t\t\tEachWO.TriStarEngineeerName = Labor.UserViz;\n\n\t\t\t\t//End of customized code block for Tri-Star\n\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 (const 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 (const 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 (const 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 (const 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 (const 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 && !Number.isNaN(parsedDate.getTime()))) {\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":"<span> </span>","FooterTemplate":"<span style=\"font-size:6pt;width: 100%; text-align:left; \"> Printed date: <span class=\"date\"></span></span>\n<span style=\"font-size:6pt;width: 96%; text-align: right; \"> Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span> </span>","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} |