From d4ab3c74215b202c050c19b4f7228e1265f2155f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 17 Feb 2022 01:46:24 +0000 Subject: [PATCH] --- .../resource/rpt/stock-report-templates/Customer Quote.ayrt | 2 +- .../resource/rpt/stock-report-templates/PM Parts Summary .ayrt | 2 +- .../Part Grouped Net Cost Difference.ayrt | 2 +- .../rpt/stock-report-templates/Parts & Labor Profit _ Loss.ayrt | 2 +- .../Quote Internal Use Costs and Charges.ayrt | 2 +- .../stock-report-templates/Quote Parts Net Cost Summary.ayrt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Customer Quote.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Customer Quote.ayrt index ecd950ba..6f9fb4fd 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Customer Quote.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Customer Quote.ayrt @@ -1 +1 @@ -{"Name":"Customer Quote","Active":true,"Notes":"\n","Roles":49514,"AType":27,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n {{#each ayReportData}}\n \n \n \n \n \n\n {{#if ../ayServerMetaData.HasSmallLogo}}\n \n \n \n \n \n \n \n {{else}}\n \n \n \n \n \n \n \n {{/if}}\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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each Items}}\n \n \n \n \n \n \n \n \n\n {{#each Units}}\n \n \n \n \n \n {{/each}}\n {{#if Units}}\n \n \n \n {{/if}}\n\n \n \n \n \n \n \n \n \n \n \n\n {{#each Labors}}\n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \n {{/each}}\n\n {{#if Labors}}\n \n \n \n {{/if}}\n\n {{#each Parts}}\n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \n {{/each}}\n\n {{#if Parts}}\n \n \n \n {{/if}}\n\n {{/each}}\n \n
{{ ayLogo \"small\" }}{{ayT 'Quote'}} {{Serial}}
{{../ayServerMetaData.CompanyName}}{{ayT 'Quote'}}{{Serial}}
 
{{ayT 'Quote'}} prepared for:
{{CustomerViz}}
 {{Address}}, {{City}}{{ayT 'QuotePreparedByID'}}{{PreparedByViz}}
 {{CustomerPhone1Viz}}{{ayT 'WorkOrderCustomerReferenceNumber'}}{{CustomerReferenceNumber}}
 {{CustomerEmailAddressViz}} {{ayT 'WorkOrderInternalReferenceNumber'}}{{InternalReferenceNumber}}
 {{ayT \"QuoteQuoteRequestDate\"}}{{ayDate Requested}}
 {{ayT 'WorkOrderSummary'}} {{ayT 'QuoteValidUntilDate'}}{{ayDate ValidUntil}}
 {{Notes}}  
 {{ayT 'QuoteIntroduction'}} 
 {{Introduction}} 
 
{{ayT 'WorkOrderItemSummary'}} #{{Sequence}}{{Notes}}
{{ayT 'WorkOrderItemTechNotes'}}{{TechNotes}}
{{ayT 'Unit'}}{{UnitViz}} - {{UnitModelNameViz}}
 
{{ayT 'WorkOrderItemList'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'Price'}}{{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'LineTotal'}}
{{ayT 'WorkOrderItemLaborServiceRateID'}}: {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency PriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}$0.00{{ayCurrency TaxBViz}}$0.00{{ayCurrency LineTotalViz}}
 
{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}{{Quantity}}{{ayCurrency PriceViz}}{{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 {{#if ThisWOTotalTaxAs}}{{else}}{{/if}}\n {{#if ThisWOTotalTaxBs}}{{else}}{{/if}}\n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
{{ayT 'WorkOrderItemLaborList'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemParts'}} {{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxA'}} {{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxB'}} {{ayT 'NetPrice'}} {{ayT 'Quote'}} {{ayT 'Total'}}
{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOTotalTaxAs}}$0.00{{ayCurrency ThisWOTotalTaxBs}}$0.00{{ayCurrency ThisWOTotalGrand}}
 
Thank you for your business!
If any questions about this price quote, please contact {{../ayServerMetaData.CompanyPhone1}} referencing {{ayT 'Quote'}} {{Serial}}
\n\n {{/each}}\n\n
\n\n\n","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\t//this function (if present) is called with the report data \n\t//before the report is rendered \n\t//modify data as required here and return it to change the data before the report renders \n\t//see the help documentation for details\n\n\tawait ayGetTranslations([\"Quote\", \"WorkOrderItemParts\", \"WorkOrderItemLaborList\", \"WorkOrderItemList\", \"QuoteIntroduction\", \"WorkOrderSummary\", \"QuotePreparedByID\", \"WorkOrderInternalReferenceNumber\", \"WorkOrderCustomerReferenceNumber\", \"QuoteDateSubmitted\", \"QuoteDateApproved\", \"QuoteValidUntilDate\", \"QuoteQuoteRequestDate\", \"Unit\", \"WorkOrderItemSummary\", \"WorkOrderItemTechNotes\", \"WorkOrderItemPartQuantity\", \"Price\", \"NetPrice\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"LineTotal\", \"Total\", \"WorkOrderItemPartPartID\", \"WorkOrderItemLaborServiceRateID\"]);\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 quote 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 quote so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\n\n\t//below declares a key on the entire wo to hold ALL of THIS quote's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS quote'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 quote'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 quote'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//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 quote 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 quote 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 quote 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 quote 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 quote 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 quote in this report data\n \t \t\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 quote 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 quote 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 quote 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 quote 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 quote 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 quote in this report data\n \t \t\t}\t\t\t\n\t\t\t}\n\n\n\t\t}\n\t}\n\n\n\treturn reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":" ","FooterTemplate":"          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Customer Quote","Active":true,"Notes":"\n","Roles":49514,"AType":27,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n {{#each ayReportData}}\n \n \n \n \n \n\n {{#if ../ayServerMetaData.HasSmallLogo}}\n \n \n \n \n \n \n \n {{else}}\n \n \n \n \n \n \n \n {{/if}}\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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {{#each Items}}\n \n \n \n \n \n \n \n \n\n {{#each Units}}\n \n \n \n \n \n {{/each}}\n {{#if Units}}\n \n \n \n {{/if}}\n\n \n \n \n \n \n \n \n \n \n \n\n {{#each Labors}}\n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \n {{/each}}\n\n {{#if Labors}}\n \n \n \n {{/if}}\n\n {{#each Parts}}\n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \n {{/each}}\n\n {{#if Parts}}\n \n \n \n {{/if}}\n\n {{/each}}\n \n
{{ ayLogo \"small\" }}{{ayT 'Quote'}} {{Serial}}
{{../ayServerMetaData.CompanyName}}{{ayT 'Quote'}}{{Serial}}
 
{{ayT 'Quote'}} prepared for:
{{CustomerViz}}
 {{Address}}, {{City}}{{ayT 'QuotePreparedByID'}}{{PreparedByViz}}
 {{CustomerPhone1Viz}}{{ayT 'WorkOrderCustomerReferenceNumber'}}{{CustomerReferenceNumber}}
 {{CustomerEmailAddressViz}} {{ayT 'WorkOrderInternalReferenceNumber'}}{{InternalReferenceNumber}}
 {{ayT \"QuoteQuoteRequestDate\"}}{{ayDate Requested}}
 {{ayT 'WorkOrderSummary'}} {{ayT 'QuoteValidUntilDate'}}{{ayDate ValidUntil}}
 {{Notes}}  
 {{ayT 'QuoteIntroduction'}} 
 {{Introduction}} 
 
{{ayT 'WorkOrderItemSummary'}} #{{Sequence}}{{Notes}}
{{ayT 'WorkOrderItemTechNotes'}}{{TechNotes}}
{{ayT 'Unit'}}{{UnitViz}} - {{UnitModelNameViz}}
 
{{ayT 'WorkOrderItemList'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'Price'}}{{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'LineTotal'}}
{{ayT 'WorkOrderItemLaborServiceRateID'}}: {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency PriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}$0.00{{ayCurrency TaxBViz}}$0.00{{ayCurrency LineTotalViz}}
 
{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}{{Quantity}}{{ayCurrency PriceViz}}{{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 {{#if ThisWOTotalTaxAs}}{{else}}{{/if}}\n {{#if ThisWOTotalTaxBs}}{{else}}{{/if}}\n \n \n \n \n \n \n \n \n \n \n \n \n
 
 
{{ayT 'WorkOrderItemLaborList'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemPartList'}} {{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxA'}} {{ayT 'NetPrice'}}{{ayT 'TaxCodeTaxB'}} {{ayT 'NetPrice'}} {{ayT 'Quote'}} {{ayT 'Total'}}
{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOTotalTaxAs}}$0.00{{ayCurrency ThisWOTotalTaxBs}}$0.00{{ayCurrency ThisWOTotalGrand}}
 
Thank you for your business!
If any questions about this price quote, please contact {{../ayServerMetaData.CompanyPhone1}} referencing {{ayT 'Quote'}} {{Serial}}
\n\n {{/each}}\n\n
\n\n\n","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\t//this function (if present) is called with the report data \n\t//before the report is rendered \n\t//modify data as required here and return it to change the data before the report renders \n\t//see the help documentation for details\n\n\tawait ayGetTranslations([\"Quote\", \"WorkOrderItemPartList\", \"WorkOrderItemLaborList\", \"WorkOrderItemList\", \"QuoteIntroduction\", \"WorkOrderSummary\", \"QuotePreparedByID\", \"WorkOrderInternalReferenceNumber\", \"WorkOrderCustomerReferenceNumber\", \"QuoteDateSubmitted\", \"QuoteDateApproved\", \"QuoteValidUntilDate\", \"QuoteQuoteRequestDate\", \"Unit\", \"WorkOrderItemSummary\", \"WorkOrderItemTechNotes\", \"WorkOrderItemPartQuantity\", \"Price\", \"NetPrice\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"LineTotal\", \"Total\", \"WorkOrderItemPartPartID\", \"WorkOrderItemLaborServiceRateID\"]);\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 quote 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 quote so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\n\n\t//below declares a key on the entire wo to hold ALL of THIS quote's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS quote'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 quote'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 quote'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//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 quote 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 quote 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 quote 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 quote 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 quote 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 quote in this report data\n \t \t\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 quote 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 quote 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 quote 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 quote 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 quote 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 quote in this report data\n \t \t\t}\t\t\t\n\t\t\t}\n\n\n\t\t}\n\t}\n\n\n\treturn reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":" ","FooterTemplate":"          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","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/PM Parts Summary .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/PM Parts Summary .ayrt index 1c4aeb2a..8dab10ca 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/PM Parts Summary .ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/PM Parts Summary .ayrt @@ -1 +1 @@ -{"Name":"PM Parts Summary ","Active":true,"Notes":"Custom Prepare to obtain translations, group by the woitempart, derived amounts and running totals","Roles":49258,"AType":21,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n \n \n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
{{ayT 'PM'}} {{ayT 'WorkOrderItemParts'}} {{ayT 'PartCost'}} {{ayT 'NetPrice'}}
 
{{ayT 'Part'}}{{ayT 'PM'}}{{ayT 'PMNextServiceDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per {{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
 
{{group}}
 {{Serial}}{{ayDate NextServiceDate}}{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}} {{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for part {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}

 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
 
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemParts'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 20px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemParts\", \"Part\", \"PMNextServiceDate\", \"WorkOrderItemPartQuantity\", \"PM\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate pms -> items -> pm item parts\n reportData.ayReportData.forEach(pm => {\n pm.Items.forEach(pmitem => {\n pmitem.Parts.forEach(part => {\n //new shape of data required for report \n let record = {\n Serial: pm.Serial,\n\t\t\t\t\tNextServiceDate: pm.NextServiceDate,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n Serials: part.Serials,\n PartDescriptionViz: part.PartDescriptionViz ?? \"\",\n };\n\n //Find or create group and insert this record \n let groupObject = ret.find(z => z.group == (part.PartNameViz + \" \" + record.PartDescriptionViz) );\n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz + \" \" + record.PartDescriptionViz), items: [record], count: 1 });\n \n }\n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//below to get running totals of THE DATA returned above\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all pms so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//makes sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"PM Parts Summary ","Active":true,"Notes":"Custom Prepare to obtain translations, group by the woitempart, derived amounts and running totals","Roles":49258,"AType":21,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n \n \n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
{{ayT 'PM'}} {{ayT 'WorkOrderItemPartList'}} {{ayT 'PartCost'}} {{ayT 'NetPrice'}}
 
{{ayT 'Part'}}{{ayT 'PM'}}{{ayT 'PMNextServiceDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per {{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
 
{{group}}
 {{Serial}}{{ayDate NextServiceDate}}{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}} {{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for part {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}

 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
 
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemPartList'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 20px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemPartList\", \"Part\", \"PMNextServiceDate\", \"WorkOrderItemPartQuantity\", \"PM\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate pms -> items -> pm item parts\n reportData.ayReportData.forEach(pm => {\n pm.Items.forEach(pmitem => {\n pmitem.Parts.forEach(part => {\n //new shape of data required for report \n let record = {\n Serial: pm.Serial,\n\t\t\t\t\tNextServiceDate: pm.NextServiceDate,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n Serials: part.Serials,\n PartDescriptionViz: part.PartDescriptionViz ?? \"\",\n };\n\n //Find or create group and insert this record \n let groupObject = ret.find(z => z.group == (part.PartNameViz + \" \" + record.PartDescriptionViz) );\n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz + \" \" + record.PartDescriptionViz), items: [record], count: 1 });\n \n }\n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//below to get running totals of THE DATA returned above\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all pms so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//makes sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","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/Part Grouped Net Cost Difference.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Part Grouped Net Cost Difference.ayrt index f4972f27..272a5700 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Part Grouped Net Cost Difference.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Part Grouped Net Cost Difference.ayrt @@ -1 +1 @@ -{"Name":"Part Grouped Net Cost Difference","Active":true,"Notes":"Custom Prepare to obtain translations, group by the woitempart, derived amounts and running totals","Roles":49258,"AType":39,"IncludeWoItemDescendants":false,"Template":"\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n {{#if ServiceDate }}{{else}} {{/if}}\n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
{{ayT 'WorkOrder'}} {{ayT 'WorkOrderItemParts'}} {{ayT 'PartCost'}} {{ayT 'NetPrice'}}
 
{{ayT 'Part'}}{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per{{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
{{group}}
 {{Serial}}{{ayDate ServiceDate}}no Service Date specified{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}}{{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for part {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemParts'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 30px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemParts\", \"Part\", \"WorkOrderServiceDate\", \"WorkOrderItemPartQuantity\", \"WorkOrder\", \"WorkOrderList\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate workorders -> items -> workorder item parts\n reportData.ayReportData.forEach(workorder => {\n workorder.Items.forEach(workorderitem => {\n workorderitem.Parts.forEach(part => {\n //new shape of data required for report\n let record = {\n Serial: workorder.Serial,\n\t\t\t\t\tServiceDate: workorder.ServiceDate,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n\t\t\t\t\tPartDescriptionViz: part.PartDescriptionViz ?? \"\",\n Serials: part.Serials\n };\n\n //Find or create group and insert this record \n let groupObject = ret.find(z => z.group == part.PartNameViz + \" \" + record.PartDescriptionViz);\n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: part.PartNameViz + \" \" + record.PartDescriptionViz, items: [record], count: 1 });\n }\n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//below gets running totals of THE custom DATA returned above\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all workorders so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Part Grouped Net Cost Difference","Active":true,"Notes":"Custom Prepare to obtain translations, group by the woitempart, derived amounts and running totals","Roles":49258,"AType":39,"IncludeWoItemDescendants":false,"Template":"\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n {{#if ServiceDate }}{{else}} {{/if}}\n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
{{ayT 'WorkOrder'}} {{ayT 'WorkOrderItemPartList'}} {{ayT 'PartCost'}} {{ayT 'NetPrice'}}
 
{{ayT 'Part'}}{{ayT 'WorkOrder'}}{{ayT 'WorkOrderServiceDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per{{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
{{group}}
 {{Serial}}{{ayDate ServiceDate}}no Service Date specified{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}}{{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for part {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemPartList'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 30px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemPartList\", \"Part\", \"WorkOrderServiceDate\", \"WorkOrderItemPartQuantity\", \"WorkOrder\", \"WorkOrderList\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate workorders -> items -> workorder item parts\n reportData.ayReportData.forEach(workorder => {\n workorder.Items.forEach(workorderitem => {\n workorderitem.Parts.forEach(part => {\n //new shape of data required for report\n let record = {\n Serial: workorder.Serial,\n\t\t\t\t\tServiceDate: workorder.ServiceDate,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n\t\t\t\t\tPartDescriptionViz: part.PartDescriptionViz ?? \"\",\n Serials: part.Serials\n };\n\n //Find or create group and insert this record \n let groupObject = ret.find(z => z.group == part.PartNameViz + \" \" + record.PartDescriptionViz);\n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: part.PartNameViz + \" \" + record.PartDescriptionViz, items: [record], count: 1 });\n }\n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//below gets running totals of THE custom DATA returned above\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all workorders so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","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/Parts & Labor Profit _ Loss.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Parts & Labor Profit _ Loss.ayrt index 56a9ca78..59d1953d 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Parts & Labor Profit _ Loss.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Parts & Labor Profit _ Loss.ayrt @@ -1 +1 @@ -{"Name":"Parts & Labor Profit / Loss","Active":true,"Notes":"Custom Prepare running totals and derived WO profit/loss ","Roles":49258,"AType":34,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n \n \n {{#if ThisWOAllLaborsNetViz }} {{else}}{{/if}}\n {{#if ThisWOAllLaborsCost }} {{else}}{{/if}}\n {{#if ThisWOAllLaborsLoss }} {{else}}{{/if}}\n \n {{#if ThisWOAllPartsNetViz }} {{else}}{{/if}}\n {{#if ThisWOAllPartsCost }} {{else}}{{/if}}\n {{#if ThisWOAllPartsLoss }} {{else}}{{/if}}\n {{#if ThisWOTotalLoss }} {{else}} {{/if}}\n \n {{/each}}\n \n\n
Parts & Labor Profit / Loss
 
{{ayT 'WorkOrder'}}{{ayT 'Customer'}}{{ayT 'WorkOrderServiceDate'}} {{ayT 'WorkOrderItemLaborList'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemLaborList'}} Cost{{ayT 'WorkOrderItemLaborList'}} Profit / Loss {{ayT 'WorkOrderItemParts'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemParts'}} Cost{{ayT 'WorkOrderItemParts'}} Profit / Loss+ / -
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}} {{ayCurrency ThisWOAllLaborsNetViz}}no billable labor{{ayCurrency ThisWOAllLaborsCost}}no labor costs({{ayCurrency ThisWOAllLaborsLoss}}){{ayCurrency ThisWOAllLaborsProfit}} {{ayCurrency ThisWOAllPartsNetViz}}no billable parts{{ayCurrency ThisWOAllPartsCost}}no parts costs({{ayCurrency ThisWOAllPartsLoss}}){{ayCurrency ThisWOAllPartsProfit}}({{ayCurrency ThisWOTotalLoss}}){{ayCurrency ThisWOTotalProfit}}
\n\n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOLaborsCost}} {{else}} {{/if}}\n {{#if AllWOLaborsLoss}} {{else}} {{/if}}\n \n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsCost}} {{else}} {{/if}}\n {{#if AllWOPartsLoss}} {{else}} {{/if}}\n {{#if AllWOTotalLoss}} {{else}} {{/if}}\n \n \n
 
Totals for all listed {{ayT 'WorkOrderList'}}{{ ayCurrency AllWOLaborsNetViz}}no billable labor{{ ayCurrency AllWOLaborsCost}}no labor costs({{ ayCurrency AllWOLaborsLoss}}) {{ ayCurrency AllWOLaborsProfit }} {{ ayCurrency AllWOPartsNetViz}}no billable parts{{ ayCurrency AllWOPartsCost}}no parts cost({{ ayCurrency AllWOPartsLoss}}) {{ ayCurrency AllWOPartsProfit }}({{ ayCurrency AllWOTotalLoss}}){{ ayCurrency AllWOTotalProfit}}
\n\n
\n\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 30px;\n font-size: 10pt; \n color: #9e9e9e;\n}\n\ntfoot th{\n border-top: solid 1pt #9e9e9e;\n height: 50px;\n text-align: center;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\n}\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\ntfoot {\n font-size: 9pt;\n }\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemParts\", \"WorkOrderItemLaborList\", \"Customer\", \"WorkOrderServiceDate\", \"WorkOrder\", \"WorkOrderList\", \"Total\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"NetPrice\" ]);\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//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs),from all workorders so it exists and a key to hold all Labor Net Costs\nreportData.AllWOLaborsNetViz = 0;\nreportData.AllWOLaborsCost = 0;\nreportData.AllWOLaborsProfit = 0;\nreportData.AllWOLaborsLoss = 0;\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all workorders so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsCost = 0;\nreportData.AllWOPartsProfit = 0;\nreportData.AllWOPartsLoss = 0;\n\n\n//below declares a key to hold all Nets, hold all Costs, profit/loss (nets - costs), from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\nreportData.AllWOTotalCost = 0;\nreportData.AllWOTotalProfit = 0;\nreportData.AllWOTotalLoss = 0;\n\n\n\n\n\n\nfor (const EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs) from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\tEachWO.ThisWOAllLaborsCost = 0;\n\tEachWO.ThisWOAllLaborsProfit = 0;\n\tEachWO.ThisWOAllLaborsLoss = 0;\n\n\t//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\tEachWO.ThisWOAllPartsCost = 0;\n\tEachWO.ThisWOAllPartsProfit = 0; \n\tEachWO.ThisWOAllPartsLoss = 0; \n\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets , costs, profit/loss (nets - costs) so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\tEachWO.ThisWOTotalCost = 0;\n\tEachWO.ThisWOTotalProfit = 0;\n\tEachWO.ThisWOTotalLoss = 0;\n\t\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\tItem.ThisItemAllLaborsCost = 0; //declare a key on the Item to hold all of this item's labor costs and set it initially to 0\n\t\t\tItem.ThisItemAllLaborsProfit = 0; //declare a key on the Item to hold all of this item's labor profit/loss (nets - costs) 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//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\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\n\n\t\t\t\t\t\tLabor.NetCost = (Labor.CostViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsCost += Labor.NetCost; //this IS where the actual adding to running total for this WOItem's Labors Cost\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsCost += Labor.NetCost; //this IS where the actual adding to the running total for this entire WO's Labors costs\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Labor.NetCost; //this IS where the actual adding to the running total for ALL costs for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLaborsCost += Labor.NetCost;\t//this IS where the actual adding to the running total for all labor costs for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalCost += Labor.NetCost; //this is where the actual adding to the running total for ALL workorders costs in this report data\n\n\t\t\t\t\t\tif (Labor.NetCost != null) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tLabor.NetProfit = (Labor.NetViz - Labor.NetCost)\n\t\t\t\t\t\tItem.ThisItemAllLaborsProfit += Labor.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\t}\n\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.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\tItem.ThisItemAllPartsCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tItem.ThisItemAllPartsProfit = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\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\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\tPart.NetCost = (Part.Cost * Part.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tItem.ThisItemAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOTotalCost += Part.NetCost;\n\n\t\t\t\t\t\tif (Part.NetViz != null) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tPart.NetProfit = (Part.NetViz - Part.Cost)\n\t\t\t\t\t\tItem.ThisItemAllPartsProfit += Part.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\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\n\t\t}\n\n\n\t\tif (EachWO.ThisWOAllLaborsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllLaborsLoss = EachWO.ThisWOAllLaborsProfit;\n\t\t\t\tEachWO.ThisWOAllLaborsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOAllPartsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllPartsLoss = EachWO.ThisWOAllPartsProfit;\n\t\t\t\tEachWO.ThisWOAllPartsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOTotalProfit <= 0) {\n\t\t\t\tEachWO.ThisWOTotalLoss = EachWO.ThisWOTotalProfit;\n\t\t\t\tEachWO.ThisWOTotalProfit = 0;\n\t\t\t}\n\n\t}\n\n\nif (reportData.AllWOLaborsProfit <= 0) {\n\t\treportData.AllWOLaborsLoss = reportData.AllWOLaborsProfit;\n\t\treportData.AllWOLaborsProfit = 0;\n\t}\n\nif (reportData.AllWOPartsProfit <= 0) {\n\t\treportData.AllWOPartsProfit = reportData.AllWOPartsProfit;\n\t\treportData.AllWOPartsProfit = 0;\n\t}\n\nif (reportData.AllWOTotalProfit <= 0) {\n\t\treportData.AllWOTotalLoss = reportData.AllWOTotalProfit;\n\t\treportData.AllWOTotalProfit = 0;\n\t}\t\n\n return reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Parts & Labor Profit / Loss","Active":true,"Notes":"Custom Prepare running totals and derived WO profit/loss ","Roles":49258,"AType":34,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n \n \n {{#if ThisWOAllLaborsNetViz }} {{else}}{{/if}}\n {{#if ThisWOAllLaborsCost }} {{else}}{{/if}}\n {{#if ThisWOAllLaborsLoss }} {{else}}{{/if}}\n \n {{#if ThisWOAllPartsNetViz }} {{else}}{{/if}}\n {{#if ThisWOAllPartsCost }} {{else}}{{/if}}\n {{#if ThisWOAllPartsLoss }} {{else}}{{/if}}\n {{#if ThisWOTotalLoss }} {{else}} {{/if}}\n \n {{/each}}\n \n\n
Parts & Labor Profit / Loss
 
{{ayT 'WorkOrder'}}{{ayT 'Customer'}}{{ayT 'WorkOrderServiceDate'}} {{ayT 'WorkOrderItemLaborList'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemLaborList'}} Cost{{ayT 'WorkOrderItemLaborList'}} Profit / Loss {{ayT 'WorkOrderItemPartList'}} {{ayT 'NetPrice'}}{{ayT 'WorkOrderItemPartList'}} Cost{{ayT 'WorkOrderItemPartList'}} Profit / Loss+ / -
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}} {{ayCurrency ThisWOAllLaborsNetViz}}no billable labor{{ayCurrency ThisWOAllLaborsCost}}no labor costs({{ayCurrency ThisWOAllLaborsLoss}}){{ayCurrency ThisWOAllLaborsProfit}} {{ayCurrency ThisWOAllPartsNetViz}}no billable parts{{ayCurrency ThisWOAllPartsCost}}no parts costs({{ayCurrency ThisWOAllPartsLoss}}){{ayCurrency ThisWOAllPartsProfit}}({{ayCurrency ThisWOTotalLoss}}){{ayCurrency ThisWOTotalProfit}}
\n\n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOLaborsCost}} {{else}} {{/if}}\n {{#if AllWOLaborsLoss}} {{else}} {{/if}}\n \n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsCost}} {{else}} {{/if}}\n {{#if AllWOPartsLoss}} {{else}} {{/if}}\n {{#if AllWOTotalLoss}} {{else}} {{/if}}\n \n \n
 
Totals for all listed {{ayT 'WorkOrderList'}}{{ ayCurrency AllWOLaborsNetViz}}no billable labor{{ ayCurrency AllWOLaborsCost}}no labor costs({{ ayCurrency AllWOLaborsLoss}}) {{ ayCurrency AllWOLaborsProfit }} {{ ayCurrency AllWOPartsNetViz}}no billable parts{{ ayCurrency AllWOPartsCost}}no parts cost({{ ayCurrency AllWOPartsLoss}}) {{ ayCurrency AllWOPartsProfit }}({{ ayCurrency AllWOTotalLoss}}){{ ayCurrency AllWOTotalProfit}}
\n\n
\n\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 30px;\n font-size: 10pt; \n color: #9e9e9e;\n}\n\ntfoot th{\n border-top: solid 1pt #9e9e9e;\n height: 50px;\n text-align: center;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\n}\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\ntfoot {\n font-size: 9pt;\n }\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemPartList\", \"WorkOrderItemLaborList\", \"Customer\", \"WorkOrderServiceDate\", \"WorkOrder\", \"WorkOrderList\", \"Total\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"NetPrice\" ]);\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//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs),from all workorders so it exists and a key to hold all Labor Net Costs\nreportData.AllWOLaborsNetViz = 0;\nreportData.AllWOLaborsCost = 0;\nreportData.AllWOLaborsProfit = 0;\nreportData.AllWOLaborsLoss = 0;\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all workorders so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsCost = 0;\nreportData.AllWOPartsProfit = 0;\nreportData.AllWOPartsLoss = 0;\n\n\n//below declares a key to hold all Nets, hold all Costs, profit/loss (nets - costs), from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\nreportData.AllWOTotalCost = 0;\nreportData.AllWOTotalProfit = 0;\nreportData.AllWOTotalLoss = 0;\n\n\n\n\n\n\nfor (const EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs) from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\tEachWO.ThisWOAllLaborsCost = 0;\n\tEachWO.ThisWOAllLaborsProfit = 0;\n\tEachWO.ThisWOAllLaborsLoss = 0;\n\n\t//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\tEachWO.ThisWOAllPartsCost = 0;\n\tEachWO.ThisWOAllPartsProfit = 0; \n\tEachWO.ThisWOAllPartsLoss = 0; \n\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets , costs, profit/loss (nets - costs) so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\tEachWO.ThisWOTotalCost = 0;\n\tEachWO.ThisWOTotalProfit = 0;\n\tEachWO.ThisWOTotalLoss = 0;\n\t\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\tItem.ThisItemAllLaborsCost = 0; //declare a key on the Item to hold all of this item's labor costs and set it initially to 0\n\t\t\tItem.ThisItemAllLaborsProfit = 0; //declare a key on the Item to hold all of this item's labor profit/loss (nets - costs) 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//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\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\n\n\t\t\t\t\t\tLabor.NetCost = (Labor.CostViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsCost += Labor.NetCost; //this IS where the actual adding to running total for this WOItem's Labors Cost\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsCost += Labor.NetCost; //this IS where the actual adding to the running total for this entire WO's Labors costs\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Labor.NetCost; //this IS where the actual adding to the running total for ALL costs for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLaborsCost += Labor.NetCost;\t//this IS where the actual adding to the running total for all labor costs for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalCost += Labor.NetCost; //this is where the actual adding to the running total for ALL workorders costs in this report data\n\n\t\t\t\t\t\tif (Labor.NetCost != null) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tLabor.NetProfit = (Labor.NetViz - Labor.NetCost)\n\t\t\t\t\t\tItem.ThisItemAllLaborsProfit += Labor.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\t}\n\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.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\tItem.ThisItemAllPartsCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tItem.ThisItemAllPartsProfit = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\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\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\tPart.NetCost = (Part.Cost * Part.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tItem.ThisItemAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOTotalCost += Part.NetCost;\n\n\t\t\t\t\t\tif (Part.NetViz != null) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tPart.NetProfit = (Part.NetViz - Part.Cost)\n\t\t\t\t\t\tItem.ThisItemAllPartsProfit += Part.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\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\n\t\t}\n\n\n\t\tif (EachWO.ThisWOAllLaborsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllLaborsLoss = EachWO.ThisWOAllLaborsProfit;\n\t\t\t\tEachWO.ThisWOAllLaborsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOAllPartsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllPartsLoss = EachWO.ThisWOAllPartsProfit;\n\t\t\t\tEachWO.ThisWOAllPartsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOTotalProfit <= 0) {\n\t\t\t\tEachWO.ThisWOTotalLoss = EachWO.ThisWOTotalProfit;\n\t\t\t\tEachWO.ThisWOTotalProfit = 0;\n\t\t\t}\n\n\t}\n\n\nif (reportData.AllWOLaborsProfit <= 0) {\n\t\treportData.AllWOLaborsLoss = reportData.AllWOLaborsProfit;\n\t\treportData.AllWOLaborsProfit = 0;\n\t}\n\nif (reportData.AllWOPartsProfit <= 0) {\n\t\treportData.AllWOPartsProfit = reportData.AllWOPartsProfit;\n\t\treportData.AllWOPartsProfit = 0;\n\t}\n\nif (reportData.AllWOTotalProfit <= 0) {\n\t\treportData.AllWOTotalLoss = reportData.AllWOTotalProfit;\n\t\treportData.AllWOTotalProfit = 0;\n\t}\t\n\n return reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","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/Quote Internal Use Costs and Charges.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Quote Internal Use Costs and Charges.ayrt index ded2d708..316d14d3 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Quote Internal Use Costs and Charges.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Quote Internal Use Costs and Charges.ayrt @@ -1 +1 @@ -{"Name":"Quote Internal Use Costs and Charges","Active":true,"Notes":"\n","Roles":49258,"AType":27,"IncludeWoItemDescendants":false,"Template":"\n\n
\n {{#each ayReportData}} \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 \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 {{#each Items}}\n \n \n \n \n \n \n \n \n\n {{#each Units}}\n \n \n \n \n \n {{/each}}\n {{#if Units}}\n \n \n \n {{/if}}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n {{#each Labors}}\n \n \n \n \n\n \n {{#if_eq ListPriceViz PriceViz }} \n {{else}}{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }} \n {{else}}{{/if_eq}}\n \n \n {{#if_eq ListPriceViz PriceViz }}\n {{else}}{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }}\n {{else}}{{/if_eq}}\n\n \n \n {{/each}}\n {{#if Labors}}\n \n \n \n {{/if}}\n\n {{#each Parts}}\n \n \n \n \n \n {{#if_eq ListPrice PriceViz }} \n {{else}}{{/if_eq}}\n {{#if_eq ListPrice PriceViz }} \n {{else}}{{/if_eq}}\n \n \n {{#if_eq ListPrice PriceViz }}\n {{else}}{{/if_eq}}\n {{#if_eq ListPrice PriceViz }}\n {{else}}{{/if_eq}}\n \n \n {{/each}}\n \n \n \n {{/each}}\n \n
Internal Use - {{ayT 'WorkOrderItemParts'}} & {{ayT 'WorkOrderItemLaborList'}} only{{ayT 'Quote'}} {{Serial}}
 
{{ayT 'Quote'}} prepared for:
{{CustomerViz}}{{ayT 'Status'}}{{LastStateNameViz}}
 {{Address}}, {{City}}{{ayT 'QuotePreparedByID'}}{{PreparedByViz}}
 {{CustomerPhone1Viz}}{{ayT 'WorkOrderCustomerReferenceNumber'}}{{CustomerReferenceNumber}}
 {{CustomerEmailAddressViz}}{{ayT 'WorkOrderInternalReferenceNumber'}}{{InternalReferenceNumber}}
 {{ayT \"QuoteQuoteRequestDate\"}}{{myDate Requested}}
 {{ayT 'WorkOrderSummary'}}{{ayT 'QuoteDateSubmitted'}}{{myDate Submitted}}
 {{Notes}} {{ayT 'QuoteValidUntilDate'}}{{myDate ValidUntil}}
 {{ayT 'QuoteIntroduction'}}{{ayT 'QuoteDateApproved'}} {{myDate Approved}}
 {{Introduction}}
 
{{ayT 'WorkOrderItemSummary'}} #{{Sequence}}{{Notes}}
{{ayT 'WorkOrderItemTechNotes'}}{{TechNotes}}
{{ayT 'Unit'}}{{UnitViz}} - {{UnitModelNameViz}}
 
{{ayT 'WorkOrderItemList'}}QtyCost PERList Price PERCust Price PERCost NETList Price NETCust Price NETDifference
{{ayT 'WorkOrderItemLaborServiceRateID'}}: {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency CostViz}}{{ayCurrency ListPriceViz}}{{ayCurrency ListPriceViz}}{{ayCurrency PriceViz}}{{ayCurrency PriceViz}}{{ayCurrency ThisLaborCostxQty}}{{ayCurrency ThisLaborListPricexQty}}{{ayCurrency ThisLaborListPricexQty}}{{ayCurrency NetViz}}{{ayCurrency NetViz}}{{ayCurrency ThisLaborNetVizMinusListLaborxQty}}
 
{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}{{Quantity}}{{ayCurrency Cost}}{{ayCurrency ListPrice}}{{ayCurrency ListPrice}}{{ayCurrency PriceViz}}{{ayCurrency PriceViz}}{{ayCurrency ThisPartCostxQty}}{{ayCurrency ThisPartListPricexQty}}{{ayCurrency ThisPartListPricexQty}}{{ayCurrency NetViz}}{{ayCurrency NetViz}}{{ayCurrency ThisPartNetVizMinusListPartxQty}}
 
\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 \n \n \n
 
 
Cost NETList Price NETCust Price NETDifference
All {{ayT 'WorkOrderItemLaborList'}}{{ayCurrency ThisWOAllLaborsCostxQty}}{{ayCurrency ThisWOAllLaborsListPricexQty}}{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllLaborsNetVizMinusListPricexQty}}
All {{ayT 'WorkOrderItemParts'}}{{ayCurrency ThisWOAllPartsCostxQty}}{{ayCurrency ThisWOAllPartsListPricexQty}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOAllPartsNetVizMinusListPricexQty}}
{{ayT 'Total'}}{{ayCurrency ThisWOTotalCostNets}}{{ayCurrency ThisWOTotalListNets}}{{ayCurrency ThisWOTotalCustNets}}{{ayCurrency ThisWOAllNetVizMinusAllListPricexQty}}
\n {{/each}}\n
\n\n","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\", \"WorkOrderItemParts\", \"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":" ","FooterTemplate":"          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Quote Internal Use Costs and Charges","Active":true,"Notes":"\n","Roles":49258,"AType":27,"IncludeWoItemDescendants":false,"Template":"\n\n
\n {{#each ayReportData}} \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 \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 {{#each Items}}\n \n \n \n \n \n \n \n \n\n {{#each Units}}\n \n \n \n \n \n {{/each}}\n {{#if Units}}\n \n \n \n {{/if}}\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n {{#each Labors}}\n \n \n \n \n\n \n {{#if_eq ListPriceViz PriceViz }} \n {{else}}{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }} \n {{else}}{{/if_eq}}\n \n \n {{#if_eq ListPriceViz PriceViz }}\n {{else}}{{/if_eq}}\n {{#if_eq ListPriceViz PriceViz }}\n {{else}}{{/if_eq}}\n\n \n \n {{/each}}\n {{#if Labors}}\n \n \n \n {{/if}}\n\n {{#each Parts}}\n \n \n \n \n \n {{#if_eq ListPrice PriceViz }} \n {{else}}{{/if_eq}}\n {{#if_eq ListPrice PriceViz }} \n {{else}}{{/if_eq}}\n \n \n {{#if_eq ListPrice PriceViz }}\n {{else}}{{/if_eq}}\n {{#if_eq ListPrice PriceViz }}\n {{else}}{{/if_eq}}\n \n \n {{/each}}\n \n \n \n {{/each}}\n \n
Internal Use - {{ayT 'WorkOrderItemPartList'}} & {{ayT 'WorkOrderItemLaborList'}} only{{ayT 'Quote'}} {{Serial}}
 
{{ayT 'Quote'}} prepared for:
{{CustomerViz}}{{ayT 'Status'}}{{LastStateNameViz}}
 {{Address}}, {{City}}{{ayT 'QuotePreparedByID'}}{{PreparedByViz}}
 {{CustomerPhone1Viz}}{{ayT 'WorkOrderCustomerReferenceNumber'}}{{CustomerReferenceNumber}}
 {{CustomerEmailAddressViz}}{{ayT 'WorkOrderInternalReferenceNumber'}}{{InternalReferenceNumber}}
 {{ayT \"QuoteQuoteRequestDate\"}}{{myDate Requested}}
 {{ayT 'WorkOrderSummary'}}{{ayT 'QuoteDateSubmitted'}}{{myDate Submitted}}
 {{Notes}} {{ayT 'QuoteValidUntilDate'}}{{myDate ValidUntil}}
 {{ayT 'QuoteIntroduction'}}{{ayT 'QuoteDateApproved'}} {{myDate Approved}}
 {{Introduction}}
 
{{ayT 'WorkOrderItemSummary'}} #{{Sequence}}{{Notes}}
{{ayT 'WorkOrderItemTechNotes'}}{{TechNotes}}
{{ayT 'Unit'}}{{UnitViz}} - {{UnitModelNameViz}}
 
{{ayT 'WorkOrderItemList'}}QtyCost PERList Price PERCust Price PERCost NETList Price NETCust Price NETDifference
{{ayT 'WorkOrderItemLaborServiceRateID'}}: {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency CostViz}}{{ayCurrency ListPriceViz}}{{ayCurrency ListPriceViz}}{{ayCurrency PriceViz}}{{ayCurrency PriceViz}}{{ayCurrency ThisLaborCostxQty}}{{ayCurrency ThisLaborListPricexQty}}{{ayCurrency ThisLaborListPricexQty}}{{ayCurrency NetViz}}{{ayCurrency NetViz}}{{ayCurrency ThisLaborNetVizMinusListLaborxQty}}
 
{{ayT 'WorkOrderItemPartPartID'}}: {{PartNameViz}} {{PartDescriptionViz}}{{Quantity}}{{ayCurrency Cost}}{{ayCurrency ListPrice}}{{ayCurrency ListPrice}}{{ayCurrency PriceViz}}{{ayCurrency PriceViz}}{{ayCurrency ThisPartCostxQty}}{{ayCurrency ThisPartListPricexQty}}{{ayCurrency ThisPartListPricexQty}}{{ayCurrency NetViz}}{{ayCurrency NetViz}}{{ayCurrency ThisPartNetVizMinusListPartxQty}}
 
\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 \n \n \n
 
 
Cost NETList Price NETCust Price NETDifference
All {{ayT 'WorkOrderItemLaborList'}}{{ayCurrency ThisWOAllLaborsCostxQty}}{{ayCurrency ThisWOAllLaborsListPricexQty}}{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllLaborsNetVizMinusListPricexQty}}
All {{ayT 'WorkOrderItemPartList'}}{{ayCurrency ThisWOAllPartsCostxQty}}{{ayCurrency ThisWOAllPartsListPricexQty}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOAllPartsNetVizMinusListPricexQty}}
{{ayT 'Total'}}{{ayCurrency ThisWOTotalCostNets}}{{ayCurrency ThisWOTotalListNets}}{{ayCurrency ThisWOTotalCustNets}}{{ayCurrency ThisWOAllNetVizMinusAllListPricexQty}}
\n {{/each}}\n
\n\n","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":" ","FooterTemplate":"          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","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/Quote Parts Net Cost Summary.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Quote Parts Net Cost Summary.ayrt index 6347b845..d8693edc 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Quote Parts Net Cost Summary.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Quote Parts Net Cost Summary.ayrt @@ -1 +1 @@ -{"Name":"Quote Parts Net Cost Summary","Active":true,"Notes":"Custom Prepare used to obtain translations, to group by the woitempart, and to obtain derived amounts and running totals\nUse of background-color to display Quote Status's display color","Roles":49258,"AType":27,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n \n {{#if Requested }}{{else}} {{/if}}\n \n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
Grouped by {{ayT 'Quote'}} {{ayT 'WorkOrderItemParts'}} showing {{ayT 'NetPrice'}} {{ayT 'PartCost'}}
 
 
{{ayT 'Part'}}{{ayT 'Quote'}}{{ayT 'Status'}}{{ayT 'QuoteQuoteRequestDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per {{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
 
{{group}}
 {{Serial}}{{LastStateNameViz}}{{ayDate Requested}}no date specified{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}} {{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for {{ayT 'Part'}} {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
 
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemParts'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 20px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemParts\", \"Part\", \"Status\", \"QuoteQuoteRequestDate\", \"WorkOrderItemPartQuantity\", \"Quote\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate quotes -> items -> quote item parts\n reportData.ayReportData.forEach(quote => {\n quote.Items.forEach(quoteitem => {\n quoteitem.Parts.forEach(part => {\n //new shape of data required for report \n let record = {\n Serial: quote.Serial,\n\t\t\t\t\tRequested: quote.Requested,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n Serials: part.Serials,\n PartDescriptionViz: part.PartDescriptionViz, \n LastStateNameViz: quote.LastStateNameViz,\n LastStateColorViz: quote.LastStateColorViz,\n };\n\n //Find or create group and insert this record \n if (part.PartDescriptionViz) { //if part description is not empty or null then will include\n let groupObject = ret.find(z => z.group == (part.PartNameViz + \" \" + part.PartDescriptionViz) ); \n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz+ \" \" + part.PartDescriptionViz), items: [record], count: 1 }); \n }\n } else { //else if part description is empty or null then will not include so doesn't show the text null \n let groupObject = ret.find(z => z.group == (part.PartNameViz) ); \n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz), items: [record], count: 1 }); \n }\n }\n \n \n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//note that below references the new shaped format of data\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all quotes so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Quote Parts Net Cost Summary","Active":true,"Notes":"Custom Prepare used to obtain translations, to group by the woitempart, and to obtain derived amounts and running totals\nUse of background-color to display Quote Status's display color","Roles":49258,"AType":27,"IncludeWoItemDescendants":false,"Template":"\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 {{#each ayReportData}}\n \n \n \n {{#each items}}\n \n \n \n \n {{#if Requested }}{{else}} {{/if}}\n \n \n \n \n \n {{#if NetCost }} {{else}}{{/if}}\n {{#if NetViz }} {{else}}{{/if}}\n {{#if NetDiff }} {{else}}{{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n {{/each}}\n \n
Grouped by {{ayT 'Quote'}} {{ayT 'WorkOrderItemPartList'}} showing {{ayT 'NetPrice'}} {{ayT 'PartCost'}}
 
 
{{ayT 'Part'}}{{ayT 'Quote'}}{{ayT 'Status'}}{{ayT 'QuoteQuoteRequestDate'}}{{ayT 'WorkOrderItemPartQuantity'}}{{ayT 'PartCost'}} Per{{ayT 'PartRetail'}} Per {{ayT 'PartCost'}} {{ayT 'NetPrice'}}{{ayT 'PartRetail'}} {{ayT 'NetPrice'}}Difference
 
{{group}}
 {{Serial}}{{LastStateNameViz}}{{ayDate Requested}}no date specified{{Quantity}}{{UnitOfMeasureViz}}{{ayCurrency Cost}}{{ayCurrency PriceViz}} {{ayCurrency NetCost}}{{Quantity}}{{ayCurrency NetViz}}{{Quantity}}{{ayCurrency NetDiff}}{{Quantity}}
 
{{ayT 'Total'}} for {{ayT 'Part'}} {{group}}{{ayCurrency GroupPartsNetCost}}{{ayCurrency GroupPartsNetViz}}{{ayCurrency GroupPartsDiff}}
 
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOPartsNetCost}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}} \n {{#if AllWOPartsDiff}} {{else}} {{/if}}\n \n \n \n
 
{{ayT 'Total'}} for all {{ayT 'WorkOrderItemPartList'}} in this reportAll Net CostAll Net ChargeAll Diff
 {{ ayCurrency AllWOPartsNetCost}}$0.00{{ ayCurrency AllWOPartsNetViz}}$0.00{{ayCurrency AllWOPartsDiff}}$0.00
\n\n","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: 14pt; \n color: #9e9e9e;\n text-align: left;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%; \n table-layout: fixed; \n }\n\nth {\n height: 20px;\n font-size: 10pt; \n color: #9e9e9e;\n text-align: center;\n}\n\ntbody td {\n padding: 2px;\n word-wrap: break-word;\n font-size: 9pt;\n text-align: center;\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\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n font-weight: bold;\n}\n.fontpurple {\n color: purple;\n}\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([\"WorkOrderItemPartList\", \"Part\", \"Status\", \"QuoteQuoteRequestDate\", \"WorkOrderItemPartQuantity\", \"Quote\", \"NetPrice\", \"PartCost\", \"PartRetail\", \"Total\" ]);\n\n\t//below is the code to group by the part - the PartNameViz\n\tlet ret = [];\n //iterate quotes -> items -> quote item parts\n reportData.ayReportData.forEach(quote => {\n quote.Items.forEach(quoteitem => {\n quoteitem.Parts.forEach(part => {\n //new shape of data required for report \n let record = {\n Serial: quote.Serial,\n\t\t\t\t\tRequested: quote.Requested,\n\t\t\t\t\tNetViz: part.NetViz,\n\t\t\t\t\tPriceOverride: part.PriceOverride,\n\t\t\t\t\tListPrice: part.ListPrice,\n UnitOfMeasureViz: part.UnitOfMeasureViz,\n PriceViz: part.PriceViz,\n Cost: part.Cost,\n SuggestedQuantity: part.SuggestedQuantity,\n Quantity: part.Quantity,\n PartWarehouseViz: part.PartWarehouseViz,\n UpcViz: part.UpcViz,\n Serials: part.Serials,\n PartDescriptionViz: part.PartDescriptionViz, \n LastStateNameViz: quote.LastStateNameViz,\n LastStateColorViz: quote.LastStateColorViz,\n };\n\n //Find or create group and insert this record \n if (part.PartDescriptionViz) { //if part description is not empty or null then will include\n let groupObject = ret.find(z => z.group == (part.PartNameViz + \" \" + part.PartDescriptionViz) ); \n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz+ \" \" + part.PartDescriptionViz), items: [record], count: 1 }); \n }\n } else { //else if part description is empty or null then will not include so doesn't show the text null \n let groupObject = ret.find(z => z.group == (part.PartNameViz) ); \n if (groupObject != undefined) {\n //there is already a matching group in the return array so just push this record into it\n groupObject.items.push(record);\n //update the count for this group's items\n groupObject.count++;\n } else {\n //No group yet, so start a new one in the ret array and push this record into it\n ret.push({ group: (part.PartNameViz), items: [record], count: 1 }); \n }\n }\n \n \n\n })\n })\n });\n\n //replace the ayReportData with our new shaped format of data\n reportData.ayReportData = ret;\n\n \n//note that below references the new shaped format of data\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit (nets - costs), from all quotes so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsNetCost = 0;\nreportData.AllWOPartsDiff = 0;\n\n\nfor (const EachGroup of reportData.ayReportData) \n\t{\n\n\n\t//below declares a key on the entire group to hold all Part Net, costs, profit/loss (nets - costs), for this group (this group is a single Part that has one or more wo item parts records)\n\tEachGroup.GroupPartsNetViz = 0;\n\tEachGroup.GroupPartsNetCost = 0;\n\tEachGroup.GroupPartsDiff = 0; \n\t\n\n\t//below is to Iterate through each woitempart record for this part - groupitem is a woitempart record\n\tfor (const groupitem of EachGroup.items)\n\t\t{\n\t\t\t\t\t\n\t\t\tgroupitem.ThisItemPartNetViz = 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\tgroupitem.ThisItemPartNetCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tgroupitem.ThisItemPartDiff = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (groupitem.Quantity != 0) \n \t \t{\n\t\t\t\t\t\tEachGroup.GroupPartsNetViz += groupitem.NetViz;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += groupitem.NetViz;\t\n\n\n\t\t\t\t\t\tgroupitem.NetCost = (groupitem.Cost * groupitem.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tEachGroup.GroupPartsNetCost += groupitem.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsNetCost += groupitem.NetCost;\n\n\n\t\t\t\t\t\tif (groupitem.NetViz != 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tgroupitem.NetDiff = (groupitem.NetViz - groupitem.NetCost)\n\t\t\t\t\t\tEachGroup.GroupPartsDiff += groupitem.NetDiff; //\n\t\t\t\t\t\treportData.AllWOPartsDiff += groupitem.NetDiff; //\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t}\n\n }\n\n return reportData; \n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"  ","FooterTemplate":"                Printed date: PDFDate\nPage of                ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file