Introduction
A Purchase Order represents the movement of product into the ownership of your organization. This could be a sourcing of inventory from suppliers or donors which will result in increase in the Qty on-hand at the destination inventory.
Direct orders enable you to create orders in a status other than Draft. This article will outline how to configure a TaroWorks Job that creates a direct-confirmed Purchase Order upon sync.
Before you begin:
- This article assumes you know how to build TaroWorks Jobs
A. Configuring the Form
1. In the Question Builder Tab, create the following sections and questions.
| Question | Question Type | |
| Section Name: Order Info (Regular Section) | ||
| Q1 | Destination Location ID** | Text |
| Q2 | Destination Warehouse ID** | Text |
| Q3 | Order Type** | Single Select (Purchase Order) |
| Q4 | Direct Orders** | Single Select (Yes) |
| Q5 | Date of Order* | Date |
| Q6 | Status** | Single Select (Confirmed) |
| Q7 | Expected Date of Delivery* | Date |
| Q8 | Supplier Contact ID** | Text |
| Q9 | Transportation Cost* | Text |
| Question | Question Type | |
| Section Name: Order Line Items (Repeat/Table Section) | ||
| Q10 | Record Type** | Single Select (Purchase Order) |
| Q11 | Status** | Single Select (Confirmed) |
| Q12 | Product ID** | Text |
| Q13 | Product* | Text |
| Q14 | Quantity* | Number (Min 0) |
| Q15 | Unit Cost* | Number |
| Question | Question Type | |
| Section Name: Total (Regular Section) | ||
| Q16 | Total Amount Due* | Number |
* Required
** Required and Hidden
2. Add the following dynamic operations to calculate and validate answers to the questions below :
Note: please replace any section names, question names, or picklist values that may be different in your org. If you are new to Dynamic Ops, kindly refer to this article for better understanding and examples.
Q3: Order Type: Sets the Order Type to Purchase Order.
Operation : Calculation
Javascript : tw.order_info.order_type.value="Purchase Order";
Q4: Direct Orders: Sets the Direct Order to "Yes"
Operation : Calculation
Javascript : tw.order_info.direct_orders.value="Yes"
Q6: Status: Sets Status to "Confirmed"
Operation : Calculation
Javascript : tw.order_info.status.value="Confirmed";
Q7: Expected Date of Delivery: Checks if Date of Delivery is greater than Date if Order
Operation : Validation
Javascript : if(tw.order_info.expected_date_of_delivery.value<tw.order_info.date_of_order.value) { throw "Date of Delivery must be on or after the date of order."; }
Q10: Record Type: Sets Record Type for Order Line Item.
Operation : Calculation
Javascript : tw.order_line_items.current.record_type.value="Purchase Order"
Q11: Status
Operation : Calculation
Javascript : tw.order_line_items.current.status_1.value="Confirmed";
Q16: Total Amount Due: Sum all Total Line Items Totals.
Operation : Calculation
Javascript : var sum =0; for(var i=0; i<tw.order_line_items.length; i++) { sum = sum + tw.order_line_items[i].unit_cost.value*tw.order_line_items[i].quantity.value; }tw.total.total_amount_due.value=sum + tw.order_info.transportation_cost.value;
| Question | Question Type | Location | Warehouse | Taro Order | Taro Order Line Item | Product | Contact | |
| Section Name: Total (Order Info) | ||||||||
| Q1 | Destination Location ID** | Text | Taro Location ID | |||||
| Q2 | Destination Warehouse ID** | Text | Taro Warehouse ID | |||||
| Q3 | Order Type** | Single Select (Purchase Order) | Record Type ID | |||||
| Q4 | Direct Orders** | Single Select (Yes) | Direct Orders | |||||
| Q5 | Date of Order* | Date | Date of Order | |||||
| Q6 | Status** | Single Select (Confirmed) | Status | |||||
| Q7 | Expected Date of Delivery* | Date | Expected Delivery Date | |||||
| Q8 | Supplier Contact ID** | Text | Contact AN ID | |||||
| Q9 | Transportation Cost* | Text | Transportation Cost | |||||
| Question | Question Type | Location | Warehouse | Taro Order | Taro Order Line Item | Product | Contact | |
| Section Name: Order Line Items (Repeat/Table Section) | ||||||||
| Q10 | Record Type** | Single Select (Purchase Order) | Record Type ID | |||||
| Q11 | Status** | Single Select (Confirmed) | Status | |||||
| Q12 | Product ID** | Text | Record AN ID | |||||
| Q13 | Product* | Text | ||||||
| Q14 | Quantity* | Number (Min 0) | Qty Ordered | |||||
| Q15 | Unit Cost* | Number | Unit Cost | |||||
| Question | Question Type | Location | Warehouse | Taro Order | Taro Order Line Item | Product | Contact | |
| Section Name: Total (Regular Section) | ||||||||
| Q16 | Total Amount Due* | Number | ||||||
B. Configuring the Job
1. Configure the following drill-down hierarchies (DDH).
2. Check Allow Mobile User to select multiple records in the last level for the first drill-down hierarchy listing products.
3. Configure the following Task.
5. Click Save, Save the job again and Publish.
NOTE: Always perform extensive testing on any jobs that you create before assigning them to your field staff.
Comments
0 comments
Article is closed for comments.