This section describes how the max quantity and ordered quantity fields are updated or used by the system when an existing Sales Order, Quote or Loaner Order is edited.
Adding New Order Lines
If a new line item is added to an existing order and the new line item makes use of a special price or rebate record with a defined maximum quantity, the system uses the logic described in the previous section (sales order entry) when checking the max quantity and blocking the entry of orders that would cause the special or rebate record to exceed the maximum quantity defined in the record.
The system performs the max quantity check for the new order line as it is saved and it blocks save of the line if the order quantity would cause the special or rebate record being used to exceed the maximum quantity defined in the record. The system then also displays a notice to indicate the quantity that is still available for the rebate or special price. This allows the operator to enter one line for the quantity available for the rebate or special price, and an additional line for any remaining qty that does not make use of the rebate or special price.
Editing Existing Order Lines
When an existing sales order line quantity is edited and a rebate or special price is being used for the order line, the system skips the maximum quantity check during line item entry. This is due to the fact the system needs to use the change to the line quantity in the max quantity check, and the change is calculated by comparing the original order line to the updated line quantity during order entry (this check cannot be made until the quantity has been edited and saved to the line).
During the save from the header, the system checks the change or delta to the order lines and it also performs the max quantity check for any of the lines that make use of a special price or rebate. The system then uses the following logic.
• Increase to order quantity – If an existing order line quantity is increased, the system checks to make sure that the current ordered qty in the record plus the increase to the line is less than or equal to the maximum quantity defined in the record. If the qty is too large, the system warns the user and displays a notice with the quantity that is still available for the rebate or special price.
• Decrease to order quantity - If an existing order line quantity is decreased and the order line makes use of a special or rebate record, the system just decreases the ordered quantity in the special or rebate record by the change (decrease) to the order line quantity.
• Changing the rebate – If an existing order line is entered with or without a rebate or special price and the line is later edited to pick up a different rebate or special pricing record, the system will decrease the quantity of any previous rebate, and it will increase the quantity of the new rebate or special pricing record selected by the operator (this picks up edits where a rebate or special price is added to a line that was originally saved without a special price or rebate record and situations where a rebate or special price is changed to another rebate or special price).
Deleting Existing Order Lines
If an existing order line (or entire sales order) is deleted and the order line (or lines) are associated with a special or rebate record, the system decreases the ordered qty field in the special or rebate record based on the quantity in each line. The logic used is the same for all order line types (L, Q and S).