You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/05/07 12:32:03 UTC

svn commit: r535839 - /ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml

Author: jacopoc
Date: Mon May  7 03:32:01 2007
New Revision: 535839

URL: http://svn.apache.org/viewvc?view=rev&rev=535839
Log:
When a serialized inventory item is issued, the ownerPartyId of the inventory item is changed to the end user customer.

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml?view=diff&rev=535839&r1=535838&r2=535839
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Mon May  7 03:32:01 2007
@@ -40,7 +40,17 @@
         <!-- if the InventoryItem issued is serialized, then change its status to DELIVERED -->
         <get-related-one value-name="newEntity" relation-name="InventoryItem" to-value-name="inventoryItem"/>
         <if-not-empty field-name="inventoryItem">
-            <if-compare field-name="inventoryItemTypeId" map-name="inventoryItem" operator="equals" value="SERIALIZED_INV_ITEM">
+            <if-compare field-name="inventoryItem.inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM">
+                <get-related-one value-name="newEntity" relation-name="OrderHeader" to-value-name="orderHeader"/>
+                <if-not-empty field-name="orderHeader">
+                    <set field="orderRoleAndMap.orderId" from-field="orderHeader.orderId"/>
+                    <set field="orderRoleAndMap.roleTypeId" value="END_USER_CUSTOMER"/>
+                    <find-by-and entity-name="OrderRole" list-name="orderRoles" map-name="orderRoleAndMap"/>
+                    <first-from-list list-name="orderRoles" entry-name="orderRole"/>
+                    <if-not-empty field-name="orderRole">
+                        <set field="updateContext.ownerPartyId" from-field="orderRole.partyId"/>
+                    </if-not-empty>
+                </if-not-empty>
                 <set field="updateContext.inventoryItemId" from-field="inventoryItem.inventoryItemId"/>
                 <set field="updateContext.statusId" value="INV_DELIVERED"/>
                 <call-service service-name="updateInventoryItem" in-map-name="updateContext"/>