1 line
2.8 KiB
Plaintext
1 line
2.8 KiB
Plaintext
{"Name":"109x EXAMPLE PO Custom fields","Active":true,"Notes":"example of using AyaNova provided Helpers to format custom fields","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"<html>\n\n<body>\n\t<div>\n\t\t<h2>Example: custom fields usage </h2>\n\t\t<p>See help documentation for details</p>\n\t\t<hr>\n\t</div>\n\t<div >\n\t\t{{#each ayReportData}} <!-- this #each is for iterating through each PO, note further below its corresponding /each to close -->\n\t\t<h2>PO # (internal key is Serial, to indicate a unique number ): {{ Serial }} </h2><br/>\n\t\tTags (if any tags, otherwise will show blank if none): {{Tags}} <br/>\n\t\t<h3>Custom fields </h3>\n\t\t<p class=\"example\">Custom field items can be accessed via the main object's CustomFields property and then by dot notation for each of the 16 possible custom fields as .c1 to .c16 \n\t\tIf a custom field is unused it will return a blank for that item.</p>\n\t\t<p class=\"example\">(note, example assumes generated sample data and that c1 and c5 have data)</p>\n\t\t<strong>Custom c1 as DateTime: {{ ayDateTime CustomFields.c1}}</strong> <br/>\n\t\t<strong>custom c5 as Number: {{ ayDecimal CustomFields.c5}}</strong> <br/>\t\t\n\n\t\t\t{{#each Items}} <!-- this #each is for iterating through each po items, note further below its corresponding /each to close -->\n\t\t\t<h2>For each PO Item (non custom fields) </h2>\t\n\t\t\tPurchaseOrderCost as is in database: {{ PurchaseOrderCost}} <br/>\t\t\n\t\t\tPurchaseOrderCost as Decimal Number (defaults to three decimal places): {{ ayDecimal PurchaseOrderCost}} <br/>\t\t\n\t\t\tPurchaseOrderCost as Currency: {{ ayCurrency PurchaseOrderCost}} <br/>\t\t\t\n\t\t\t{{/each}} <!-- this /each closes the iterating through each po items -->\n\t\t\t<hr />\n\t\t{{/each}} <!-- this /each closes the iterating through each PO -->\n\t\t<hr >\n\n\t</div>\n\n</body>\n\n</html>","Style":".example {\n color: blue;\n}\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 return reportData;\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})","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":null,"MarginOptionsLeft":null,"MarginOptionsRight":null,"MarginOptionsTop":null,"PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.00000} |