Files
raven/server/AyaNova/resource/rpt/stock-report-templates/Service Dispatch.ayrt
2022-02-17 02:17:31 +00:00

1 line
14 KiB
Plaintext

{"Name":"Service Dispatch","Active":true,"Notes":"#if_eq custom Helper - if status is Completed show checkmark in checkbox; custom Prepare to replace carriage returns with spaces; display digital signatures if present","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n\t<div>\n\t\t{{#each ayReportData}}\n\t\t<!-- the #each aspect MUST encompass the section where the class is that forces page break -->\n\t\t<table class=\"singlePage\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"4\" class=\"reporttitle\" >{{ayT 'Customer'}}</th>\n\t\t\t\t\t<td colspan=\"12\" class=\"reporttitle\">{{CustomerViz}}</td>\n\t\t\t\t\t<th colspan=\"8\" class=\"rightlean\">{{../ayServerMetaData.CompanyName}}</th>\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'AddressTypePhysical'}}</th>\n\t\t\t\t\t<td colspan=\"12\">{{Address}}, {{City}}</td>\n\t\t\t\t\t<th colspan=\"4\" class=\"rightlean \">{{ayT 'WorkOrderSerialNumber'}}</th>\n \t\t\t<td colspan=\"4\" class=\"rightlean\">{{Serial}}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'WorkOrderCustomerContactName'}}</th>\n\t\t\t\t\t{{#if CustomerContactName}}<td colspan=\"12\">{{CustomerContactName}} {{CustomerPhone1Viz}} {{CustomerEmailAddressViz}}</td>\n\t\t\t\t\t{{else}}<td colspan=\"12\">{{CustomerPhone1Viz}} {{CustomerEmailAddressViz}}</td>{{/if}}\n\t\t\t\t\t<th colspan=\"4\" class=\"rightlean \">{{ayT 'WorkOrderServiceDate'}}</th>\n \t\t\t<td colspan=\"4\" class=\"rightlean\">{{ayDate ServiceDate}}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\n\t\t\t<tbody>\t\t\t\t\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'WorkOrderSummary'}}</th>\n\t\t\t\t\t<td colspan=\"20\">{{Notes}}</td>\n\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'WorkOrderCloseByDate'}}</th>\n\t\t\t\t\t<td colspan=\"18\">{{ayDateTime CompleteByDate}}</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'CustomerTechNotes'}}</th>\n\t\t\t\t\t<td colspan=\"18\">{{CustomerTechNotesViz}}</td>\n\t\t\t\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#each Items}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"1\"></td>\n\t\t\t\t\t<th style=\"background-color:{{WorkOrderItemPriorityColorViz}};\" colspan=\"4\" class=\"centerlean\">{{ayT 'WorkOrderItemPriorityID'}}</th>\n\t\t\t\t\t<td style=\"background-color:{{WorkOrderItemPriorityColorViz}};\" colspan=\"4\" class=\"centerlean\">{{WorkOrderItemPriorityNameViz}}</td>\n\t\t\t\t\t<th colspan=\"3\" class=\"rightlean\">{{ayT 'WorkOrderItemRequestDate'}}</th>\n\t\t\t\t\t<td colspan=\"4\" class=\"leftlean\">{{ayDateTime RequestDate}}</td>\n\t\t\t\t\t<th style=\"background-color:{{WorkOrderItemStatusColorViz}};\" colspan=\"4\" class=\"centerlean\">{{ayT 'WorkOrderItemWorkOrderStatusID'}}</th>\n\t\t\t\t\t<td style=\"background-color:{{WorkOrderItemStatusColorViz}};\" colspan=\"4\" class=\"centerlean\">{{WorkOrderItemStatusNameViz}}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"1\"></td>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'WorkOrderItemSummary'}} &#35;{{Sequence}}</th>\n\t\t\t\t\t<td colspan=\"19\">{{Notes}}</td>\n\t\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"1\"></td>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'WorkOrderItemTechNotes'}}</th>\n\t\t\t\t\t<td colspan=\"19\">{{TechNotes}}</td>\n\t\t\t\t\t\n\t\t\t\t</tr>\n\n\t\t\t\t{{#each Units}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\"></td>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'Unit'}}</th>\n\t\t\t\t\t<td colspan=\"18\">{{UnitViz}} {{UnitModelNameViz}}</td>\n\t\t\t\t</tr>\n\t\t\t\t{{/each}}<!--closes the Units -->\n\t\t\t\t\n\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{{#each ScheduledUsers}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\"></td>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'NotifyEventScheduledOnWorkorder'}}</th>\n\t\t\t\t\t<td colspan=\"8\">{{UserViz}}</td>\n\t\t\t\t\t<th colspan=\"4\">As expected?</th>\n\t\t\t\t\t<th colspan=\"4\" class=\"centerlean\">Actual</th>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'WorkOrderItemScheduledUserStartDate'}}</th>\n\t\t\t\t\t<td colspan=\"8\">{{ayDateTime StartDate}}</td>\n\t\t\t\t\t<td colspan=\"3\"><input type=\"checkbox\" id=\"manual1\"> <label for=\"manual1\"> </label></td>\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'WorkOrderItemScheduledUserStopDate'}}</th>\n\t\t\t\t\t<td colspan=\"8\">{{ayDateTime StopDate}}</td>\n\t\t\t\t\t<td colspan=\"3\"><input type=\"checkbox\" id=\"manual1\"> <label for=\"manual1\"> </label></td>\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'WorkOrderItemScheduledUserServiceRateID'}}</th>\n\t\t\t\t\t<td colspan=\"8\">{{ServiceRateViz}}</td>\n\t\t\t\t\t<td colspan=\"3\"><input type=\"checkbox\" id=\"manual1\"> <label for=\"manual1\"></label></td>\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"6\">{{ayT 'WorkOrderItemScheduledUserEstimatedQuantity'}}</th>\n\t\t\t\t\t<td colspan=\"8\">{{EstimatedQuantity}}</td>\n\t\t\t\t\t<td colspan=\"3\"><input type=\"checkbox\" id=\"manual1\"> <label for=\"manual1\"></label></td>\n\t\t\t\t\t<td colspan=\"5\"></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{{/each}}<!--closes the ScheduledUsers -->\n\n\t\t\t\t{{#if Tasks}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\"></td>\n\t\t\t\t\t<th colspan=\"6\" class=\"centerlean\" >{{ayT 'WorkOrderItemTaskWorkOrderItemTaskCompletionType'}}</th>\n\t\t\t\t\t<th colspan=\"16\">{{ayT 'WorkOrderItemTasks'}}</th>\n\t\t\t\t</tr>\n\t\t\t\t{{/if}}\n\t\t\t\t{{#each Tasks}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\"></td>\n\t\t\t\t\t<td colspan=\"3\">{{StatusViz}}</td>\n\t\t\t\t\t<!-- note that this if_eq is from a custom Helper --><!-- IF status equals Completed (value is 2) then displays with a checkmark -->\n\t\t\t\t\t{{#if_eq Status 2}}<td colspan=\"3\" class=\"centerlean\"><input type=\"checkbox\" id=\"manual1\" checked><label for=\"manual1\"> </label></td>\n\t\t\t\t\t{{else}}<td colspan=\"3\" class=\"centerlean\"><input type=\"checkbox\" id=\"manual1\" ><label for=\"manual1\"> </label></td>{{/if_eq}}\n\t\t\t\t\t<td colspan=\"16\">{{Task}}</td>\n\t\t\t\t</tr>\n\t\t\t\t{{/each}}<!--closes the Tasks -->\n\t\t\t\t{{#if Tasks}}<!--if there is Tasks then places a blank row after all tasks for this item -->\t\t\t\t\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{{/if}}\n\n\t\t\t\t{{#if Parts}}\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=\"2\"></th>\n\t\t\t\t\t<th colspan=\"2\">{{ayT 'WorkOrderItemPartQuantity'}}</th>\n\t\t\t\t\t<th colspan=\"4\" class=\"centerlean\">{{ayT 'WorkOrderItemPartPartWarehouseID'}}</th>\n\t\t\t\t\t<th colspan=\"13\">{{ayT 'Part'}}</th>\n\t\t\t\t\t<th colspan=\"3\">{{ayT 'WorkOrderItemPartUsed'}}</th>\n\t\t\t\t</tr>\n\t\t\t\t{{/if}}\n\t\t\t\t{{#each Parts}}\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\" class=\"centerlean\"></td>\n\t\t\t\t\t<td colspan=\"2\" class=\"centerlean\">{{Quantity}}</td>\n\t\t\t\t\t<td colspan=\"4\" class=\"centerlean\">{{PartWarehouseViz}}</td>\n\t\t\t\t\t<!--below if includes a label Seria#: and displays serial numbers IF they are present, else only shows the displayed Part -->\n\t\t\t\t\t{{#if Serials}} <td colspan=\"14\">{{PartNameViz}} {{PartDescriptionViz}} &nbsp; {{ayT 'PurchaseOrderItemSerialNumbers'}}: {{Serials}} </td>\n\t\t\t\t\t{{else}} <td colspan=\"14\">{{PartNameViz}} {{PartDescriptionViz}}</td> {{/if}}\n\t\t\t\t\t<td colspan=\"2\" class=\"centerlean\"><input type=\"checkbox\" id=\"manual1\"><label for=\"manual1\"> </label></td>\n\t\t\t\t</tr>\n\t\t\t\t{{/each}}<!--closes the Parts -->\n\t\t\t\t{{#if Parts}}<!--if there is Parts then places a blank row after all parts for this item -->\t\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{{/if}}\n\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\"></td>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'WorkOrderItemLaborServiceDetails'}}</th>\n\t\t\t\t\t<td colspan=\"18\" class=\"centerlean\"></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<tr>\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</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<tr>\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t{{/each}}\n\t\t\t\t<!--closes the Items -->\n\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'TechSignature'}}</th>\n\t\t\t\t\t{{#if TechSignature}} <td colspan=\"8\"><img src=\"{{{TechSignature}}}\" height=\"40px\"/></td>\n\t\t\t\t\t{{else}}<td colspan=\"8\"><hr></td>{{/if}}\n\t\t\t\t\t<td colspan=\"1\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"4\">{{ayT 'CustomerSignature'}}</th>\n\t\t\t\t\t{{#if CustomerSignature}} <td colspan=\"7\"><img src=\"{{{CustomerSignature}}}\" height=\"40px\"/></td>\n\t\t\t\t\t{{else}}<td colspan=\"7\"><hr></td>{{/if}}\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<td colspan=\"24\">&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr style=\"background-color:white\">\n\t\t\t\t\t<th colspan=\"4\">Date</th>\n\t\t\t\t\t{{#if TechSignatureCaptured}} <td colspan=\"8\"> {{ayDateTime TechSignatureCaptured}} </td>\n\t\t\t\t\t{{else}}<td colspan=\"8\"><hr></td>{{/if}}\n\t\t\t\t\t<td colspan=\"1\">&nbsp;</td>\n\t\t\t\t\t<th colspan=\"4\">Date</th>\n\t\t\t\t\t{{#if CustomerSignatureCaptured}} <td colspan=\"7\"> {{ayDateTime CustomerSignatureCaptured}}</td>\n\t\t\t\t\t{{else}}<td colspan=\"7\"><hr></td>{{/if}}\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t\t{{/each}}\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} \n\n\ntable { \n table-layout: fixed; \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 8pt;\n width: 100%;\n }\n\n\nth {\n height: 30px;\n text-align: left;\n color: #9e9e9e;\n}\n\n\ntbody tr {\n height: 10px;\n word-wrap: break-word;\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.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}","JsPrerender":"async function ayPrepareData(reportData){ \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([ \"WorkOrderCloseByDate\", \"WorkOrderServiceDate\", \"WorkOrderSerialNumber\", \"Customer\", \"WorkOrderSummary\", \"Unit\", \"WorkOrderItemSummary\", \"WorkOrderItemPartQuantity\", \"AddressTypePhysical\", \"WorkOrderCustomerContactName\", \"CustomerTechNotes\", \"WorkOrderItemTechNotes\", \"Part\", \"WorkOrderItemPartUsed\", \"WorkOrderItemPartPartWarehouseID\", \"PurchaseOrderItemSerialNumbers\", \"WorkOrderItemLaborServiceDetails\", \"WorkOrderItemScheduledUser\", \"NotifyEventScheduledOnWorkorder\", \"WorkOrderItemScheduledUserEstimatedQuantity\", \"WorkOrderItemScheduledUserStartDate\", \"WorkOrderItemScheduledUserStopDate\", \"WorkOrderItemScheduledUserServiceRateID\", \"WorkOrderItemTasks\", \"WorkOrderItemTaskWorkOrderItemTaskCompletionType\", \"CustomerSignature\", \"TechSignature\", \"WorkOrderItemPriorityID\", \"WorkOrderItemWorkOrderStatusID\", \"WorkOrderItemRequestDate\" ]);\n\n //below checks if any parts have Serials to remove carriage returns so parts serials display on same line\n for (const EachWO of reportData.ayReportData) {\n for (const Item of EachWO.Items) {\n for (const Part of Item.Parts) {\n if (Part.Serials != null) {\n let s = Part.Serials; \n Part.Serials = s.replace(/[\\n\\r]+/g, ' ');\n }\n }\n }\n }\n\n return reportData; \n}","JsHelpers":"//custom helper so can do a direct comparison - i.e. if value equals xxxx, then show, else show yyyyy\n\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});\n\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":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}