Author: ashish
Date: Sat Feb 21 12:57:04 2015
New Revision: 1661350

URL: http://svn.apache.org/r1661350
Log:
Applied patch from jira issue - OFBIZ-5373 - If received quantity is greater 
then ordered quantity then order item quantity update but order item shipgroup 
assoc quantity does not updated.
Thanks Deepak for creating the issue, Thanks Rishi for providing the patch. 
Thanks Arun for the verification. 

Modified:
    
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml

Modified: 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=1661350&r1=1661349&r2=1661350&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
 Sat Feb 21 12:57:04 2015
@@ -467,7 +467,26 @@ under the License.
         </if-not-empty>
         <call-simple-method method-name="getReceivedQuantityForOrderItem"/>
         <if-compare-field field="orderItem.quantity" operator="less" 
to-field="receivedQuantity" type="BigDecimal">
+            <entity-and list="orderItemShipGroupAssocs" 
entity-name="OrderItemShipGroupAssoc">
+                <field-map field-name="orderId" 
from-field="orderItem.orderId"/>
+                <field-map field-name="orderItemSeqId" 
from-field="orderItem.orderItemSeqId"/>
+            </entity-and>
+            <calculate field="quantityVariance" type="BigDecimal" 
decimal-scale="2" rounding-mode="HalfUp">
+                <calcop operator="subtract">
+                    <calcop operator="get" field="receivedQuantity"/>
+                    <calcop operator="get" field="orderItem.quantity"/>
+                </calcop>
+            </calculate>
+            <first-from-list entry="orderItemShipGroupAssoc" 
list="orderItemShipGroupAssocs"/>
+            <calculate field="oisgaQuantity" type="BigDecimal" 
decimal-scale="2" rounding-mode="HalfUp">
+                <calcop operator="add">
+                    <calcop operator="get" 
field="orderItemShipGroupAssoc.quantity"/>
+                    <calcop operator="get" field="quantityVariance"/>
+                </calcop>
+            </calculate>
+            <set field="orderItemShipGroupAssoc.quantity" 
from-field="oisgaQuantity"/>
             <set field="orderItem.quantity" from-field="receivedQuantity"/>
+            <store-value value-field="orderItemShipGroupAssoc"/>
             <store-value value-field="orderItem"/>
         </if-compare-field>
         <if-not-empty field="parameters.shipmentId">


Reply via email to