From 35aba3c13bc02f72d45bbadad5a4e6b5c07bf3bc Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Mon, 14 May 2007 19:19:34 +0000 Subject: [PATCH] Set a default date of now for the ship groups with a null requiredByDate in setEstimatedDeliveryDates service. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@537955 13f79535-47bb-0310-9956-ffa450edef68 --- .../manufacturing/jobshopmgt/ProductionRunServices.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java index 60f387f59b..b42e9f6fa5 100644 --- a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java +++ b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java @@ -2614,12 +2614,15 @@ public class ProductionRunServices { while (backordersIt.hasNext()) { GenericValue genericResult = (GenericValue) backordersIt.next(); String productId = genericResult.getString("productId"); - Timestamp requiredByDate = genericResult.getTimestamp("shipBeforeDate"); + GenericValue orderItemShipGroup = delegator.findByPrimaryKey("OrderItemShipGroup", UtilMisc.toMap("orderId", genericResult.get("orderId"), + "shipGroupSeqId", genericResult.get("shipGroupSeqId"))); + Timestamp requiredByDate = orderItemShipGroup.getTimestamp("shipByDate"); + Double quantityNotAvailable = genericResult.getDouble("quantityNotAvailable"); double quantityNotAvailableRem = quantityNotAvailable.doubleValue(); if (requiredByDate == null) { - // TODO: what happens if requiredByDate is null? - continue; + // If shipByDate is not set, 'now' is assumed. + requiredByDate = now; } if (!products.containsKey(productId)) { continue;