From 608f34263dd8d070bd67e1686d640a94d41f0d53 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 9 Jul 2021 17:33:09 +0000 Subject: [PATCH] --- ...109x EXAMPLE PO running total each POItem with PO Total.ayrt | 1 + .../109x EXAMPLE PO API use and meta data.ayrt | 1 + .../109x EXAMPLE PO Barcode using built in helper.ayrt | 1 + .../109x EXAMPLE PO Basic table layout .ayrt | 1 + .../stock-report-templates/109x EXAMPLE PO Custom fields.ayrt | 1 + .../109x EXAMPLE PO Landscape with derived totals.ayrt | 1 + .../stock-report-templates/109x EXAMPLE PO Wiki displayed.ayrt | 1 + .../109x EXAMPLE PO additional Today's Date Time Helpers.ayrt | 1 + ...PO comparing qty ordered to qty received for each poitem.ayrt | 1 + .../109x EXAMPLE PO custom date time format Helpers.ayrt | 1 + ...EXAMPLE PO show parent value AND child value on SAME row.ayrt | 1 + .../109x EXAMPLE PO show tags dependent on custom Helpers.ayrt | 1 + ...PLE PO showing ordered received including serial numbers.ayrt | 1 + .../109x EXAMPLE PO using #if, #unless and custom #if_eq.ayrt | 1 + .../stock-report-templates/109x EXAMPLE single line per PO.ayrt | 1 + .../112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt | 1 + .../112 EXAMPLE WO Invoice with derived Net and Grand Total.ayrt | 1 + ...2 EXAMPLE WO single line PROFIT_LOSS on net parts labors.ayrt | 1 + .../112 EXAMPLE WO single line per wo Nets NO TAXES .ayrt | 1 + .../112 EXAMPLE WO single line per wo Nets Taxes Totals.ayrt | 1 + .../112 unfinished WO Dispatch example.ayrt | 1 + .../stock-report-templates/EXAMPLE API use and meta data.ayrt | 1 - .../rpt/stock-report-templates/EXAMPLE Bar code helper.ayrt | 1 - .../EXAMPLE Custom date time format helpers.ayrt | 1 - .../resource/rpt/stock-report-templates/EXAMPLE Logo helper.ayrt | 1 - .../stock-report-templates/EXAMPLE PDF Options page number.ayrt | 1 - .../rpt/stock-report-templates/EXAMPLE Translation helper.ayrt | 1 - .../resource/rpt/stock-report-templates/EXAMPLE WIKI helper.ayrt | 1 - .../EXAMPLE WO Invoice with derived Net and Grand Total.ayrt | 1 - .../EXAMPLE WO single line per wo Nets NO TAXES .ayrt | 1 - .../EXAMPLE WO single line per wo Nets Taxes Totals.ayrt | 1 - .../rpt/stock-report-templates/EXAMPLE custom fields.ayrt | 1 - .../rpt/stock-report-templates/EXAMPLE localization helpers.ayrt | 1 - .../EXAMPLE modify data before rendering.ayrt | 1 - .../SAMPLE Additional Today's Date Time Helpers.ayrt | 1 - .../SAMPLE one object prints per page.ayrt | 1 - .../SAMPLE showing IF ELSE inline html.ayrt | 1 - .../SAMPLE showing tag only if has specific tagword.ayrt | 1 - .../SAMPLE widgets invoice rpt footer last pg only.ayrt | 1 - .../SAMPLE widgets invoice rpt head footer repeats.ayrt | 1 - 40 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO running total each POItem with PO Total.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO API use and meta data.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Barcode using built in helper.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Basic table layout .ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Custom fields.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Wiki displayed.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO additional Today's Date Time Helpers.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO comparing qty ordered to qty received for each poitem.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO custom date time format Helpers.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show parent value AND child value on SAME row.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show tags dependent on custom Helpers.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO showing ordered received including serial numbers.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO using #if, #unless and custom #if_eq.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE single line per PO.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO Invoice with derived Net and Grand Total.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line PROFIT_LOSS on net parts labors.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets NO TAXES .ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets Taxes Totals.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 unfinished WO Dispatch example.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE API use and meta data.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Bar code helper.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Custom date time format helpers.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Logo helper.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE PDF Options page number.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Translation helper.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WIKI helper.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE custom fields.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE localization helpers.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE modify data before rendering.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE Additional Today's Date Time Helpers.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE one object prints per page.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing IF ELSE inline html.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing tag only if has specific tagword.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt footer last pg only.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt head footer repeats.ayrt diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO running total each POItem with PO Total.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO running total each POItem with PO Total.ayrt new file mode 100644 index 00000000..b61879b8 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO running total each POItem with PO Total.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO running total each POItem with PO Total","Active":true,"Notes":"Custom Prepare example to gather running total for the PO and running total for ALL POs in this list\nHTML example using ayCurrency","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t{{#each ayReportData}} \n\t

PO: {{ Serial }}

\n\t\t{{#each Items}}\n\t\t

LineTotalViz: {{ ayCurrency LineTotalViz}}, RunningTotal: {{ ayCurrency PORunningTotal }}

\n\t\t{{/each}}\n\t

This PO total dollar amount: {{ ayCurrency ThisPODollarAmount }}

\n\t
\n\t\n\t{{/each}}\n

ALL POS: {{ayCurrency AllPORunningTotal}}

\n\n\n\n","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n //Declare a temporary variable to hold the running total\n \nlet AllPODollarAmount = 0;\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0;\n for (Item of EachPO.Items)\n {\n\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount;\n }\n\n //Add the AllPODollarAmount variable to the reportData so it can be \n //accessed in the report template \n reportData.AllPORunningTotal=AllPODollarAmount;\n\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO API use and meta data.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO API use and meta data.ayrt new file mode 100644 index 00000000..6034503c --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO API use and meta data.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO API use and meta data","Active":true,"Notes":"","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t

Example: Meta data and API usage

\n\t

See help documentation for further details

\n\t\n\t
\n\t\t

ayServerMetaData - from the database

\n\t\t

If specify only the ayServerMetaData between mustashes, displays all this info:

\n\t\t

{{ ayJSON ayServerMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\n\t\t

ayClientMetaData - from the web browser you have used for this session

\n\t\t

If only specify ayClientMetaData between the mustaches then displays all this info (keys and values):

\n\t\t

{{ ayJSON ayClientMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\t\t\n\t\t

ayReportMetaData - from this report template

\n\t\t

If only specify ayReportMetaData between the mustashes then displays all this info (keys and values including array values):

\n\t\t

{{ ayJSON ayReportMetaData }}

\n\t\t\n\t
\n\t
\n\n\t
\n\t\t

myData - Fetched dynamically from API route enum-list/list/AyaType using report template's Prepare

\n\t\t

In this case, myData includes ServerInfo AND SearchResults

\n\t\t

specifically, Prepare searches for the text \"purple\" in any object in the database and returns....\n\t\t

If only specify myData (the name given via Prepare in this report template) between mustashes then displays all this info:

\n\t\t

{{ ayJSON myData }}

\n\t\t\n\t
\n\t
\n\t\n\t
\n\t\t

ayReportData - to display the PO Number value and the PO Notes value for each PO in the list:

\n\t\t{{#each ayReportData}}\n\t\t

PO#: {{ Serial }}

\n\t\t
Notes: {{ Notes }}
\n\t\t{{/each}}\n\t
\n\n\n","Style":".bluefont {\n color: blue;\n}\n\n.greenfont {\n color: green;\n}\n\nul[title]::before {\n content: attr(title);\n /* then add some nice styling as needed, eg: */\n font-weight: bold;\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\n //Example of using API GET method to fetch data from API server and make it available to the report template\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(\"server-info\")};\n\n //Example API POST method to fetch data from api server\n let searchPostData={phrase: \"Purple\"};\n reportData.myData.SearchResults=await ayPostToAPI(\"search\", searchPostData);\n\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":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Barcode using built in helper.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Barcode using built in helper.ayrt new file mode 100644 index 00000000..34a08291 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Barcode using built in helper.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO Barcode using built in helper","Active":true,"Notes":"","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t

Example: Bar code helper

\n\t

See Report editor help documentation for details

\n\n\t{{#each ayReportData}}\n\tPO #: {{Serial}}\n\t
\n\t\tPO # as \"CODE-128\" BarCode:
\n\t\t{{ ayBC Serial '{ \"bcid\": \"code128\",\"includetext\":true, \"scale\":1}' }}\n\t
\n\t
\n\t
\n\t\tPO # as \"QR\" Code:
\n\t\t{{ ayBC Serial '{ \"bcid\": \"qrcode\",\"includetext\":true, \"scale\":3}' }}\n\t
\n\t
\n\t
\n\t\tSample \"UPC-A\" Code (PO # wouldn't be a valid UPC code so hard coded the numbers 712345678904 as example here):
\n\t\t{{ ayBC \"712345678904\" '{ \"bcid\": \"upca\",\"includetext\":true, \"scale\":1}' }}\n\t
\n\t
\n\t
\n\t
\n\t{{/each}}\n\n\n","Style":".example {\n color: blue;\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Basic table layout .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Basic table layout .ayrt new file mode 100644 index 00000000..bb834f90 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Basic table layout .ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO Basic table layout ","Active":true,"Notes":"example of displaying a Parent value when the #each references a Child, use a ../ in front of the Property name in the mustaches\nexample PDF Options Header & Footer; ","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\t\n\t\t\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t{{#each ayReportData}}\n\t\t\n\t\t\t\n\t\t{{#each Items}} \n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t{{/each}}\t\t\n\t\n\t{{/each}}\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\t\n\t
column header 1 column header 2column header 3column header 4
TBODY PO# {{../Serial}} TBODY Part #: {{PartViz}} TBODY Qty Ordered: {{QuantityOrdered}}TBODY Serials: {{Serials}}
footer stuff 1expands across two columns with or without having to have textfooter stuff 3
\t\t\n\n","Style":"table { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n.footertext {\n font-size: 20pt;\n font-style: italic;\n background-color: pink;\n}\n\n.fontgreen {\n color: green;\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Custom fields.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Custom fields.ayrt new file mode 100644 index 00000000..a8863ac5 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Custom fields.ayrt @@ -0,0 +1 @@ +{"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":"\n\n\n\t
\n\t\t

Example: custom fields usage

\n\t\t

See help documentation for details

\n\t\t
\n\t
\n\t
\n\t\t{{#each ayReportData}} \n\t\t

PO # (internal key is Serial, to indicate a unique number ): {{ Serial }}


\n\t\tTags (if any tags, otherwise will show blank if none): {{Tags}}
\n\t\t

Custom fields

\n\t\t

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.

\n\t\t

(note, example assumes generated sample data and that c1 and c5 have data)

\n\t\tCustom c1 as DateTime: {{ ayDateTime CustomFields.c1}}
\n\t\tcustom c5 as Number: {{ ayDecimal CustomFields.c5}}
\t\t\n\n\t\t\t{{#each Items}} \n\t\t\t

For each PO Item (non custom fields)

\t\n\t\t\tPurchaseOrderCost as is in database: {{ PurchaseOrderCost}}
\t\t\n\t\t\tPurchaseOrderCost as Decimal Number (defaults to three decimal places): {{ ayDecimal PurchaseOrderCost}}
\t\t\n\t\t\tPurchaseOrderCost as Currency: {{ ayCurrency PurchaseOrderCost}}
\t\t\t\n\t\t\t{{/each}} \n\t\t\t
\n\t\t{{/each}} \n\t\t
\n\n\t
\n\n\n\n","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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt new file mode 100644 index 00000000..52a93387 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO Landscape with derived totals","Active":true,"Notes":"example one PO with po items details per page (or multiple pages as needed); example Prepare to derive running net totals, tax totals, grand PO total","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n static header section - no data here.
below data obtained from ayReportData shows in green font.\n below data derived from Prepare shows in blue font. below data using builtinhelpers shows in red font\n \n
\n\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n \t\t \n \t\t\n \t\t\n \t\t\n \t\t\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \n \n\t\t
{{ ayLogo \"small\" }}Our PO#:{{Serial}}Vendor Ref #: {{ReferenceNumber}}
Ordered Date: {{ayDate OrderedDate}}
ETA Date: {{ayDate ExpectedReceiveDate}} {{ayDate ExpectedReceiveDate}}
VENDOR:DELIVER TO:
{{VendorViz}}My Company Name
vstaddress vstcity vststate vstpostal123 - 123 MyStreetname Ave My City, My State, My Postal
Contact: vcontact vphone vemailOrdered By: creator Phone: creatorphone
 
Our Part#:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}} {{PartNameViz}}{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}{{ayCurrency TaxBViz}}{{ayCurrency LineTotalViz}}
 
Net Total:{{ ayCurrency ThisPONet }}
 Tax A Total:{{ ayCurrency ThisPOTaxA }}0.00
Uppercase text in row below occurs as calling the Helper 'loud'Tax B Total:{{ ayCurrency ThisPOTaxB }}0.00
{{ loud \"See the last page of the entire report for a footer that ONLY displays on the last page\"}}PO Total:{{ ayCurrency ThisPODollarAmount }}
To have Prepare's AllPORunningTotal show:{{ ayCurrency ../AllPORunningTotal }}
\n {{/each}}\n \n\t
\n \n \n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n
row 1 placed here cause of the static header above:
row 2 placed here cause of the static header above:
Reminder - nothing will show if use 'AllPODollarAmount' as is NOT a variable. ONLY the left side reportDate.AllPORunningTotal will show (used in the row below)AllPODollarAmount:{{ ayCurrency AllPODollarAmount }}
no leading ../ needed when AllPORunningTotal is placed OUTSIDE of the specific #each AllPORunningTotal:{{ ayCurrency AllPORunningTotal }}
\n\n","Style":"\n\n.singlePage\n{\npage-break-after: always;\n}\n\n.page {\n page-break-after: always;\n}\n\n.page-header, .page-header-space {\n height: 50px;\n}\n\n\n.page-header { /* interesting - if this is set (fixed) then the repeating header of the actual table doesn't repeat*/\n position: fixed;\n top: 0mm;\n width: 100%;\n border-bottom: 1px solid black; /* for demo */\n background: yellow; /* for demo */\n}\n\n.blank_row\n{\n height: 15mm;\n background-color: lightgreen;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \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}\n\ntbody tr:nth-child(even) {\n font-size: 18pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 18pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work hmmm */\n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n background: pink; \n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarAmount = 0; //Declare a temporary variable to hold the running total of all POs in this list\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the AllPODollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0; //Declare a temporary variable to hold the running total of THIS PO\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount; // Use ThisPODoallarAmount to display the running Total for THIS PO\n }\n //Add the AllPODollarAmount variable to the reportData so it can be accessed in the report template using {{AllPORunningTotal}} AS LONG as placed OUTSIDE of the main /{/{#each ayReportData}} /{/{/each}}\n reportData.AllPORunningTotal=AllPODollarAmount;\n\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":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Wiki displayed.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Wiki displayed.ayrt new file mode 100644 index 00000000..a9f2cb45 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Wiki displayed.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO Wiki displayed","Active":true,"Notes":"","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t

Example: WIKI / markdown field usage

\n\t

See help documentation for details

\n\n\t{{#each ayReportData}}\n\t

FOR PO# {{Serial}} from vendor: {{VendorViz}}

\n\t

Below is Wiki for above PO:

\n\t
\n\t{{ ayWiki Wiki }}\n\t
\n\t
\n\t{{/each}}\n\t\n\n\n","Style":".example {\n color: blue;\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":"15mm","MarginOptionsLeft":"15mm","MarginOptionsRight":"15mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO additional Today's Date Time Helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO additional Today's Date Time Helpers.ayrt new file mode 100644 index 00000000..006885b9 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO additional Today's Date Time Helpers.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO additional Today's Date Time Helpers","Active":true,"Notes":"example Custom Helpers to display todays date in different formats","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t

Additional custom time date helpers

\n\t

today's date using custom Helper todaysDate no formatting: {{ todaysDate}}

\n\t

today's date using custom Helper date.toLocaleDateString() : {{ todaysLocaleStringDate}}

\n\ttoday's date using custom Helper todaysget that users date.getFullYear etc: {{ todaysget}}

\n\t

today's date using custom Helper long format of ayClientMetaData: {{ todaysMonthDDYYYYDate}}

\n\t

today's date using custom Helper todaysDateYearFromParts formatter.formatToParts(parsedDate): {{ todaysDateYearFromParts}}

\n\t

all can be further customized to display short, long, etc format

\n\t
\n\n\n","Style":".example {\n color: blue;\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\n\n\nHandlebars.registerHelper('todaysDate', function() {\n var dt1=new Date();\n return dt1\n});// today's date with no formatting EXAMPLE SHOW: Wed Jun 09 2021 16:17:27 GMT-0700 (Pacific Daylight Time)\n\nHandlebars.registerHelper('todaysLocaleStringDate', function() {\n var dt2=new Date();\n return dt2.toLocaleDateString() \n});// today's date displayed in the localedatestring EXAMPLE SHOW: 09/06/2021\n\n\nHandlebars.registerHelper('todaysget', function() {\n var dt5 =new Date();\n var date = dt5.getFullYear()+'-'+(dt5.getMonth()+1)+'-'+dt5.getDate() + \" \" + +dt5.getHours() + \":\" + +dt5.getMinutes() ;\n return date\n});// today's date displayed EXAMPLE SHOW: 2021-6-9 16:17\n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format EXAMPLE SHOW: June 9, 2021\n\n\n\n\n\n//\n// CUSTOM FORMAT TO PARTS HELPER\n// this offers the most control over the return format\n// Locale aware conversion to parts that can be returned in any format\n//\nHandlebars.registerHelper('todaysDateYearFromParts', function () {\n\n //parse todays date\n let parsedDate = new Date();\n\n //Set formatter options\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts\n let formatter = new Intl.DateTimeFormat('en-us', {\n weekday: 'long',\n year: 'numeric',\n month: 'long', //long to show the full name of month, short to show short name, numeric to show the month number\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n hour12: true,\n timeZone: 'Canada/Pacific' //refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for appropriate TZ database name to use\n //OR use what is displayed in the output for your ayClientMetaData's TimeZoneName:\n });\n\n let parts = formatter.formatToParts(parsedDate);\n /*\n // parts example return value: \n [ \n { type: 'weekday', value: 'Monday' }, \n { type: 'literal', value: ', ' }, \n { type: 'month', value: '12' }, \n { type: 'literal', value: '/' }, \n { type: 'day', value: '17' }, \n { type: 'literal', value: '/' }, \n { type: 'year', value: '2012' }, \n { type: 'literal', value: ', ' }, \n { type: 'hour', value: '3' }, \n { type: 'literal', value: ':' }, \n { type: 'minute', value: '00' }, \n { type: 'literal', value: ':' }, \n { type: 'second', value: '42' }, \n { type: 'fractionalSecond', value: '000' },\n { type: 'literal', value: ' ' }, \n { type: 'dayPeriod', value: 'AM' } \n ]\n */\n//identify here which of the above will use when returning\n let partWeekDay = parts.find(({ type }) => type === 'weekday').value;\n let partDay = parts.find(({ type }) => type === 'day').value;\n let partMonth = parts.find(({ type }) => type === 'month').value;\n let partYear = parts.find(({ type }) => type === 'year').value;\n let partHour = parts.find(({ type }) => type === 'hour').value;\n let partMin = parts.find(({ type }) => type === 'minute').value;\n let partdayPeriod = parts.find(({ type }) => type === 'dayPeriod').value;\n\n\n \n //return in some custom format\n return `${partWeekDay} ${partDay}, ${partMonth} ${partYear} - ${partHour}:${partMin} ${partdayPeriod}`; // EXAMPLE SHOW Wednesday 9, June 2021 - 4:17 PM\n\n \n //return below instead to see array of the possible values for each type while initially figuring out what to customize to\n //return JSON.stringify(parts);\n});","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO comparing qty ordered to qty received for each poitem.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO comparing qty ordered to qty received for each poitem.ayrt new file mode 100644 index 00000000..fb3a6108 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO comparing qty ordered to qty received for each poitem.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO comparing qty ordered to qty received for each poitem","Active":true,"Notes":"example custom Helper if_eq to compare ordered to received, if same show in green. if NOT same, show in red.\nexample use of HTML if else /if - if serials present then show, else show preset text","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t\n\t\n \n \n \n \n \n \n \n \n \n \n {{#each ayReportData}}\n \n {{#each Items}} \n \n \n \n \n\n \n {{#if_eq QuantityOrdered QuantityReceived}} {{else}}{{/if_eq}}\n\t\t\t\t\t\n {{#if Serials}}{{else}}{{/if}}\n \n {{/each}}\n \n {{/each}}\n
PO#:Part#:QTY Ordered:QTY Received:Serials Received:
{{../Serial}} {{PartViz}} {{QuantityOrdered}}same as ordered {{QuantityReceived}}different than ordered {{QuantityReceived}}{{Serials}}no serials documented
\n\t\n\n","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody td {\n width: 20%; /* spans each column even width */\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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})\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});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO custom date time format Helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO custom date time format Helpers.ayrt new file mode 100644 index 00000000..3d140a3b --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO custom date time format Helpers.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO custom date time format Helpers","Active":true,"Notes":"examples of custom Helpers to format date and date/time data fields","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":" \n\n\n\t

Example: custom formatted date time helpers

\n\t

Below shows example of each PO's OrderedDate in various formats:

\n\t
\n\t\n{{#each ayReportData}}\n\n\t\n\t\t\n\t\n\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n
For PO#: {{ Serial }}
The raw UTC / GMT AyaNova stored value from server:{{ OrderedDate}}
Below as available Built in helpers
ayDateTime helper:{{ ayDateTime OrderedDate}}
ayDate helper:{{ ayDate OrderedDate}}
ayTime helper:{{ ayTime OrderedDate}}
Below are Custom helpers in this report template
myDateTime custom helper:{{ myDateTime OrderedDate}}
myDate custom helper:{{ myDate OrderedDate}}
myTime custom helper:{{ myTime OrderedDate}}
**NOTE the Helpers below as of alpha.109 no longer can set timeZoneName:
myDateTimeAustralia custom helper:{{ myDateTimeAustralia OrderedDate}}
myDateTimeArabic custom helper:{{ myDateTimeArabic OrderedDate}}
myDateTimeFromParts custom helper: {{ myDateTimeFromParts OrderedDate}}
\n
\n{{/each}}\n\n\n\n\n","Style":"table { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n.footertext {\n font-size: 20pt;\n font-style: italic;\n background-color: pink;\n}\n\n.fontgreen {\n color: green;\n}\n.fontred {\n color: red;\n}\n.fontpurple {\n color: purple;\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":"//////////////////////////////////// /////////////////////////////\n// \n// CUSTOM DATE AND TIME HELPER\n//\nHandlebars.registerHelper('myDateTime', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date \n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\n return parsedDate.toLocaleString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\",\n timeStyle: \"long\",\n hour12: AYMETA.ayClientMetaData.Hour12 //Use User setting for 12/24 hour clock\n }\n );\n});\n\n\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n\n\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM TIME HELPER\n//\nHandlebars.registerHelper('myTime', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleTimeString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\n return parsedDate.toLocaleTimeString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone \n timeStyle: \"long\",//display the time zone used \n hour12: AYMETA.ayClientMetaData.Hour12 //Use User setting for 12/24 hour clock\n }\n );\n});\n\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE AND TIME HELPER WITH AUSTRALIAN OPTIONS\n//\nHandlebars.registerHelper('myDateTimeAustralia', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString \n return parsedDate.toLocaleString(\n \"en-au\",//use English-Australia locale (Day / Month / Year is Australia default format)\n {\n timeZone: \"Australia/Sydney\",//use forced time zone, see \"tz database\" column for name in list here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n // timeZoneName: \"long\",//display the time zone used - AS OF alpha.109 unable to use this?\n dateStyle: \"short\",\n timeStyle: \"long\"\n }\n );\n});\n\n\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE AND TIME HELPER WITH Arabic OPTIONS \n//\nHandlebars.registerHelper('myDateTimeArabic', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString \n return parsedDate.toLocaleString(\n \"ar-EG\",//use Arabic locale \n {\n timeZone: \"Asia/Dubai\",//use forced time zone, see \"tz database\" column for name in list here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n // timeZoneName: \"short\",//display the time zone used \n dateStyle: \"short\",\n timeStyle: \"long\"\n }\n );\n});\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM FORMAT TO PARTS HELPER\n// this offers the most control over the return format\n// Locale aware conversion to parts that can be returned in any format\n//\nHandlebars.registerHelper('myDateTimeFromParts', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Set formatter options\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts\n let formatter = new Intl.DateTimeFormat('en-us', {\n weekday: 'long',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n hour12: true,\n timeZone: 'UTC'\n });\n\n let parts = formatter.formatToParts(parsedDate);\n /*\n // parts example return value: \n [ \n { type: 'weekday', value: 'Monday' }, \n { type: 'literal', value: ', ' }, \n { type: 'month', value: '12' }, \n { type: 'literal', value: '/' }, \n { type: 'day', value: '17' }, \n { type: 'literal', value: '/' }, \n { type: 'year', value: '2012' }, \n { type: 'literal', value: ', ' }, \n { type: 'hour', value: '3' }, \n { type: 'literal', value: ':' }, \n { type: 'minute', value: '00' }, \n { type: 'literal', value: ':' }, \n { type: 'second', value: '42' }, \n { type: 'fractionalSecond', value: '000' },\n { type: 'literal', value: ' ' }, \n { type: 'dayPeriod', value: 'AM' } \n ]\n */\n\n let partWeekDay = parts.find(({ type }) => type === 'weekday').value;\n let partDay = parts.find(({ type }) => type === 'day').value;\n let partYear = parts.find(({ type }) => type === 'year').value;\n \n //return in some custom format\n return `DAY:${partWeekDay}-${partDay} YEAR: ${partYear}`;\n //return this instead to see the actual return array\n //return JSON.stringify(parts);\n});","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show parent value AND child value on SAME row.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show parent value AND child value on SAME row.ayrt new file mode 100644 index 00000000..0ebd565e --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show parent value AND child value on SAME row.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO show parent value AND child value on SAME row","Active":true,"Notes":"example HTML mustache for displaying parent property (i.e. the PO number) when \"in\" Child iteration (PO items)","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t\n\t\n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n {{#each Items}} \n \n \n \n \n \n \n \n \n {{/each}}\n \n {{/each}}\n
MAIN HEADER PO#: {{Serial}} MAIN HEADER empty1MAIN HEADER empty2
TBODY PO# {{../Serial}} TBODY Part #: {{PartViz}} TBODY Qty Ordered: {{QuantityOrdered}}
\n\t\n\n","Style":".example {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 16pt;\n width: 100%;\n }\n\ntbody tr {\n width: 100%;\n}\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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":"    (from PDF Options) Printed date: ","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show tags dependent on custom Helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show tags dependent on custom Helpers.ayrt new file mode 100644 index 00000000..c522bda2 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO show tags dependent on custom Helpers.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO show tags dependent on custom Helpers","Active":true,"Notes":"example custom Helpers functions if has tag X then show Y, else return something else like preset text\nexample in custom Helper if want to use CSS styling, how to correctly wrap in a safestring","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t

Example: Helpers to show if has a specific Tag / Custom fields usage

\n\t

See the specific Helpers in this report template, and the help documentation for additional details

\n\n\t\n\t\t{{#each ayReportData}}\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t \n\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\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 PO#: {{ Serial }}
Display 1st Tag only:{{ Tags.[0]}}
Called ayReportData's to display all tags for this PO:{{ Tags}}
Called custom Helper to display if has tag 'gold':{{ isInTag Tags}}
Called custom Helper to display if has tag 'brown':{{ isInTag2 Tags}}
Called custom Helper to display if has tag 'yellow':{{ isInTag3 Tags}}
If CustomFields.c1 has value, will display greenfont else will display redfont{{CustomFields.c1}}nope nothing here
For each POitem will display in redfont if QuantyReceived is false, undefined, null, \"\", 0, or []For {{PartViz}} have received: {{QuantityReceived}}Nothing received yet for {{PartViz}}
\n \n\n\n","Style":".redMe {\n color: red;\n}\n\n.greenMe {\n color: green;\n}\n\n\n.blueMe {\n color: blue;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 18pt;\n width: 100%;\n }\n\n\n\ntbody tr:nth-child(even) {\n font-size: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\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":"Handlebars.registerHelper('isInTag', function (Tags) \n{\n for (var i=0; i\" + \"yellow is in here!! see how this shows in greenfont!\" +\"

\"); //if want to use CSS styling, be sure to wrap in a safestring\n\t\t}\n }\n return 'Nope yellow isn\\'t in tags for this poitem'; //if don't want to return any element at all, comment this else aspect out fully\n});\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO showing ordered received including serial numbers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO showing ordered received including serial numbers.ayrt new file mode 100644 index 00000000..ac3c8c59 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO showing ordered received including serial numbers.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO showing ordered received including serial numbers","Active":true,"Notes":"TO DO: PartName property as not yet in Sample Data; example Prepare for running nets and total\n","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \n \n \n\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n\n \n \n \n \n \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n {{#if PartNameViz}}{{else}} {{/if}}\n \n {{#if Serials}}{{else}} {{/if}}\n \t\t \n \t\t\n \t\t\n \n \t\t{{#if TaxAViz}}{{else}} {{/if}} \n \t\t{{#if TaxBViz}}{{else}} {{/if}}\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n\t\t\t\n\t\t\n\t\t \n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t \n \n\t\t \n\t\t\t\n\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t \n \n\t\t\n \n \n\t\t
{{ayLogo 'small'}} Our Internal PO#:{{Serial}}Addt'l Ref #: {{ReferenceNumber}}
data from ayReportData shows in greenfont Ordered Date: {{ayDate OrderedDate}}
data derived from Prepare shows in bluefontETA Date: {{ayDate ExpectedReceiveDate}}{{ayDate ExpectedReceiveDate}}
data derived from Helper shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
VENDOR:DELIVER TO:
{{VendorViz}}{{DropShipToCustomerViz}}My Company Name
unsure where to get vendor contact information customer contact data unknown how to get123 - 123 MyStreetname Ave My City, My State, My Postal
vendor contact not part of datasetcustomer contact data unknown how to getOrdered By: creator Phone: creatorphone
 
Part#:Part Name:Serials Received#:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}}{{PartNameViz}}no part name has been entered{{Serials}}no serials entered as received{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Total Qty CountTotal NetTotal Tax A:Total Tax B:PO Total:
{{ThisPOQty}}{{ ayCurrency ThisPONet }}{{ ayCurrency ThisPOTaxA }}0.00{{ ayCurrency ThisPOTaxB }}0.00{{ ayCurrency ThisPODollarAmount }}
\n {{/each}}\n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 12pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 14pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 14pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n font-size: 12pt; \n bottom: 0;\n width: 90%;\n border-top: 1px solid black;\n\n}\n\n.fontsmall {\n font-size: 8px;\n}\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPOQty = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOQty = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.QuantityOrdered != null) \n {\n ThisPOQty += Item.QuantityOrdered;\n }\n Item.POTaxQtyRunning=ThisPOQty;\n }\n EachPO.ThisPOQty=ThisPOQty;\n AllPOQty += ThisPOQty; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOQtyRunning=AllPOQty; \n \n\nlet AllPODollarAmount = 0; //Declare a temporary variable to hold the running total of all POs in this list\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the AllPODollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0; //Declare a temporary variable to hold the running total of THIS PO\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount; // Use ThisPODoallarAmount to display the running Total for THIS PO\n }\n //Add the AllPODollarAmount variable to the reportData so it can be accessed in the report template \n reportData.AllPORunningTotal=AllPODollarAmount;\n\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})\nHandlebars.registerHelper('words', function() {\n return \"stuff and text\"\n})\n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format\n","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":null,"DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO using #if, #unless and custom #if_eq.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO using #if, #unless and custom #if_eq.ayrt new file mode 100644 index 00000000..619fd8cc --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO using #if, #unless and custom #if_eq.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE PO using #if, #unless and custom #if_eq","Active":true,"Notes":"HTML handlebars #unless example (i.e. #unless is \"if not\" - as in if not true do this. no 'else' aspect) , #if example that checks for truthiness - if false, undefined, null, \"\", 0, or [], Handlebars will not render the block","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \n \n \n\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n \n {{#unless Serials}}{{else}} {{/unless}}\n \t\t\n \n {{#if_eq QuantityOrdered \"5\"}}{{else}}{{/if_eq}}\n \n \t\t\n \t\t\n \n \t\t{{#if TaxAViz}}{{else}} {{/if}}\n \t\t{{#if TaxBViz}}{{else}} {{/if}}\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \n\t\t
{{ ayLogo \"small\" }}Our Internal PO#:{{Serial}}Addt'l Ref #: {{ReferenceNumber}}
data from ayReportData shows in greenfont Ordered Date: {{ayDate OrderedDate}}
data derived from Prepare shows in bluefontETA Date: {{ayDate ExpectedReceiveDate}}{{ayDate ExpectedReceiveDate}}
data derived from Helper shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
VENDOR:DELIVER TO:
{{VendorViz}}{{DropShipToCustomerViz}}My Company Name
unsure where to get vendor contact information customer contact data unknown how to get123 - 123 MyStreetname Ave My City, My State, My Postal
vendor contact not part of datasetcustomer contact data unknown how to getOrdered By: creator Phone: creatorphone
 
Part # & Name:Serials Received:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}} {{PartNameViz}}no serials listed{{Serials}}LOTS{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Net Total:{{ ayCurrency ThisPONet }}
 Tax A Total:{{ ayCurrency ThisPOTaxA }}0.00
Direct all inquiries to My Company 1-888-555-5555Tax B Total:{{ ayCurrency ThisPOTaxB }}0.00
Approval for off-specification goods must be obtained via a new purchase orderPO Total:{{ ayCurrency ThisPODollarAmount }}
\n {{/each}}\n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 12pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 14pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 14pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom always BUT then leftlean and rightlean don't work AND tbody overwrites */\n font-size: 12pt; \n bottom: 0;\n width: 90%;\n border-top: 1px solid black;\n}\n\n.fontsmall {\n font-size: 8px;\n}\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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 //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarAmount = 0; //Declare a temporary variable to hold the running total of all POs in this list\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the AllPODollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0; //Declare a temporary variable to hold the running total of THIS PO\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount; // Use ThisPODoallarAmount to display the running Total for THIS PO\n }\n //Add the AllPODollarAmount variable to the reportData so it can be accessed in the report template \n reportData.AllPORunningTotal=AllPODollarAmount;\n\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})\nHandlebars.registerHelper('words', function() {\n return \"stuff and text\"\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});\n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE single line per PO.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE single line per PO.ayrt new file mode 100644 index 00000000..f4c0326c --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE single line per PO.ayrt @@ -0,0 +1 @@ +{"Name":"109x EXAMPLE single line per PO","Active":true,"Notes":"example of custom Prepare - derived running totals for nets, taxes and totals for EACH PO on single line, and running total for all POs Nets, Taxes, Totals at bottom of report","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n\t\t \n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n \n \n {{#each ayReportData}}\n \n \n \n \n {{#if ThisPOTaxA}}{{else}} {{/if}} \n {{#if ThisPOTaxB}}{{else}} {{/if}}\n \n \n \t {{/each}}\n \n
Header on every page
One line of Net totals for each PO in body
Footer of Net totals (derived) on last page only
PO#:PO Net:PO Tax A:PO Tax B:PO Total:
{{Serial}}{{ayCurrency ThisPONet}}{{ayCurrency ThisPOTaxA}}$0.00{{ayCurrency ThisPOTaxB}}$0.00{{ayCurrency ThisPOTotalofLines}}
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
All POs Net:All POs Tax A:All POs Tax B:All POs Total:
{{ ayCurrency AllPONetRunning }}{{ ayCurrency AllPOTaxARunning }}{{ ayCurrency AllPOTaxBRunning }} {{ ayCurrency AllPOTotal }}
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 18pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 14pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 14pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody td {\n width: 20%; /* to space 5 columns evenly */\n}\n\ntfoot {\n /* display: table-footer-group; uncomment to print the table-footer on all pages, not just last page - */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work AND tbody overwrites */\n font-size: 14pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\ntfoot td {\n width: 20%; /* to space 5 columns evenly */\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\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 //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarTotalRunning = 0; //Declare a temporary variable to hold the running total of all POs in this list\n//let ThisPOTotal = 0; //if declare this at this stage will NOT get correct EachPO.ThisPOTotalofLines\n for (EachPO of reportData.ayReportData) \n { \n let ThisPOTotal = 0; \n // need to declared let ThisPOTotal = 0; at this stage so then it will reset ThisPOTotal back to 0 before being able to add to EachPO.POsRunningTotalSoFar\n //BUT OH OH - now the entire AllPOTotal is off hmmmmmmmmmm \n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPOTotal += Item.LineTotalViz;\n }\n Item.ThisPORunningTotal=ThisPOTotal;\n } \n EachPO.ThisPOTotalofLines =ThisPOTotal; \n //add a new key to each record in the reportData object named \"EachPO.POsRunningTotalSoFar\" with the running total so far\n EachPO.POsRunningTotalSoFar=ThisPOTotal; \n\n AllPODollarTotalRunning += ThisPOTotal; \n }\n //set the AllPODollarTotalRunning variable to the reportData so the reportData.AllPOTotal can be accessed in the report template outside of the #each \n //- i.e. in a separate footer that displays once at end of report\n reportData.AllPOTotal=AllPODollarTotalRunning; \n \n\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":"    (from PDF Options) Printed date: ","FooterTemplate":null,"DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt new file mode 100644 index 00000000..8c4c39c3 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt @@ -0,0 +1 @@ +{"Name":"112 EXAMPLE PO Basic with Custom.c1 Shipping charge","Active":true,"Notes":"Example of utilizing a custom field for entering Shipping Charges, and custom Prepare to derive the subtotals and totals including shipping\nHTML If else /if \nMISSING: customer AND vendor contact info & address (not yet exposed in Sample Data)","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \n \n \n\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n \t\t \n \t\t\n \t\t\n \t\t{{#if TaxAViz}}{{else}} {{/if}}\n \t\t{{#if TaxBViz}}{{else}} {{/if}}\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t{{#if CustomFields.c1}}{{else}}{{/if}}\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \n\t\t
{{ ayLogo \"small\" }}Our Internal PO#:{{Serial}}Addt'l Ref #: {{ReferenceNumber}}
data from ayReportData shows in greenfont Ordered Date: {{ayDate OrderedDate}}
data derived from Prepare shows in bluefontETA Date: {{ayDate ExpectedReceiveDate}}{{ayDate ExpectedReceiveDate}}
data derived from Helper shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
VENDOR:DELIVER TO:
{{VendorViz}}{{DropShipToCustomerViz}}My Company Name
unsure where to get vendor contact information customer contact data unknown how to get123 - 123 MyStreetname Ave My City, My State, My Postal
vendor contact not part of datasetcustomer contact data unknown how to getOrdered By: creator Phone: creatorphone
 
Our Part#:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}} {{PartNameViz}}{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Net Total:{{ ayCurrency ThisPONet }}
 Tax A Total:{{ ayCurrency ThisPOTaxA }}0.00
Direct all inquiries to My Company 1-888-555-5555Tax B Total:{{ ayCurrency ThisPOTaxB }}0.00
Approval for off-specification goods must be obtained via a new purchase orderThisPODollarAmountBeforeShip:{{ ayCurrency ThisPODollarAmountBeforeShip }}
This text shows IF THERE IS A Custom Shipping currency amount in CustomFields.c1:This is the text that shows IF NO Custom Shipping Charge currenty amount in CustomFields.c1:{{ ayCurrency CustomFields.c1 }}
ThisPODollarAmountWithShip:{{ ayCurrency ThisPODollarAmountWithShip }}
\n {{/each}}\n\n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 12pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 14pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 14pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work AND tbody overwrites */\n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \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 //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n\n//remove statements not needed, for example ALLPOxxx are not needed\n//let AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n//let AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n//let AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n//let AllPODollarAmountBeforeShip = 0; //Declare a temporary variable to hold the running total of all POs (no shipping) in this list\n//let AllPODollarAmountWithShip = 0; //Declare a temporary variable to hold the running total of all POs with shipping custom amount\n \n\n //Iterate through all the records in the reportData adding the dollar amount of each specified property to the appropriate declared variable\n\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n // AllPONet += ThisPONet; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n // AllPOTaxA += ThisPOTaxA; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n // AllPOTaxB += ThisPOTaxB; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ShipCharge=0; // has to be declared first before below \n if ( EachPO.CustomFields != null && EachPO.CustomFields.c1 != null )// then this - this first checks that CustomFields is NOT null, if so then checks that c1 isNOT null\n {\n const tempc1 = parseFloat(EachPO.CustomFields.c1); // const instead of let because not declaring it more than once per PO\n if ( tempc1 != NaN) // don't check if Null, instead check if NaN because return value for parseFloat is either NaN or the floating point number \n {\n ShipCharge = tempc1; //don't declare, update the existing instead\n }\n \n }\n\n let ThisPODollarAmountBeforeShip = 0; //Declare a temporary variable to hold the running total of THIS PO before adding shipcharge\n let ThisPODollarAmountWithShip = 0; //Declare a temporary variable to hold the running total of THIS PO WITH shipcharge\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmountBeforeShip += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmountBeforeShip;\n ThisPODollarAmountWithShip=ThisPODollarAmountBeforeShip + ShipCharge; // this working when using ShipCharge = 12 for testing, BUT while trying to use CustomFields.c1\n //isn't \"seeing\" CustomFields.c1 or EachPO.CustomFields.c1 value resulting in AllPODollarAmountWithShip showing innvalid number as well as ThisPODollarAmountWithShip not includes the actual shipping$\n }\n \n EachPO.ThisPODollarAmountBeforeShip =ThisPODollarAmountBeforeShip; // \n EachPO.ThisPODollarAmountWithShip = ThisPODollarAmountWithShip; // \n \n \n // AllPODollarAmountBeforeShip += ThisPODollarAmountBeforeShip; //remove statements not needed, for example ALLPOxxx are not needed\n // AllPODollarAmountWithShip += ThisPODollarAmountWithShip; //remove statements not needed, for example ALLPOxxx are not needed\n \n\n\n\n }\n \n // reportData.AllPONetRunning=AllPONet; //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n // reportData.AllPOTaxARunning=AllPOTaxA; //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n // reportData.AllPOTaxBRunning=AllPOTaxB; //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n // reportData.AllPORunningTotalwithoutShip=AllPODollarAmountBeforeShip; \n // reportData.AllPORunningTotalwithShip=AllPODollarAmountWithShip; \n \n\n\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":"    (from PDF Options) Printed date: ","FooterTemplate":null,"DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO Invoice with derived Net and Grand Total.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO Invoice with derived Net and Grand Total.ayrt new file mode 100644 index 00000000..9098de4e --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO Invoice with derived Net and Grand Total.ayrt @@ -0,0 +1 @@ +{"Name":"112 EXAMPLE WO Invoice with derived Net and Grand Total","Active":true,"Notes":"Example of how to show Signature and date signed and printed name. PDF options header & footer example; Header for each WO spans multiple pages if WO multi-paged; Footer once per WO regardless number of pages\nPrepare functions to derive nets and grand totals; #IF helper in HTML to only show the child section IF true; Helper example: custom todaysMonthDDYYYYDate and custom myDate\nCSS example: tbody tr:nth-child for row striped;\n","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\n\t\t\t\t{{#each Items}} \n {{#each Expenses}}\n {{#if ChargeToCustomer}}\t\t\t\n \t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t \n {{else}} {{/if}}\n {{/each}}\n {{#each Loans}}\n \t\t\t\t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Labors}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Parts}}\n \t\t\t\t\n \n \n \n \n {{#if TaxPartSaleId}}{{else}} {{/if}}\n {{#if TaxPartSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Travels}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each OutsideServices}}\n \t\t\t\t\n \n \n {{#if TaxCodeId}}{{else}} {{/if}}\n {{#if TaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n\t\t\t \t{{/each}}\n\t\t\t \n
{{ ayLogo \"small\" }}Internal WO#:{{Serial}}
data from ayReportData shows in greenfont Service Date from WO: {{myDate ServiceDate}}
data derived from Helper or Prepare shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
Service performed for: {{CustomerViz}}
Physical Address where service performed:Postal Address where invoice sent to:
{{Address}}, {{City}}{{PostAddress}}, {{PostCity}}
 
Item:QtyPrice Per:Net:Tax A:Tax B:Line Total:
Expense: {{Name}}{{ayCurrency ChargeAmount}}{{ayCurrency TaxAViz}}{{TaxPaid}}{{ayCurrency TaxBViz}} {{ayCurrency LineTotalViz}}
custom expenses for {{Name}} NOT charged to customer
Loaner: {{LoanUnitViz}} / {{UnitOfMeasureViz}} {{Quantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Service performed at {{ayDateTime ServiceStartDate}} with Service Rate of {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Part: {{PartViz}}{{Quantity}}{{ayCurrency ListPrice}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Travel performed on {{ayDate TravelStartDate}} with Travel rate of {{TravelRateViz}}{{TravelRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Outside Service performed on Unit: {{UnitViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n {{#if CustomerSignature}}{{else}} {{/if}}\n \n {{#if CustomerSignatureCaptured}} {{else}} {{/if}} \n \n {{#if CustomerSignatureName}}{{else}} {{/if}} \n\t\t\t\t \n \n\t\t\t\t\n\t\t\t\t \n \n \n
Net LaborNet TravelNet PartsNet ExpensesNet LoansNet OutsideTotal NetsTotal Tax ATotal Tax BWO Total
{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllTravelsNetViz}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOAllExpsNetChargeAmount}}{{ayCurrency ThisWOAllLoansNetViz}}{{ayCurrency ThisWOAllOutsidesNetViz}}{{ayCurrency ThisWOTotalNets}}{{ayCurrency ThisWOTotalTaxAs}}{{ayCurrency ThisWOTotalTaxBs}}{{ayCurrency ThisWOTotalGrand}}
 
 
I acknowledge the satisfactory provision and completion of the above for internal workorder #{{Serial}}:
 
 
Customer Signature: ___________________________________________Signature Date:_{{ayDateTime CustomerSignatureCaptured}}_________________________________Print of Name:_{{CustomerSignatureName}}_ ______________________________
 
\n {{/each}}\n\t
\n\n\n","Style":"/* if not using a rule set or specific property it is recommended to comment out or delete fully for report performance*/\n\n.singlePage /* so that page always breaks after footer */\n{\npage-break-after: always;\n} \n\ntable { \n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n page-break-inside: avoid; \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n /* NOTE if this IS here but NOT displaying on subsequent pages (i.e. page 2 of a wo), you NEED to edit your thead so it is NO MORE than approx 20% of the page */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 10pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 8pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 8pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group;\n page-break-inside: avoid; \n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"Handlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format EXAMPLE SHOW: June 9, 2021\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n\n","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":"  this is set in PDF Options  Note this is all pages of report  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line PROFIT_LOSS on net parts labors.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line PROFIT_LOSS on net parts labors.ayrt new file mode 100644 index 00000000..9ab88f9b --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line PROFIT_LOSS on net parts labors.ayrt @@ -0,0 +1 @@ +{"Name":"112 EXAMPLE WO single line PROFIT/LOSS on net parts labors","Active":true,"Notes":"Example single line per WO showing net labor charges and costs and its profit/loss; net parts charges and costs and its profit/loss; and derived WO profit/loss (via Prepare)\nTotalling up all wo's net labor charges and costs and profit/loss, all wo's net parts charges and costs and profit/loss, and derived all wos total profit/loss\nPDF Options example header & footer; CSS tbody tr:nth-child striped rows","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n

Nets for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t \n {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllLaborsCost }} {{else}} {{/if}} \n \n {{#if ThisWOAllLaborsLoss }} {{else}} {{/if}}\n \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsCost }} {{else}} {{/if}} \n \n {{#if ThisWOAllPartsLoss }} {{else}} {{/if}}\n \n \n {{#if ThisWOTotalLoss }} {{else}} {{/if}}\n \n {{/each}}\n \n \n
WO#:Customer:Service Date:ThisWOAllLaborsNetViz:ThisWOAllLaborsCost:ThisWOAllLaborsProfit:ThisWOAllPartsNetViz:ThisWOAllPartsCost:ThisWOAllPartsProfit:ThisWOTotalProfit:
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable labor{{ayCurrency ThisWOAllLaborsCost}}no labor costs({{ayCurrency ThisWOAllLaborsLoss}}){{ayCurrency ThisWOAllLaborsProfit}}{{ayCurrency ThisWOAllPartsNetViz}}no billable parts{{ayCurrency ThisWOAllPartsCost}}no parts costs({{ayCurrency ThisWOAllPartsLoss}}){{ayCurrency ThisWOAllPartsProfit}}({{ayCurrency ThisWOTotalLoss}}){{ayCurrency ThisWOTotalProfit}}
\n\n \n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n \n\n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOLaborsCost}} {{else}} {{/if}}\n \n {{#if AllWOLaborsLoss}} {{else}} {{/if}}\n\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsCost}} {{else}} {{/if}}\n \n {{#if AllWOPartsLoss}} {{else}} {{/if}}\n\n \n {{#if AllWOTotalLoss}} {{else}} {{/if}} \n \n \n
Totals for all listed workorders AllWOLaborsNetVizAllWOLaborsCost AllWOLaborsProfitAllWOPartsNetVizAllWOPartsCostAllWOPartsProfitAllWOTotalProfit
{{ ayCurrency AllWOLaborsNetViz}}no billable labor{{ ayCurrency AllWOLaborsCost}}no labor costs({{ ayCurrency AllWOLaborsLoss}}) {{ ayCurrency AllWOLaborsProfit }}{{ ayCurrency AllWOPartsNetViz}}no billable parts{{ ayCurrency AllWOPartsCost}}no parts cost({{ ayCurrency AllWOPartsLoss}}) {{ ayCurrency AllWOPartsProfit }}({{ ayCurrency AllWOTotalLoss}}){{ ayCurrency AllWOTotalProfit}}
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 5pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 9pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 7pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 7pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n\ntfoot {\n border-top: 2px solid black;\n}\n\n\n.fontblue {\n color: blue;\n}\n.fontpurple {\n color: purple;\n}\n\n.fontgreen {\n color: green;\n}\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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs),from all workorders so it exists and a key to hold all Labor Net Costs\nreportData.AllWOLaborsNetViz = 0;\nreportData.AllWOLaborsCost = 0;\nreportData.AllWOLaborsProfit = 0;\nreportData.AllWOLaborsLoss = 0;\n\n\n//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all workorders so it exists and a key to hold all Part Net Costs\nreportData.AllWOPartsNetViz = 0;\nreportData.AllWOPartsCost = 0;\nreportData.AllWOPartsProfit = 0;\nreportData.AllWOPartsLoss = 0;\n\n\n//below declares a key to hold all Nets, hold all Costs, profit/loss (nets - costs), from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\nreportData.AllWOTotalCost = 0;\nreportData.AllWOTotalProfit = 0;\nreportData.AllWOTotalLoss = 0;\n\n\n\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor nets, costs, profit/loss (nets - costs) from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\tEachWO.ThisWOAllLaborsCost = 0;\n\tEachWO.ThisWOAllLaborsProfit = 0;\n\tEachWO.ThisWOAllLaborsLoss = 0;\n\n\t//below declares a key on the entire wo to hold all Part Net, costs, profit/loss (nets - costs), from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\tEachWO.ThisWOAllPartsCost = 0;\n\tEachWO.ThisWOAllPartsProfit = 0; \n\tEachWO.ThisWOAllPartsLoss = 0; \n\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets , costs, profit/loss (nets - costs) so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\tEachWO.ThisWOTotalCost = 0;\n\tEachWO.ThisWOTotalProfit = 0;\n\tEachWO.ThisWOTotalLoss = 0;\n\t\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\tItem.ThisItemAllLaborsCost = 0; //declare a key on the Item to hold all of this item's labor costs and set it initially to 0\n\t\t\tItem.ThisItemAllLaborsProfit = 0; //declare a key on the Item to hold all of this item's labor profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\n\n\t\t\t\t\t\tLabor.NetCost = (Labor.CostViz * Labor.ServiceRateQuantity);\n\t\t\t\t\t\tItem.ThisItemAllLaborsCost += Labor.NetCost; //this IS where the actual adding to running total for this WOItem's Labors Cost\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsCost += Labor.NetCost; //this IS where the actual adding to the running total for this entire WO's Labors costs\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Labor.NetCost; //this IS where the actual adding to the running total for ALL costs for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLaborsCost += Labor.NetCost;\t//this IS where the actual adding to the running total for all labor costs for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalCost += Labor.NetCost; //this is where the actual adding to the running total for ALL workorders costs in this report data\n\n\t\t\t\t\t\tif (Labor.NetCost != null) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\tLabor.NetProfit = (Labor.NetViz - Labor.NetCost)\n\t\t\t\t\t\tItem.ThisItemAllLaborsProfit += Labor.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOLaborsProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Labor.NetProfit; //this works\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\tItem.ThisItemAllPartsCost = 0; //declare a key on the Item to hold all of this item's parts costs and set it initially to 0 \n\t\t\tItem.ThisItemAllPartsProfit = 0; //declare a key on the Item to hold all of this item's part profit/loss (nets - costs) and set it initially to 0 \n\t\t\t\n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n\t\t\t\t\t\tPart.NetCost = (Part.Cost * Part.Quantity);\t\t\t\t\t\t\n\t\t\t\t\t\tItem.ThisItemAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOAllPartsCost += Part.NetCost;\n\t\t\t\t\t\tEachWO.ThisWOTotalCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOPartsCost += Part.NetCost;\n\t\t\t\t\t\treportData.AllWOTotalCost += Part.NetCost;\n\n\t\t\t\t\t\tif (Part.NetViz != null) \n\t\t\t\t\t\t{\n\t\t\t\t\t\tPart.NetProfit = (Part.NetViz - Part.Cost)\n\t\t\t\t\t\tItem.ThisItemAllPartsProfit += Part.NetProfit; //this NOT USED \n\t\t\t\t\t\tEachWO.ThisWOAllPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\tEachWO.ThisWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOPartsProfit += Part.NetProfit; //this works\n\t\t\t\t\t\treportData.AllWOTotalProfit += Part.NetProfit; //this works\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t\n\t\t}\n\n\n\t\tif (EachWO.ThisWOAllLaborsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllLaborsLoss = EachWO.ThisWOAllLaborsProfit;\n\t\t\t\tEachWO.ThisWOAllLaborsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOAllPartsProfit <= 0) {\n\t\t\t\tEachWO.ThisWOAllPartsLoss = EachWO.ThisWOAllPartsProfit;\n\t\t\t\tEachWO.ThisWOAllPartsProfit = 0;\n\t\t\t}\n\n\t\tif (EachWO.ThisWOTotalProfit <= 0) {\n\t\t\t\tEachWO.ThisWOTotalLoss = EachWO.ThisWOTotalProfit;\n\t\t\t\tEachWO.ThisWOTotalProfit = 0;\n\t\t\t}\n\n\t}\n\n\nif (reportData.AllWOLaborsProfit <= 0) {\n\t\treportData.AllWOLaborsLoss = reportData.AllWOLaborsProfit;\n\t\treportData.AllWOLaborsProfit = 0;\n\t}\n\nif (reportData.AllWOPartsProfit <= 0) {\n\t\treportData.AllWOPartsProfit = reportData.AllWOPartsProfit;\n\t\treportData.AllWOPartsProfit = 0;\n\t}\n\nif (reportData.AllWOTotalProfit <= 0) {\n\t\treportData.AllWOTotalLoss = reportData.AllWOTotalProfit;\n\t\treportData.AllWOTotalProfit = 0;\n\t}\t\n\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets NO TAXES .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets NO TAXES .ayrt new file mode 100644 index 00000000..6a8b9186 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets NO TAXES .ayrt @@ -0,0 +1 @@ +{"Name":"112 EXAMPLE WO single line per wo Nets NO TAXES ","Active":true,"Notes":"Example of single line per WO of net labors, parts, travel, exps, loans, outsides, and before tax total with corresponding Prepare functions to obtain.\nWith Grand Totals at bottom of ALL listed wo's net labors, parts, travel, exps, loans, outsides, and total of before tax totals with corresponding Prepare functions to obtain.\nPDF options header & footer example; CSS tbody tr:nth-child striped table rows","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n

Nets for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n \n {{/each}}\n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{else}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNets
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loan in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder
Totals for all workorders in this report{{ ayCurrency AllWOLaborsNetViz }}$0.00{{ ayCurrency AllWOPartsNetViz }}$0.00{{ ayCurrency AllWOTravelsNetViz }}$0.00{{ ayCurrency AllWOExpsNetChargeAmount }}$0.00{{ ayCurrency AllWOLoansNetViz }}$0.00{{ ayCurrency AllWOOutsidesNetViz }}$0.00{{ ayCurrency AllWOTotalNets }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets Taxes Totals.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets Taxes Totals.ayrt new file mode 100644 index 00000000..98ff03a6 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE WO single line per wo Nets Taxes Totals.ayrt @@ -0,0 +1 @@ +{"Name":"112 EXAMPLE WO single line per wo Nets Taxes Totals","Active":true,"Notes":"Example of single line per WO of net labors, parts, travel, exps, loans, outsides, before tax net totals, taxas, taxbs, and that WO's all totaled with corresponding Prepare functions to obtain.\nWith Grand Totals at bottom of ALL listed wo's net labors, parts, travel, exps, loans, outsides, before tax net totals, taxas, taxbs, all WOs totals with corresponding Prepare functions to obtain.\nPDF options header & footer example; CSS tbody tr:nth-child striped table rows","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n

Nets Taxes and Totals for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxAs }} {{else}} {{/if}} \n {{#if ThisWOTotalTaxBs }} {{else}} {{/if}} \n {{#if ThisWOTotalGrand }} {{else}} {{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{else}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n {{#if AllWOTotalTaxAs}} {{else}} {{/if}}\n {{#if AllWOTotalTaxBs }} {{else}} {{/if}}\n {{#if AllWOTotalGrand}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNetsThisWO AllTaxA:ThisWO AllTaxB:ThisWO GrandTotal:
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loans in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder{{ayCurrency ThisWOTotalTaxAs}}no Tax A in this workorder{{ayCurrency ThisWOTotalTaxBs}}no Tax B charges in this workorder{{ayCurrency ThisWOTotalGrand}}no charges in this workorder
Totals for all workorders in this reportAll Labor NetAll Parts NetAll Travel NetAll Exp NetAll Loan NetAll Outside NetAll NetsAll Tax AAll Tax BAll Grand Total
{{ ayCurrency AllWOLaborsNetViz }}$0.00{{ ayCurrency AllWOPartsNetViz }}$0.00{{ ayCurrency AllWOTravelsNetViz }}$0.00{{ ayCurrency AllWOExpsNetChargeAmount }}$0.00{{ ayCurrency AllWOLoansNetViz }}$0.00{{ ayCurrency AllWOOutsidesNetViz }}$0.00{{ ayCurrency AllWOTotalNets }}$0.00{{ ayCurrency AllWOTotalTaxAs }}$0.00{{ ayCurrency AllWOTotalTaxBs }}$0.00{{ ayCurrency AllWOTotalGrand }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 unfinished WO Dispatch example.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 unfinished WO Dispatch example.ayrt new file mode 100644 index 00000000..9e184308 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/112 unfinished WO Dispatch example.ayrt @@ -0,0 +1 @@ +{"Name":"112 unfinished WO Dispatch example","Active":true,"Notes":"#if_eq example custom Helper - if status is Completed show checkmark in checkbox\nHTML if examples - if part has serial numbers then show partviz + serials, else show only part\nREQUIRES ADDITIONAL EDITING - each workorder item to a single page, room for manual entry, ","Roles":124927,"AType":34,"IncludeWoItemDescendants":false,"Template":"\n\t\n\t\t
\t\n\n\t\t\n \t\n\t\t{{#each ayReportData}}\t \n\t\t \t\n \t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \t\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \t \n \t\t\n \n \t\t\n\t\t\t\t{{#each Items}}\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t \t\n \t\t\n\n\t\t\t\t\t{{#each Units}}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \t\n \t\t\t\n \t\t\t{{/each}}\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \t\t\n \t\t\t\n \t\t\t{{#each ScheduledUsers}}\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \t\t\t{{/each}}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t{{#each Tasks}}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{#if_eq Status 2}}{{else}}{{/if_eq}} \t\n\t\t\t\t\t\t\t\t\n \t\t\t\n \t\t\t{{/each}}\n\n\t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n \t\t\t\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t{{#each Parts}}\n \t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t{{#if Serials}} {{else}}\t {{/if}}\n \t\t\t\n \t\t\t{{/each}} \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t{{/each}} \n\t\t\t \n\n\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t{{#if TechSignature}} {{else}} {{/if}}\n\t\t\t\t\t \n\t\t\t\t\t{{#if CustomerSignature}} {{else}} {{/if}}\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t{{#if TechSignatureCaptured}} {{else}} {{/if}} \n\t\t\t\t\t \n\t\t\t\t\t{{#if CustomerSignatureCaptured}} {{else}} {{/if}} \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n \t\n
{{ ayLogo \"small\" }}Internal WO#:{{Serial}}
Service To Be Completed By:{{ayDateTime CompleteByDate}}
 
Customer: {{CustomerViz}}{{Address}}, {{City}} PHONE ETC NOT YET EXPOSED IN SAMPLE DATA
 
Summary of work: {{Notes}}
Scheduleable User Notes:PROPERTY FOR Scheduleable User Notes NOT YET EXPOSED IN SAMPLE DATA??
 
TechNotes for this work item: {{TechNotes}}
Unit to be serviced in this work item: {{UnitViz}}
 
Scheduled:Actual:
Tech: {{UserViz}}
 Expected Start: {{ayDateTime StartDate}}Actual Start:
 Expected Stop: {{ayDateTime StopDate}}Actual Stop:
 Expected Rate: {{ServiceRateViz}}Actual Rate:
 Expected Qty: {{EstimatedQuantity}}Actual Qty:
 
Task Status:TickBox:Task:
{{StatusViz}} {{Task}}
 
Need to add to wo?QtyWarehouse Part:
 {{Quantity}}{{PartWarehouseViz}}{{PartViz}}    Serial#: {{Serials}} {{PartViz}}
 
Additional Details of service:
 
 
 
 
Tech Signature: {{TechSignature}} ________________________________________Client Signature: {{CustomerSignature}} __________________________________________
 
 
Date: {{TechSignatureCaptured}} ________________________________________Date: {{CustomerSignatureCaptured}} __________________________________________
 
\n\n {{/each}}\n\n\n\t\t
\n\t\n","Style":"/* if not using a rule set or specific property it is recommended to comment out or delete fully for report performance*/\n\n.singlePage\n{\npage-break-after: always;\n}\n\ntable { \n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n /* NOTE if this IS here in your CSS but your thead contents are NOT displaying on subsequent pages (i.e. page 2 of a wo), you NEED to edit your thead so it is NO MORE than approx 20% of the page */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 10pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; \n page-break-inside: avoid; \n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \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 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})\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});\n","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":"  this is set in PDF Options  Note this is all pages of report  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE API use and meta data.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE API use and meta data.ayrt deleted file mode 100644 index 9a57451e..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE API use and meta data.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE API use and meta data","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: Meta data and API usage

\n\t

See help documentation for details

\n\t\n\t
\n\t\t

ayServerMetaData

\n\t\t{{ ayJSON ayServerMetaData }}\n\t
\n\n\t
\n\t\t

ayClientMetaData

\n\t\t{{ ayJSON ayClientMetaData }}\n\t
\n\n\t
\n\t\t

ayReportMetaData

\n\t\t{{ ayJSON ayReportMetaData }}\n\t
\n\n\n\t
\n\t\t

myData

\n\t\t
(Fetched dynamically from API route enum-list/list/AyaType)
\n\t\t{{ ayJSON myData }}\n\t
\n\n\t
\n\t\t

ayReportData

\n\t\t{{#each ayReportData}}\n\t\t

{{ Name }}

\n\t\t
Notes: {{ Notes }}
\n\t\t{{/each}}\n\t
\n\n\n","Style":".example {\n color: blue;\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\n //Example of using API GET method to fetch data from API server and make it available to the report template\n\n //Put the data into the main report data object so it's available to the template\n reportData.myData={ServerInfo:await ayGetFromAPI(\"server-info\")};\n\n //Example API POST method to fetch data from api server\n let searchPostData={phrase: \"Fresh\"};\n reportData.myData.SearchResults=await ayPostToAPI(\"search\", searchPostData);\n\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Bar code helper.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Bar code helper.ayrt deleted file mode 100644 index 62041364..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Bar code helper.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE Bar code helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: Bar code helper

\n\t

See Report editor help documentation for details

\n\n\t{{#each ayReportData}}\n\t

{{ Name }}

\n\t
\n\t\tSerial as \"CODE-128\" BarCode:
\n\t\t{{ ayBC Serial '{ \"bcid\": \"code128\",\"includetext\":true, \"scale\":1}' }}\n\t
\n\t
\n\t
\n\t\tSerial as \"QR\" Code:
\n\t\t{{ ayBC Serial '{ \"bcid\": \"qrcode\",\"includetext\":true, \"scale\":3}' }}\n\t
\n\t
\n\t
\n\t\tSample \"UPC-A\" Code (Serial wouldn't be a valid UPC code so hard coded here):
\n\t\t{{ ayBC \"712345678904\" '{ \"bcid\": \"upca\",\"includetext\":true, \"scale\":1}' }}\n\t
\n\t
\n\t
\n\t
\n\t{{/each}}\n\n\n","Style":".example {\n color: blue;\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Custom date time format helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Custom date time format helpers.ayrt deleted file mode 100644 index f2b07ed3..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Custom date time format helpers.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE Custom date time format helpers","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: custom formatted date time helpers

\n\t{{#each ayReportData}}\n\t

{{ Name }}

\n\t

Below are all the StartDate in various formats:

\n\t

Raw UTC / GMT AyaNova stored value from server

\n\t{{ StartDate }}
\n\t

Built in helpers

\n\tayDateTime helper: {{ ayDateTime StartDate}}
\n\tayDate helper: {{ ayDate StartDate}}
\n\tayTime helper: {{ ayTime StartDate}}
\n\t

Custom helpers in this report template

\n\tmyDateTime custom helper: {{ myDateTime StartDate}}
\n\tmyDate custom helper: {{ myDate StartDate}}
\n\tmyTime custom helper: {{ myTime StartDate}}
\t\n\tmyDateTimeAustralia custom helper: {{ myDateTimeAustralia StartDate}}
\n\tmyDateTimeArabic custom helper: {{ myDateTimeArabic StartDate}}
\n\tmyDateTimeFromParts custom helper: {{ myDateTimeFromParts StartDate}}
\n\t\n\t{{/each}}\n\n\n","Style":"","JsPrerender":"","JsHelpers":"/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE AND TIME HELPER\n//\nHandlebars.registerHelper('myDateTime', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date \n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\n return parsedDate.toLocaleString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\",\n timeStyle: \"long\",\n hour12: AYMETA.ayClientMetaData.Hour12 //Use User setting for 12/24 hour clock\n }\n );\n});\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM TIME HELPER\n//\nHandlebars.registerHelper('myTime', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleTimeString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\n return parsedDate.toLocaleTimeString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone \n timeStyle: \"long\",\n hour12: AYMETA.ayClientMetaData.Hour12 //Use User setting for 12/24 hour clock\n }\n );\n});\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE AND TIME HELPER WITH AUSTRALIAN OPTIONS\n//\nHandlebars.registerHelper('myDateTimeAustralia', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString \n return parsedDate.toLocaleString(\n \"en-au\",//use English-Australia locale (Day / Month / Year is Australia default format)\n {\n timeZone: \"Australia/Sydney\",//use forced time zone, see \"tz database\" column for name in list here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n dateStyle: \"short\",\n timeStyle: \"long\"\n }\n );\n});\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE AND TIME HELPER WITH Arabic OPTIONS\n//\nHandlebars.registerHelper('myDateTimeArabic', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleString method to format the date and time\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString \n return parsedDate.toLocaleString(\n \"ar-EG\",//use Arabic locale \n {\n timeZone: \"Asia/Dubai\",//use forced time zone, see \"tz database\" column for name in list here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n dateStyle: \"short\",\n timeStyle: \"long\"\n }\n );\n});\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM FORMAT TO PARTS HELPER\n// this offers the most control over the return format\n// Locale aware conversion to parts that can be returned in any format\n//\nHandlebars.registerHelper('myDateTimeFromParts', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Set formatter options\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts\n let formatter = new Intl.DateTimeFormat('en-us', {\n weekday: 'long',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n hour12: true,\n timeZone: 'UTC'\n });\n\n let parts = formatter.formatToParts(parsedDate);\n /*\n // parts example return value: \n [ \n { type: 'weekday', value: 'Monday' }, \n { type: 'literal', value: ', ' }, \n { type: 'month', value: '12' }, \n { type: 'literal', value: '/' }, \n { type: 'day', value: '17' }, \n { type: 'literal', value: '/' }, \n { type: 'year', value: '2012' }, \n { type: 'literal', value: ', ' }, \n { type: 'hour', value: '3' }, \n { type: 'literal', value: ':' }, \n { type: 'minute', value: '00' }, \n { type: 'literal', value: ':' }, \n { type: 'second', value: '42' }, \n { type: 'fractionalSecond', value: '000' },\n { type: 'literal', value: ' ' }, \n { type: 'dayPeriod', value: 'AM' } \n ]\n */\n\n let partWeekDay = parts.find(({ type }) => type === 'weekday').value;\n let partDay = parts.find(({ type }) => type === 'day').value;\n let partYear = parts.find(({ type }) => type === 'year').value;\n \n //return in some custom format\n return `DAY:${partWeekDay}-${partDay} YEAR: ${partYear}`;\n //return this instead to see the actual return array\n //return JSON.stringify(parts);\n});","RenderType":0} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Logo helper.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Logo helper.ayrt deleted file mode 100644 index 23c2a2ac..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Logo helper.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE Logo helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: LOGO

\n\t

See Report editor help documentation for details

\n\t

Note: you must upload a logo via the Global Settings form in order to see them here

\n\n\t

Small logo

\n\t{{ ayLogo \"small\" }}\n\n\t

Medium logo

\n\t{{ ayLogo \"medium\" }}\n\n\t

Large logo

\n\t{{ ayLogo \"large\" }}\n\n\n\t{{#each ayReportData}}\n\t

{{ Name }}

\n\t
Notes: {{ Notes }}
\n\t{{/each}}\n\n\n","Style":".example {\n color: blue;\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE PDF Options page number.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE PDF Options page number.ayrt deleted file mode 100644 index 754f66fd..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE PDF Options page number.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE PDF Options page number","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t{{#each ayReportData}}\n\t

{{ Name }}

\n\t
Notes: {{ Notes }}
\n\t{{/each}}\n\n\n","Style":"","JsPrerender":"","JsHelpers":"","RenderType":0,"HeaderTemplate":"  Header: Page  of ","FooterTemplate":"  Footer: Page  of ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"40px","MarginOptionsLeft":"40px","MarginOptionsRight":"40px","MarginOptionsTop":"40px","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Translation helper.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Translation helper.ayrt deleted file mode 100644 index ddc8b880..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE Translation helper.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE Translation helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\n\t

Example: Translation helper

\n\t

See Report editor help documentation for details

\n\n\t
\n\t\t

ayReportData

\n\t\t{{#each ayReportData}}\n\t\t

{{ayT 'WidgetName' }}: {{ Name }}

\n\t\t
{{ayT 'WidgetSerial' }}:{{ Serial }}
\n\t\t
{{ayT 'WidgetDollarAmount' }}:{{ DollarAmount }}
\n\t\t
{{ayT 'WidgetStartDate' }}:{{ StartDate }}
\n\t\t
{{ayT 'WidgetNotes' }}:{{ Notes }}
\n\t\t{{/each}}\n\t
\n\n\n","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Fetch translation keys required for report \n //Server will get the translations that match the current logged in user's language\n //Only translation keys pre-fetched here will be available for use with the ayT translation helper\n\n //NOTE: you *must* await the call to ayGetTranslations or they will not be present for the report template use\n\n await ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WIKI helper.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WIKI helper.ayrt deleted file mode 100644 index 243f09ab..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WIKI helper.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE WIKI helper","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: WIKI / markdown field usage

\n\t

See help documentation for details

\n\n\t{{#each ayReportData}}\n\t

Object name:

\n\t{{ Name }}\n\t

Object WIKI:

\n\t{{ ayWiki Wiki }}\n\t{{/each}}\n\n\n","Style":"","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\n","RenderType":0} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt deleted file mode 100644 index 0e8f6723..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO Invoice with derived Net and Grand Total.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE WO Invoice with derived Net and Grand Total","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\n\t\t\t\t{{#each Items}} \n {{#each Expenses}}\n {{#if ChargeToCustomer}}\t\t\t\n \t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t \n {{else}} {{/if}}\n {{/each}}\n {{#each Loans}}\n \t\t\t\t\n \n \n \n \n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n {{#if ChargeTaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Labors}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Parts}}\n \t\t\t\t\n \n \n \n \n {{#if TaxPartSaleId}}{{else}} {{/if}}\n {{#if TaxPartSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each Travels}}\n \t\t\t\t\n \n \n \n \n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n {{#if TaxCodeSaleId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n {{#each OutsideServices}}\n \t\t\t\t\n \n \n {{#if TaxCodeId}}{{else}} {{/if}}\n {{#if TaxCodeId}}{{else}} {{/if}}\n \t\t\n \n {{/each}}\n\t\t\t \t{{/each}}\n\t\t\t \n
{{ ayLogo \"small\" }}Internal WO#:{{Serial}}
data from ayReportData shows in greenfont Service Date from WO: {{myDate ServiceDate}}
data derived from Helper or Prepare shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
Service performed for: {{CustomerViz}}
Physical Address where service performed:Postal Address where invoice sent to:
{{Address}}, {{City}}{{PostAddress}}, {{PostCity}}
 
Item:QtyPrice Per:Net:Tax A:Tax B:Line Total:
Expense: {{Name}}{{ayCurrency ChargeAmount}}{{ayCurrency TaxAViz}}{{TaxPaid}}{{ayCurrency TaxBViz}} {{ayCurrency LineTotalViz}}
custom expenses for {{Name}} NOT charged to customer
Loaner: {{LoanUnitViz}} / {{UnitOfMeasureViz}} {{Quantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Service performed at {{ayDateTime ServiceStartDate}} with Service Rate of {{ServiceRateViz}}{{ServiceRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Part: {{PartViz}}{{Quantity}}{{ayCurrency ListPrice}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Travel performed on {{ayDate TravelStartDate}} with Travel rate of {{TravelRateViz}}{{TravelRateQuantity}}{{ayCurrency ListPriceViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
Outside Service performed on Unit: {{UnitViz}}{{ayCurrency NetViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\t\n\t\t\t\t \n \n
Net LaborNet TravelNet PartsNet ExpensesNet LoansNet OutsideTotal NetsTotal Tax ATotal Tax BWO Total
{{ayCurrency ThisWOAllLaborsNetViz}}{{ayCurrency ThisWOAllTravelsNetViz}}{{ayCurrency ThisWOAllPartsNetViz}}{{ayCurrency ThisWOAllExpsNetChargeAmount}}{{ayCurrency ThisWOAllLoansNetViz}}{{ayCurrency ThisWOAllOutsidesNetViz}}{{ayCurrency ThisWOTotalNets}}{{ayCurrency ThisWOTotalTaxAs}}{{ayCurrency ThisWOTotalTaxBs}}{{ayCurrency ThisWOTotalGrand}}
 
\n {{/each}}\n\t
\n\n\n","Style":"/* if not using a rule set or specific property it is recommended to comment out or delete fully for report performance*/\n\n.singlePage\n{\npage-break-after: always;\n}\n\ntable { \n table-layout: fixed; //setting this to fixed causes columns to be evenly spaced for the entire table regardless of cell content, and then colspan then \"works\" as expected\n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n /* NOTE if this IS here but NOT displaying on subsequent pages (i.e. page 2 of a wo), you NEED to edit your thead so it is NO MORE than approx 20% of the page */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 10pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 8pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 8pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n/* display: table-footer-group; uncomment this if want footer to repeat on every page of a mulit-page report for a single wo AND your tfoot is within the same table as your thead and tbody */\n page-break-inside: avoid; \n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\n return reportData;\n}","JsHelpers":"Handlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format EXAMPLE SHOW: June 9, 2021\n\n/////////////////////////////////////////////////////////////////\n//\n// CUSTOM DATE HELPER\n//\nHandlebars.registerHelper('myDate', function (value) {\n if (!value) {\n return \"\";\n }\n\n //parse the date\n let parsedDate = new Date(value);\n\n //is it a valid date?\n if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {\n return \"not valid\";\n }\n\n //Use built in toLocaleDateString method to format the date\n //there are many options that change the displayed format documented here\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString\n return parsedDate.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n );\n});\n\n","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":"  this is set in PDF Options  Note this is all pages of report  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt deleted file mode 100644 index 903a7a70..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets NO TAXES .ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE WO single line per wo Nets NO TAXES ","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t \n

Nets for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n \n {{/each}}\n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNets
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loan in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder
Totals for all workorders in this report {{ ayCurrency AllWOLaborsNetViz }}$0.00 {{ ayCurrency AllWOPartsNetViz }}$0.00 {{ ayCurrency AllWOTravelsNetViz }}$0.00 {{ ayCurrency AllWOExpsNetChargeAmount }} {{else}} $0.00 {{ ayCurrency AllWOLoansNetViz }}$0.00 {{ ayCurrency AllWOOutsidesNetViz }}$0.00 {{ ayCurrency AllWOTotalNets }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt deleted file mode 100644 index 94c5e656..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE WO single line per wo Nets Taxes Totals.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE WO single line per wo Nets Taxes Totals","Active":true,"Notes":"","Roles":124927,"AType":34,"Template":"\n\n\t
\t \n

Nets Taxes and Totals for each WO in report

\n\t\t \n \t\t\n \n \n\t\t\t \n \n \n \n \n \n \n \n \n \n \n \n \n \t \n \n {{#each ayReportData}}\n \n \n\t\t\t \n {{#if ServiceDate }}{{else}} {{/if}}\n\t\t\t {{#if ThisWOAllLaborsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllPartsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllTravelsNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllExpsNetChargeAmount }} {{else}} {{/if}} \n {{#if ThisWOAllLoansNetViz }} {{else}} {{/if}} \n {{#if ThisWOAllOutsidesNetViz }} {{else}} {{/if}}\n {{#if ThisWOTotalNets }} {{else}} {{/if}}\n {{#if ThisWOTotalTaxAs }} {{else}} {{/if}} \n {{#if ThisWOTotalTaxBs }} {{else}} {{/if}} \n {{#if ThisWOTotalGrand }} {{else}} {{/if}} \n \n {{/each}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllWOLaborsNetViz}} {{else}} {{/if}}\n {{#if AllWOPartsNetViz}} {{else}} {{/if}}\n {{#if AllWOTravelsNetViz}} {{else}} {{/if}}\n {{#if AllWOExpsNetChargeAmount}} {{/if}}\n {{#if AllWOLoansNetViz}} {{else}} {{/if}}\n {{#if AllWOOutsidesNetViz}} {{else}} {{/if}}\n {{#if AllWOTotalNets}} {{else}} {{/if}}\n {{#if AllWOTotalTaxAs}} {{else}} {{/if}}\n {{#if AllWOTotalTaxBs }} {{else}} {{/if}}\n {{#if AllWOTotalGrand}} {{else}} {{/if}}\n \n \n \n\n
WO#:Customer:Service Date:ThisWO AllLabors NetViz:ThisWO AllParts NetViz:ThisWO AllTravels NetViz:ThisWO AllExpsNet ChargeAmount:ThisWO AllLoans NetViz:ThisWO AllOutsides NetViz:ThisWOTotalNetsThisWO AllTaxA: ThisWO AllTaxB: ThisWO GrandTotal:
{{Serial}}{{CustomerViz}}{{ayDate ServiceDate}}no Service Date specified{{ayCurrency ThisWOAllLaborsNetViz}}no billable Labor in this workorder{{ayCurrency ThisWOAllPartsNetViz}}no billable Parts in this workorder{{ayCurrency ThisWOAllTravelsNetViz}}no billable Travel in this workorder{{ayCurrency ThisWOAllExpsNetChargeAmount}}no billable misc expenses in this workorder{{ayCurrency ThisWOAllLoansNetViz}}no billable Loans in this workorder{{ayCurrency ThisWOAllOutsidesNetViz}}no billable Outside Service in this workorder{{ayCurrency ThisWOTotalNets}}no billable charges in this workorder{{ayCurrency ThisWOTotalTaxAs}}no Tax A in this workorder{{ayCurrency ThisWOTotalTaxBs}}no Tax B charges in this workorder{{ayCurrency ThisWOTotalGrand}}no charges in this workorder
Totals for all workorders in this reportAll Labor NetAll Parts NetAll Travel NetAll Exp NetAll Loan NetAll Outside NetAll NetsAll Tax AAll Tax BAll Grand Total
{{ ayCurrency AllWOLaborsNetViz }}$0.00 {{ ayCurrency AllWOPartsNetViz }}$0.00 {{ ayCurrency AllWOTravelsNetViz }}$0.00 {{ ayCurrency AllWOExpsNetChargeAmount }} {{else}} $0.00 {{ ayCurrency AllWOLoansNetViz }}$0.00 {{ ayCurrency AllWOOutsidesNetViz }}$0.00 {{ ayCurrency AllWOTotalNets }}$0.00 {{ ayCurrency AllWOTotalTaxAs }}$0.00 {{ ayCurrency AllWOTotalTaxBs }}$0.00 {{ ayCurrency AllWOTotalGrand }}$0.00
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n width: 100%;\n \n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 11pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n text-align: center;\n} \n\ntbody tr:nth-child(even) {\n font-size: 9pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n.nodata {\n font-size: 7pt;\n}\n\ntfoot {\n border-top: 2px solid black;\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\n//********************//NOTE if you customize this report template and do NOT need a function or key identified below, remove to increase report performance\n\n//below declares a key on the entire wo to hold all Labor Net Viz from all workorders so it exists\nreportData.AllWOLaborsNetViz = 0;\n//below declares a key on the entire wo to hold all Part Net Viz from all workorders so it exists\nreportData.AllWOPartsNetViz = 0;\n//below declares a key on the entire wo to hold all Travel Net Viz from all workorders so it exists\nreportData.AllWOTravelsNetViz = 0;\n//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all workorders so it exists\nreportData.AllWOExpsNetChargeAmount = 0;\n//below declares a key on the entire wo to hold all Loan Net Viz from all workorders so it exists\nreportData.AllWOLoansNetViz = 0;\n//below declares a key on the entire wo to hold all OutsideServices Net Viz from all workorders so it exists\nreportData.AllWOOutsidesNetViz = 0;\n\n//below declares a key to hold all Nets from all workorders in this list so it exists\nreportData.AllWOTotalNets = 0;\n\n//below declares a key to hold all Tax As from all workorders in this list so it exists\nreportData.AllWOTotalTaxAs = 0;\n//below declares a key to hold all Tax Bs from all workorders in this list so it exists\nreportData.AllWOTotalTaxBs = 0;\n//below declares a key to hold all GrandTotal from all workorders in this list so it exists\nreportData.AllWOTotalGrand = 0;\n\n\n\nfor (EachWO of reportData.ayReportData) \n\t{\n\t//below declares a key on the entire wo to hold all Labor Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLaborsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Part Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllPartsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Travel Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllTravelsNetViz = 0;\n\t//below declares a key on the entire wo to hold all Exp Net ChargeAmount from all Items in this wo so it exists\n\tEachWO.ThisWOAllExpsNetChargeAmount = 0;\n\t//below declares a key on the entire wo to hold all Loan Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllLoansNetViz = 0;\n\t//below declares a key on the entire wo to hold all Outside Net Viz from all Items in this wo so it exists\n\tEachWO.ThisWOAllOutsidesNetViz = 0;\t\n\n\t//below declares a key on the entire wo to hold ALL of THIS workorder's Nets so it exists\n\tEachWO.ThisWOTotalNets = 0;\n\n\t//below declares a key on the entire wo to hold THIS workorder's Tax A (for all items) so it exists \n\tEachWO.ThisWOTotalTaxAs = 0;\n\t//below declares a key on the entire wo to hold THIS workorder's Tax B (for all items) so it exists\n\tEachWO.ThisWOTotalTaxBs = 0;\t\n\t//below declares a key on the entire wo to hold THIS workorder's Grand Total so it exists\n\tEachWO.ThisWOTotalGrand = 0;\n\n\t//below is to Iterate through each item of the wo's Items\n\tfor (Item of EachWO.Items)\n\t\t{\n\t\t\tItem.ThisItemAllLaborsNetViz = 0; //declare a key on the Item to hold all of this item's labor nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each labor record of the wo's Item\n\t\t\tfor (Labor of Item.Labors)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Labor.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to running total for this WOItem's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOAllLaborsNetViz += Labor.NetViz; //this IS where the actual adding to the running total for this entire WO's Net Labors\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Labor.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOLaborsNetViz += Labor.NetViz;\t//this IS where the actual adding to the running total for all labor for ALL workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Labor.NetViz; //this is where the actual adding to the running total for ALL workorders Nets in this report data\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxAViz; //this IS where the actual adding of Labor's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Labor.TaxBViz; //this IS where the actual adding of Labor's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Labor.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllPartsNetViz = 0; //declare a key on the Item to hold all of this item's parts nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Part record of the wo's Item\n\t\t\tfor (Part of Item.Parts)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Part.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllPartsNetViz += Part.NetViz; //this IS where the actual adding to running total for this WOItem's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOAllPartsNetViz += Part.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Parts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Part.NetViz; //this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\t\t\t\t\t\t\n\t\t\t\t\t\treportData.AllWOPartsNetViz += Part.NetViz; //this IS where the actual adding to the running total for all Parts for all workorders in this report data\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Part.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxAViz; //this IS where the actual adding of Part's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Part.TaxBViz; //this IS where the actual adding of Part's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Part.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllTravelsNetViz = 0; //declare a key on the Item to hold all of this item's travel nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Travel record of the wo's Item\n\t\t\tfor (Travel of Item.Travels)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Travel.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to running total for this WOItem's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOAllTravelsNetViz += Travel.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Travels\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Travel.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTravelsNetViz += Travel.NetViz;\t//this IS where the actual adding to the running total for all Travels for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Travel.NetViz; //this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxAViz; //this IS where the actual adding of Travel's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Travel.TaxBViz; //this IS where the actual adding of Travel's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Travel.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\t//note additional statements for misc expense to ONLY add to running totals if ChargeToCustomer is true\n\t\t\t\n\t\t\tItem.ThisItemAllExpsNetChargeAmount = 0; //declare a key on the Item to hold all of this item's misc nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Exp record of the wo's Item\n\t\t\tfor (Exp of Item.Expenses)\n\t\t\t{\n\t\t\t//if this expense has a ChargeAmount value AND the ChargeToCustomer is true then adds the ChargeAmount to running totals\n \tif (Exp.ChargeAmount != null && Exp.ChargeToCustomer == true) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to running total for this WOItem's Net Exps\n\t\t\t\t\t\tEachWO.ThisWOAllExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for this entire WO's Net ChargeAmounts\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Exp.ChargeAmount;//this IS where the actual adding to the running total for ALL NET ChargeAmountS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.ChargeAmount; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOExpsNetChargeAmount += Exp.ChargeAmount;//this IS where the actual adding to the running total for all Exp ChargeAmount for all workorders in this report data\t\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Exp.ChargeAmount;//this is where the actual adding to the running total for all workorder Net ChargeAmount in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.ChargeAmount; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\n\t\t\t//if this expense the ChargeToCustomer is true AND ChargeTaxCode has a value then adds the TaxAViz and TaxBViz to running totals\t\t\n\t\t\t\t\tif (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId != null ) \n \t \t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxAViz; //this IS where the actual adding of Exp's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxBViz; //this IS where the actual adding of Exp's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t\t\telse if (Exp.ChargeToCustomer == true && Exp.ChargeTaxCodeId == null ) //else if ChargeToCustomer is true AND ChargeTaxCodeID is null, then add TaxPaid to TaxA running total and Grand Total\t\t\n\t\t\t\t\t\t{\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Exp.TaxPaid; //this IS where the actual adding of Exp's TaxPaid to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Exp.TaxPaid; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\t\t\tItem.ThisItemAllLoansNetViz = 0; //declare a key on the Item to hold all of this item's loans nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Loan record of the wo's Item\n\t\t\tfor (Loan of Item.Loans)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Loan.NetViz != null) \n \t \t{\n \t \tItem.ThisItemAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to running total for this WOItem's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOAllLoansNetViz += Loan.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Loans\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Loan.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOLoansNetViz += Loan.NetViz;\t\t//this IS where the actual adding to the running total for all Loans for all workorders in this report data\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Loan.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxAViz; //this IS where the actual adding of Loan's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Loan.TaxBViz; //this IS where the actual adding of Loan's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Loan.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\n\t\t\tItem.ThisItemAllOutsidesNetViz = 0; //declare a key on the Item to hold all of this item's Outsie nets and set it initially to 0 \n\t\t\t\n\t\t\t//below is to Iterate through each Outside record of the wo's Item\n\t\t\tfor (Outside of Item.OutsideServices)\n\t\t\t{\n\t\t\t//make sure it has a value before attempting to add it to the running total\n \tif (Outside.NetViz != null) \n \t \t{\n\t\t\t\t\t\t\n \t \tItem.ThisItemAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to running total for this WOItem's Net Outside\n\t\t\t\t\t\tEachWO.ThisWOAllOutsidesNetViz += Outside.NetViz;//this IS where the actual adding to the running total for this entire WO's Net Outsides\n\t\t\t\t\t\tEachWO.ThisWOTotalNets += Outside.NetViz;//this IS where the actual adding to the running total for ALL NETS for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.NetViz; //this IS where the actual adding to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOOutsidesNetViz += Outside.NetViz;\t//this IS where the actual adding to the running total for all Outside for all workorders in this report data\t\t\t\n\t\t\t\t\t\treportData.AllWOTotalNets += Outside.NetViz;//this is where the actual adding to the running total for all workorder Nets in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.NetViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxAs += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for ALL Tax A for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxAViz; //this IS where the actual adding of Outside's Tax A to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxAs += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax As in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxAViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n\t\t\t\t\t\t\n\t\t\t\t\t\tEachWO.ThisWOTotalTaxBs += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for ALL Tax B for THIS workorders in this report data\n\t\t\t\t\t\tEachWO.ThisWOTotalGrand += Outside.TaxBViz; //this IS where the actual adding of Outside's Tax B to the running total for GrandTotal for THIS workorders in this report data\n\t\t\t\t\t\treportData.AllWOTotalTaxBs += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Tax Bs in this report data\n\t\t\t\t\t\treportData.AllWOTotalGrand += Outside.TaxBViz; //this is where the actual adding to the running GRAND TOTAL for ALL workorders Grand Totals in this report data\n \t \t\t}\t\t\t\t//NOTE if you customize this report template and do NOT need a key above, remove it to increase report performance\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\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":"    Todays date:    set in PDF Options","FooterTemplate":"  set in PDF Options  Page  of     ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE custom fields.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE custom fields.ayrt deleted file mode 100644 index d7b1f35e..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE custom fields.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE custom fields","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: custom fields usage

\n\t

See help documentation for details

\n\n\t
\n\t\t{{#each ayReportData}}\n\n\t\t

Non custom fields

\n\t\tName: {{ Name }}
\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}}
\n\n\t\t

Custom fields

\n\t\t

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.\n\t\t(note, example assumes generated sample data and that c1 and c5 have data)

\n\t\tCustom c1 as DateTime: {{ ayDateTime CustomFields.c1}}
\n\t\tcustom c5 as Number: {{ ayDecimal CustomFields.c5}}
\t\n\t\t
\n\t\t{{/each}}\n\t
\n\n\n","Style":"","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"","RenderType":0} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE localization helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE localization helpers.ayrt deleted file mode 100644 index 60ef9704..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE localization helpers.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE localization helpers","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: Localization helpers

\n\t

See help documentation for details

\n\n\t
\n\t\t

Client locale settings used

\n\t\tBrowser TimeZone: {{ ayClientMetaData.TimeZoneName }}
\n\t\tBrowser LanguageName: {{ ayClientMetaData.LanguageName }}
\n\t\tHour12: {{ ayClientMetaData.Hour12 }}
\n\t\tCurrencyName: {{ ayClientMetaData.CurrencyName }}
\n\t
\n\t
\n\t\t{{#each ayReportData}}\n\t\t

Name: {{ Name }}

\n\t\tStartDate as DateTime: {{ ayDateTime StartDate}}
\n\t\tStartDate as Date : {{ ayDate StartDate}}
\n\t\tStartDate as Time: {{ ayTime StartDate}}
\n\t\tDollarAmount as Currency: {{ ayCurrency DollarAmount}}
\n\t\tDollarAmount as Number: {{ ayDecimal DollarAmount}}
\n\t\t
\n\t\t{{/each}}\n\t
\n\n\n","Style":".example {\n color: blue;\n}","JsPrerender":"async function ayPrepareData(reportData){ \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} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE modify data before rendering.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE modify data before rendering.ayrt deleted file mode 100644 index 288b31f3..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/EXAMPLE modify data before rendering.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"EXAMPLE modify data before rendering","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t{{#each ayReportData}}\n\tName: {{ Name }}, DollarAmount: {{ ayCurrency DollarAmount }}, RunningTotal: {{ ayCurrency MyRunningTotal }}
\n\t{{/each}}\n\n\t

Total dollar amount: {{ ayCurrency MyTotalDollarAmount }}\n\n\n","Style":"","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n //Declare a temporary variable to hold the running total\n let TotalDollarAmount = 0;\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (MyItem of reportData.ayReportData) {\n\n //make sure it has a value before attempting to add it to the running total\n if (MyItem.DollarAmount != null) {\n TotalDollarAmount += MyItem.DollarAmount;\n }\n\n //add a new key to each record in the reportData object named \"MyRunningTotal\" with the running total so far\n MyItem.MyRunningTotal=TotalDollarAmount;\n }\n\n //Add the TotalDollarAmount variable to the reportData so it can be \n //accessed in the report template\n reportData.MyTotalDollarAmount=TotalDollarAmount;\n\n return reportData;\n}","JsHelpers":"","RenderType":0} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE Additional Today's Date Time Helpers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE Additional Today's Date Time Helpers.ayrt deleted file mode 100644 index 63595986..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE Additional Today's Date Time Helpers.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE Additional Today's Date Time Helpers","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t
\n\t\t

Additional custom time date helpers

\n\t

today's date using custom Helper todaysDate no formatting: {{ todaysDate}}

\n\t

today's date using custom Helper date.toLocaleDateString() : {{ todaysLocaleStringDate}}

\n\ttoday's date using custom Helper todaysget that users date.getFullYear etc: {{ todaysget}}

\n\t

today's date using custom Helper long format of ayClientMetaData: {{ todaysMonthDDYYYYDate}}

\n\t

today's date using custom Helper todaysDateYearFromParts formatter.formatToParts(parsedDate): {{ todaysDateYearFromParts}}

\n\t

all can be further customized to display short, long, etc format

\n\t
\n\n\n","Style":".example {\n color: blue;\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\n\n\nHandlebars.registerHelper('todaysDate', function() {\n var dt1=new Date();\n return dt1\n});// today's date with no formatting\n\nHandlebars.registerHelper('todaysLocaleStringDate', function() {\n var dt2=new Date();\n return dt2.toLocaleDateString() \n});// today's date displayed in the localedatestring\n\n\nHandlebars.registerHelper('todaysget', function() {\n var dt5 =new Date();\n var date = dt5.getFullYear()+'-'+(dt5.getMonth()+1)+'-'+dt5.getDate() + \" \" + +dt5.getHours() + \":\" + +dt5.getMinutes() ;\n return date\n});// today's date displayed \n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format\n\n\n\n\n\n//\n// CUSTOM FORMAT TO PARTS HELPER\n// this offers the most control over the return format\n// Locale aware conversion to parts that can be returned in any format\n//\nHandlebars.registerHelper('todaysDateYearFromParts', function () {\n\n //parse todays date\n let parsedDate = new Date();\n\n //Set formatter options\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/formatToParts\n let formatter = new Intl.DateTimeFormat('en-us', {\n weekday: 'long',\n year: 'numeric',\n month: 'long', //long to show the full name of month, short to show short name, numeric to show the month number\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n fractionalSecondDigits: 3,\n hour12: true,\n timeZone: 'Canada/Pacific' //refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for appropriate TZ database name to use\n //OR use what is displayed in the output for your ayClientMetaData's TimeZoneName:\n });\n\n let parts = formatter.formatToParts(parsedDate);\n /*\n // parts example return value: \n [ \n { type: 'weekday', value: 'Monday' }, \n { type: 'literal', value: ', ' }, \n { type: 'month', value: '12' }, \n { type: 'literal', value: '/' }, \n { type: 'day', value: '17' }, \n { type: 'literal', value: '/' }, \n { type: 'year', value: '2012' }, \n { type: 'literal', value: ', ' }, \n { type: 'hour', value: '3' }, \n { type: 'literal', value: ':' }, \n { type: 'minute', value: '00' }, \n { type: 'literal', value: ':' }, \n { type: 'second', value: '42' }, \n { type: 'fractionalSecond', value: '000' },\n { type: 'literal', value: ' ' }, \n { type: 'dayPeriod', value: 'AM' } \n ]\n */\n//identify here which of the above will use when returning\n let partWeekDay = parts.find(({ type }) => type === 'weekday').value;\n let partDay = parts.find(({ type }) => type === 'day').value;\n let partMonth = parts.find(({ type }) => type === 'month').value;\n let partYear = parts.find(({ type }) => type === 'year').value;\n let partHour = parts.find(({ type }) => type === 'hour').value;\n let partMin = parts.find(({ type }) => type === 'minute').value;\n let partdayPeriod = parts.find(({ type }) => type === 'dayPeriod').value;\n\n\n \n //return in some custom format\n return `${partWeekDay} ${partDay}, ${partMonth} ${partYear} - ${partHour}:${partMin} ${partdayPeriod}`;\n \n //return below instead to see array of the possible values for each type while initially figuring out what to customize to\n //return JSON.stringify(parts);\n});","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":null,"MarginOptionsLeft":null,"MarginOptionsRight":null,"MarginOptionsTop":null,"PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE one object prints per page.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE one object prints per page.ayrt deleted file mode 100644 index 7ddd5ecf..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE one object prints per page.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE one object prints per page","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\n\t

Example: Translation helper

\n\t

See Report editor help documentation for details

\n\t

this will show on the first page only as is HTML code BEFORE the #each aspect which is used for iteration

\n\t

if want this on its own page unto itself, wrap it also in a class that does a page-break

\n\n{{#each ayReportData}} \n\t
\t\t\n\t\t

{{ayT 'WidgetName' }}: {{ Name }}

\n\t\t
{{ayT 'WidgetSerial' }}:{{ Serial }}
\n\t\t
{{ayT 'WidgetDollarAmount' }}:{{ DollarAmount }}
\n\t\t
{{ayT 'WidgetStartDate' }}:{{ StartDate }}
\n\t\t
{{ayT 'WidgetNotes' }}:{{ Notes }}
\t\t\n\t
\n{{/each}}\n\n\n\n\n","Style":".example {\n color: blue;\n}\n\n\n.singlePage\n{\npage-break-after: always;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Fetch translation keys required for report \n //Server will get the translations that match the current logged in user's language\n //Only translation keys pre-fetched here will be available for use with the ayT translation helper\n\n //NOTE: you *must* await the call to ayGetTranslations or they will not be present for the report template use\n\n await ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\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":0,"Landscape":false,"MarginOptionsBottom":null,"MarginOptionsLeft":null,"MarginOptionsRight":null,"MarginOptionsTop":null,"PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing IF ELSE inline html.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing IF ELSE inline html.ayrt deleted file mode 100644 index df6028a3..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing IF ELSE inline html.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE showing IF ELSE inline html","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: custom fields usage

\n\t

this is an examle report template that shows value of Count in red if has 0 or null, or shows green if has ANY value

\n\n\t
\n\t\t{{#each ayReportData}}\n\t\t

Name: {{ Name }}

\n\t\t{{#if Count}}

Count is: {{ Count }}

{{else}}

has 0 or null

{{/if}}\n\t\t
\t\t\n\t\t{{/each}}\n\t
\n\n\n","Style":".redFont {\r\n color: red;\r\n}\r\n\r\n.greenFont {\r\n color: green;\r\n}\r\n","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":null,"MarginOptionsLeft":null,"MarginOptionsRight":null,"MarginOptionsTop":null,"PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing tag only if has specific tagword.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing tag only if has specific tagword.ayrt deleted file mode 100644 index 4c895e7d..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE showing tag only if has specific tagword.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE showing tag only if has specific tagword","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\t

Example: custom fields usage

\n\t

See help documentation for details

\n\n\t
\n\t\t{{#each ayReportData}}\n\n\t\tName: {{ Name }}
\n\t\t\n\t\t

Tags:

\n\t\t

Displays first tag :::::{{ Tags.[0]}}

\n\t\t

Displays all tags for this object::::: {{ Tags}}

\n\t\t

Displays if has brown in its tags::::: {{ isInTag2 Tags}}

\n\t\t

Count: {{Count}}

\n\t\t\n\t\t\n\t\t
    \n\t\t\t {{#if CustomFields.c4}}
  • true custom fields c4 is true
  • {{else}}
  • custom fields c4 is false
  • {{/if}}\n\t\t\t
  • Actual Count value: {{Count}}
  • \n\t\t\t {{#if Count}}
  • renders in red font if 'Count' has any value
  • {{else}}
  • renders in green font if false, undefined, null, \"\", 0, or []
  • {{/if}}\n\t\t
\n\n\t\t

{{isInTag3 Tags}}

\n\t\t\n\t\t{{/each}}\n\t
\n\n\n","Style":".redMe {\r\n color: red;\r\n}\r\n\r\n.greenMe {\r\n color: green;\r\n}\r\n\r\n.redfont {\r\n color: red;\r\n}","JsPrerender":"async function ayPrepareData(reportData){ \n return reportData;\n}","JsHelpers":"\r\n\r\nHandlebars.registerHelper('isInTag', function (Tags) \r\n{\r\n for (var i=0; i\" + \"brownbrwnbrown is in here!!!!!!!!!!!!\" +\"

\");\r\n\t\t}\r\n }\r\n return 'some other text'; //if don't want to return any element at all, comment this else aspect out fully\r\n});\r\n","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":0,"Landscape":false,"MarginOptionsBottom":null,"MarginOptionsLeft":null,"MarginOptionsRight":null,"MarginOptionsTop":null,"PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":false,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt footer last pg only.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt footer last pg only.ayrt deleted file mode 100644 index 49553f8f..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt footer last pg only.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE widgets invoice rpt footer last pg only","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\n\n\n\t
\t\t\n\t\t\n\t\t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n \t\t \n \t\t\n \t\t\n \t\t\n \t\t\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n\t\t
{{ ayLogo \"small\" }}PO#: A1A1G43Our Account #: 198453
Ordered Date: 2020-09-13
ETA Date: 2020-09-19
VENDOR:DELIVER TO:
vendorNameMy Company Name
vstaddress123 - 123 MyStreetname Ave
vstcity vststate vstpostalMy City, My State, My Postal
Contact: vcontact vphone vemailOrdered By: creator Phone: creatorphone
 
Our Part#:Serial#Price Per:Net:Tax A:Tax B:Line Total:
{{Name}}{{Serial}}{{ayCurrency DollarAmount}}xx.xxx.xxx.xx{{ayCurrency DollarAmount}}
\n\n\n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\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\n \t\t\t\n \t\t\t\n \n
 
Net Total: $xxx.xx
 Tax A Total: $xx.xx
Direct all inquiries to My Company 1-888-555-5555Tax B Total:$xx.xx
Approval for off-specification goods must be obtained via a new purchase orderPO Total:{{ ayCurrency MyTotalDollarAmount }}
\n\n\t
\n \n\n\n\n\n","Style":"\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\ntfoot {\n page-break-inside: avoid;\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n} \n.fontsizeBig {\n font-size: 11pt;\n font-weight: bold ;\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\ntbody tr:nth-child(even) {\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\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\n\n//Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n let TotalDollarAmount = 0; //Declare a temporary variable to hold the running total\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (EachItem of reportData.ayReportData) { //EachItem is name i've give, reportData.ayReportData is set\n\n //make sure it has a value before attempting to add it to the running total\n if (EachItem.DollarAmount != null) { //EachItem is name I've given, DollarAmount is the \n TotalDollarAmount += EachItem.DollarAmount;\n }\n\n //add a new key to each record in the reportData object named \"MyRunningTotal\" with the running total so far\n EachItem.MyRunningTotal=TotalDollarAmount;\n }\n\n //Add the TotalDollarAmount variable to the reportData so it can be \n //accessed in the report template\n reportData.MyTotalDollarAmount=TotalDollarAmount;\n\n\n\n//below gets your translations for the following field labels\nawait ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\n return reportData;\n}\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})\nHandlebars.registerHelper('words', function() {\n return \"stuff and text\"\n})\n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format\n\n","RenderType":0,"HeaderTemplate":"  Todays date: \nPage  of   \n","FooterTemplate":"  ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.0000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt head footer repeats.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt head footer repeats.ayrt deleted file mode 100644 index d2133f3b..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/SAMPLE widgets invoice rpt head footer repeats.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"SAMPLE widgets invoice rpt head footer repeats","Active":true,"Notes":"","Roles":124927,"AType":2,"Template":"\n\n\n\n\n\n\t
\t\t\n\t\t\n\t\t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\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\n \t\t\t\n \t\t\t\n \n\t\t\t\n\t\t\t\t{{#each ayReportData}}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n \t\t \n \t\t\n \t\t\n \t\t\n \t\t\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n\t\t
{{ ayLogo \"small\" }}PO#: A1A1G43Our Account #: 198453
Ordered Date: 2020-09-13
ETA Date: 2020-09-19
VENDOR:DELIVER TO:
vendorNameMy Company Name
vstaddress123 - 123 MyStreetname Ave
vstcity vststate vstpostalMy City, My State, My Postal
Contact: vcontact vphone vemailOrdered By: creator Phone: creatorphone
 
Our Part#:Serial#Price Per:Net:Tax A:Tax B:Line Total:
 
Net Total for all pages: $xxx.xx
 Tax A Total for all pages: $xx.xx
Direct all inquiries to My Company 1-888-555-5555Tax B Total for all pages:$xx.xx
Approval for off-specification goods must be obtained via a new purchase orderPO Total for all pages:{{ ayCurrency MyTotalDollarAmount }}
{{Name}}{{Serial}}{{ayCurrency DollarAmount}}xx.xxx.xxx.xx{{ayCurrency DollarAmount}}
\n\n\n\n\t
\n \n\n\n\n\n","Style":"\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n} \n.fontsizeBig {\n font-size: 10pt;\n font-weight: bold ;\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\ntbody tr:nth-child(even) {\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\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\n\n//Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n let TotalDollarAmount = 0; //Declare a temporary variable to hold the running total\n\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the TotalDollarAmount variable\n for (EachItem of reportData.ayReportData) { //EachItem is name i've give, reportData.ayReportData is set\n\n //make sure it has a value before attempting to add it to the running total\n if (EachItem.DollarAmount != null) { //EachItem is name I've given, DollarAmount is the \n TotalDollarAmount += EachItem.DollarAmount;\n }\n\n //add a new key to each record in the reportData object named \"MyRunningTotal\" with the running total so far\n EachItem.MyRunningTotal=TotalDollarAmount;\n }\n\n //Add the TotalDollarAmount variable to the reportData so it can be \n //accessed in the report template\n reportData.MyTotalDollarAmount=TotalDollarAmount;\n\n\n\n//below gets your translations for the following field labels\nawait ayGetTranslations([\n \"Widget\",\n \"WidgetName\",\n \"WidgetSerial\",\n \"WidgetDollarAmount\",\n \"WidgetCount\",\n \"WidgetStartDate\",\n \"WidgetEndDate\",\n \"WidgetNotes\",\n \"WidgetCustom1\",\n \"WidgetCustom2\",\n \"WidgetCustom3\",\n \"WidgetCustom4\",\n \"WidgetCustom5\",\n \"WidgetCustom6\",\n \"WidgetCustom7\",\n \"WidgetCustom8\",\n \"WidgetCustom9\",\n \"WidgetCustom10\",\n \"WidgetCustom11\",\n \"WidgetCustom12\",\n \"WidgetCustom13\",\n \"WidgetCustom14\",\n \"WidgetCustom15\",\n \"WidgetCustom16\",\n ]);\n\n return reportData;\n}\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})\nHandlebars.registerHelper('words', function() {\n return \"stuff and text\"\n})\n\n\nHandlebars.registerHelper('todaysMonthDDYYYYDate', function() {\n var dt3=new Date();\n return dt3.toLocaleDateString(\n AYMETA.ayClientMetaData.LanguageName,//use Client browser default Language, change this setting here to force an alternative language\n {\n timeZone: AYMETA.ayClientMetaData.TimeZoneName,//use Client browser's default TimeZone, change this setting here to force a specific time zone\n dateStyle: \"long\"\n }\n ) ;\n});// today's date displayed in MONTH DD, YYYY format\n\n","RenderType":0,"HeaderTemplate":"    Todays date: \nPage  of     \n","FooterTemplate":"  ","DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"15mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"15mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.0000} \ No newline at end of file