A bit of a change to create a shiment plan ONLY for phyiscal products

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@564520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2007-08-10 09:06:16 +00:00
parent 13769d5fe9
commit f2070bd3d3
@@ -1373,14 +1373,24 @@ under the License.
<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>