svn commit: r432831 - /incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml

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

svn commit: r432831 - /incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml

jacopoc
Author: jacopoc
Date: Sat Aug 19 05:02:33 2006
New Revision: 432831

URL: http://svn.apache.org/viewvc?rev=432831&view=rev
Log:
Applied patch from Scott Gray (OFBIZ-168) to make the routing associated to a virtual product the default value for all the variants.

Modified:
    incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml

Modified: incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml?rev=432831&r1=432830&r2=432831&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml (original)
+++ incubator/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/routing/RoutingServices.xml Sat Aug 19 05:02:33 2006
@@ -27,6 +27,31 @@
         <filter-list-by-date list-name="routings"/>
         <!-- TODO: we should consider the quantity to select the best routing -->
         <first-from-list list-name="routings" entry-name="routingGS"/>
+        <!-- If there are no routings associated with our product and it's a variant, then
+             check to see if it's virtual product has a routing -->
+        <if-empty field-name="routingGS">
+            <entity-one entity-name="Product" value-name="product" auto-field-map="false" >
+                <field-map field-name="productId" env-name="parameters.productId" />
+            </entity-one>
+            <if-compare field-name="product.isVariant" operator="equals" value="Y">
+                <entity-condition entity-name="ProductAssoc" list-name="virtualProductAssocList" filter-by-date="true">
+                    <condition-list combine="and">
+                        <condition-expr field-name="productIdTo" env-name="parameters.productId" />
+                        <condition-expr field-name="productAssocTypeId" value="PRODUCT_VARIANT" />
+                    </condition-list>
+                </entity-condition>
+                <first-from-list list-name="virtualProductAssocList" entry-name="virtualProductAssoc" />
+                <if-not-empty field-name="virtualProductAssoc">
+                    <set from-field="virtualProductAssoc.productId" field="lookupRouting.productId"/>
+                    <set value="ROU_PROD_TEMPLATE" field="lookupRouting.workEffortGoodStdTypeId"/>
+                    <find-by-and entity-name="WorkEffortGoodStandard" list-name="routings" map-name="lookupRouting"/>
+                    <!-- TODO: we should consider the validity against a date passed as (optional) parameter -->
+                    <filter-list-by-date list-name="routings"/>
+                    <!-- TODO: we should consider the quantity to select the best routing -->
+                    <first-from-list list-name="routings" entry-name="routingGS"/>
+                </if-not-empty>
+            </if-compare>
+        </if-empty>
         <if-not-empty field-name="routingGS">
                 <clear-field field-name="lookupRouting"/>
                 <set from-field="routingGS.workEffortId" field="lookupRouting.workEffortId"/>