diff --git a/server/AyaNova/biz/PartAssemblyBiz.cs b/server/AyaNova/biz/PartAssemblyBiz.cs index 98daaaef..e30f9588 100644 --- a/server/AyaNova/biz/PartAssemblyBiz.cs +++ b/server/AyaNova/biz/PartAssemblyBiz.cs @@ -116,10 +116,10 @@ namespace AyaNova.Biz var partNames = await PickListFetcher.GetResponseAsync(PickList, null, null, true, partIdList, null, ct, null,string.Empty); foreach (PartAssemblyItem pai in ret.Items) { - pai.PartViz = partNames.Where(z => z.Id == pai.PartId).First().Name; + pai.PartNameViz = partNames.Where(z => z.Id == pai.PartId).First().Name; } - //sort in place by partviz - ret.Items.Sort((lhs, rhs) => lhs.PartViz.CompareTo(rhs.PartViz)); + //sort in place by partnameviz + ret.Items.Sort((lhs, rhs) => lhs.PartNameViz.CompareTo(rhs.PartNameViz)); } return ret; @@ -354,7 +354,7 @@ namespace AyaNova.Biz private async Task PopulateVizFields(PartAssembly pa) { foreach (PartAssemblyItem o in pa.Items) - o.PartViz = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => x.Name).FirstOrDefaultAsync(); + o.PartNameViz = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => x.Name).FirstOrDefaultAsync(); } diff --git a/server/AyaNova/biz/PartInventoryBiz.cs b/server/AyaNova/biz/PartInventoryBiz.cs index 5f3796af..aa6f10d1 100644 --- a/server/AyaNova/biz/PartInventoryBiz.cs +++ b/server/AyaNova/biz/PartInventoryBiz.cs @@ -293,8 +293,8 @@ namespace AyaNova.Biz //populate viz fields from provided object private async Task PopulateVizFields(PartInventory o, List ayaTypesEnumList, System.Data.Common.DbCommand cmd) { - var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => new { partViz = x.Description, partNameViz = x.Name, partUPCViz = x.UPC }).FirstOrDefaultAsync(); - o.PartDescriptionViz = partInfo.partViz; + var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == o.PartId).Select(x => new { PartDescriptionViz = x.Description, partNameViz = x.Name, partUPCViz = x.UPC }).FirstOrDefaultAsync(); + o.PartDescriptionViz = partInfo.PartDescriptionViz; o.PartNameViz = partInfo.partNameViz; o.PartUpcViz = partInfo.partUPCViz; diff --git a/server/AyaNova/biz/PurchaseOrderBiz.cs b/server/AyaNova/biz/PurchaseOrderBiz.cs index a29d550f..35c14ec8 100644 --- a/server/AyaNova/biz/PurchaseOrderBiz.cs +++ b/server/AyaNova/biz/PurchaseOrderBiz.cs @@ -180,8 +180,8 @@ namespace AyaNova.Biz { - var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => new { partViz = x.Description, partNameViz = x.Name, partUPCViz=x.UPC, partunitofmeasureviz = x.UnitOfMeasure, partmanufacturernumber = x.ManufacturerNumber }).FirstOrDefaultAsync(); - item.PartDescriptionViz = partInfo.partViz; + var partInfo = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => new { PartDescriptionViz = x.Description, partNameViz = x.Name, partUPCViz=x.UPC, partunitofmeasureviz = x.UnitOfMeasure, partmanufacturernumber = x.ManufacturerNumber }).FirstOrDefaultAsync(); + item.PartDescriptionViz = partInfo.PartDescriptionViz; item.PartNameViz = partInfo.partNameViz; item.UpcViz=partInfo.partUPCViz; item.PartUnitOfMeasureViz = partInfo.partunitofmeasureviz; diff --git a/server/AyaNova/models/PartAssemblyItem.cs b/server/AyaNova/models/PartAssemblyItem.cs index 814b7686..665f747b 100644 --- a/server/AyaNova/models/PartAssemblyItem.cs +++ b/server/AyaNova/models/PartAssemblyItem.cs @@ -16,7 +16,7 @@ namespace AyaNova.Models [Required] public long PartId { get; set; } [NotMapped] - public string PartViz { get; set; } + public string PartNameViz { get; set; } [Required] public decimal Quantity { get; set; } 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 index e8a4e21d..87b314c1 100644 --- 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 @@ -1 +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 +{"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 #: {{PartNameViz}} 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 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 index 638493da..e1c1af34 100644 --- 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 @@ -1 +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 +{"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}} {{PartNameViz}} {{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 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 index 73e731ca..54ff621d 100644 --- 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 @@ -1 +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 +{"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 #: {{PartNameViz}} 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 index 3e306b9c..4d704d7e 100644 --- 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 @@ -1 +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 +{"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 {{PartNameViz}} have received: {{QuantityReceived}}Nothing received yet for {{PartNameViz}}
\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 index 4182bfca..5d7a9ce0 100644 --- 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 @@ -1 +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 +{"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:
{{PartNameViz}}{{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 index 1eab3e0e..5457f2ff 100644 --- 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 @@ -1 +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 +{"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:
{{PartNameViz}} {{PartDescriptionViz}}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/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 index b92acda8..6c68743c 100644 --- 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 @@ -1 +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 +{"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: {{PartNameViz}}{{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 unfinished WO Dispatch example.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 unfinished WO Dispatch example.ayrt index 9e184308..aa9b23a6 100644 --- 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 @@ -1 +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 +{"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 partnameviz + 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}}{{PartNameViz}}    Serial#: {{Serials}} {{PartNameViz}}
 
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 PO Items Received vs Ordered.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt index 345826be..34faaf69 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt @@ -1 +1 @@ -{"Name":"Example PO Items Received vs Ordered","Active":true,"Notes":"Includes Prepare that determines the difference between Ordered and Received for display, and #if_eq Helper used to display red if difference between QuantityReceived and QuantityOrdered","Roles":33130,"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\t\t\t \n \n \n \n \n \n\t\t\t \n \n \n \n \n \t\t\n \n \n {{#each ayReportData}}\n {{#each Items}}\n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t \n \n \n \n \n \n {{#if_eq QuantityOrdered QuantityReceived }} {{else}}{{/if_eq}}\n\t\t\t \n\t\t\t\t\n\n \t {{/each}} \n {{/each}} \n \n\n
Purchase Order Items Received compared to Ordered
 
PO StatusPO#VendorPO Ordered DateItem Received DatePartQty OrderedQty ReceivedDiff +/-
 
{{../StatusViz}}{{../Serial}} {{../VendorViz}} {{ayDate ../OrderedDate}} {{ayDate ReceivedDate}}{{PartViz}} {{PartNameViz}}{{QuantityOrdered}}{{QuantityReceived}}{{ThisItemQtyDiff}}{{ThisItemQtyDiff}}
\n\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 table-layout: fixed;\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: 14pt; \n text-align: center;\n} \n\n.bodyhead {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n font-size: 12pt; \n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\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 overflow-wrap: break-word;\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 overflow-wrap: break-word;\n} \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 \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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\n\n \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 \n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po \n\t\n {\n let ThisItemQtyDiff = 0; //Declare a temporary variable to hold the difference for this item\n \n if (Item.QuantityOrdered != null) //make sure QuantityOrdered has a value before attempting to use it\n {\n \n ThisItemQtyDiff = Item.QuantityOrdered - Item.QuantityReceived;\n }\n Item.ThisItemQtyDiff=ThisItemQtyDiff;\n }\n }\n\n\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})\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});","RenderType":0,"HeaderTemplate":"    (set in report template's PDF Options) Printed date: ","FooterTemplate":"  (set in report template's PDF Options showing x of ALL pages printed)  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 +{"Name":"Example PO Items Received vs Ordered","Active":true,"Notes":"Includes Prepare that determines the difference between Ordered and Received for display, and #if_eq Helper used to display red if difference between QuantityReceived and QuantityOrdered","Roles":33130,"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\t\t\t \n \n \n \n \n \n\t\t\t \n \n \n \n \n \t\t\n \n \n {{#each ayReportData}}\n {{#each Items}}\n \n\t\t\t\t\n\t\t\t\t \n \n\t\t\t \n \n \n \n \n \n {{#if_eq QuantityOrdered QuantityReceived }} {{else}}{{/if_eq}}\n\t\t\t \n\t\t\t\t\n\n \t {{/each}} \n {{/each}} \n \n\n
Purchase Order Items Received compared to Ordered
 
PO StatusPO#VendorPO Ordered DateItem Received DatePartQty OrderedQty ReceivedDiff +/-
 
{{../StatusViz}}{{../Serial}} {{../VendorViz}} {{ayDate ../OrderedDate}} {{ayDate ReceivedDate}}{{PartNameViz}} {{PartDescriptionViz}}{{QuantityOrdered}}{{QuantityReceived}}{{ThisItemQtyDiff}}{{ThisItemQtyDiff}}
\n\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 table-layout: fixed;\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: 14pt; \n text-align: center;\n} \n\n.bodyhead {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n font-size: 12pt; \n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\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 overflow-wrap: break-word;\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 overflow-wrap: break-word;\n} \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 \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\n\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\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\n\n \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 \n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po \n\t\n {\n let ThisItemQtyDiff = 0; //Declare a temporary variable to hold the difference for this item\n \n if (Item.QuantityOrdered != null) //make sure QuantityOrdered has a value before attempting to use it\n {\n \n ThisItemQtyDiff = Item.QuantityOrdered - Item.QuantityReceived;\n }\n Item.ThisItemQtyDiff=ThisItemQtyDiff;\n }\n }\n\n\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})\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});","RenderType":0,"HeaderTemplate":"    (set in report template's PDF Options) Printed date: ","FooterTemplate":"  (set in report template's PDF Options showing x of ALL pages printed)  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 Purchase Order Detailed w Custom.c1 Shipping.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed w Custom.c1 Shipping.ayrt index 1717f277..b65c4a88 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed w Custom.c1 Shipping.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed w Custom.c1 Shipping.ayrt @@ -1 +1 @@ -{"Name":"Example Purchase Order Detailed w Custom.c1 Shipping","Active":true,"Notes":"HTML If else /if \nNOT YET COMPLETED TO USE custom.c1 with shipping charge\nWhy is it called \"VendorPartNumber \" when in the Part record itself, is referred to as WholesalerNumber??","Roles":98,"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 {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \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 \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 \n \n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \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\n \n\t\t\t\t\n\t\t\t\t\n \n \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 \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n {{#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\n \n\t\t\t\t\n\t\t\t\t\n\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{{#if CustomFields.c1}}{{else}}{{/if}}\n \t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n \n\t\t
 
PO#: {{Serial}}SHIP TO CLIENT:BILL TO:BILL TO & SHIP TO:
Ref#: {{ReferenceNumber}}{{DropShipToCustomerViz}}My Company Name
Ordered Date: {{ayDate OrderedDate}}{{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}} {{DropShipToCustomerRegionViz}} 123 - 123 MyStreetname Ave
 {{DropShipToCustomerEmailAddressViz}} {{DropShipToCustomerPhone1Viz}} My City, My State, My Postal
VENDOR: {{VendorViz}}TEL: My telephone
{{VendorPostAddressViz}} {{VendorPostCityViz}} {{VendorPostRegionViz}} {{VendorPostCodeViz}}Email: My email address
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}} Acct#: VendorAccountNumberViz
 
QtyUOMOur Part#MFG#Vendor#Price PerNetTaxATaxBLine Total
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartViz}} {{PartNameViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
**Please note all packing slips and invoices REQUIRE line pricing**Total Qty of Parts Ordered: {{ThisPOTotalQty}}
**Approval for off-specification items or changes MUST be obtained via a NEW purchase order** 
 
PO VENDOR MEMO:{{VendorMemo}} Net Total:{{ ayCurrency ThisPONet }}
 
VENDOR ALERT MEMO:{{VendorAlertNotesViz}} TaxA Total:{{ ayCurrency ThisPOTaxA }}0.00
TaxB Total:{{ ayCurrency ThisPOTaxB }}0.00
 
ThisPODollarAmountBeforeShip Total before custom shipping amount:{{ ayCurrency ThisPODollarAmountBeforeShip }}
Custom Shipping currency amount in CustomFields.c1:{{ ayCurrency CustomFields.c1 }}0.00
 
Direct all inquiries to My Company 1-888-555-5555 or mycompany@mycompany.comThisPODollarAmountWithShip:{{ ayCurrency ThisPODollarAmountWithShip }}
\n {{/each}}\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 table-layout: fixed;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n.bold13 {\n font-size: 13pt;\n font-weight: bold;\n}\n.bold12 {\n font-size: 12pt;\n font-weight: bold;\n}\n.bold10 {\n font-size: 10;\n font-weight: bold;\n}\n\n.bkyellow {\n background-color: lightyellow;\n}\n\n.bodyhead {\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 font-weight: bold; \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; /* so as to print the table-footer on all subsequent pages */\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","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 ThisPOTotalDollar = 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 ThisPOTotalDollar += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPOTotalDollar;\n }\n \n EachPO.ThisPOTotalDollar =ThisPOTotalDollar; // \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 // ThisPOTotalDollar += AllPOTotalDollar; //remove statements not needed, for example ALLPOxxx are not needed\n \n let ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the Qty amount of each item to the ThisPOTotalQty 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 ThisPOTotalQty += Item.QuantityOrdered;\n }\n Item.QuantityOrderedRunning=ThisPOTotalQty;\n }\n EachPO.ThisPOTotalQty=ThisPOTotalQty;\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":"          (set in report template's PDF Options) Printed date: ","FooterTemplate":"  (set in report template's PDF Options showing x of ALL pages printed)  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 +{"Name":"Example Purchase Order Detailed w Custom.c1 Shipping","Active":true,"Notes":"HTML If else /if \nNOT YET COMPLETED TO USE custom.c1 with shipping charge\nWhy is it called \"VendorPartNumber \" when in the Part record itself, is referred to as WholesalerNumber??","Roles":98,"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 {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \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 \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 \n \n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \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\n \n\t\t\t\t\n\t\t\t\t\n \n \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 \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n {{#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\n \n\t\t\t\t\n\t\t\t\t\n\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{{#if CustomFields.c1}}{{else}}{{/if}}\n \t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n \n\t\t
 
PO#: {{Serial}}SHIP TO CLIENT:BILL TO:BILL TO & SHIP TO:
Ref#: {{ReferenceNumber}}{{DropShipToCustomerViz}}My Company Name
Ordered Date: {{ayDate OrderedDate}}{{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}} {{DropShipToCustomerRegionViz}} 123 - 123 MyStreetname Ave
 {{DropShipToCustomerEmailAddressViz}} {{DropShipToCustomerPhone1Viz}} My City, My State, My Postal
VENDOR: {{VendorViz}}TEL: My telephone
{{VendorPostAddressViz}} {{VendorPostCityViz}} {{VendorPostRegionViz}} {{VendorPostCodeViz}}Email: My email address
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}} Acct#: VendorAccountNumberViz
 
QtyUOMOur Part#MFG#Vendor#Price PerNetTaxATaxBLine Total
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartNameViz}} {{PartDescriptionViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
**Please note all packing slips and invoices REQUIRE line pricing**Total Qty of Parts Ordered: {{ThisPOTotalQty}}
**Approval for off-specification items or changes MUST be obtained via a NEW purchase order** 
 
PO VENDOR MEMO:{{VendorMemo}} Net Total:{{ ayCurrency ThisPONet }}
 
VENDOR ALERT MEMO:{{VendorAlertNotesViz}} TaxA Total:{{ ayCurrency ThisPOTaxA }}0.00
TaxB Total:{{ ayCurrency ThisPOTaxB }}0.00
 
ThisPODollarAmountBeforeShip Total before custom shipping amount:{{ ayCurrency ThisPODollarAmountBeforeShip }}
Custom Shipping currency amount in CustomFields.c1:{{ ayCurrency CustomFields.c1 }}0.00
 
Direct all inquiries to My Company 1-888-555-5555 or mycompany@mycompany.comThisPODollarAmountWithShip:{{ ayCurrency ThisPODollarAmountWithShip }}
\n {{/each}}\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 table-layout: fixed;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n.bold13 {\n font-size: 13pt;\n font-weight: bold;\n}\n.bold12 {\n font-size: 12pt;\n font-weight: bold;\n}\n.bold10 {\n font-size: 10;\n font-weight: bold;\n}\n\n.bkyellow {\n background-color: lightyellow;\n}\n\n.bodyhead {\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 font-weight: bold; \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; /* so as to print the table-footer on all subsequent pages */\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","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 ThisPOTotalDollar = 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 ThisPOTotalDollar += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPOTotalDollar;\n }\n \n EachPO.ThisPOTotalDollar =ThisPOTotalDollar; // \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 // ThisPOTotalDollar += AllPOTotalDollar; //remove statements not needed, for example ALLPOxxx are not needed\n \n let ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the Qty amount of each item to the ThisPOTotalQty 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 ThisPOTotalQty += Item.QuantityOrdered;\n }\n Item.QuantityOrderedRunning=ThisPOTotalQty;\n }\n EachPO.ThisPOTotalQty=ThisPOTotalQty;\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":"          (set in report template's PDF Options) Printed date: ","FooterTemplate":"  (set in report template's PDF Options showing x of ALL pages printed)  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 Purchase Order Detailed.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed.ayrt index 2fdd4b6a..6720dbcb 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed.ayrt @@ -1 +1 @@ -{"Name":"Example Purchase Order Detailed","Active":true,"Notes":"AS OF 131: why is it called VendorPartNumber?\nIncludes IF/ELSE ship to client; ","Roles":98,"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 {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \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 \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 \n \n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \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\n \n\t\t\t\t\n\t\t\t\t\n \t\t\t\n \n \n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n {{#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\n \n\t\t\t\t\n\t\t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n \n\t\t
 
PO#: {{Serial}}SHIP TO CLIENT:BILL TO:BILL TO & SHIP TO:
Ref#: {{ReferenceNumber}}{{DropShipToCustomerViz}}My Company Name
Ordered Date: {{ayDate OrderedDate}}{{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}} {{DropShipToCustomerRegionViz}} 123 - 123 MyStreetname Ave
 {{DropShipToCustomerEmailAddressViz}} {{DropShipToCustomerPhone1Viz}} My City, My State, My Postal
VENDOR: {{VendorViz}}TEL: My telephone
{{VendorPostAddressViz}} {{VendorPostCityViz}} {{VendorPostRegionViz}} {{VendorPostCodeViz}}Email: My email address
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}} Acct#: VendorAccountNumberViz
 
QtyUOMOur Part#MFG#Vendor#Price PerNetTaxATaxBLine Total
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartViz}} {{PartNameViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
**Please note all packing slips and invoices REQUIRE line pricing**Total Qty of Parts Ordered: {{ThisPOTotalQty}}
**Approval for off-specification items or changes MUST be obtained via a NEW purchase order** 
 
PO VENDOR MEMO:{{VendorMemo}} Net Total:{{ ayCurrency ThisPONet }}
 
VENDOR ALERT MEMO:{{VendorAlertNotesViz}} TaxA Total:{{ ayCurrency ThisPOTaxA }}0.00
TaxB Total:{{ ayCurrency ThisPOTaxB }}0.00
 
Direct all inquiries to My Company 1-888-555-5555 or mycompany@mycompany.comPurchase Order Total:{{ ayCurrency ThisPOTotalDollar }}
\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 table-layout: fixed;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n.bold13 {\n font-size: 13pt;\n font-weight: bold;\n}\n.bold12 {\n font-size: 12pt;\n font-weight: bold;\n}\n.bold10 {\n font-size: 10;\n font-weight: bold;\n}\n\n.bkyellow {\n background-color: lightyellow;\n}\n\n.italic {\n font-style: italic;\n}\n\n.bodyhead {\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 font-weight: bold; \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; /* so as to print the table-footer on all subsequent pages */\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","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\n\n //Iterate through all the records in the reportData adding the dollar amount of each specified property to the appropriate declared 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; //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 ThisPOTotalDollar = 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 ThisPOTotalDollar += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPOTotalDollar;\n }\n \n EachPO.ThisPOTotalDollar =ThisPOTotalDollar; // \n \n \n // ThisPOTotalDollar += AllPOTotalDollar; //remove statements not needed, for example ALLPOxxx are not needed\n \n let ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the Qty amount of each item to the ThisPOTotalQty 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 ThisPOTotalQty += Item.QuantityOrdered;\n }\n Item.QuantityOrderedRunning=ThisPOTotalQty;\n }\n EachPO.ThisPOTotalQty=ThisPOTotalQty;\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.AllPORunningTotal=AllPODollarAmount; \n\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":"       (set in report template's PDF Options) Printed date: \n","FooterTemplate":"\n  (set in report template's PDF Options showing x of ALL pages printed)  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 +{"Name":"Example Purchase Order Detailed","Active":true,"Notes":"AS OF 131: why is it called VendorPartNumber?\nIncludes IF/ELSE ship to client; ","Roles":98,"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 {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \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 \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 \n \n \n \n \n \n \n \n {{#if TaxAViz}}{{else}}{{/if}}\n {{#if TaxBViz}}{{else}}{{/if}}\n \n \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\n \n\t\t\t\t\n\t\t\t\t\n \t\t\t\n \n \n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n\t\t\t\t\n {{#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\n \n\t\t\t\t\n\t\t\t\t\n\n \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \n \n \n\t\t
 
PO#: {{Serial}}SHIP TO CLIENT:BILL TO:BILL TO & SHIP TO:
Ref#: {{ReferenceNumber}}{{DropShipToCustomerViz}}My Company Name
Ordered Date: {{ayDate OrderedDate}}{{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}} {{DropShipToCustomerRegionViz}} 123 - 123 MyStreetname Ave
 {{DropShipToCustomerEmailAddressViz}} {{DropShipToCustomerPhone1Viz}} My City, My State, My Postal
VENDOR: {{VendorViz}}TEL: My telephone
{{VendorPostAddressViz}} {{VendorPostCityViz}} {{VendorPostRegionViz}} {{VendorPostCodeViz}}Email: My email address
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}} Acct#: VendorAccountNumberViz
 
QtyUOMOur Part#MFG#Vendor#Price PerNetTaxATaxBLine Total
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartNameViz}} {{PartDescriptionViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
**Please note all packing slips and invoices REQUIRE line pricing**Total Qty of Parts Ordered: {{ThisPOTotalQty}}
**Approval for off-specification items or changes MUST be obtained via a NEW purchase order** 
 
PO VENDOR MEMO:{{VendorMemo}} Net Total:{{ ayCurrency ThisPONet }}
 
VENDOR ALERT MEMO:{{VendorAlertNotesViz}} TaxA Total:{{ ayCurrency ThisPOTaxA }}0.00
TaxB Total:{{ ayCurrency ThisPOTaxB }}0.00
 
Direct all inquiries to My Company 1-888-555-5555 or mycompany@mycompany.comPurchase Order Total:{{ ayCurrency ThisPOTotalDollar }}
\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 table-layout: fixed;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n.bold13 {\n font-size: 13pt;\n font-weight: bold;\n}\n.bold12 {\n font-size: 12pt;\n font-weight: bold;\n}\n.bold10 {\n font-size: 10;\n font-weight: bold;\n}\n\n.bkyellow {\n background-color: lightyellow;\n}\n\n.italic {\n font-style: italic;\n}\n\n.bodyhead {\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 font-weight: bold; \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; /* so as to print the table-footer on all subsequent pages */\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","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\n\n //Iterate through all the records in the reportData adding the dollar amount of each specified property to the appropriate declared 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; //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 ThisPOTotalDollar = 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 ThisPOTotalDollar += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPOTotalDollar;\n }\n \n EachPO.ThisPOTotalDollar =ThisPOTotalDollar; // \n \n \n // ThisPOTotalDollar += AllPOTotalDollar; //remove statements not needed, for example ALLPOxxx are not needed\n \n let ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the Qty amount of each item to the ThisPOTotalQty 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 ThisPOTotalQty += Item.QuantityOrdered;\n }\n Item.QuantityOrderedRunning=ThisPOTotalQty;\n }\n EachPO.ThisPOTotalQty=ThisPOTotalQty;\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.AllPORunningTotal=AllPODollarAmount; \n\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":"       (set in report template's PDF Options) Printed date: \n","FooterTemplate":"\n  (set in report template's PDF Options showing x of ALL pages printed)  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