You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/04/19 12:36:27 UTC

svn commit: r530366 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/order/OrderServices.xml servicedef/services.xml

Author: jacopoc
Date: Thu Apr 19 03:36:20 2007
New Revision: 530366

URL: http://svn.apache.org/viewvc?view=rev&rev=530366
Log:
New service that computes and returns the OrderItemShipGroup estimated ship date based on the associated items.
If maySplit=Y, then the ship group's ship date is the earliest of all of the items.  If the maySplit=N, then it's the latest of the estimated items' dates. For now I've considered the OrderItemShipGrpInvRes.promisedDatetime as the estimated ship date for the reserved items.

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
    ofbiz/trunk/applications/order/servicedef/services.xml

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?view=diff&rev=530366&r1=530365&r2=530366
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Thu Apr 19 03:36:20 2007
@@ -701,7 +701,22 @@
             <call-service service-name="removeOrderContactMech" in-map-name="removeOrderContactMechMap" include-user-login="true"/>
         </if-empty>
     </simple-method>
-    
+
+    <simple-method method-name="getOrderItemShipGroupEstimatedShipDate" short-description="Compute and return the OrderItemShipGroup estimated ship date based on the associated items.">
+<log level="always" message="JACOPO: ${orderItemShipGroupInvRes.promisedDatetime}"/>
+        <entity-one entity-name="OrderItemShipGroup" value-name="orderItemShipGroup"/>
+        <if-compare field-name="orderItemShipGroup.maySplit" operator="equals" value="Y">
+            <set field="orderByList[]" value="+promisedDatetime"/>
+        <else>
+            <set field="orderByList[]" value="-promisedDatetime"/>
+        </else>
+        </if-compare>
+        <get-related value-name="orderItemShipGroup" relation-name="OrderItemShipGrpInvRes" list-name="orderItemShipGroupInvResList" order-by-list-name="orderByList"/>
+        <first-from-list entry-name="orderItemShipGroupInvRes" list-name="orderItemShipGroupInvResList"/>
+<log level="always" message="JACOPO: ${orderItemShipGroupInvRes.promisedDatetime}"/>
+        <field-to-result field-name="orderItemShipGroupInvRes.promisedDatetime" result-name="estimatedShipDate"/>
+    </simple-method>
+
     <simple-method method-name="createOrderContactMech" short-description="Create OrderContactMech">
         <check-permission permission="ORDERMGR" action="_CREATE">
             <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderContactMech"/>

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=530366&r1=530365&r2=530366
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Apr 19 03:36:20 2007
@@ -363,6 +363,14 @@
         <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
     </service>
 
+    <service name="getOrderItemShipGroupEstimatedShipDate" engine="simple"
+            location="org/ofbiz/order/order/OrderServices.xml" invoke="getOrderItemShipGroupEstimatedShipDate" auth="true">
+        <description>Compute and return the OrderItemShipGroup estimated ship date based on the associated items.</description>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
+        <attribute name="estimatedShipDate" type="Timestamp" mode="OUT" optional="true"/>
+    </service>
+
     <service name="addOrderRole" engine="java"
             location="org.ofbiz.order.order.OrderServices" invoke="addRoleType">
         <description>Adds a RoleType to an order</description>