1 line
8.5 KiB
Plaintext
1 line
8.5 KiB
Plaintext
{"Name":"Nets Taxes LineTotals for each WO Expense","Active":true,"Notes":"","Roles":50538,"AType":36,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n <div>\n <div class=\"reporttitle\">\n <p>{{ayT 'WorkOrder'}} {{ayT 'WorkOrderItemExpenseList'}} Nets Taxes LineTotals and Grand Totals </p>\n </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=\"4\">{{ayT 'WorkOrderItemExpenseName'}}</th>\n <th colspan=\"2\">{{ayT 'WorkOrderItemExpenseChargeToCustomer'}}</th>\n <th colspan=\"2\" class=\"rightlean\">{{ayT 'WorkOrderItemExpenseChargeAmount'}}</th> \n <th colspan=\"2\" class=\"rightlean\">{{ayT 'Tax'}}</th>\n <th colspan=\"2\" class=\"rightlean\">{{ayT 'Total'}}</th>\n </tr>\n </thead>\n <tbody>\n {{#each ayReportData}}\n {{#each Items}}\n {{#each Expenses}}\n <tr>\n <td colspan=\"1\" class=\"centerlean\">{{../../Serial}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{../../CustomerViz}}</td>\n <td colspan=\"2\" class=\"centerlean\">{{ayDate ../../ServiceDate}}</td> \n <td colspan=\"4\">{{Name}} {{Description}} </td>\n {{#if ChargeToCustomer}}<td colspan=\"2\" class=\"centerlean\"><input type=\"checkbox\" id=\"manual1\" checked><label for=\"manual1\"> </label></td>\n\t\t\t\t\t{{else}}<td colspan=\"2\" class=\"centerlean\"><input type=\"checkbox\" id=\"manual1\" ><label for=\"manual1\"> </label></td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency ChargeAmount}}</td>\n <!--NOTE for tax lines below, checks to see if TaxCode selected. If true, displays derived, otherwise displays TaxPaid -->\n {{#if ChargeTaxCodeId}}<td colspan=\"2\" class=\"rightlean\">{{ayCurrency TaxAViz}} {{ayCurrency TaxBViz}}</td>{{else}} <td colspan=\"2\" class=\"rightlean\">{{ayCurrency TaxPaid}}</td>{{/if}}\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency LineTotalViz}}</td>\n <!-- NOTE that LineTotalViz is derived from (\"ChargeAmount\" + \"TaxPaid\") OR if there is a TaxCode selected, then is auto figured out from \"ChargeAmount\" + (TaxCodes% * ChargeAmount) -->\n </tr>\n {{/each}}\n {{/each}}\n {{/each}}\n </tbody>\n </table>\n\n <table>\n <!-- footer is in its own table so displays once at end of report-->\n <tfoot>\n <tr>\n <th colspan=\"17\"> </th>\n </tr>\n <tr>\n <th colspan=\"10\" class=\"rightlean\">Totals for all {{ayT 'WorkOrderItemExpenseChargeToCustomer'}} {{ayT 'WorkOrderItemExpenseList'}} in this report</th> \n <th colspan=\"1\"> </th>\n <th colspan=\"2\" class=\"rightlean\">{{ayT 'WorkOrderItemExpenseChargeAmount'}}</th>\n <th colspan=\"2\" class=\"rightlean\">{{ayT 'Tax'}}</th>\n <th colspan=\"2\" class=\"rightlean\">{{ayT 'Total'}}</th>\n </tr>\n <tr>\n <!-- note no #each encompasses here - the data below is obtained through Prepare -->\n <td colspan=\"11\"></td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency AllWOExpensesNetViz}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency AllWOExpensesTaxs}}</td>\n <td colspan=\"2\" class=\"rightlean\">{{ayCurrency AllWOExpensesTotalGrand}}</td>\n </tr>\n </tfoot>\n </table>\n </div>\n</body>\n\n</html>","Style":"\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 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}\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\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([\"WorkOrder\", \"Customer\", \"WorkOrderServiceDate\", \"WorkOrderItemExpenseChargeToCustomer\", \"NetPrice\", \"WorkOrderItemExpenseList\", \"WorkOrderItemExpenseName\", \"WorkOrderItemExpenseChargeAmount\", \"Tax\", \"Total\"]);\n\n\n\t//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n\n\t//below declares keys to hold for all Expenses so it exists\n\treportData.AllWOExpensesNetViz = 0;\n\treportData.AllWOExpensesTaxs = 0;\n\treportData.AllWOExpensesTotalGrand = 0;\n\n\n\n\tfor (const EachWO of reportData.ayReportData) {\n\n\t\t//below is to Iterate through each item of the wo's Items\n\t\tfor (const Item of EachWO.Items) {\n\n\n\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 \treportData.AllWOExpensesNetViz += Exp.ChargeAmount;\n\t\t\t\t\t\treportData.AllWOExpensesTotalGrand += Exp.ChargeAmount;\n \t \t\t}\t\t\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\treportData.AllWOExpensesTaxs += 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\treportData.AllWOExpensesTotalGrand += Exp.TaxAViz; \n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOExpensesTaxs += 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\treportData.AllWOExpensesTotalGrand += Exp.TaxBViz;\n \t \t\t}\t\t\t\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\treportData.AllWOExpensesTaxs += 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\treportData.AllWOExpensesTotalGrand += 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}\n\t}\n\n\n\treturn 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} |