Files
raven/server/AyaNova/resource/rpt/stock-report-templates/Quote Internal Use Costs and Charges.ayrt
2022-02-17 01:46:24 +00:00

1 line
26 KiB
Plaintext

{"Name":"Quote Internal Use Costs and Charges","Active":true,"Notes":"\n","Roles":49258,"AType":27,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n <div>\n {{#each ayReportData}} <!-- the #each aspect MUST encompass the section where the class is that forces page break -->\n <table>\n\n <thead>\n <!--table header will repeat on multiple pages if total thead content is less than 25% of page - IF NOT SHOWING ON 2nd PAGE of WO, is because is too high - note css -->\n <tr class=\"reporttitle\">\n <th colspan=\"16\" class=\"leftlean\">Internal Use - {{ayT 'WorkOrderItemPartList'}} &#38; {{ayT 'WorkOrderItemLaborList'}} only</th>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'Quote'}}</th>\n <td colspan=\"4\"> {{Serial}}</td>\n </tr>\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n <tr>\n <th colspan=\"24\" class=\"leftlean\">{{ayT 'Quote'}} prepared for:</th>\n </tr>\n <tr>\n <td colspan=\"1\"></td>\n <td colspan=\"15\" class=\"reporttitle\">{{CustomerViz}}</td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'Status'}}</th>\n <td colspan=\"4\" class=\"rightlean\" style=\"background-color:{{LastStateColorViz}}\" >{{LastStateNameViz}}</td> \n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <td colspan=\"15\">{{Address}}, {{City}}</td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'QuotePreparedByID'}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{PreparedByViz}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <td colspan=\"15\">{{CustomerPhone1Viz}}</td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'WorkOrderCustomerReferenceNumber'}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{CustomerReferenceNumber}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <td colspan=\"15\">{{CustomerEmailAddressViz}}</td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'WorkOrderInternalReferenceNumber'}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{InternalReferenceNumber}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <td colspan=\"15\"></td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT \"QuoteQuoteRequestDate\"}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{myDate Requested}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'WorkOrderSummary'}}</th>\n <td colspan=\"11\"></td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'QuoteDateSubmitted'}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{myDate Submitted}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <td colspan=\"15\">{{Notes}} </td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'QuoteValidUntilDate'}}</th>\n <td colspan=\"4\" class=\"rightlean\">{{myDate ValidUntil}}</td>\n </tr>\n <tr> \n <td colspan=\"1\">&nbsp;</td>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'QuoteIntroduction'}}</th>\n <td colspan=\"11\"></td>\n <th colspan=\"4\" class=\"rightlean\">{{ayT 'QuoteDateApproved'}} </th>\n <td colspan=\"4\" class=\"rightlean\">{{myDate Approved}}</td>\n </tr>\n <tr>\n <td colspan=\"1\">&nbsp;</td> \n <td colspan=\"23\">{{Introduction}}</td>\n </tr>\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n </thead>\n\n <tbody>\n {{#each Items}}\n <tr>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'WorkOrderItemSummary'}} &#35;{{Sequence}}</th>\n <td colspan=\"20\">{{Notes}}</td>\n </tr>\n <tr>\n <th colspan=\"4\" class=\"leftlean\">{{ayT 'WorkOrderItemTechNotes'}}</th>\n <td colspan=\"20\">{{TechNotes}}</td>\n </tr>\n\n {{#each Units}}\n <tr>\n <td colspan=\"1\"></td>\n <th colspan=\"3\" class=\"leftlean\">{{ayT 'Unit'}}</th>\n <td colspan=\"20\">{{UnitViz}} - {{UnitModelNameViz}}</td>\n </tr>\n {{/each}}\n {{#if Units}}\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n {{/if}}\n\n <tr>\n <td colspan=\"1\"></td>\n <th colspan=\"6\" class=\"leftlean\">{{ayT 'WorkOrderItemList'}}</th>\n <th colspan=\"2\">Qty</th> \n <th colspan=\"2\">Cost PER</th>\n <th colspan=\"2\">List Price PER</th>\n <th colspan=\"2\">Cust Price PER</th>\n <td colspan=\"1\"></td>\n <th colspan=\"2\">Cost NET</th>\n <th colspan=\"2\">List Price NET</th>\n <th colspan=\"2\">Cust Price NET</th>\n <th colspan=\"2\">Difference</th>\n </tr>\n\n\n\n {{#each Labors}}\n <tr>\n <td colspan=\"1\"></td>\n <td colspan=\"6\">{{ayT 'WorkOrderItemLaborServiceRateID'}}: {{ServiceRateViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ServiceRateQuantity}}</td> \n\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency CostViz}}</td>\n {{#if_eq ListPriceViz PriceViz }} <td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency ListPriceViz}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency ListPriceViz}}</td>{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }} <td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency PriceViz}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency PriceViz}}</td>{{/if_eq}}\n <td colspan=\"1\"></td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisLaborCostxQty}}</td>\n {{#if_eq ListPriceViz PriceViz }}<td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency ThisLaborListPricexQty}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency ThisLaborListPricexQty}}</td>{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }}<td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency NetViz}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency NetViz}}</td>{{/if_eq}}\n\n <td colspan=\"2\" class=\"rightlean fontpurple\">{{ayCurrency ThisLaborNetVizMinusListLaborxQty}}</td>\n </tr>\n {{/each}}\n {{#if Labors}}\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n {{/if}}\n\n {{#each Parts}}\n <tr>\n <td colspan=\"1\"></td>\n <td colspan=\"6\">{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{Quantity}}</td> \n <td colspan=\" 2\" class=\"rightlean\">{{ayCurrency Cost}}</td>\n {{#if_eq ListPrice PriceViz }} <td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency ListPrice}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency ListPrice}}</td>{{/if_eq}}\n {{#if_eq ListPrice PriceViz }} <td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency PriceViz}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency PriceViz}}</td>{{/if_eq}}\n <td colspan=\"1\"></td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisPartCostxQty}}</td>\n {{#if_eq ListPrice PriceViz }}<td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency ThisPartListPricexQty}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency ThisPartListPricexQty}}</td>{{/if_eq}}\n {{#if_eq ListPrice PriceViz }}<td colspan=\"2\" class=\"rightlean fontgreen\">{{ayCurrency NetViz}}</td>\n {{else}}<td colspan=\"2\" class=\"rightlean fontred\">{{ayCurrency NetViz}}</td>{{/if_eq}}\n <td colspan=\"2\" class=\"rightlean fontpurple\">{{ayCurrency ThisPartNetVizMinusListPartxQty}}</td>\n </tr>\n {{/each}}\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n {{/each}}\n </tbody>\n </table>\n\n <table class=\"singlePage\">\n <tfoot>\n <!--footer ONLY displays on last page for each workorder because it is within its own table. if want to display on each page of multi-page workorder, move tfoot back up within the above table and edit above table with class=\"singlePage\" -->\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"24\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"16\">>&nbsp;</td>\n \n <th colspan=\"2\">Cost NET</th>\n <th colspan=\"2\">List Price NET</th>\n <th colspan=\"2\">Cust Price NET</th>\n\n <th colspan=\"2\">Difference</th>\n </tr>\n <tr>\n <th colspan=\"12\"></th>\n <th colspan=\"4\">All {{ayT 'WorkOrderItemLaborList'}}</th>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllLaborsCostxQty}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllLaborsListPricexQty}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllLaborsNetViz}}</td> \n <td colspan=\"2\" class=\"rightlean fontpurple\">{{ayCurrency ThisWOAllLaborsNetVizMinusListPricexQty}}</td>\n </tr>\n <tr>\n <th colspan=\"12\"></th>\n <th colspan=\"4\">All {{ayT 'WorkOrderItemPartList'}}</th>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllPartsCostxQty}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllPartsListPricexQty}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOAllPartsNetViz}}</td>\n <td colspan=\"2\" class=\"rightlean fontpurple\">{{ayCurrency ThisWOAllPartsNetVizMinusListPricexQty}}</td>\n </tr>\n <tr>\n <th colspan=\"12\"></th>\n <th colspan=\"4\">{{ayT 'Total'}}</th>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOTotalCostNets}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOTotalListNets}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ThisWOTotalCustNets}}</td>\n <td colspan=\"2\" class=\"rightlean fontpurple\">{{ayCurrency ThisWOAllNetVizMinusAllListPricexQty}}</td>\n </tr>\n </tfoot>\n </table>\n {{/each}}\n </div>\n</body>\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: 8pt;\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.fontpurple {\n color: purple;\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([\"Quote\", \"QuoteIntroduction\", \"WorkOrderSummary\", \"Status\", \"QuotePreparedByID\", \"WorkOrderInternalReferenceNumber\", \"WorkOrderCustomerReferenceNumber\", \"QuoteDateSubmitted\", \"QuoteDateApproved\", \"QuoteValidUntilDate\", \"QuoteQuoteRequestDate\", \"Unit\", \"WorkOrderItemSummary\", \"WorkOrderItemTechNotes\", \"WorkOrderItemPartQuantity\", \"Price\", \"NetPrice\", \"WorkOrderItemPartList\", \"WorkOrderItemPartPartID\", \"WorkOrderItemList\", \"WorkOrderItemLaborServiceRateID\", \"WorkOrderItemLaborList\", \"Total\"]);\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 Part Costs from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsCostxQty = 0.00;\n\t//below declares a key on the entire wo to hold all Part ListPricexQuantity from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsListPricexQty = 0.00;\n\t//below declares a key on the entire wo to hold all Part ListPricexQuantity from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetVizMinusListPricexQty = 0.00;\n\t\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.00;\n\n\t//below declares a key on the entire wo to hold all Labor Costs from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsCostxQty = 0.00;\n\t//below declares a key on the entire wo to hold all Labor ListPricexQuantity from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsListPricexQty = 0.00;\n\t//below declares a key on the entire wo to hold all Labor ListPricexQuantity from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetVizMinusListPricexQty = 0.00;\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.00;\n\n\t//below declares a key on the entire wo to hold ALL of THIS quote's Nets so it exists\n\tEachWO.ThisWOTotalCostNets = 0.00;\n\t//below declares a key on the entire wo to hold ALL of THIS quote's Nets so it exists\n\tEachWO.ThisWOTotalListNets = 0.00;\n\t//below declares a key on the entire wo to hold ALL of THIS quote's Nets so it exists\n\tEachWO.ThisWOTotalCustNets = 0.00;\n\t//below declares a key on entire wo to hold difference between all netviz and all listpricexqty\n\tEachWO.ThisWOAllNetVizMinusAllListPricexQty= 0.00;\n\n\n\n\t//below is to Iterate through each item of the quote's Items\n\n\tfor (const Item of EachWO.Items)\n\t\t{\n\t\t\t\n\t\t\tItem.ThisItemAllPartsCostxQty = 0.00;\t\t\t\n\t\t\t//below is to Iterate through each Part record of the quote's Item to add a field identifying Cost * Qty for each part, \n\t\t\t// running total of these for all item's parts, and running total for all wo parts. \n\t\t\tfor (const Part of Item.Parts)\n\t\t\t{\n\t\t\t\tPart.ThisPartCostxQty = 0.00;\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.Cost != null) //if Cost is NOT null, then multiplies Cost by Qty, and adds that to running total for this item and this workorder.\n \t \t{\n\t\t\t\t\t\tPart.ThisPartCostxQty = (Part.Cost * Part.Quantity);\n\t\t\t\t\t\tItem.ThisItemAllPartsCostxQty += (Part.Cost * Part.Quantity);\t\n\t\t\t\t\t\tEachWO.ThisWOAllPartsCostxQty += (Part.Cost * Part.Quantity);\t\n\t\t\t\t\t\tEachWO.ThisWOTotalCostNets += (Part.Cost * Part.Quantity);\t\n\t\t\t\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 //whereas if Cost IS null, then makes Part.ThisPartCostxQty of 0 \n\t\t\t\t\t{\n\t\t\t\t\t\tPart.ThisPartCostxQty = 0.00;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tItem.ThisItemAllPartsNetViz = 0.00; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\n\t\t\t//below is to Iterate through each Part record of the quote'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 \t//NetViz already shows part net x qty\t\t\t\t\t\t\n\t\t\t\t\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 quote's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalCustNets += 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\n\t\t\t\t\t\t\t\n\t\t\t\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\n\t\t\tItem.ThisItemAllPartsListPricexQty = 0.00;\t\t\t\n\t\t\t//below is to Iterate through each Part record of the quote's Item to add a field identifying ListPrice * Qty for each part, \n\t\t\t// running total of these for all item's parts, and running total for all wo parts.\n\t\t\tfor (const Part of Item.Parts)\n\t\t\t{\n\t\t\t\tPart.ThisPartListPricexQty = 0.00;\n\t\t\t\tPart.ThisPartNetVizMinusListPartxQty = 0.00;\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.ListPrice != null) //if ListPrice is NOT null, then multiplies ListPrice by Qty, and adds that to running total for this item and this workorder. Then subtracts NetList from NetCust to get diff\n \t \t{\n\t\t\t\t\t\tPart.ThisPartListPricexQty = (Part.ListPrice * Part.Quantity);\n\t\t\t\t\t\tItem.ThisItemAllPartsListPricexQty += (Part.ListPrice * Part.Quantity);\n\t\t\t\t\t\tEachWO.ThisWOAllPartsListPricexQty += (Part.ListPrice * Part.Quantity);\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalListNets += (Part.ListPrice * Part.Quantity);\n\n\t\t\t\t\t\tPart.ThisPartNetVizMinusListPartxQty = (Part.NetViz - Part.ThisPartListPricexQty);\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetVizMinusListPricexQty = ( EachWO.ThisWOAllPartsNetViz - EachWO.ThisWOAllPartsListPricexQty);\n\t\t\t\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 //whereas if ListPrice IS null, then makes the ListPrice the same as the PriceViz \n\t\t\t\t\t{\n\t\t\t\t\t\tPart.ListPrice = Part.PriceViz;\n\t\t\t\t\t\tPart.ThisPartListPricexQty = (Part.ListPrice * Part.Quantity);\n\t\t\t\t\t\tItem.ThisItemAllPartsListPricexQty += (Part.ListPrice * Part.Quantity);\n\t\t\t\t\t\tEachWO.ThisWOAllPartsListPricexQty += (Part.ListPrice * Part.Quantity);\t\n\t\t\t\t\t\tEachWO.ThisWOTotalListNets += (Part.ListPrice * Part.Quantity);\n\n\t\t\t\t\t\tPart.ThisPartNetVizMinusListPartxQty = (Part.NetViz - Part.ThisPartListPricexQty);\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetVizMinusListPricexQty = ( EachWO.ThisWOAllPartsNetViz - EachWO.ThisWOAllPartsListPricexQty);\t\n\t\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\tItem.ThisItemAllLaborsCostxQty = 0.00;\t\t\t\n\t\t\t//below is to Iterate through each Labor record of the quote's Item to add a field identifying Cost * Qty for each Labor, \n\t\t\t// running total of these for all item's Labor, and running total for all wo Labor. \n\t\t\tfor (const Labor of Item.Labors)\n\t\t\t{\n\t\t\t\tLabor.ThisLaborCostxQty = 0.00;\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.CostViz != null) //if Cost is NOT null, then multiplies Cost by Qty, and adds that to running total for this item and this workorder.\n \t \t{\n\t\t\t\t\t\tLabor.ThisLaborCostxQty = (Labor.CostViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsCostxQty += (Labor.CostViz * Labor.ServiceRateQuantity);\t\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsCostxQty += (Labor.CostViz * Labor.ServiceRateQuantity);\t\n\t\t\t\t\t\tEachWO.ThisWOTotalCostNets += (Labor.CostViz * Labor.ServiceRateQuantity);\t\n\t\t\t\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 //whereas if Cost IS null, then makes Labor.ThisLaborCostxQty of 0 \n\t\t\t\t\t{\n\t\t\t\t\t\tLabor.ThisLaborCostxQty = 0.00;\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tItem.ThisItemAllLaborsNetViz = 0.00; //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 quote's Item\n\t\t\tfor (const 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 quote's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalCustNets += 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\t\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\t\n\t\t\tItem.ThisItemAllLaborsListPricexQty = 0.00;\t\t\t\n\t\t\t//below is to Iterate through each Labor record of the quote's Item to add a field identifying ListPrice * Qty for each Labor, \n\t\t\t// running total of these for all item's Labors, and running total for all wo Labors. \n\t\t\tfor (const Labor of Item.Labors)\n\t\t\t{\n\t\t\t\tLabor.ThisLaborListPricexQty = 0.00;\n\t\t\t\tLabor.ThisLaborNetVizMinusListLaborxQty = 0.00;\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.ListPriceViz != null) //if ListPrice is NOT null, then multiplies ListPrice by Qty, and adds that to running total for this item and this workorder. Then subtracts NetList from NetCust to get diff\n \t \t{\n\t\t\t\t\t\tLabor.ThisLaborListPricexQty = (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsListPricexQty += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsListPricexQty += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalListNets += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\n\t\t\t\t\t\tLabor.ThisLaborNetVizMinusListLaborxQty = (Labor.NetViz - Labor.ThisLaborListPricexQty);\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetVizMinusListPricexQty = ( EachWO.ThisWOAllLaborsNetViz - EachWO.ThisWOAllLaborsListPricexQty);\n\t\t\t\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 //whereas if ListPrice IS null, then makes the ListPrice the same as the PriceViz \n\t\t\t\t\t{\n\t\t\t\t\t\tLabor.ListPriceViz = Labor.PriceViz;\n\t\t\t\t\t\tLabor.ThisLaborListPricexQty = (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsListPricexQty += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsListPricexQty += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\t\n\t\t\t\t\t\tEachWO.ThisWOTotalListNets += (Labor.ListPriceViz * Labor.ServiceRateQuantity);\n\n\t\t\t\t\t\tLabor.ThisLaborNetVizMinusListLaborxQty = (Labor.NetViz - Labor.ThisLaborListPricexQty);\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetVizMinusListPricexQty = ( EachWO.ThisWOAllLaborsNetViz - EachWO.ThisWOAllLaborsListPricexQty);\t\n\t\t\t\t\t}\n\t\t\t\tEachWO.ThisWOAllNetVizMinusAllListPricexQty = ( EachWO.ThisWOAllLaborsNetVizMinusListPricexQty + EachWO.ThisWOAllPartsNetVizMinusListPricexQty)\n\n\t\t\t}\n\n\n\n\n\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//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\n//note that this HAS to be added here in Helpers, is NOT built in\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\n if(a == b) // Or === depending on your needs\n return opts.fn(this);\n else\n return opts.inverse(this);\n});\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>&nbsp;</span>","FooterTemplate":"<span style=\"font-size:6pt;width: 100%; text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Printed date:&nbsp;<span class=\"date\"></span></span>\n<span style=\"font-size:6pt;width: 96%; text-align: right; \">&nbsp;&nbsp;&nbsp;Page&nbsp;<span class=\"pageNumber\"></span>&nbsp;of&nbsp;<span class=\"totalPages\"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}