Author: jacopoc
Date: Wed Jun 27 11:36:24 2007
New Revision: 551262

URL: http://svn.apache.org/viewvc?view=rev&rev=551262
Log:
Added new field to the ProductStore entity to track if the store should set the 
owner on serialized inventory items upon issuance.

Modified:
    ofbiz/trunk/applications/product/entitydef/entitymodel.xml
    
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
    ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?view=diff&rev=551262&r1=551261&r2=551262
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Wed Jun 27 
11:36:24 2007
@@ -3286,6 +3286,7 @@
       <field name="autoApproveInvoice" type="indicator"><description>If Y or 
empty, sales invoices created from orders will be marked 
ready.</description></field>
       <field name="autoApproveOrder" type="indicator"><description>If N, 
orders will not be automatically approved when payment is 
authorized.</description></field>
       <field name="shipIfCaptureFails" type="indicator"><description>If N, the 
captureOrderPayments will cause a service error if credit card capture 
fails.</description></field>
+      <field name="setOwnerUponIssuance" type="indicator"><description>If Y or 
empty, set the inventory item owner upon issuance.</description></field>
       <prim-key field="productStoreId"/>
       <relation type="one" fk-name="PROD_STR_PRSTRGP" title="Primary" 
rel-entity-name="ProductStoreGroup">
         <key-map field-name="primaryStoreGroupId" 
rel-field-name="productStoreGroupId"/>

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=551262&r1=551261&r2=551262
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
 Wed Jun 27 11:36:24 2007
@@ -47,9 +47,23 @@
                     <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>
+                    <set field="prodStoreMap" 
from-field="orderHeader.productStoreId"/>
+                    <find-by-and entity-name="ProductStore" 
list-name="productStore" map-name="prodStoreMap"/>
+                    <if>
+                        <condition>
+                            <and>
+                                <not><if-empty field-name="orderRole"/></not>
+                                <or>
+                                    <if-empty field-name="productStore"/>
+                                    <if-empty 
field-name="productStore.setOwnerUponIssuance"/>
+                                    <if-compare 
field-name="productStore.setOwnerUponIssuance" operator="equals" value="Y"/>
+                                </or>
+                            </and>
+                        </condition>
+                        <then>
+                            <set field="updateContext.ownerPartyId" 
from-field="orderRole.partyId"/>
+                        </then>
+                    </if>
                 </if-not-empty>
                 <set field="updateContext.inventoryItemId" 
from-field="inventoryItem.inventoryItemId"/>
                 <set field="updateContext.statusId" value="INV_DELIVERED"/>

Modified: 
ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml?view=diff&rev=551262&r1=551261&r2=551262
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml 
(original)
+++ ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml 
Wed Jun 27 11:36:24 2007
@@ -246,7 +246,9 @@
         <field name="shipIfCaptureFails" widget-style="selectBox">
             <drop-down allow-empty="false" no-current-selected-key="Y"><option 
key="Y" description="${uiLabelMap.CommonY}"/><option key="N" 
description="${uiLabelMap.CommonN}"/></drop-down>
         </field>
-        
+        <field name="setOwnerUponIssuance" widget-style="selectBox">
+            <drop-down allow-empty="true"><option key="Y" 
description="${uiLabelMap.CommonY}"/><option key="N" 
description="${uiLabelMap.CommonN}"/></drop-down>
+        </field>
         <field name="submitButton" title="${uiLabelMap.CommonUpdate}" 
widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
 


Reply via email to