From fd26809e154495d6bf9651047311ea19cc92f8ef Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 12 Oct 2021 16:05:50 +0000 Subject: [PATCH] updated report templates from email 2021-10-08 4:25pm --- .../109x EXAMPLE PO Landscape with derived totals.ayrt | 1 - .../112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt | 1 - .../Example Inventory Reconciliation Form.ayrt | 1 + .../Example PO Items Received vs Ordered.ayrt | 1 + .../Example Parts with available serial numbers.ayrt | 1 + .../Example Purchase Order Detailed w Custom.c1 Shipping.ayrt | 1 + .../stock-report-templates/Example Purchase Order Detailed.ayrt | 1 + .../Example Purchase Order Summary single line per PO.ayrt | 1 + .../stock-report-templates/Example Vendor Contact Report.ayrt | 1 + 9 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt delete mode 100644 server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Inventory Reconciliation Form.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Parts with available serial numbers.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed w Custom.c1 Shipping.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Summary single line per PO.ayrt create mode 100644 server/AyaNova/resource/rpt/stock-report-templates/Example Vendor Contact Report.ayrt diff --git a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt deleted file mode 100644 index 52a93387..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/109x EXAMPLE PO Landscape with derived totals.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"109x EXAMPLE PO Landscape with derived totals","Active":true,"Notes":"example one PO with po items details per page (or multiple pages as needed); example Prepare to derive running net totals, tax totals, grand PO total","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n
\n static header section - no data here.
below data obtained from ayReportData shows in green font.\n below data derived from Prepare shows in blue font. below data using builtinhelpers shows in red font\n \n
\n\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n \t\t \n \t\t\n \t\t\n \t\t\n \t\t\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \n \n\t\t
{{ ayLogo \"small\" }}Our PO#:{{Serial}}Vendor Ref #: {{ReferenceNumber}}
Ordered Date: {{ayDate OrderedDate}}
ETA Date: {{ayDate ExpectedReceiveDate}} {{ayDate ExpectedReceiveDate}}
VENDOR:DELIVER TO:
{{VendorViz}}My Company Name
vstaddress vstcity vststate vstpostal123 - 123 MyStreetname Ave My City, My State, My Postal
Contact: vcontact vphone vemailOrdered By: creator Phone: creatorphone
 
Our Part#:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}} {{PartNameViz}}{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}{{ayCurrency TaxBViz}}{{ayCurrency LineTotalViz}}
 
Net Total:{{ ayCurrency ThisPONet }}
 Tax A Total:{{ ayCurrency ThisPOTaxA }}0.00
Uppercase text in row below occurs as calling the Helper 'loud'Tax B Total:{{ ayCurrency ThisPOTaxB }}0.00
{{ loud \"See the last page of the entire report for a footer that ONLY displays on the last page\"}}PO Total:{{ ayCurrency ThisPODollarAmount }}
To have Prepare's AllPORunningTotal show:{{ ayCurrency ../AllPORunningTotal }}
\n {{/each}}\n \n\t
\n \n \n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n
row 1 placed here cause of the static header above:
row 2 placed here cause of the static header above:
Reminder - nothing will show if use 'AllPODollarAmount' as is NOT a variable. ONLY the left side reportDate.AllPORunningTotal will show (used in the row below)AllPODollarAmount:{{ ayCurrency AllPODollarAmount }}
no leading ../ needed when AllPORunningTotal is placed OUTSIDE of the specific #each AllPORunningTotal:{{ ayCurrency AllPORunningTotal }}
\n\n","Style":"\n\n.singlePage\n{\npage-break-after: always;\n}\n\n.page {\n page-break-after: always;\n}\n\n.page-header, .page-header-space {\n height: 50px;\n}\n\n\n.page-header { /* interesting - if this is set (fixed) then the repeating header of the actual table doesn't repeat*/\n position: fixed;\n top: 0mm;\n width: 100%;\n border-bottom: 1px solid black; /* for demo */\n background: yellow; /* for demo */\n}\n\n.blank_row\n{\n height: 15mm;\n background-color: lightgreen;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 11pt; \n} \n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\ntbody tr:nth-child(even) {\n font-size: 18pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 18pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work hmmm */\n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n background: pink; \n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarAmount = 0; //Declare a temporary variable to hold the running total of all POs in this list\n //Iterate through all the records in the reportData\n //adding the dollar amount of each item to the AllPODollarAmount variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPODollarAmount = 0; //Declare a temporary variable to hold the running total of THIS PO\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmount += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmount;\n }\n EachPO.ThisPODollarAmount=ThisPODollarAmount;\n AllPODollarAmount += ThisPODollarAmount; // Use ThisPODoallarAmount to display the running Total for THIS PO\n }\n //Add the AllPODollarAmount variable to the reportData so it can be accessed in the report template using {{AllPORunningTotal}} AS LONG as placed OUTSIDE of the main /{/{#each ayReportData}} /{/{/each}}\n reportData.AllPORunningTotal=AllPODollarAmount;\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":null,"FooterTemplate":null,"DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt deleted file mode 100644 index 8c4c39c3..00000000 --- a/server/AyaNova/resource/rpt/stock-report-templates/112 EXAMPLE PO Basic with Custom.c1 Shipping charge.ayrt +++ /dev/null @@ -1 +0,0 @@ -{"Name":"112 EXAMPLE PO Basic with Custom.c1 Shipping charge","Active":true,"Notes":"Example of utilizing a custom field for entering Shipping Charges, and custom Prepare to derive the subtotals and totals including shipping\nHTML If else /if \nMISSING: customer AND vendor contact info & address (not yet exposed in Sample Data)","Roles":124927,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t\n {{#each ayReportData}}\t \n\t\t \t\n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n \n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}} \n \n \n\n \n \n \n {{#if DropShipToCustomerViz}}{{else}} {{/if}}\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n\t\t\t\t{{#each Items}} \n\t\t\t\t\t\t\t\t\n\t\t\t\t \n \t\t \n \t\t\n \t\t\n \t\t{{#if TaxAViz}}{{else}} {{/if}}\n \t\t{{#if TaxBViz}}{{else}} {{/if}}\n \t\t \t\t\n\t\t\t\t\n\t\t\t \t{{/each}}\n\t\t\t\n \n \n \n\t\t\t\t\n\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxA}}{{else}} {{/if}}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n \t\t\t\n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t{{#if CustomFields.c1}}{{else}}{{/if}}\n \t\t\t \n \t\t\t\n \n \t\t\t\n \t\t\t\n \t\t\t \n \t\t\t\n \n \n\t\t
{{ ayLogo \"small\" }}Our Internal PO#:{{Serial}}Addt'l Ref #: {{ReferenceNumber}}
data from ayReportData shows in greenfont Ordered Date: {{ayDate OrderedDate}}
data derived from Prepare shows in bluefontETA Date: {{ayDate ExpectedReceiveDate}}{{ayDate ExpectedReceiveDate}}
data derived from Helper shows in redfontTodays date from Helper: {{todaysMonthDDYYYYDate}}
VENDOR:DELIVER TO:
{{VendorViz}}{{DropShipToCustomerViz}}My Company Name
unsure where to get vendor contact information customer contact data unknown how to get123 - 123 MyStreetname Ave My City, My State, My Postal
vendor contact not part of datasetcustomer contact data unknown how to getOrdered By: creator Phone: creatorphone
 
Our Part#:QtyPrice Per:Net:Tax A:Tax B:Line Total:
{{PartViz}} {{PartNameViz}}{{QuantityOrdered}}{{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Net Total:{{ ayCurrency ThisPONet }}
 Tax A Total:{{ ayCurrency ThisPOTaxA }}0.00
Direct all inquiries to My Company 1-888-555-5555Tax B Total:{{ ayCurrency ThisPOTaxB }}0.00
Approval for off-specification goods must be obtained via a new purchase orderThisPODollarAmountBeforeShip:{{ ayCurrency ThisPODollarAmountBeforeShip }}
This text shows IF THERE IS A Custom Shipping currency amount in CustomFields.c1:This is the text that shows IF NO Custom Shipping Charge currenty amount in CustomFields.c1:{{ ayCurrency CustomFields.c1 }}
ThisPODollarAmountWithShip:{{ ayCurrency ThisPODollarAmountWithShip }}
\n {{/each}}\n\n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 9pt;\n width: 100%;\n }\n\nthead {\n display: table-header-group; /* so as to print the table-header on all subsequent pages */\n}\n\n.heading {\n border-style: solid;\n border-width: 1pt;\n border-color: #e8e5e5; \n margin: 10pt;\n background-color: #e8e5e5;\n padding: 5pt; \n font-size: 12pt; \n} \n\ntbody tr:nth-child(even) {\n font-size: 14pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n} \ntbody tr:nth-child(odd) {\n font-size: 14pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n} \n\ntfoot {\n display: table-footer-group; /* so as to print the table-footer on all subsequent pages */\n page-break-inside: avoid;\n /* position: fixed; uncommenting position: will force footer to bottom BUT then leftlean and rightlean don't work AND tbody overwrites */\n font-size: 8pt; \n bottom: 0;\n width: 100%;\n border-top: 1px solid black; \n}\n\n.fontgreen {\n color: green;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}","JsPrerender":"async function ayPrepareData(reportData) {\n //Example of both manipulating the reportData before rendering the report (by adding a running total field)\n //and adding a field to the overall data calculating the total dollar amount for all records\n\n\n//remove statements not needed, for example ALLPOxxx are not needed\n//let AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n//let AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n//let AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n//let AllPODollarAmountBeforeShip = 0; //Declare a temporary variable to hold the running total of all POs (no shipping) in this list\n//let AllPODollarAmountWithShip = 0; //Declare a temporary variable to hold the running total of all POs with shipping custom amount\n \n\n //Iterate through all the records in the reportData adding the dollar amount of each specified property to the appropriate declared variable\n\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n // AllPONet += ThisPONet; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n // AllPOTaxA += ThisPOTaxA; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n // AllPOTaxB += ThisPOTaxB; //remove statements not needed, for example ALLPOxxx are not needed\n\n let ShipCharge=0; // has to be declared first before below \n if ( EachPO.CustomFields != null && EachPO.CustomFields.c1 != null )// then this - this first checks that CustomFields is NOT null, if so then checks that c1 isNOT null\n {\n const tempc1 = parseFloat(EachPO.CustomFields.c1); // const instead of let because not declaring it more than once per PO\n if ( tempc1 != NaN) // don't check if Null, instead check if NaN because return value for parseFloat is either NaN or the floating point number \n {\n ShipCharge = tempc1; //don't declare, update the existing instead\n }\n \n }\n\n let ThisPODollarAmountBeforeShip = 0; //Declare a temporary variable to hold the running total of THIS PO before adding shipcharge\n let ThisPODollarAmountWithShip = 0; //Declare a temporary variable to hold the running total of THIS PO WITH shipcharge\n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPODollarAmountBeforeShip += Item.LineTotalViz;\n }\n Item.PORunningTotal=ThisPODollarAmountBeforeShip;\n ThisPODollarAmountWithShip=ThisPODollarAmountBeforeShip + ShipCharge; // this working when using ShipCharge = 12 for testing, BUT while trying to use CustomFields.c1\n //isn't \"seeing\" CustomFields.c1 or EachPO.CustomFields.c1 value resulting in AllPODollarAmountWithShip showing innvalid number as well as ThisPODollarAmountWithShip not includes the actual shipping$\n }\n \n EachPO.ThisPODollarAmountBeforeShip =ThisPODollarAmountBeforeShip; // \n EachPO.ThisPODollarAmountWithShip = ThisPODollarAmountWithShip; // \n \n \n // AllPODollarAmountBeforeShip += ThisPODollarAmountBeforeShip; //remove statements not needed, for example ALLPOxxx are not needed\n // AllPODollarAmountWithShip += ThisPODollarAmountWithShip; //remove statements not needed, for example ALLPOxxx are not needed\n \n\n\n\n }\n \n // reportData.AllPONetRunning=AllPONet; //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n // reportData.AllPOTaxARunning=AllPOTaxA; //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n // reportData.AllPOTaxBRunning=AllPOTaxB; //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n // reportData.AllPORunningTotalwithoutShip=AllPODollarAmountBeforeShip; \n // reportData.AllPORunningTotalwithShip=AllPODollarAmountWithShip; \n \n\n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})","RenderType":0,"HeaderTemplate":"    (from PDF Options) Printed date: ","FooterTemplate":null,"DisplayHeaderFooter":true,"PaperFormat":10,"Landscape":false,"MarginOptionsBottom":"10mm","MarginOptionsLeft":"10mm","MarginOptionsRight":"10mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Example Inventory Reconciliation Form.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Inventory Reconciliation Form.ayrt new file mode 100644 index 00000000..109a6bc5 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Inventory Reconciliation Form.ayrt @@ -0,0 +1 @@ +{"Name":"Example Inventory Reconciliation Form","Active":true,"Notes":"","Roles":49258,"AType":90,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n\t\t \n \t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\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\t\n\t\t\t\t \n \t\t\n\n\t\t\t \n\t\t\t\t {{#each ayReportData}} \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\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \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\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t \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.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: 11pt; \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} \ntbody tr:nth-child(odd) {\n font-size: 9pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \n\n\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 font-size: 16pt;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //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":"    (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 PO Items Received vs Ordered.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt new file mode 100644 index 00000000..345826be --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example PO Items Received vs Ordered.ayrt @@ -0,0 +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
 
My Company NameInventory Reconciliation Form
 
WarehouseCategoryPart Number and NameOn HandActual CountDifference + / (-)
{{PartWarehouseName}}{{PartTags}} {{PartNumber}} {{PartName}}{{OnHandQty}}
 
Count By:__________________________________________Count Date:__________________________________________
 
 
Signature:__________________________________________
\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 diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Example Parts with available serial numbers.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Parts with available serial numbers.ayrt new file mode 100644 index 00000000..18ade006 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Parts with available serial numbers.ayrt @@ -0,0 +1 @@ +{"Name":"Example Parts with available serial numbers","Active":true,"Notes":"Uses #if_eq custom Helper to ONLY display parts from the datalist that HAVE serial numbers \n","Roles":115050,"AType":20,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n\t\t \n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n \n \n {{#each ayReportData}}\n \n\n {{#if_eq PartSerialsViz \"\"}} \n {{else}} \n \n \n \n \n \n \n \n \n {{/if_eq}}\n \t {{/each}} \n \n\n
Parts with Serials Report
 
Part NumberPart NameManufacturerCostRetailSerials
 
{{PartNumber}}{{Name}}{{ManufacturerViz}}{{ayCurrency Cost}}{{ayCurrency Retail}}{{PartSerialsViz}}
\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 font-size: 16pt;\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 return reportData;\n\n \n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})\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 new file mode 100644 index 00000000..1717f277 --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed w Custom.c1 Shipping.ayrt @@ -0,0 +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 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 new file mode 100644 index 00000000..2fdd4b6a --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Detailed.ayrt @@ -0,0 +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 diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Summary single line per PO.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Summary single line per PO.ayrt new file mode 100644 index 00000000..1155683b --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Purchase Order Summary single line per PO.ayrt @@ -0,0 +1 @@ +{"Name":"Example Purchase Order Summary single line per PO","Active":true,"Notes":"example of custom Prepare - derived running totals for nets, taxes and totals for EACH PO on single line, and running total for all POs Nets, Taxes, Totals at bottom of report","Roles":49258,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n\t\t \n \t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\t\n \n \n {{#each ayReportData}}\n \n \n \n \n \n \n \n \n \n {{#if ThisPOTaxA}}{{else}} {{/if}} \n {{#if ThisPOTaxB}}{{else}} {{/if}}\n \n \n \t {{/each}}\n \n
Header on every page
One line of Net totals for each PO in body
Footer of derived Net totals at bottom to display final totals
 
VendorPO StatusRef#PO#Expected DateOrdered DatePO NetPO TaxAPO TaxBPO Total
 
{{VendorViz}}{{StatusViz}}{{ReferenceNumber}}{{Serial}}{{ayDate ExpectedReceiveDate}}{{ayDate OrderedDate}}{{ayCurrency ThisPONet}}{{ayCurrency ThisPOTaxA}}$0.00{{ayCurrency ThisPOTaxB}}$0.00{{ayCurrency ThisPOTotalofLines}}
\n\n \n \n \n \n \n \n \n \n \n \n \n \n {{#if AllPOTaxARunning}}{{else}} {{/if}} \n {{#if AllPOTaxBRunning}}{{else}} {{/if}} \n \n \n \n
All NetAll TaxAAll TaxBAll Total
{{ ayCurrency AllPONetRunning }}{{ ayCurrency AllPOTaxARunning }}$0.00{{ ayCurrency AllPOTaxBRunning }}$0.00 {{ ayCurrency AllPOTotal }}
\n \n\t
\n\n","Style":".singlePage\n{\npage-break-after: always;\n}\n\ntable { \n font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;\n border-collapse: collapse;\n white-space: pre-wrap;\n 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: 10pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n} \ntbody tr:nth-child(odd) {\n font-size: 10pt;\n background-color: lightgoldenrodyellow; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\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 font-size: 16pt;\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\nlet AllPONet = 0; //Declare a temporary variable to hold the running net total for all POs in this list\n //Iterate through all the records in the reportData adding the dollar amount of each item to the AllPONet variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPONet variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.NetTotalViz != null) \n {\n ThisPONet += Item.NetTotalViz;\n }\n Item.PONetRunning=ThisPONet;\n }\n EachPO.ThisPONet=ThisPONet;\n AllPONet += ThisPONet; //Use ThisPONet to display the running Net total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Net\n reportData.AllPONetRunning=AllPONet;\n \nlet AllPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax A dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxA variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxAViz != null) \n {\n ThisPOTaxA += Item.TaxAViz;\n }\n Item.POTaxARunning=ThisPOTaxA;\n }\n EachPO.ThisPOTaxA=ThisPOTaxA;\n AllPOTaxA += ThisPOTaxA; // Use ThisPOTaxA to display the running Tax A total for THIS PO\n }\n //Add the AllPONet variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax A\n reportData.AllPOTaxARunning=AllPOTaxA; \n \nlet AllPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for all POs in the list\n //Iterate through all the records in the reportData adding the Tax B dollar amount of each item to the AllPOTaxA variable\n for (EachPO of reportData.ayReportData) \n {\n let ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n for (Item of EachPO.Items) //Iterate through all the poitems of THIS po adding the dollar amount of each item to the ThisPOTaxB variable\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.TaxBViz != null) \n {\n ThisPOTaxB += Item.TaxBViz;\n }\n Item.POTaxBRunning=ThisPOTaxB;\n }\n EachPO.ThisPOTaxB=ThisPOTaxB;\n AllPOTaxB += ThisPOTaxB; // Use ThisPOTaxB to display the running Tax B total for THIS PO\n }\n //Add the AllPOTaxB variable to the reportData so it can be accessed in the report template i.e. a final running total of ALL PO's Tax B\n reportData.AllPOTaxBRunning=AllPOTaxB; \n\nlet AllPODollarTotalRunning = 0; //Declare a temporary variable to hold the running total of all POs in this list\n//let ThisPOTotal = 0; //if declare this at this stage will NOT get correct EachPO.ThisPOTotalofLines\n for (EachPO of reportData.ayReportData) \n { \n let ThisPOTotal = 0; \n // need to declared let ThisPOTotal = 0; at this stage so then it will reset ThisPOTotal back to 0 before being able to add to EachPO.POsRunningTotalSoFar\n //BUT OH OH - now the entire AllPOTotal is off hmmmmmmmmmm \n for (Item of EachPO.Items)\n {\n //make sure it has a value before attempting to add it to the running total\n if (Item.LineTotalViz != null) \n {\n ThisPOTotal += Item.LineTotalViz;\n }\n Item.ThisPORunningTotal=ThisPOTotal;\n } \n EachPO.ThisPOTotalofLines =ThisPOTotal; \n //add a new key to each record in the reportData object named \"EachPO.POsRunningTotalSoFar\" with the running total so far\n EachPO.POsRunningTotalSoFar=ThisPOTotal; \n\n AllPODollarTotalRunning += ThisPOTotal; \n }\n //set the AllPODollarTotalRunning variable to the reportData so the reportData.AllPOTotal can be accessed in the report template outside of the #each \n //- i.e. in a separate footer that displays once at end of report\n reportData.AllPOTotal=AllPODollarTotalRunning; \n \n\n return reportData;\n}","JsHelpers":"//Register custom Handlebars helpers here to use in your report script\n//https://handlebarsjs.com/guide/#custom-helpers\nHandlebars.registerHelper('loud', function (aString) {\n return aString.toUpperCase()\n})\n\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 Vendor Contact Report.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Example Vendor Contact Report.ayrt new file mode 100644 index 00000000..18b0f5ff --- /dev/null +++ b/server/AyaNova/resource/rpt/stock-report-templates/Example Vendor Contact Report.ayrt @@ -0,0 +1 @@ +{"Name":"Example Vendor Contact Report","Active":true,"Notes":"","Roles":114815,"AType":33,"IncludeWoItemDescendants":false,"Template":"\n\n\t
\t \n\t\t \n \t\t\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \t\n \t\n \t\t\n \n \n {{#each ayReportData}}\n \n \n\t\t\t \n \n \n \n \n \n \n \t {{/each}}\n \n\n\t\t \n\t\t \n\n
Vendor Contact List
 
VendorTagsPrimary PhoneEmail AddressWebsiteNotes
 
{{Name}}{{Tags}}{{Phone1}}{{EmailAddress}}{{WebAddress}}{{Notes}}
\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; /* the # of columns set in the first row of the thead will be fixed and of equal width throughout */\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: 8pt;\n background-color: lightgray; /* MUST checkmark Print background in PDF Options for this to show */\n height: 50px;\n word-wrap: break-word;\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 height: 50px;\n word-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 font-size: 16pt;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n\n","JsPrerender":"async function ayPrepareData(reportData){ \n //this function (if present) is called with the report data \n //before the report is rendered\n //modify data as required here and return it to change the data before the report renders\n //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":"    (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