Files
raven/server/AyaNova/resource/rpt/stock-report-templates/Restock List Grouped By Wholesaler.ayrt
2022-01-21 18:49:58 +00:00

1 line
4.9 KiB
Plaintext

{"Name":"Restock List Grouped By Wholesaler","Active":true,"Notes":"Will only display parts that have ReOrderQty > 0","Roles":49514,"AType":90,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n\t<div>\n\t\t<div class=\"reporttitle\">\n\t\t\t<p>{{ayT 'PurchaseOrderUIRestockList'}} grouped by {{ayT 'PartWholesalerID'}}</p>\n\t\t</div>\n\t\t<table>\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"4\"></th>\n\t\t\t\t\t<th colspan=\"9\">{{ayT 'Part'}}</th>\n\t\t\t\t\t<th colspan=\"5\">{{ayT 'PartByWarehouseInventoryReorderQuantity'}}</th>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'PartWarehouseName'}}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t<!-- the #each for the Sample Data MUST encompass the section where its gonna show - in this case the tbody, so needs to be placed within -->\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"3\" >{{ayT 'PartWholesalerID'}}:&nbsp;</th>\n\t\t\t\t\t<td colspan=\"21\">&nbsp;&nbsp;&nbsp;{{group}}</td>\n\t\t\t\t</tr>\n\t\t\t\t{{#each items}}\n\t\t\t\t{{#if ReOrderQty}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"4\">&nbsp;</td>\n\t\t\t\t\t<td colspan=\"9\" class=\"centerlean\">{{PartName}}</td>\n\t\t\t\t\t<td colspan=\"5\" class=\"centerlean\">{{ReOrderQty}}</td>\n\t\t\t\t\t<td colspan=\"6\" class=\"centerlean\">{{PartWarehouseName}}</td>\n\t\t\t\t</tr>\n\t\t\t\t{{/if}}\n\t\t\t\t{{/each}}\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"22\" class=\"rightlean\">{{ayT 'PartByWarehouseInventoryReorderQuantity'}} for all parts from {{ayT 'PartWholesalerID'}} {{group}}:&emsp;</th>\n\t\t\t\t\t<td colspan=\"2\">{{ThisGroupTotalQty}}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</body>\n</html>","Style":".singlePage\r\n{\r\npage-break-after: always;\r\n\r\n}\r\nbody {\r\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \r\n}\r\n\r\n.reporttitle { \r\n margin-bottom: 20pt; \r\n font-weight: bold; \r\n font-size: 13pt; \r\n color: #9e9e9e;\r\n} \r\n\r\ntable { \r\n border-collapse: collapse;\r\n white-space: pre-wrap;\r\n width: 100%;\r\n table-layout: fixed; \r\n }\r\n\r\nth {\r\n /* border-bottom: solid 1pt #9e9e9e; */\r\n height: 30px;\r\n font-size: 11pt; \r\n color: #9e9e9e;\r\n}\r\n\r\ntbody td {\r\n padding: 10px;\r\n word-wrap: break-word;\r\n font-size: 9pt;\r\n}\r\n\r\n\r\ntbody tr:nth-child(even) {\r\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\r\n}\r\n\r\n\r\n.rightlean {\r\n text-align: right;\r\n}\r\n.leftlean {\r\n text-align: left;\r\n}\r\n.centerlean {\r\n text-align: center;\r\n}\r\n\r\n\r\n.fontgreen {\r\n color: green;\r\n font-size: 16pt;\r\n}\r\n.fontblue {\r\n color: blue;\r\n}\r\n.fontred {\r\n color:red;\r\n}\r\n\r\n","JsPrerender":"async function ayPrepareData(ayData) {\n\n //send the raw report data to the groupByKey function which will return a new array grouped by the key name provided\n ayData.ayReportData = ayGroupByKey(ayData.ayReportData, 'WholesalerName')\n\n await ayGetTranslations([\"PurchaseOrderUIRestockList\", \"PartWholesalerID\", \"PartByWarehouseInventoryReorderQuantity\", \"PartWarehouseName\", \"Part\" ]);\n\n //Iterate through all the records in the reportData obtaining a running total of ReOrderQty for each group\n for (const EachGroup of ayData.ayReportData) \n { \n let ThisGroupTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS group\n for (const Item of EachGroup.items) //Iterate through all the poitems of THIS po adding the Qty amount of each item to the ThisPOTotalQty variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.ReOrderQty != null) \n {\n ThisGroupTotalQty += Item.ReOrderQty;\n }\n Item.QuantityRunning=ThisGroupTotalQty;\n }\n EachGroup.ThisGroupTotalQty=ThisGroupTotalQty;\n\n\n }\n\n //return the data into the pipeline to send to the report template\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":"<span>&nbsp; </span>","FooterTemplate":"<span style=\"font-size:6pt; width: 96%;text-align:left; \">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span>","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}