AR Changes - Apply Scheduled Qty in Contract Upon Saving of TM Order

Issue No: AR-14552
Created 4/12/2022 2:22:04 AM
Type Feature
Priority Critical
Status Closed
Resolution Fixed
Fixed Version 20.1
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-271567 - Handle Contract Overages for Digital Dispatcher|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-271567]   +Requirements:+   * Implement Contracts > Schedule Qty upon creating and saving of TM Order. * Removing of order should revert the contract's schedule qty to its previous value. * AR should be able to determine if the tank delivery invoice created is from ET or MBIL. This is to avoid double update on scheduled qty via TM Order creation and invoice.     *Steps and Example*   +I. Order via Consumption Site+   1. Create a contract with Qty of 1000. Click Save. Contract should have:   * Applied = 0.00 * Qty Scheduled = 0.00 * Available - 1000.00   2. Create an order with calculated or desired qty of 500. Select or use the customer contract created in Step 1. Click Save.   3. Check the contract's Schedule Qty value. It should show the values as:   * Applied = 0.00 * Qty Scheduled = 500.00 * Available - 500.00   4. Dispatch the order.   5. Create an invoice based on TM order. Save the invoice.   6. Check the contract's Schedule Qty value.   * Applied = 0.00 * Qty Scheduled = 500.00 * Available - 500.00   7. Post the invoice.   * Applied = 500.00 * Qty Scheduled = 0.00 * Available - 500.00     +II. Order via Generate Orders+   1. Create a contract with Qty of 1000. Click Save. Contract should have:   * Applied = 0.00 * Qty Scheduled = 0.00 * Available - 1000.00   2. From TM > Generate Order > enter parameters that will list customers with contract   3. Select the customer > click Finalize Order button.   4. Check the generated order by opening the site   5. Check the contract's Schedule Qty value. It should show the values as:   * Applied = 0.00 * Qty Scheduled = 500.00 * Available - 500.00   6. Dispatch the order.   7. Create an invoice based on TM order. Save the invoice.   8. Check the contract's Schedule Qty value.   * Applied = 0.00 * Qty Scheduled = 500.00 * Available - 500.00   9. Post the invoice.   * Applied = 500.00 * Qty Scheduled = 0.00 * Available - 500.00     +III.++Order with Mismatch Qty in+ +Tank Delivery Invoice+   _Based on AR-TM Discussions:_   If tank delivery invoice is created manually, AR should check if there's an existing order for the customer based on site and ticket assigned no.   * Ticket Assigned/Order No column to be added in Invoice > Item grid. This will determine if the site has existing order. * If site no has existing order, desired qty/calc qty will be checked behind the scene. ** If invoice shipped qty is equal to desired qty/calc qty, Scheduled Qty will not be updated. ** Else, the invoice will update (add or subtract) the Scheduled Qty upon saving. Ex. Order Qty = 500 then Scheduled Qty = 500, Invoice Shipped Qty entered is 1000 then AR will compare the qty and will add 500 to Scheduled Qty to match.   1. Prepare a contract with customer and item used is equal to consumption site customer and item. Set balance qty to 1000.   2. Create an order with Desired Qty = 500. Save.   3. Check the contract's Schedule Qty value. It should show the values as:   * Applied = 0.00 * Qty Scheduled = 500.00 (from TM order) * Available = 500.00   3. From Sales AR > Invoices > New > enter details for Source Type = Tank Delivery   4. Enter the details for item in grid. Select the site no, contract and sequence. Shipped Qty = 1000.   5. Save the invoice.   6. Go to Contract Management > Contracts > open the specific contract used in invoice.   If qty in order is does not match with the invoice shipped qty, AR will update the Scheduled Qty upon saving:   * Applied = 0.00 * Qty Scheduled = 1000.00 (500 from TM order and additional 500 from invoice) * Available = 0.00   5. Go back to invoice. Post.   6. Check the contract which should display the correct values:   * Applied = 1000.00 * Qty Scheduled = 0.00 * Available = 0.00     Acceptance:   Quantity should be updated successfully.