1 line
31 KiB
Plaintext
1 line
31 KiB
Plaintext
{"Name":"112 EXAMPLE WO Invoice with derived Net and Grand Total","Active":true,"Notes":"Example of how to show Signature and date signed and printed name. PDF options header & footer example; Header for each WO spans multiple pages if WO multi-paged; Footer once per WO regardless number of pages\nPrepare functions to derive nets and grand totals; #IF helper in HTML to only show the child section IF true; Helper example: custom todaysMonthDDYYYYDate and custom myDate\nCSS example: tbody tr:nth-child for row striped;\n","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t<div >\t\n {{#each ayReportData}}\t <!-- the #each aspect MUST encompass the section where the class is that forces page break -->\n\t\t<table > \t<!-- the css to start a new page when a new object -->\n \t\t<thead> <!--table header will repeat on multiple pages if total thead content is less than 25% of page - IF NOT SHOWING ON 2nd PAGE of WO, is because is too high - note css -->\n <tr>\n <td colspan=\"8\" class=\"leftlean heading\">{{ ayLogo \"small\" }}</td>\n <td colspan=\"2\" class=\"rightlean heading\">Internal WO#:</td>\n <td colspan=\"2\" class=\"rightlean heading fontgreen\">{{Serial}}</td>\n </tr>\n <tr> \n <td colspan=\"8\" class=\"fontgreen\" >data from ayReportData shows in greenfont </td>\n <td colspan=\"2\" class=\"rightlean\">Service Date from WO:</td> \n <td colspan=\"2\" class=\"rightlean fontgreen\"> {{myDate ServiceDate}}</td> \n </tr>\n <tr> \n <td colspan=\"7\" class=\"fontred\" >data derived from Helper or Prepare shows in redfont</td>\n <td colspan=\"3\" class=\"rightlean\">Todays date from Helper:</td> \n <td colspan=\"2\" class=\"rightlean fontred\"> {{todaysMonthDDYYYYDate}}</td> \n </tr>\n <tr> \n <td colspan=\"12\" class=\"heading fontgreen\">Service performed for: {{CustomerViz}}</td>\n </tr>\n <tr> \n <td colspan=\"6\" class=\"leftlean\">Physical Address where service performed:</td>\n <td colspan=\"6\" class=\"rightlean\">Postal Address where invoice sent to:</td>\n </tr>\n <tr> \n <td colspan=\"6\" class=\"leftlean fontgreen\">{{Address}}, {{City}}</td>\n <td colspan=\"6\" class=\"rightlean fontgreen\">{{PostAddress}}, {{PostCity}}</td>\n </tr>\n <tr>\n <td colspan=\"12\"> </td>\n </tr>\n \n <tr > \n <td colspan=\"6\" class=\"centerlean heading\" >Item:</td>\n <td colspan=\"1\" class=\"centerlean heading\" >Qty</td> \n <td colspan=\"1\" class=\"centerlean heading\" >Price Per:</td>\n <td colspan=\"1\" class=\"centerlean heading\" >Net:</td>\n <td colspan=\"1\" class=\"centerlean heading\" >Tax A:</td>\n <td colspan=\"1\" class=\"centerlean heading\" >Tax B:</td>\n <td class=\"rightlean heading\" colspan=\"1\" >Line Total:</td> \n </tr> \n </thead>\n \n \t<tbody >\n\t\t\t\t{{#each Items}} \n {{#each Expenses}}\n {{#if ChargeToCustomer}}<tr> <!-- note the encompassing #each statement which only does this IF ChargeToCustomer is true-->\t\t\t\n <td colspan=\"6\" class=\"fontgreen\" > Expense: {{Name}}</td>\t<!-- note too the custom Prepare function that WILL NOT include Expense charges in the Net Totals and Grand Total IF ChargeToCustomer is false -->\n <td colspan=\"1\" class=\"centerlean fontgreen\" ></td> \n <td colspan=\"1\" class=\"centerlean fontgreen\" ></td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency ChargeAmount}}</td><!--this is the \"net\" charge -->\n <!--NOTE for tax lines below, checks to see if TaxCode selected. If true, displays derived, otherwise displays TaxPaid -->\n {{#if ChargeTaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean fontgreen\" >{{TaxPaid}}</td>{{/if}}\n {{#if ChargeTaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" > </td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t <!-- NOTE LineTotalViz is derived \n from (\"ChargeAmount\" + \"TaxPaid\") OR if there is a TaxCode selected, then is auto figured out from \"ChargeAmount\" + (TaxCodes% * ChargeAmount)--> \n </tr>{{else}} <tr><td colspan=\"12\"> custom expenses for {{Name}} NOT charged to customer </td></tr>{{/if}}\n {{/each}}\n {{#each Loans}}\n <tr>\t\t\t\t\n <td colspan=\"6\" class=\"fontgreen\" > Loaner: {{LoanUnitViz}} / {{UnitOfMeasureViz}} </td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{Quantity}}</td> \n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency ListPriceViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetViz}}</td>\n {{#if ChargeTaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean fontred\" >0.00</td>{{/if}}\n {{#if ChargeTaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean fontred\" >0.00</td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n </tr>\n {{/each}}\n {{#each Labors}}\n <tr>\t\t\t\t\n <td colspan=\"6\" class=\"fontgreen\" > Service performed at {{ayDateTime ServiceStartDate}} with Service Rate of {{ServiceRateViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ServiceRateQuantity}}</td> \n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency ListPriceViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetViz}}</td>\n {{#if TaxCodeSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n {{#if TaxCodeSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n </tr>\n {{/each}}\n {{#each Parts}}\n <tr>\t\t\t\t\n <td colspan=\"6\" class=\"fontgreen\" > Part: {{PartViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{Quantity}}</td> \n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency ListPrice}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetViz}}</td>\n {{#if TaxPartSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n {{#if TaxPartSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n </tr>\n {{/each}}\n {{#each Travels}}\n <tr>\t\t\t\t\n <td colspan=\"6\" class=\"fontgreen\" >Travel performed on {{ayDate TravelStartDate}} with Travel rate of {{TravelRateViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{TravelRateQuantity}}</td> \n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency ListPriceViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetViz}}</td>\n {{#if TaxCodeSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n {{#if TaxCodeSaleId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n </tr>\n {{/each}}\n {{#each OutsideServices}}\n <tr>\t\t\t\t\n <td colspan=\"8\" class=\"fontgreen\" > Outside Service performed on Unit: {{UnitViz}}</td>\n <td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetViz}}</td>\n {{#if TaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n {{#if TaxCodeId}}<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"1\" class=\"centerlean\" >0.00</td>{{/if}}\n <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n </tr>\n {{/each}}\n\t\t\t \t{{/each}}\n\t\t\t</tbody> \n </table>\n\n <table class=\"singlePage\">\n <tfoot> <!--footer ONLY displays on last page for each workorder because it is within its own table. if want to display on each page of multi-page workorder, move back up within the above table and edit above table with class=\"singlePage\" -->\n <tr > \n <td >Net Labor</td>\n <td >Net Travel</td> \n <td >Net Parts</td>\n <td >Net Expenses</td>\n <td >Net Loans</td>\n <td >Net Outside</td>\n <td class=\"rightlean heading\">Total Nets</td>\n <td class=\"rightlean heading\">Total Tax A</td>\n <td class=\"rightlean heading\">Total Tax B</td>\n <td colspan=\"3\" class=\"rightlean heading\">WO Total</td>\n </tr>\n <tr > \n <td class=\"fontred\">{{ayCurrency ThisWOAllLaborsNetViz}}</td>\n <td class=\"fontred\" >{{ayCurrency ThisWOAllTravelsNetViz}}</td>\n <td class=\"fontred\" >{{ayCurrency ThisWOAllPartsNetViz}}</td>\n <td class=\"fontred\" >{{ayCurrency ThisWOAllExpsNetChargeAmount}}</td>\n <td class=\"fontred\" >{{ayCurrency ThisWOAllLoansNetViz}}</td>\n <td class=\"fontred\" >{{ayCurrency ThisWOAllOutsidesNetViz}}</td>\n <td class=\"rightlean fontred heading\">{{ayCurrency ThisWOTotalNets}}</td>\n <td class=\"rightlean fontred heading\">{{ayCurrency ThisWOTotalTaxAs}}</td>\n <td class=\"rightlean fontred heading\">{{ayCurrency ThisWOTotalTaxBs}}</td>\n <td colspan=\"3\" class=\"rightlean fontred heading\">{{ayCurrency ThisWOTotalGrand}}</td>\n </tr>\n <tr>\n\t\t\t\t<td colspan=\"12\"> </td>\n\t\t\t\t</tr> \n <tr>\n\t\t\t\t<td colspan=\"12\"> </td>\n\t\t\t\t</tr> \n <tr>\n\t\t\t\t<td colspan=\"12\">I acknowledge the satisfactory provision and completion of the above for internal workorder #{{Serial}}:</td>\n\t\t\t\t</tr> \n <tr>\n\t\t\t\t<td colspan=\"12\"> </td>\n\t\t\t\t</tr> \n <tr>\n\t\t\t\t<td colspan=\"12\"> </td>\n\t\t\t\t</tr>\n <tr>\n\t\t\t\t<td>Customer Signature:</td>\n {{#if CustomerSignature}}<td colspan=\"4\"> <img src=\"{{{CustomerSignature}}}\" height=\"40px\"/> </td>{{else}} <td colspan=\"4\">___________________________________________</td> {{/if}}\n <td>Signature Date:</td>\n {{#if CustomerSignatureCaptured}}<td colspan=\"3\">_{{ayDateTime CustomerSignatureCaptured}}_</td> {{else}} <td colspan=\"3\">________________________________</td> {{/if}} \n <td >Print of Name:</td>\n {{#if CustomerSignatureName}}<td colspan=\"2\">_{{CustomerSignatureName}}_ </td>{{else}} <td colspan=\"2\">______________________________</td> {{/if}} \n\t\t\t\t</tr> \n <tr>\n\t\t\t\t<td colspan=\"12\"> </td>\n\t\t\t\t</tr> \n \n </tfoot>\n </table>\n {{/each}}\n\t</div>\n\n</body>\n</html>","Style":"/* if not using a rule set or specific property it is recommended to comment out or delete fully for report performance*/\n\n.singlePage /* so that page always breaks after footer */\n{\npage-break-after: always;\n} \n\ntable { \n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n page-break-inside: avoid; \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n /* NOTE if this IS here but NOT displaying on subsequent pages (i.e. page 2 of a wo), you NEED to edit your thead so it is NO MORE than approx 20% of the page */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 10pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 8pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 8pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group;\n page-break-inside: avoid; \n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //see the help documentation for details\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"Handlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format EXAMPLE SHOW: June 9, 2021\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n\n","RenderType":0,"HeaderTemplate":"<span style=\"font-size:6pt;width: 94%; text-align:left; \"> (from PDF Options) Printed date: <span class=\"date\"></span></span>","FooterTemplate":"<span style=\"font-size:6pt;width: 94%; text-align: right; \"> this is set in PDF Options Note this is all pages of report Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span> </span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} |