{"Name":"z_if key value X show Y via custom Helpers","Active":true,"Notes":"example custom Helper if has tag X then show Y, else return something else such as preset text\nexample custom Helper of how to correctly wrap output in a safestring as result of Helper if CSS styling required","Roles":50538,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t

Use of Custom Helpers to display specific aspects if {{ayT 'Tags'}} have a specific value

\n\t\n\t
\n\t\n\t\t{{#each ayReportData}}\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if CustomFields.c1}} {{else}} {{/if}}\n\t\t\t\n\t\t\t{{#each Items}}\n\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if QuantityReceived}} {{else}} {{/if}}\n\t\t\t\n\t\t\t{{/each}}\n\t\t\n\t\t{{/each}}\n\t
For {{ayT 'PurchaseOrderPONumber'}} {{ Serial }}
Using HTML5 mustache to display all {{ayT 'Tags'}} for this {{ayT 'PurchaseOrder'}}{{ Tags}}
Using HTML5 mustache to display ONLY the 1st {{ayT 'Tag'}} for this {{ayT 'PurchaseOrder'}} {{ayT 'Tags'}}{{ Tags.[0]}}
Custom Helper to display if has {{ayT 'Tag'}} 'gold':{{ isInTag Tags}}
Custom Helper to display if has {{ayT 'Tag'}} 'brown':{{ isInTag2 Tags}}
Custom Helper to display if has {{ayT 'Tag'}} 'green' will display using safestring call of the CSS styling fontgreen else displays safestring call of the CSS styling fontred:{{{ isInTag3 Tags}}}
HTML5 use of #if to display PO's CustomFields.c1 value with CSS fontgreen applied to the text, else will display fontred if is is false, undefined, null, \"\", 0, or []{{CustomFields.c1}}No value has been entered in Custom1 field for this PO
HTML5 use of #each for each POitem - #if to display text in fontred if QuantyReceived is false, undefined, null, \"\", 0, or [], else display in fontgreen{{ayT 'PurchaseOrderItemQuantityOrdered'}} for {{ayT 'Part'}} {{PartNameViz}} is {{QuantityOrdered}} which EQUALS {{ayT \"PurchaseOrderItemQuantityReceived\"}} value of {{QuantityReceived}}{{ayT 'PurchaseOrderItemQuantityOrdered'}} for {{ayT 'Part'}} {{PartNameViz}} is {{QuantityOrdered}} which is NOT EQUAL to the {{ayT \"PurchaseOrderItemQuantityReceived\"}} so far of {{QuantityReceived}}!
\n \n\n\n","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: center;\n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n table-layout: fixed; \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}\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}\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([\"Part\", \"PurchaseOrderItemQuantityReceived\", \"PurchaseOrderItemQuantityOrdered\", \"Tag\", \"Tags\", \"PurchaseOrderPONumber\", \"PurchaseOrder\" ]);\n\n return ayData;\n}","JsHelpers":"Handlebars.registerHelper('isInTag', function (Tags) //example of HELPER to show specific text IF a specific tag is found\n{\n for (var i=0; i\" + \"The tag \\'green\\' is found in this PO\\'s Tags array, so this text shows with green font color!\" +\"

\"); //note the use of \\ to be able to show special character '\n\t\t}\n }\n return new Handlebars.SafeString(\"

\" + 'Nope, the tag \\'green\\' is NOT found in this PO\\'s Tags array, so this text shows with red font color' +\"

\"); //note the use of \\ to be able to show special character '\n});\n","RenderType":0,"HeaderTemplate":"                Printed date: PDFDate\nPage of                ","FooterTemplate":"  ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000}