svn commit: r537964 - in /ofbiz/trunk/applications: manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ product/entitydef/ product/script/org/ofbiz/product/inventory/ product/servicedef/

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

svn commit: r537964 - in /ofbiz/trunk/applications: manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ product/entitydef/ product/script/org/ofbiz/product/inventory/ product/servicedef/

jaz-3
Author: jaz
Date: Mon May 14 12:50:48 2007
New Revision: 537964

URL: http://svn.apache.org/viewvc?view=rev&rev=537964
Log:
implemented InventoryItemStatus service; set triggers and modified direct calls to store() to call the updateInventoryItem service (there may still be more)

Modified:
    ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
    ofbiz/trunk/applications/product/entitydef/eecas.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
    ofbiz/trunk/applications/product/servicedef/secas.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.xml

Modified: ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml (original)
+++ ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.xml Mon May 14 12:50:48 2007
@@ -254,7 +254,7 @@
             <if-compare value="INV_AVAILABLE" operator="equals" field-name="inventoryItem.statusId">
                 <!-- change status on inventoryItem -->
                 <set field="inventoryItem.statusId" value="INV_DELIVERED"/>
-                <store-value value-name="inventoryItem"/>
+                <call-service service-name="updateInventoryItem" in-map-name="updateContext"/>
 
                 <!-- create ItemIssuance record -->
                 <set field="issuanceCreateMap.workEffortId" from-field="parameters.workEffortId"/>

Modified: ofbiz/trunk/applications/product/entitydef/eecas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/eecas.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/eecas.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/eecas.xml Mon May 14 12:50:48 2007
@@ -50,6 +50,11 @@
     <eca entity="InventoryItem" operation="create" event="return">
         <action service="createInventoryItemCheckSetAtpQoh" mode="sync"/>
     </eca>
+    <!-- Create the initial status record -->
+    <eca entity="InventoryItem" operation="create" event="return">
+        <condition field-name="statusId" operator="is-not-empty"/>
+        <action service="createInventoryItemStatus" mode="sync"/>
+    </eca>
     <!-- The InventoryItemDetail entity should never be updated/stored or deleted/removed, but we'll catch those too anyway... -->
     <eca entity="InventoryItemDetail" operation="create-store-remove" event="return">
         <action service="updateInventoryItemFromDetail" mode="sync"/>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryIssueServices.xml Mon May 14 12:50:48 2007
@@ -197,7 +197,7 @@
                 <if-compare value="INV_AVAILABLE" operator="equals" field-name="statusId" map-name="inventoryItem">
                     <!-- change status on inventoryItem -->
                     <set field="inventoryItem.statusId" value="INV_DELIVERED" />
-                    <store-value value-name="inventoryItem"/>
+                    <call-service service-name="updateInventoryItem" in-map-name="inventoryItem"/>
 
                     <!-- create ItemIssuance record -->
                     <set field="issuanceCreateMap.orderId" from-field="parameters.orderId"/>

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Mon May 14 12:50:48 2007
@@ -162,6 +162,16 @@
         <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
         <store-value value-name="lookedUpValue"/>
     </simple-method>
+
+    <simple-method method-name="createInventoryItemStatus" short-description="Create an inventory item status record">
+        <make-value value-name="invStatus" entity-name="InventoryItemStatus"/>
+        <set-nonpk-fields map-name="parameters" value-name="invStatus"/>
+        <set-pk-fields map-name="parameters" value-name="invStatus"/>
+        <now-timestamp-to-env env-name="now"/>
+        <set field="invStatus.statusDatetime" from-field="now"/>
+        <create-value value-name="invStatus"/>
+    </simple-method>
+
     <simple-method method-name="createInventoryItemDetail" short-description="Create an InventoryItemDetail">
         <make-value value-name="newEntity" entity-name="InventoryItemDetail"/>
 

Modified: ofbiz/trunk/applications/product/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/secas.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/secas.xml Mon May 14 12:50:48 2007
@@ -20,7 +20,24 @@
 
 <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-eca.xsd">
-    <!-- Inventory Transfer ECAs -->
+    <!-- update inventory item -->    
+    <eca service="updateInventoryItem" event="commit">
+        <condition field-name="statusId" operator="is-not-empty"/>
+        <condition-field field-name="oldStatusId" operator="not-equals" to-field-name="statusId"/>
+        <action service="createInventoryItemStatus" mode="sync"/>
+    </eca>
+    <eca service="updateInventoryItem" event="commit">
+        <condition field-name="productId" operator="is-not-empty"/>
+        <condition-field field-name="oldProductId" operator="not-equals" to-field-name="productId"/>
+        <action service="createInventoryItemStatus" mode="sync"/>
+    </eca>
+    <eca service="updateInventoryItem" event="commit">
+        <condition field-name="ownerPartyId" operator="is-not-empty"/>
+        <condition-field field-name="oldOwnerPartyId" operator="not-equals" to-field-name="ownerPartyId"/>
+        <action service="createInventoryItemStatus" mode="sync"/>
+    </eca>
+
+    <!-- inventory transfer -->
     <eca service="createInventoryTransfer" event="invoke">
         <condition field-name="statusId" operator="not-equals" value="IXF_CANCELLED"/>
         <action service="prepareInventoryTransfer" mode="sync"/>

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?view=diff&rev=537964&r1=537963&r2=537964
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Mon May 14 12:50:48 2007
@@ -55,8 +55,18 @@
             <exclude field-name="quantityOnHandTotal"/>
         </auto-attributes>
         <attribute name="oldOwnerPartyId" mode="OUT" optional="false" type="String"/>
+        <attribute name="oldProductId" mode="OUT" optional="true" type="String"/>
         <attribute name="oldStatusId" mode="OUT" optional="true" type="String"/>
     </service>
+
+    <service name="createInventoryItemStatus" engine="simple" default-entity-name="InventoryItemStatus"
+            location="org/ofbiz/product/inventory/InventoryServices.xml" invoke="createInventoryItemStatus">
+        <description>Create an inventory item status record</description>
+        <auto-attributes mode="IN" include="all" optional="true"/>
+        <override name="inventoryItemId" optional="false"/>
+        <override name="statusId" optional="false"/>
+    </service>
+
     <service name="checkProductInventoryDiscontinuation" engine="simple"
                 location="org/ofbiz/product/inventory/InventoryServices.xml" invoke="checkProductInventoryDiscontinuation" auth="false">
         <description>Check Product Inventory Discontinuation</description>