1 line
31 KiB
Plaintext
1 line
31 KiB
Plaintext
{"Name":"Net Taxes and Totals for Each WO","Active":true,"Notes":"Custom Prepare to display each WO total nets, taxes and grand total; and totals for all workorders in list","Roles":50538,"AType":34,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n <div>\n <div class=\"reporttitle\">\n\t\t\t<p>Nets Taxes and Totals for each {{ayT 'WorkOrder'}}</p>\n\t\t</div>\n <table>\n <thead>\n <tr>\n <th colspan=\"1\">{{ayT 'WorkOrder'}}</th>\n <th colspan=\"2\">{{ayT 'Customer'}}</th>\n <th colspan=\"2\">{{ayT 'WorkOrderServiceDate'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemLaborList'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemPartList'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemTravelList'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemExpenseList'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemLoanList'}}</th>\n <th colspan=\"1\">{{ayT 'WorkOrderItemOutsideService'}}</th>\n <th colspan=\"2\">{{ayT 'NetPrice'}}</th>\n <th colspan=\"1\">{{ayT 'TaxCodeTaxA'}}</th>\n <th colspan=\"1\">{{ayT 'TaxCodeTaxB'}}</th>\n <th colspan=\"2\">{{ayT 'Total'}}</th>\n </tr>\n </thead>\n <tbody>\n {{#each ayReportData}}\n <tr>\n <td colspan=\"1\">{{Serial}}</td>\n <td colspan=\"2\">{{CustomerViz}}</td>\n {{#if ServiceDate }}<td colspan=\"2\">{{ayDate ServiceDate}}</td>{{else}}<td colspan=\"2\" class=\"nodata\">no Service Date specified</td>{{/if}}\n {{#if ThisWOAllLaborsNetViz }}<td colspan=\"1\">{{ayCurrency ThisWOAllLaborsNetViz}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOAllPartsNetViz }}<td colspan=\"1\">{{ayCurrency ThisWOAllPartsNetViz}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOAllTravelsNetViz }}<td colspan=\"1\">{{ayCurrency ThisWOAllTravelsNetViz}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOAllExpsNetChargeAmount }}<td colspan=\"1\">{{ayCurrency ThisWOAllExpsNetChargeAmount}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOAllLoansNetViz }}<td colspan=\"1\">{{ayCurrency ThisWOAllLoansNetViz}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOAllOutsidesNetViz }}<td colspan=\"1\">{{ayCurrency ThisWOAllOutsidesNetViz}}</td>{{else}}<td colspan=\"1\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOTotalNets }}<td colspan=\"2\">{{ayCurrency ThisWOTotalNets}}</td> {{else}} <td colspan=\"2\" class=\"nodata\">none billable</td>{{/if}}\n {{#if ThisWOTotalTaxAs }}<td colspan=\"1\">{{ayCurrency ThisWOTotalTaxAs}}</td> {{else}} <td colspan=\"1\" class=\"nodata\">none</td>{{/if}}\n {{#if ThisWOTotalTaxBs }}<td colspan=\"1\">{{ayCurrency ThisWOTotalTaxBs}}</td> {{else}} <td colspan=\"1\" class=\"nodata\">none</td>{{/if}}\n {{#if ThisWOTotalGrand }}<td colspan=\"2\">{{ayCurrency ThisWOTotalGrand}}</td> {{else}} <td colspan=\"2\" class=\"nodata\">none billable</td>{{/if}}\n \n </tr>\n {{/each}}\n </tbody>\n </table>\n\n <table><!-- footer is in its own table so displays once at end of report-->\n <tfoot>\n <tr>\n <th colspan=\"3\">Totals for all</th>\n <th>{{ayT 'WorkOrderItemLaborList'}}</th>\n <th>{{ayT 'WorkOrderItemPartList'}}</th>\n <th>{{ayT 'WorkOrderItemTravelList'}}</th>\n <th>{{ayT 'WorkOrderItemExpenseList'}}</th>\n <th>{{ayT 'WorkOrderItemLoanList'}}</th>\n <th>{{ayT 'WorkOrderItemOutsideService'}}</th>\n <th>{{ayT 'NetPrice'}}</th>\n <th>{{ayT 'TaxCodeTaxA'}}</th>\n <th>{{ayT 'TaxCodeTaxB'}}</th>\n <th>{{ayT 'Total'}}</th>\n </tr>\n <tr>\n <!-- note no #each encompasses here - the data below is from Prepare's reportData.xxxx as in reportData.AllWOLaborNetViz -->\n <td colspan=\"3\"></td>\n {{#if AllWOLaborsNetViz}} <td>{{ ayCurrency AllWOLaborsNetViz }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOPartsNetViz}} <td>{{ ayCurrency AllWOPartsNetViz }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOTravelsNetViz}} <td>{{ ayCurrency AllWOTravelsNetViz }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOExpsNetChargeAmount}} <td>{{ ayCurrency AllWOExpsNetChargeAmount }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOLoansNetViz}} <td>{{ ayCurrency AllWOLoansNetViz }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOOutsidesNetViz}} <td>{{ ayCurrency AllWOOutsidesNetViz }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOTotalNets}} <td>{{ ayCurrency AllWOTotalNets }}</td>{{else}}<td>$0.00</td> {{/if}}\n {{#if AllWOTotalTaxAs}} <td>{{ ayCurrency AllWOTotalTaxAs }}</td>{{else}} <td>$0.00</td> {{/if}}\n {{#if AllWOTotalTaxBs }} <td>{{ ayCurrency AllWOTotalTaxBs }}</td>{{else}} <td>$0.00</td> {{/if}}\n {{#if AllWOTotalGrand}} <td>{{ ayCurrency AllWOTotalGrand }}</td>{{else}} <td>$0.00</td> {{/if}}\n </tr>\n </tfoot>\n </table>\n </div>\n</body>\n\n</html>","Style":".nodata {\n font-size: 6pt;\n}\n\ntfoot {\n border-top: 2px solid #9e9e9e;\n font-size: 7pt;\n text-align: center;\n}\n\n.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 color: #9e9e9e;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; \n }\n\nth {\n /* border-bottom: solid 1pt #9e9e9e; */\n height: 30px;\n font-size: 9pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 7pt;\n text-align: center;\n}\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}\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([\"WorkOrder\", \"Customer\", \"WorkOrderServiceDate\", \"NetPrice\", \"WorkOrderItemLaborList\", \"WorkOrderItemPartList\", \"WorkOrderItemTravelList\", \"WorkOrderItemExpenseList\", \"WorkOrderItemLoanList\", \"WorkOrderItemOutsideService\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"Total\" ]);\n\n\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\n\nfor (const EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (const Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (const Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (const Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (const Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (const Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (const Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (const Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"<span> </span>","FooterTemplate":"<span style=\"font-size:6pt; width: 96%;text-align:left; \"> Printed date: PDFDate</span>\n<span style=\"font-size:6pt;width: 96%; text-align: right; \">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span> </span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} |