Author: mor
Date: Fri May 28 05:01:52 2010
New Revision: 949097
URL: http://svn.apache.org/viewvc?rev=949097&view=rev
Log:
Minor improvement over the commit in r948414. Moving the code out of the loop
since the code is just intended to be run for non-serialized inventory.
The code inside the loop runs only once for non-serialized inventory but in
case of serialized inventory the code inside loop runs equivalent to the
number of the quanity accepted and hence the code for status checking may run
multiple times based on the quantity accepted. So as a performance check
it will now run only once.
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=949097&r1=949096&r2=949097&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
Fri May 28 05:01:52 2010
@@ -96,32 +96,33 @@ under the License.
<!-- before getting going, see if there are any validation issues so
far -->
<check-errors/>
+ <!-- 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>
+
<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"/>