Author: jleroux
Date: Mon Jul 7 15:37:06 2014 New Revision: 1608495 URL: http://svn.apache.org/r1608495 Log: Fixes a bug: can't call PackSession.getShipmentCostEstimate() w/o orderItemShipGroup.contactMechId && orderItemShipGroup.shipmentMethodTypeId && orderItemShipGroup.carrierPartyId && orderItemShipGroup.carrierRoleTypeId) Fixes indentation Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy?rev=1608495&r1=1608494&r2=1608495&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Mon Jul 7 15:37:06 2014 @@ -140,27 +140,29 @@ if (orderId) { if ("ORDER_APPROVED".equals(orderHeader.statusId)) { if (shipGroupSeqId) { - if (!shipment) { - - // Generate the shipment cost estimate for the ship group - productStoreId = orh.getProductStoreId(); - shippableItemInfo = orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId); - shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false); - shippableTotal = new Double(orh.getShippableTotal(shipGroupSeqId).doubleValue()); - shippableWeight = new Double(orh.getShippableWeight(shipGroupSeqId).doubleValue()); - shippableQuantity = new Double(orh.getShippableQuantity(shipGroupSeqId).doubleValue()); - shipmentCostEstimate = packSession.getShipmentCostEstimate(orderItemShipGroup, productStoreId, shippableItemInfo, shippableTotal, shippableWeight, shippableQuantity); - context.shipmentCostEstimateForShipGroup = shipmentCostEstimate; - context.productStoreId = productStoreId; - - if (!picklistBinId) { - packSession.addItemInfo(shippableItems); - //context.put("itemInfos", shippableItemInfo); + if (!shipment) { + + // Generate the shipment cost estimate for the ship group + productStoreId = orh.getProductStoreId(); + shippableItemInfo = orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId); + shippableItems = delegator.findList("OrderItemAndShipGrpInvResAndItemSum", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false); + shippableTotal = new Double(orh.getShippableTotal(shipGroupSeqId).doubleValue()); + shippableWeight = new Double(orh.getShippableWeight(shipGroupSeqId).doubleValue()); + shippableQuantity = new Double(orh.getShippableQuantity(shipGroupSeqId).doubleValue()); + if (orderItemShipGroup.contactMechId && orderItemShipGroup.shipmentMethodTypeId && orderItemShipGroup.carrierPartyId && orderItemShipGroup.carrierRoleTypeId) { + shipmentCostEstimate = packSession.getShipmentCostEstimate(orderItemShipGroup, productStoreId, shippableItemInfo, shippableTotal, shippableWeight, shippableQuantity); + context.shipmentCostEstimateForShipGroup = shipmentCostEstimate; + } + context.productStoreId = productStoreId; + + if (!picklistBinId) { + packSession.addItemInfo(shippableItems); + //context.put("itemInfos", shippableItemInfo); + } + } else { + request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderHasBeenAlreadyVerified", [orderId : orderId], locale)); } } else { - request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderHasBeenAlreadyVerified", [orderId : orderId], locale)); - } - } else { request.setAttribute("errorMessageList", ['No ship group sequence ID. Cannot process.']); } } else { |
Free forum by Nabble | Edit this page |