Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (order.containsBackorderItems())
- {
- //Fetch all items that has to be backordered from supplier
- items = order.backorderItems();
- //Get the "slowest" item, based on delivery calculation of the (active) supplier
- slowestItem = items.sortBy(function(item) {
- return item.supplier.delivery_calculation_time;
- }).first();
- //Set the order delivery date to the longest of the suppliers
- order.deliveryDate = slowestItem.supplier.delivery_calculation_time;
- } else {
- order.deliveryDate = "today+3D";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement