svn commit: r1172965 - in /ofbiz/trunk/applications: accounting/servicedef/ product/script/org/ofbiz/shipment/issuance/ product/script/org/ofbiz/shipment/receipt/ 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: r1172965 - in /ofbiz/trunk/applications: accounting/servicedef/ product/script/org/ofbiz/shipment/issuance/ product/script/org/ofbiz/shipment/receipt/ product/servicedef/

hansbak-2
Author: hansbak
Date: Tue Sep 20 03:51:08 2011
New Revision: 1172965

URL: http://svn.apache.org/viewvc?rev=1172965&view=rev
Log:
update service product implementation now more generalized as per comment from Scott

Modified:
    ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml

Modified: ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml?rev=1172965&r1=1172964&r2=1172965&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml Tue Sep 20 03:51:08 2011
@@ -31,8 +31,8 @@ under the License.
     <eca service="createItemIssuance" event="commit">
         <condition field-name="orderId" operator="is-not-empty"/>
         <condition field-name="inventoryItemId" operator="is-not-empty"/>
-        <!-- Ignore the inventory shipment if the product type is service_product -->
-        <condition field-name="productTypeId" operator="not-equals" value="SERVICE_PRODUCT"/>
+        <!-- Ignore the inventory shipment if affectAccounting set as false -->
+        <condition field-name="affectAccounting" operator="equals" value="true" type="Boolean"/>
         <action service="createAcctgTransForSalesShipmentIssuance" mode="sync"/>
     </eca>
 
@@ -44,8 +44,8 @@ under the License.
 
     <!-- create the accounting transactions for a shipment receipt every time the inventory is received -->
     <eca service="createShipmentReceipt" event="commit">
-        <!-- Ignore the inventory shipment if the product type is service_product -->
-        <condition field-name="productTypeId" operator="not-equals" value="SERVICE_PRODUCT"/>
+        <!-- Ignore the inventory shipment if affectAccounting set as false -->
+        <condition field-name="affectAccounting" operator="equals" value="true" type="Boolean"/>
         <action service="createAcctgTransForShipmentReceipt" mode="sync"/>
     </eca>
 

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?rev=1172965&r1=1172964&r2=1172965&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml Tue Sep 20 03:51:08 2011
@@ -35,6 +35,7 @@ under the License.
         </if-empty>
 
         <create-value value-field="newEntity"/>
+        <set field="affectAccounting" type="Boolean" value="true"/>
 
         <!-- if the InventoryItem issued is serialized, then change its status to DELIVERED -->
         <get-related-one value-field="newEntity" relation-name="InventoryItem" to-value-field="inventoryItem"/>
@@ -47,9 +48,20 @@ under the License.
                 <entity-one value-field="product" entity-name="Product">
                     <field-map field-name="productId" from-field="inventoryItem.productId"/>
                 </entity-one>
-                <field-to-result field="product.productTypeId" result-name="productTypeId"/>
+                <if>
+                    <condition>
+                        <or>
+                            <if-compare field="product.productTypeId" operator="equals" value="SERVICE_PRODUCT"/>
+                            <if-compare field="product.productTypeId" operator="equals" value="ASSET_USAGE_OUT_IN"/>
+                        </or>
+                    </condition>
+                    <then>
+                        <set field="affectAccounting" type="Boolean" value="false"/>
+                    </then>
+                </if>
             </if-compare>
         </if-not-empty>
+        <field-to-result field="affectAccounting" result-name="affectAccounting"/>
     </simple-method>
     <simple-method method-name="updateItemIssuance" short-description="Update ItemIssuance">
         <set value="Update ItemIssuance" field="operationName"/>

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=1172965&r1=1172964&r2=1172965&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 Tue Sep 20 03:51:08 2011
@@ -45,9 +45,21 @@ under the License.
             <set field="invDet.receiptId" from-field="receiptId"/>
             <store-value value-field="invDet"/>
         </if-not-empty>
+        <set field="affectAccounting" type="Boolean" value="true"/>
         
         <entity-one value-field="product" entity-name="Product"/>
-        <field-to-result field="product.productTypeId" result-name="productTypeId"/>
+        <if>
+            <condition>
+                <or>
+                    <if-compare field="product.productTypeId" operator="equals" value="SERVICE_PRODUCT"/>
+                    <if-compare field="product.productTypeId" operator="equals" value="ASSET_USAGE_OUT_IN"/>
+                </or>
+            </condition>
+            <then>
+                <set field="affectAccounting" type="Boolean" value="false"/>
+            </then>
+        </if>
+        <field-to-result field="affectAccounting" result-name="affectAccounting"/>
     </simple-method>
 
     <simple-method method-name="createShipmentReceiptRole" short-description="Create a ShipmentReceipt Role">

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=1172965&r1=1172964&r2=1172965&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Tue Sep 20 03:51:08 2011
@@ -397,7 +397,7 @@ under the License.
         <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
         <auto-attributes include="pk" mode="OUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <attribute name="productTypeId" type="String" mode="OUT" optional="true"/>
+        <attribute name="affectAccounting" type="Boolean" mode="OUT" optional="true"/>
     </service>
     <service name="updateItemIssuance" default-entity-name="ItemIssuance" engine="simple"
             location="component://product/script/org/ofbiz/shipment/issuance/IssuanceServices.xml" invoke="updateItemIssuance" auth="true">
@@ -736,7 +736,7 @@ under the License.
         <permission-service service-name="facilityGenericPermission" main-action="CREATE"/>
         <implements service="interfaceShipmentReceipt"/>
         <attribute name="receiptId" type="String" mode="OUT" optional="false"/>
-        <attribute name="productTypeId" type="String" mode="OUT" optional="true"/>
+        <attribute name="affectAccounting" type="Boolean" mode="OUT" optional="true"/>
     </service>
     <service name="updatePurchaseShipmentFromReceipt" engine="java"
       location="org.ofbiz.shipment.shipment.ShipmentServices" invoke="updatePurchaseShipmentFromReceipt" auth="true">