Files
raven/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt
2021-07-09 17:33:09 +00:00

1 line
15 KiB
Plaintext

{"Name":"109x EXAMPLE PO Landscape with derived totals","Active":true,"Notes":"example one PO with po items details per page (or multiple pages as needed); example Prepare to derive running net totals, tax totals, grand PO total","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\n <div class=\"page-header\">\n static header section - no data here. </br> below data obtained from ayReportData shows in <span class=\"fontgreen\">green font</span>.\n below data derived from Prepare shows in <span class=\"fontblue\">blue font</span>. below data using builtinhelpers shows in <span class=\"fontred\">red font</span>\n \n </div>\n\n\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 class=\"singlePage\" > \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 PO, is because is too high - note css -->\n <tr class=\"blank_row\"><td colspan=\"12\"></td></tr>\n <tr>\n <td colspan=\"4\" rowspan=\"3\" class=\"leftlean\">{{ ayLogo \"small\" }}</td> \n <td colspan=\"3\" class=\"rightlean\">Our PO#:</td><td colspan=\"1\" class=\"rightlean fontgreen\">{{Serial}}</td>\n <td colspan=\"3\" class=\"rightlean\">Vendor Ref #:</td><td colspan=\"1\" class=\"rightlean fontgreen\"> {{ReferenceNumber}}</td>\n </tr>\n <tr>\n \n <td colspan=\"4\" class=\"centerlean\"></td>\n <td colspan=\"3\" class=\"rightlean\">Ordered Date:</td> <td colspan=\"1\" class=\"rightlean fontgreen\"> {{ayDate OrderedDate}}</td> \n </tr>\n <tr>\n \n <td colspan=\"4\" class=\"centerlean\"></td>\n <td colspan=\"3\" class=\"rightlean\">ETA Date: {{ayDate ExpectedReceiveDate}}</td> <td colspan=\"1\" class=\"rightlean fontgreen\">{{ayDate ExpectedReceiveDate}}</td> \n </tr>\n \n <tr> \n <td colspan=\"4\" class=\"heading\">VENDOR:</td>\n <td colspan=\"4\" class=\"centerlean heading\"></td>\n <td colspan=\"4\" class=\"rightlean heading\">DELIVER TO:</td>\n </tr>\n <tr>\n <td colspan=\"4\" class=\"fontgreen\" >{{VendorViz}}</td> \n <td colspan=\"4\" class=\"centerlean\"></td> \n <td colspan=\"4\" class=\"rightlean\">My Company Name</td>\n </tr> \n <tr>\n <td colspan=\"4\" >vstaddress vstcity vststate vstpostal</td> \n <td colspan=\"4\" class=\"centerlean\"></td> \n <td colspan=\"4\"class=\"rightlean\" >123 - 123 MyStreetname Ave My City, My State, My Postal</td>\n </tr>\n\n <tr>\n <td colspan=\"4\" >Contact: vcontact vphone vemail</td>\n <td colspan=\"3\" class=\"centerlean\"></td>\n <td colspan=\"5\" class=\"rightlean\">Ordered By: creator Phone: creatorphone</td>\n </tr>\n\n <tr>\n <td colspan=\"12\">&nbsp;</td>\n </tr>\n \n <tr > \n <td colspan=\"6\" class=\"centerlean heading\" >Our Part#:</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\t<tbody >\n\t\t\t\t{{#each Items}} \n\t\t\t\t<tr>\t\t\t\t\n\t\t\t\t <td colspan=\"6\" class=\"fontgreen\" > {{PartViz}} {{PartNameViz}}</td>\n \t\t<td colspan=\"1\" class=\"centerlean fontgreen\" >{{QuantityOrdered}}</td> \n \t\t<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency PurchaseOrderCost}}</td>\n \t\t<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency NetTotalViz}}</td>\n \t\t<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxAViz}}</td>\n \t\t<td colspan=\"1\" class=\"centerlean fontgreen\" >{{ayCurrency TaxBViz}}</td>\n \t\t<td colspan=\"1\" class=\"rightlean fontgreen\">{{ayCurrency LineTotalViz}}</td> \t\t\n\t\t\t\t</tr>\n\t\t\t \t{{/each}}\n\t\t\t</tbody>\n \n <tfoot> <!--to have footer ONLY display on last page of entire report, place within its own table. otherwise is part of existing table. note css to have repeating footer -->\n <tr>\n\t\t\t\t<td colspan=\"12\">&nbsp;</td>\n\t\t\t\t</tr> \n\t\t\t\t<tr>\n\t\t\t\t<td colspan=\"8\" ></td>\n\t\t\t\t<td colspan=\"2\" class=\"rightlean heading\">Net Total:</td>\n\t\t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency ThisPONet }}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td colspan=\"8\">&nbsp;</td>\n\t\t\t\t<td colspan=\"2\" class=\"rightlean heading\">Tax A Total:</td>\n\t\t\t\t{{#if ThisPOTaxA}}<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency ThisPOTaxA }}</td>{{else}} <td colspan=\"2\" class=\"rightlean heading fontblue\" >0.00</td>{{/if}}\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<td colspan=\"8\">Uppercase text in row below occurs as calling the Helper 'loud'</td>\n\t\t\t\t<td colspan=\"2\" class=\"rightlean heading\">Tax B Total:</td>\n\t\t\t\t\t{{#if ThisPOTaxB}}<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency ThisPOTaxB }}</td>{{else}} <td colspan=\"2\" class=\"rightlean heading fontblue\" >0.00</td>{{/if}}\n\t\t\t\t</tr>\n \t\t\t<tr>\n \t\t\t<td colspan=\"8\">{{ loud \"See the last page of the entire report for a footer that ONLY displays on the last page\"}}</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">PO Total:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency ThisPODollarAmount }}</td> \n \t\t\t</tr>\n <tr>\n \t\t\t<td colspan=\"8\"></td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">To have Prepare's AllPORunningTotal show:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency ../AllPORunningTotal }}</td> \n \t\t\t</tr>\n \n </tfoot>\n \n\t\t</table>\n {{/each}}\n \n\t</div>\n <table>\n <tfoot>\n <tr>\n \t\t\t<td colspan=\"8\">row 1 placed here cause of the static header above</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" ></td> \n \t\t\t</tr>\n <tr>\n \t\t\t<td colspan=\"8\">row 2 placed here cause of the static header above</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" ></td> \n \t\t\t</tr>\n <tr>\n \t\t\t<td colspan=\"8\">Reminder - nothing will show if use 'AllPODollarAmount' as is NOT a variable. ONLY the left side reportDate.AllPORunningTotal will show (used in the row below)</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">AllPODollarAmount:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency AllPODollarAmount }}</td> \n \t\t\t</tr>\n <tr>\n \t\t\t<td colspan=\"8\">no leading ../ needed when AllPORunningTotal is placed OUTSIDE of the specific #each </td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading\">AllPORunningTotal:</td>\n \t\t\t<td colspan=\"2\" class=\"rightlean heading fontblue\" >{{ ayCurrency AllPORunningTotal }}</td> \n \t\t\t</tr>\n </tfoot>\n </table>\n</body>\n</html>","Style":"\n\n.singlePage\n{\npage-break-after: always;\n}\n\n.page {\n page-break-after: always;\n}\n\n.page-header, .page-header-space {\n height: 50px;\n}\n\n\n.page-header { /* interesting - if this is set (fixed) then the repeating header of the actual table doesn't repeat*/\n position: fixed;\n top: 0mm;\n width: 100%;\n border-bottom: 1px solid black; /* for demo */\n background: yellow; /* for demo */\n}\n\n.blank_row\n{\n height: 15mm;\n background-color: lightgreen;\n}\n\ntable { \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 }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\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: 11pt; \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}\n\ntbody tr:nth-child(even) {\n font-size: 18pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 18pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work hmmm */\n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n background: pink; \n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarAmount = 0; //Declare a temporary variable to hold the running total of all POs in this list\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the AllPODollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0; //Declare a temporary variable to hold the running total of THIS PO\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount; // Use ThisPODoallarAmount to display the running Total for THIS PO\n }\n //Add the AllPODollarAmount variable to the reportData so it can be accessed in the report template using {{AllPORunningTotal}} AS LONG as placed OUTSIDE of the main /{/{#each ayReportData}} /{/{/each}}\n reportData.AllPORunningTotal=AllPODollarAmount;\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}