Author: mor
Date: Thu Dec 29 20:25:34 2011 New Revision: 1225640 URL: http://svn.apache.org/viewvc?rev=1225640&view=rev Log: Formatting changes only. Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1225640&r1=1225639&r2=1225640&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Thu Dec 29 20:25:34 2011 @@ -4046,38 +4046,38 @@ public class ShoppingCart implements Ite for (CartShipInfo csi : shipInfo) { Set<ShoppingCartItem> items = csi.getShipItems(); - for (ShoppingCartItem item : items) { - String requirementId = item.getRequirementId(); - if (requirementId != null) { - try { - List<GenericValue> commitments = getDelegator().findByAnd("OrderRequirementCommitment", UtilMisc.toMap("requirementId", requirementId)); - // TODO: multiple commitments for the same requirement are still not supported - GenericValue commitment = EntityUtil.getFirst(commitments); - if (commitment != null) { - GenericValue orderItemAssociation = getDelegator().makeValue("OrderItemAssoc"); - orderItemAssociation.set("orderId", commitment.getString("orderId")); - orderItemAssociation.set("orderItemSeqId", commitment.getString("orderItemSeqId")); - orderItemAssociation.set("shipGroupSeqId", "_NA_"); - orderItemAssociation.set("toOrderItemSeqId", item.getOrderItemSeqId()); - orderItemAssociation.set("toShipGroupSeqId", "_NA_"); - orderItemAssociation.set("orderItemAssocTypeId", "PURCHASE_ORDER"); - allOrderItemAssociations.add(orderItemAssociation); + for (ShoppingCartItem item : items) { + String requirementId = item.getRequirementId(); + if (requirementId != null) { + try { + List<GenericValue> commitments = getDelegator().findByAnd("OrderRequirementCommitment", UtilMisc.toMap("requirementId", requirementId)); + // TODO: multiple commitments for the same requirement are still not supported + GenericValue commitment = EntityUtil.getFirst(commitments); + if (commitment != null) { + GenericValue orderItemAssociation = getDelegator().makeValue("OrderItemAssoc"); + orderItemAssociation.set("orderId", commitment.getString("orderId")); + orderItemAssociation.set("orderItemSeqId", commitment.getString("orderItemSeqId")); + orderItemAssociation.set("shipGroupSeqId", "_NA_"); + orderItemAssociation.set("toOrderItemSeqId", item.getOrderItemSeqId()); + orderItemAssociation.set("toShipGroupSeqId", "_NA_"); + orderItemAssociation.set("orderItemAssocTypeId", "PURCHASE_ORDER"); + allOrderItemAssociations.add(orderItemAssociation); + } + } catch (GenericEntityException e) { + Debug.logError(e, "Unable to load OrderRequirementCommitment records for requirement ID : " + requirementId, module); } - } catch (GenericEntityException e) { - Debug.logError(e, "Unable to load OrderRequirementCommitment records for requirement ID : " + requirementId, module); + } + if (item.getAssociatedOrderId() != null && item.getAssociatedOrderItemSeqId() != null) { + GenericValue orderItemAssociation = getDelegator().makeValue("OrderItemAssoc"); + orderItemAssociation.set("orderId", item.getAssociatedOrderId()); + orderItemAssociation.set("orderItemSeqId", item.getAssociatedOrderItemSeqId()); + orderItemAssociation.set("shipGroupSeqId", csi.getAssociatedShipGroupSeqId() != null ? csi.getAssociatedShipGroupSeqId() : "_NA_"); + orderItemAssociation.set("toOrderItemSeqId", item.getOrderItemSeqId()); + orderItemAssociation.set("toShipGroupSeqId", csi.getShipGroupSeqId() != null ? csi.getShipGroupSeqId() : "_NA_"); + orderItemAssociation.set("orderItemAssocTypeId", item.getOrderItemAssocTypeId()); + allOrderItemAssociations.add(orderItemAssociation); } } - if (item.getAssociatedOrderId() != null && item.getAssociatedOrderItemSeqId() != null) { - GenericValue orderItemAssociation = getDelegator().makeValue("OrderItemAssoc"); - orderItemAssociation.set("orderId", item.getAssociatedOrderId()); - orderItemAssociation.set("orderItemSeqId", item.getAssociatedOrderItemSeqId()); - orderItemAssociation.set("shipGroupSeqId", csi.getAssociatedShipGroupSeqId() != null ? csi.getAssociatedShipGroupSeqId() : "_NA_"); - orderItemAssociation.set("toOrderItemSeqId", item.getOrderItemSeqId()); - orderItemAssociation.set("toShipGroupSeqId", csi.getShipGroupSeqId() != null ? csi.getShipGroupSeqId() : "_NA_"); - orderItemAssociation.set("orderItemAssocTypeId", item.getOrderItemAssocTypeId()); - allOrderItemAssociations.add(orderItemAssociation); - } - } } return allOrderItemAssociations; } |
Free forum by Nabble | Edit this page |