{"Name":"Units Per Customer ","Active":true,"Notes":"Use of ayGroupByKey in the custom Prepare to group units by the customer","Roles":50554,"AType":31,"IncludeWoItemDescendants":false,"Template":"<html>\n<body>\n\t<div  >\t      \n\t\t<table  > \n     \t\t<thead>\n            <tr>\n\t\t\t\t<th colspan=\"3\"></th>\n\t\t\t\t<th colspan=\"3\">{{ayT 'UnitSerial'}}</th>\n\t\t\t\t<th colspan=\"4\">{{ayT 'UnitModel'}}</th>\n\t\t\t\t<th colspan=\"4\">{{ayT 'LastServiceWorkOrderServiceDate'}}</th>\n\t\t\t\t<th colspan=\"4\">{{ayT 'LastServiceWorkOrder'}}</th>\n\t\t\t\t<th colspan=\"6\">{{ayT 'UnitNotes'}}</th>             \n            </tr>\n     \t\t</thead>\n          \n         <tbody>  \n            {{#each ayReportData}}<!--  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           <!--  to get alternating coloured rows when one PO per line, need CSS statements PLUS this # each MUST be placed BEFORE the tr /tr -->\n           <tr>\n\t\t\t   <th colspan=\"24\"  class=\"leftlean\"># of {{ayT 'UnitList'}} for {{group}}:&emsp;{{count}}</th>\n           </tr>\n\t\t   {{#each items}}\n\t\t   <tr>\n\t\t\t   <td colspan=\"3\">&nbsp;</td>\n\t\t\t\t<td colspan=\"3\">{{Serial}}</td>\n\t\t\t\t<td colspan=\"4\">{{UnitModelNameViz}}</td>\n\t\t\t\t<td colspan=\"4\" class=\"centerlean\">{{ayDate LastServiceDateViz}}</td>\n\t\t\t\t<td colspan=\"4\" class=\"centerlean\">{{LastWorkOrderViz}}</td>\n\t\t\t\t<td colspan=\"6\">{{Notes}}</td> \n           </tr>\n\t\t\t{{/each}}\n\t\t\t<tr>\n\t\t\t   <td colspan=\"24\" class=\"rightlean\">&nbsp;</td>\n           </tr>\n           \t {{/each}}\n         </tbody>\n      </table>\n\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  text-align: left;\n} \n\ntable { \n  border-collapse: collapse;\n  white-space: pre-wrap;\n  width: 100%;\n  table-layout: fixed; \n    }\n\nth {\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}\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  font-size: 16pt;\n}\n.fontblue {\n  color: blue;\n}\n.fontred {\n  color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData) {\n\n    //send the raw report data to the groupByKey function which will return a new array grouped by the key name provided\n    reportData.ayReportData = ayGroupByKey(reportData.ayReportData, 'CustomerViz')\n\n    await ayGetTranslations([ \"UnitList\", \"Customer\", \"UnitSerial\", \"LastServiceWorkOrder\", \"LastServiceWorkOrderServiceDate\", \"UnitNotes\", \"UnitModel\" ]);\n\n\n    //return the data into the pipeline to send to the report template\n    return reportData;\n}\n\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":true,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"20mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}