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
This commit is contained in:
Jacopo Cappellato
2007-05-14 19:19:34 +00:00
parent 532ad4e66c
commit 35aba3c13b
@@ -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;