svn commit: r564520 - /ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

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

svn commit: r564520 - /ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml

jonesde
Author: jonesde
Date: Fri Aug 10 02:06:16 2007
New Revision: 564520

URL: http://svn.apache.org/viewvc?view=rev&rev=564520
Log:
A bit of a change to create a shiment plan ONLY for phyiscal products

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

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml?view=diff&rev=564520&r1=564519&r2=564520
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/shipment/ShipmentServices.xml Fri Aug 10 02:06:16 2007
@@ -1373,14 +1373,24 @@
             <entity-one entity-name="Shipment" value-name="shipment"/>
             <get-related value-name="orderHeader" relation-name="OrderItem" list-name="orderItems"/>
             <iterate entry-name="orderItem" list-name="orderItems">
-                <!-- Create shipment item -->
-                <clear-field field-name="addOrderShipmentToShipmentCtx"/>
-                <set field="addOrderShipmentToShipmentCtx.orderId" from-field="orderHeader.orderId"/>
-                <set field="addOrderShipmentToShipmentCtx.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
-                <set field="addOrderShipmentToShipmentCtx.shipmentId" from-field="parameters.shipmentId"/>
-                <set field="addOrderShipmentToShipmentCtx.quantity" from-field="orderItem.quantity"/>
-                <set field="addOrderShipmentToShipmentCtx.userLogin" from-field="parameters.userLogin"/>
-                <call-service service-name="addOrderShipmentToShipment" in-map-name="addOrderShipmentToShipmentCtx"/>            
+                <entity-one entity-name="Product" value-name="itemProduct" auto-field-map="false" use-cache="true">
+                    <field-map field-name="productId" env-name="orderItem.productId"/>
+                </entity-one>
+                
+                <!-- make sure the OrderItem is for a Product that has a ProductType with isPhysical=Y -->
+                <if-not-empty field-name="itemProduct">
+                    <get-related-one value-name="itemProduct" relation-name="ProductType" to-value-name="itemProductType" use-cache="true"/>
+                    <if-compare field-name="itemProductType.isPhysical" operator="equals" value="Y">
+                        <!-- Create shipment item -->
+                        <clear-field field-name="addOrderShipmentToShipmentCtx"/>
+                        <set field="addOrderShipmentToShipmentCtx.orderId" from-field="orderHeader.orderId"/>
+                        <set field="addOrderShipmentToShipmentCtx.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
+                        <set field="addOrderShipmentToShipmentCtx.shipmentId" from-field="parameters.shipmentId"/>
+                        <set field="addOrderShipmentToShipmentCtx.quantity" from-field="orderItem.quantity"/>
+                        <set field="addOrderShipmentToShipmentCtx.userLogin" from-field="parameters.userLogin"/>
+                        <call-service service-name="addOrderShipmentToShipment" in-map-name="addOrderShipmentToShipmentCtx"/>            
+                    </if-compare>
+                </if-not-empty>
             </iterate>
             <field-to-result field-name="shipmentId" map-name="parameters"/>
         </iterate>