svn commit: r948414 - /ofbiz/trunk/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: r948414 - /ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml

mor-2
Author: mor
Date: Wed May 26 12:37:11 2010
New Revision: 948414

URL: http://svn.apache.org/viewvc?rev=948414&view=rev
Log:
An alternative fix to the status of non-serialized inventory item when a return is received. This also fix an issue when a
defective inventory item is reserved against a non-serialized inventory while placing a sales order.

Bug reported by Ratnesh Upadhyay.
 

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=948414&r1=948413&r2=948414&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 Wed May 26 12:37:11 2010
@@ -99,6 +99,29 @@ under the License.
         <loop count="${loops}" field="currentLoop">
             <log level="info" message="receiveInventoryProduct Looping and creating inventory info - ${currentLoop}"/>
 
+            <!-- Status for Non serialized and Serialized inventory are different, lets make sure correct status is stored in database -->
+            <if-compare field="parameters.inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM">
+                <if-compare field="parameters.statusId" operator="equals" value="INV_DEFECTIVE"><!-- This status may come from the Receive Return Screen -->
+                    <set field="parameters.statusId" value="INV_NS_DEFECTIVE"/>
+                <else>
+                    <if-compare field="parameters.statusId" operator="equals" value="INV_ON_HOLD">
+                        <set field="parameters.statusId" value="INV_NS_ON_HOLD"/>
+                    </if-compare>
+                </else>
+                </if-compare>
+                <!-- Any other status should be just set to null, if it is not a valid status for Non Serialized inventory -->
+                <if>
+                    <condition>
+                        <and>
+                            <not><if-compare field="parameters.statusId" operator="equals" value="INV_NS_DEFECTIVE"/></not>
+                            <not><if-compare field="parameters.statusId" operator="equals" value="INV_NS_ON_HOLD"/></not>
+                        </and>
+                    </condition>
+                    <then>
+                        <set field="parameters.statusId" from-field="nullField"/>
+                    </then>
+                </if>
+            </if-compare>
             <!-- if there is an inventoryItemId, update it (this will happen when receiving serialized inventory already in the system, like for returns); if not create one -->
             <clear-field field="serviceInMap"/>
             <clear-field field="currentInventoryItemId"/>