Files
raven/server/AyaNova/resource/rpt/stock-report-templates/PRODUCTION PO Items Received vs Ordered.ayrt

1 line
6.7 KiB
Plaintext

{"Name":"PO Items Received vs Ordered","Active":true,"Notes":"Includes Prepare that determines the difference between Ordered and Received for display, and #if_eq Helper used to display red if difference between QuantityReceived and QuantityOrdered","Roles":33130,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t<div >\t \n\t\t<table > \n \t\t<thead>\n <tr >\n <th colspan=\"25\" class=\"reporttitle\" >Purchase Order Items Received compared to Ordered</th>\n </tr>\n <tr>\n <td colspan=\"25\">&nbsp;</td>\n </tr>\n <tr>\n <th colspan=\"4\">{{ayT 'PurchaseOrderStatus'}}</th>\n <th colspan=\"2\">{{ayT 'PurchaseOrderPONumber'}}</th>\n\t\t\t <th colspan=\"5\">{{ayT 'PartWholesalerID'}}</th>\n <th colspan=\"2\">{{ayT 'PurchaseOrderOrderedDate'}}</th>\n <th colspan=\"2\">{{ayT 'PurchaseOrderReceiptReceivedDate'}}</th>\n <th colspan=\"5\">{{ayT 'Part'}}</th>\n <th colspan=\"2\">{{ayT 'PurchaseOrderItemQuantityOrdered'}}</th>\n <th colspan=\"2\">{{ayT 'PurchaseOrderItemQuantityReceived'}}</th> \n\t\t\t <th colspan=\"1\">Diff +/- </th> \n </tr>\n <tr>\n <td colspan=\"25\">&nbsp;</td>\n </tr>\n \t\t</thead>\n \n <tbody> \n {{#each ayReportData}}\n {{#each Items}}<!-- 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 <!-- note that the #each Items as is looping through the Items of each PO, not the PO header\n <!-- to get alternating coloured rows when one PO per line, need CSS statements PLUS this # each MUST be placed BEFORE the tr /tr -->\n\t\t\t\t<tr>\n\t\t\t\t <td colspan=\"4\" class=\"leftlean\">{{../StatusViz}}</td>\n <td colspan=\"2\">{{../Serial}}</td> <!-- note the ../ in front of the variable name when calling a variable from 'above' the Items array of the object -->\n\t\t\t <td colspan=\"5\">{{../VendorViz}}</td> <!-- note the ../ in front of the variable name when calling a variable from 'above' the Items array of the object -->\n <td colspan=\"2\">{{ayDate ../OrderedDate}}</td> <!-- note the ../ in front of the variable name when calling a variable from 'above' the Items array of the object -->\n <td colspan=\"2\">{{ayDate ReceivedDate}}</td>\n <td colspan=\"5\">{{PartViz}} {{PartNameViz}}</td>\n <td colspan=\"2\">{{QuantityOrdered}}</td>\n <td colspan=\"2\">{{QuantityReceived}}</td> \n {{#if_eq QuantityOrdered QuantityReceived }} <td colspan=\"1\" class=\"fontgreen\">{{ThisItemQtyDiff}}</td> {{else}}<td colspan=\"1\" class=\"fontred\">- {{ThisItemQtyDiff}}</td>{{/if_eq}}\n\t\t\t\t</tr>\n\n \t {{/each}} \n {{/each}} \n </tbody>\n\n </table>\n\n \n\t</div>\n</body>\n</html>","Style":".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; /* the # of columns set in the first row of the thead will be fixed and applied throughout table and rows */\n }\n\nth {\n /* border-bottom: solid 1pt #9e9e9e; */\n height: 50px;\n font-size: 11pt; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 10px;\n word-wrap: break-word;\n font-size: 9pt;\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 font-weight: bold; \n}\n\n","JsPrerender":"async function ayPrepareData(ayData){ \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 await ayGetTranslations([\"PurchaseOrderStatus\", \"PartWholesalerID\", \"Part\", \"PurchaseOrderItemQuantityOrdered\", \"\", \"PurchaseOrderPONumber\", \"PurchaseOrderOrderedDate\", \"PurchaseOrderReceiptReceivedDate\", \"PurchaseOrderItemQuantityReceived\" ]);\n\n //Iterate through all the records in the reportData to get the difference between ordered and received\n for (EachPO of ayData.ayReportData) \n {\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po \n {\n let ThisItemQtyDiff = 0; //Declare a temporary variable to hold the difference for this item\n if (Item.QuantityOrdered != null) //make sure QuantityOrdered has a value before attempting to use it\n {\n ThisItemQtyDiff = Item.QuantityOrdered - Item.QuantityReceived;\n }\n Item.ThisItemQtyDiff=ThisItemQtyDiff;\n }\n }\n\n return ayData;\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})\n\n//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\n//note that this HAS to be added here in Helpers, is NOT built in\nHandlebars.registerHelper('if_eq', function(a, b, opts) {\n if(a == b) // Or === depending on your needs\n return opts.fn(this);\n else\n return opts.inverse(this);\n});","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":true,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}