svn commit: r1661354 - /ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1661354 - /ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml

ashish-18
Author: ashish
Date: Sat Feb 21 13:03:34 2015
New Revision: 1661354

URL: http://svn.apache.org/r1661354
Log:
Applied bug fix from trunk r1661350.
========================================================================
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/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml

Modified: ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=1661354&r1=1661353&r2=1661354&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml (original)
+++ ofbiz/branches/release12.04/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml Sat Feb 21 13:03:34 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">