svn commit: r834282 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

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

svn commit: r834282 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

lektran
Author: lektran
Date: Mon Nov  9 23:56:13 2009
New Revision: 834282

URL: http://svn.apache.org/viewvc?rev=834282&view=rev
Log:
Removed some strange code that was attempting to work out the next sub-sequence id but was doing it incorrectly, replaced with the operation make-next-seq-id which was built for this purpose

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=834282&r1=834281&r2=834282&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Mon Nov  9 23:56:13 2009
@@ -361,24 +361,11 @@
         </if-compare>
 
         <make-value value-field="newEntity" entity-name="ReturnItem"/>
-        <!-- do a lookup to find the existing returnItems on this return, order by returnItemSeqId DESC, then get the first one
-             and add 1 to returnItemSeqId to get the new returnItemSeqId -->
         <set from-field="parameters.returnId" field="newEntity.returnId"/>
-        <set from-field="parameters.returnId" field="lookupMap.returnId"/>
-        <string-to-list string="-returnItemSeqId" list="orderBy"/>
-        <find-by-and entity-name="ReturnItem" list="currentItems" map="lookupMap" order-by-list="orderBy"></find-by-and>
-        <if-empty field="currentItems">
-            <set field="newEntity.returnItemSeqId" value="1"/>
-        <else>
-            <first-from-list entry="newestItem" list="currentItems"/>
-            <set field="newEntity.returnItemSeqId" value="${newestItem.returnItemSeqId + 1}" type="Integer"/>
-        </else>
-        </if-empty>
-        <to-string field="newEntity.returnItemSeqId" numeric-padding="5"/>
+        <make-next-seq-id seq-field-name="returnItemSeqId" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
         <set field="newEntity.statusId" value="RETURN_REQUESTED"/>  <!-- default status for new return items -->
         <field-to-result field="newEntity.returnItemSeqId" result-name="returnItemSeqId"/>
-        <log level="info" message="Return Item Seq ID: ${newEntity.returnItemSeqId}"/>
         <create-value value-field="newEntity"/>
         <refresh-value value-field="newEntity"/>