diff --git a/docs/8.0/ayanova/docs/img/inv-po-item-edit.png b/docs/8.0/ayanova/docs/img/inv-po-item-edit.png new file mode 100644 index 00000000..2a426cb1 Binary files /dev/null and b/docs/8.0/ayanova/docs/img/inv-po-item-edit.png differ diff --git a/docs/8.0/ayanova/docs/img/inv-po-items-menu.png b/docs/8.0/ayanova/docs/img/inv-po-items-menu.png new file mode 100644 index 00000000..d320df2a Binary files /dev/null and b/docs/8.0/ayanova/docs/img/inv-po-items-menu.png differ diff --git a/docs/8.0/ayanova/docs/img/inv-po-items-table.png b/docs/8.0/ayanova/docs/img/inv-po-items-table.png new file mode 100644 index 00000000..b19e2388 Binary files /dev/null and b/docs/8.0/ayanova/docs/img/inv-po-items-table.png differ diff --git a/docs/8.0/ayanova/docs/inv-purchase-orders.md b/docs/8.0/ayanova/docs/inv-purchase-orders.md index 9fd2e3d1..8a4d994b 100644 --- a/docs/8.0/ayanova/docs/inv-purchase-orders.md +++ b/docs/8.0/ayanova/docs/inv-purchase-orders.md @@ -39,9 +39,9 @@ Purchase orders are accessed in the following ways: The Purchase orders [data table](ay-start-form-data-tables.md) lists all the purchase orders previously entered, where you create a new purchase order and provides access to common [data table menu options](ay-start-form-data-tables.md#common-menu-options). -## Purchase order edit form +## Purchase order edit form header -The Purchase order edit form provides all the [standard edit form](ay-start-edit-forms.md) functionality and the following fields: +The Purchase order edit form provides all the [standard edit form](ay-start-edit-forms.md) functionality and the following header fields that are not part of the purchase order items collection documented [below](#order-items). #### PO number @@ -97,6 +97,107 @@ Optional notes area for any purpose that makes sense to your business. Often thi This field does not display on the stock vendor purchase order report. +#### Tags + +Optional [tags control](ay-start-form-tags.md) for categorizing and notification [filtering](home-notify-subscriptions.md#tags). + +#### Wiki + +Optional [wiki control](ay-start-form-wiki.md). + +#### Attached files + +Optional [attachments control](ay-start-form-attachments.md). + +## Order items + +### Items table + +![po items table](img/inv-po-items-table.png) + +The Items table is where the details of each line item in the PO are viewed, entered and where each item can be received individually in the case of a partial receipt. + +The columns displayed in the order items table are a mix of user entered PO Item fields and read only fields containing extra details for reference purposes. + +Many of these columns can be hidden in the user interface via [form customization](ay-customize.md) if not required. + +The far right column contains an Open button to open the purchase order item edit form to make changes to an existing item. + +### Items menu + +The items collection has it's own menu accessed from the context menu at the end of the "Order items" title in the items table. + +The menu offers options for adding items from various sources as well as bulk receiving all items when the order is received exactly as requested: + +![po items menu](img/inv-po-items-menu.png) + +#### New + +This menu option opens a [form](#item-edit-form) for entering a new purchase order line item manually. + +#### Restock list + +This menu option opens a form for selecting parts to add to this purchase order that have fallen below their [required minimum inventory quantity level](inv-part-stock-levels.md). Selections made in that form will be turned into PO items automatically and added to this purchase order. + +#### Part requests + +This menu option opens a form for selecting parts to add to this purchase order that have been [requested](inv-part-requests.md) by a service technician on a work order when they have insufficient inventory of a part to provide service. Selections made in that form will be turned into PO items automatically and added to this purchase order and a connection will be made between the work order item part request and this purchase order item to facilitate notification and provide a navigation link between both records. + +#### Receive all + +Use this menu option to completely receive the items on order that have not been received yet. This option should only be used when the order matches the received quantities exactly. In all other cases you should receive items individually inside their line item edit form. + +### Item edit form + +![po item edit form](img/inv-po-item-edit.png) + + + + +#### Changing received line items + +Inventory is _live_ in AyaNova and received items affect inventory when first received and when edited later. If you modify a received purchase order item, for example adjusting the quantity or changing a part and save the record those changes will take effect immediately in the inventory that all other AyaNova Users have access to. + +#### Part + +This column displays the selected [Part](inv-parts.md) being ordered. + +#### Part description + +This read only field displays the value entered in the [Part](inv-parts.md) records `Part description` field. This field is also available to the Part [autocomplete list template](adm-global-autocomplete-templates.md) for selection purposes. + +#### Part UPC + +This read only field displays the value entered in the [Part](inv-parts.md) records `UPC` field. This field is also available to the Part [autocomplete list template](adm-global-autocomplete-templates.md) for selection purposes. + +#### Part warehouse + +This column displays the selected part [warehouse](inv-part-warehouses.md) that will receive this line item. + +#### Part Unit of measure + +This read only field displays the value entered in the [Part](inv-parts.md) records `Unit of measure` field. This field is also available to the Part [autocomplete list template](adm-global-autocomplete-templates.md) for selection purposes. + +#### Quantity ordered + +#### Net total + +This value is the sum of the Quantity multiplied by the received cost of this line item before taxes. This value is calculated at the _server_ so will not display until a record is saved. + +#### Tax A + +This is the line total Tax A amount calculated by multiplying the Tax A percentage in the selected [Tax Code](acc-tax-codes.md) by the Net total. This value is calculated at the server and will display once a record is saved. + +#### Tax B + +This is the line total Tax B amount calculated by multiplying the Tax B percentage in the selected [Tax Code](acc-tax-codes.md) by the Net total. This value is calculated at the server and will display once a record is saved. + +#### Line total + +This value is the total sum of the Net total + Tax A amount + Tax B amount. This value is calculated at the server and will display once a record is saved. + +#### New item + 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ## New PO Item first save diff --git a/server/AyaNova/resource/rpt/stock-report-templates/Purchase Order Detailed.ayrt b/server/AyaNova/resource/rpt/stock-report-templates/Purchase Order Detailed.ayrt index 03e76dc8..81bc32ee 100644 --- a/server/AyaNova/resource/rpt/stock-report-templates/Purchase Order Detailed.ayrt +++ b/server/AyaNova/resource/rpt/stock-report-templates/Purchase Order Detailed.ayrt @@ -1 +1 @@ -{"Name":"Purchase Order Detailed","Active":true,"Notes":"custom Prepare for deriving net totals and grand total \n","Roles":49250,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t{{#each ayReportData}}\n\t\t\n\t\t\n\t\t\t\n\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{{#if DropShipToCustomerViz}}{{else}} {{/if}}\n\t\t\t\t\t{{#if DropShipToCustomerViz}}{{else}} {{/if}}\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{{#if DropShipToCustomerViz}}{{else}}{{/if}}\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 DropShipToCustomerViz}}{{else}} {{/if}}\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{{#if DropShipToCustomerViz}}{{else}} {{/if}}\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 DropShipToCustomerViz}}{{else}} {{/if}}\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\n\n\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\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 Items}}\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\t\n\t\t\t\t\t{{#if TaxAViz}}{{else}}{{/if}}\n\t\t\t\t\t{{#if TaxBViz}}{{else}}{{/if}}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\n\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\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\t{{#if ThisPOTaxA}}{{else}} {{/if}}\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{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\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\n\t\t\t\n\n\t\t
{{ayT 'PurchaseOrderPONumber'}}{{Serial}}{{ayT 'PurchaseOrderDropShipToCustomerID'}}Bill ToBill To & Ship To
{{ayT 'PurchaseOrderOrderedDate'}}{{ayDate OrderedDate}}{{DropShipToCustomerViz}}{{../ayServerMetaData.CompanyName}}
 {{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}}{{../ayServerMetaData.CompanyPostAddress}}
{{ayT 'Vendor'}}{{VendorViz}} {{DropShipToCustomerRegionViz}} {{DropShipToCustomerPostCodeViz}}{{../ayServerMetaData.CompanyPostCity}} {{../ayServerMetaData.CompanyPostRegion}} {{../ayServerMetaData.CompanyPostCode}}
{{VendorAddressViz}} {{VendorCityViz}} {{VendorRegionViz}}{{DropShipToCustomerPhone1Viz}}{{../ayServerMetaData.CompanyPhone1}} {{../ayServerMetaData.CompanyEmailAddress}}
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}}{{ayT 'VendorAccountNumber'}}{{VendorAccountNumberViz}}
 
QtyUOMOur Part#MFG#Vendor#Price PerNet{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'PurchaseOrderItemLineTotal'}}
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartNameViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Total Qty of Parts Ordered{{ThisPOTotalQty}}
{{ayT 'PurchaseOrderItemNetTotal'}}{{ayCurrency ThisPONet}}
{{ayT 'VendorAlertNotes'}}{{VendorAlertNotesViz}} {{ayT 'TaxCodeTaxA'}}{{ ayCurrency ThisPOTaxA }}0.00
{{ayT 'TaxCodeTaxB'}}{{ ayCurrency ThisPOTaxB }}0.00
 
Direct all inquiries to {{../ayServerMetaData.CompanyName}} {{../ayServerMetaData.CompanyPhone1}} or {{../ayServerMetaData.CompanyEmailAddress}}Purchase Order Total{{ ayCurrency ThisPOTotalDollar}}
\n\t\t{{/each}}\n\n\t
\n\n\n","Style":"\n.singlePage\n{\npage-break-after: always;\n\n}\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 10pt;\n width: 100%;\n table-layout: fixed; \n }\n\nth {\n height: 25px; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 7px;\n word-wrap: break-word;\n font-size: 9pt;\n}\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n font-size: 16pt;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n","JsPrerender":"async function ayPrepareData(ayData) {\n //Example of both manipulating the ayData before rendering the report (by adding a running total field)\n //and adding fields to the overall data such as calculating the total dollar amount for all records\n\n await ayGetTranslations([\"PurchaseOrderPONumber\", \"PurchaseOrderOrderedDate\", \"PurchaseOrderDropShipToCustomerID\", \"Vendor\", \"Part\", \"VendorAccountNumber\", \"PurchaseOrderItemNetTotal\", \"VendorAlertNotes\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"PurchaseOrderItemLineTotal\" ]);\n\n\n //Iterate through all the records in the ayData adding the dollar amount of each specified property to the appropriate declared variable\n\n for (const EachPO of ayData.ayReportData) \n {\n EachPO.ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n EachPO.ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po \n EachPO.ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n EachPO.ThisPOTotalDollar = 0; //Declare a temporary variable to hold the running total of THIS PO \n EachPO.ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n\n for (const 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 EachPO.ThisPONet += Item.NetTotalViz;\n }\n }\n \n for (const 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 EachPO.ThisPOTaxA += Item.TaxAViz;\n }\n }\n \n for (const 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 EachPO.ThisPOTaxB += Item.TaxBViz;\n }\n }\n\n\n for (const 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 EachPO.ThisPOTotalDollar += Item.LineTotalViz;\n }\n }\n \n\n \n \n for (const 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 EachPO.ThisPOTotalQty += Item.QuantityOrdered;\n }\n }\n\n }\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":" ","FooterTemplate":"\n          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file +{"Name":"Purchase Order Detailed","Active":true,"Notes":"custom Prepare for deriving net totals and grand total \n","Roles":49250,"AType":26,"IncludeWoItemDescendants":false,"Template":"\n\n\n\t
\n\t\t{{#each ayReportData}}\n\t\t\n\t\t\n\t\t\t\n\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{{#if DropShipToCustomerViz}}{{else}} {{/if}}\n\t\t\t\t\t{{#if DropShipToCustomerViz}}{{else}} {{/if}}\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{{#if DropShipToCustomerViz}}{{else}}{{/if}}\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 DropShipToCustomerViz}}{{else}} {{/if}}\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{{#if DropShipToCustomerViz}}{{else}} {{/if}}\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 DropShipToCustomerViz}}{{else}} {{/if}}\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\n\n\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\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 Items}}\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\t\n\t\t\t\t\t{{#if TaxAViz}}{{else}}{{/if}}\n\t\t\t\t\t{{#if TaxBViz}}{{else}}{{/if}}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{/each}}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\n\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\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\t{{#if ThisPOTaxA}}{{else}} {{/if}}\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{{#if ThisPOTaxB}}{{else}} {{/if}}\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\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\n\t\t\t\n\n\t\t
{{ayT 'PurchaseOrderPONumber'}}{{Serial}}{{ayT 'PurchaseOrderDropShipToCustomerID'}}Bill ToBill To & Ship To
{{ayT 'PurchaseOrderOrderedDate'}}{{ayDate OrderedDate}}{{DropShipToCustomerViz}}{{../ayServerMetaData.CompanyName}}
 {{DropShipToCustomerAddressViz}} {{DropShipToCustomerCityViz}}{{../ayServerMetaData.CompanyPostAddress}}
{{ayT 'Vendor'}}{{VendorViz}} {{DropShipToCustomerRegionViz}} {{DropShipToCustomerPostCodeViz}}{{../ayServerMetaData.CompanyPostCity}} {{../ayServerMetaData.CompanyPostRegion}} {{../ayServerMetaData.CompanyPostCode}}
{{VendorAddressViz}} {{VendorCityViz}} {{VendorRegionViz}}{{DropShipToCustomerPhone1Viz}}{{../ayServerMetaData.CompanyPhone1}} {{../ayServerMetaData.CompanyEmailAddress}}
{{VendorContactViz}} {{VendorPhone1Viz}} {{VendorEmailAddressViz}}{{ayT 'VendorAccountNumber'}}{{VendorAccountNumberViz}}
 
QtyUOMOur Part#MFG#Vendor#Price PerNet{{ayT 'TaxCodeTaxA'}}{{ayT 'TaxCodeTaxB'}}{{ayT 'PurchaseOrderItemLineTotal'}}
{{QuantityOrdered}}{{PartUnitOfMeasureViz}}{{PartNameViz}}{{PartManufacturerNumberViz}} {{VendorPartNumber}} {{ayCurrency PurchaseOrderCost}}{{ayCurrency NetTotalViz}}{{ayCurrency TaxAViz}}0.00{{ayCurrency TaxBViz}}0.00{{ayCurrency LineTotalViz}}
 
Total Qty of Parts Ordered{{ThisPOTotalQty}}
{{ayT 'PurchaseOrderItemNetTotal'}}{{ayCurrency ThisPONet}}
{{ayT 'PurchaseOrderVendorMemo'}}{{VendorMemo}} {{ayT 'TaxCodeTaxA'}}{{ ayCurrency ThisPOTaxA }}0.00
{{ayT 'TaxCodeTaxB'}}{{ ayCurrency ThisPOTaxB }}0.00
 
Direct all inquiries to {{../ayServerMetaData.CompanyName}} {{../ayServerMetaData.CompanyPhone1}} or {{../ayServerMetaData.CompanyEmailAddress}}Purchase Order Total{{ ayCurrency ThisPOTotalDollar}}
\n\t\t{{/each}}\n\n\t
\n\n\n","Style":"\n.singlePage\n{\npage-break-after: always;\n\n}\nbody {\n font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif; \n}\n\n.reporttitle { \n margin-bottom: 20pt; \n font-weight: bold; \n font-size: 13pt; \n} \n\ntable { \n border-collapse: collapse;\n white-space: pre-wrap;\n font-size: 10pt;\n width: 100%;\n table-layout: fixed; \n }\n\nth {\n height: 25px; \n color: #9e9e9e;\n}\n\ntbody td {\n padding: 7px;\n word-wrap: break-word;\n font-size: 9pt;\n}\n\ntbody tr:nth-child(even) {\n background-color: #f8f8f8; /* MUST checkmark Print background in PDF Options for this to show */\n}\n\n\n.rightlean {\n text-align: right;\n}\n.leftlean {\n text-align: left;\n}\n.centerlean {\n text-align: center;\n}\n\n\n.fontgreen {\n color: green;\n font-size: 16pt;\n}\n.fontblue {\n color: blue;\n}\n.fontred {\n color:red;\n}\n","JsPrerender":"async function ayPrepareData(ayData) {\n //Example of both manipulating the ayData before rendering the report (by adding a running total field)\n //and adding fields to the overall data such as calculating the total dollar amount for all records\n\n await ayGetTranslations([\"PurchaseOrderPONumber\", \"PurchaseOrderOrderedDate\", \"PurchaseOrderDropShipToCustomerID\", \"Vendor\", \"Part\", \"VendorAccountNumber\", \"PurchaseOrderItemNetTotal\", \"PurchaseOrderVendorMemo\", \"TaxCodeTaxA\", \"TaxCodeTaxB\", \"PurchaseOrderItemLineTotal\" ]);\n\n\n //Iterate through all the records in the ayData adding the dollar amount of each specified property to the appropriate declared variable\n\n for (const EachPO of ayData.ayReportData) \n {\n EachPO.ThisPONet = 0; //Declare a temporary variable to hold the running net total for THIS po\n EachPO.ThisPOTaxA = 0; //Declare a temporary variable to hold the running Tax A total for THIS po \n EachPO.ThisPOTaxB = 0; //Declare a temporary variable to hold the running Tax B total for THIS po\n EachPO.ThisPOTotalDollar = 0; //Declare a temporary variable to hold the running total of THIS PO \n EachPO.ThisPOTotalQty = 0; //Declare a temporary variable to hold the running Qty total for THIS po\n\n for (const 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 EachPO.ThisPONet += Item.NetTotalViz;\n }\n }\n \n for (const 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 EachPO.ThisPOTaxA += Item.TaxAViz;\n }\n }\n \n for (const 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 EachPO.ThisPOTaxB += Item.TaxBViz;\n }\n }\n\n\n for (const 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 EachPO.ThisPOTotalDollar += Item.LineTotalViz;\n }\n }\n \n\n \n \n for (const 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 EachPO.ThisPOTotalQty += Item.QuantityOrdered;\n }\n }\n\n }\n\n return ayData;\n}","JsHelpers":"","RenderType":0,"HeaderTemplate":" ","FooterTemplate":"\n          Printed date: \n   Page  of         ","DisplayHeaderFooter":false,"PaperFormat":10,"Landscape":true,"MarginOptionsBottom":"20mm","MarginOptionsLeft":"20mm","MarginOptionsRight":"15mm","MarginOptionsTop":"10mm","PageRanges":null,"PreferCSSPageSize":false,"PrintBackground":true,"Scale":1.00000} \ No newline at end of file