Description: Escalating charges based on container size and quantity of cartons (Num Units 1)
Script:
User Input:
Explanation: You set a default charge, then tiered charges (highest to lowest count) and pick a Capacity Type from the drop-list. If the Num Units 1 field has a value, and the capacity type on the WarehouseTransaction is one of the ones you defined in the script setup, then it creats a new charge, assigns the NumUnits (for the charge, not the Num Units 1 field) to 1, sets the initial charge to the default value, and adds the Num Units 1 value to the Unit Description (of the charge). After that it checks through your tiered charges, finds the first one that is less than or equal to the Num Units 1 value, and sets the ChargePerUnit of the charge to the associated price. For Example: if you have tiered charges of 20:15, 15:12, 10:10, 5:7 and the Num Units 1 value was 16, the charge would be 15. If it was 10-6 it would be 10, and if it was 5 or less it would be 7. If it was more than 20 (21 or higher) the default charge would be used. Again, this is only in cases where there is a CapacityType selected on the transaction, and it's one of the ones setup in the script.