svn commit: r924647 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml script/org/ofbiz/order/request/CustRequestServices.xml

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

svn commit: r924647 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml script/org/ofbiz/order/request/CustRequestServices.xml

hansbak-2
Author: hansbak
Date: Thu Mar 18 05:45:28 2010
New Revision: 924647

URL: http://svn.apache.org/viewvc?rev=924647&view=rev
Log:
update status after other fields in cust request and check id name is filled in

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=924647&r1=924646&r2=924647&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Thu Mar 18 05:45:28 2010
@@ -2512,6 +2512,9 @@
         <value xml:lang="en">Customer Request Note added Notification</value>
         <value xml:lang="it">Notifica nota richiesta cliente aggiunta</value>
     </property>
+    <property key="OrderCustRequestShouldHaveCustRequestNameIfNotDraft">
+        <value xml:lang="en">Customer Request should have a 'Name' if not in the draft status</value>
+    </property>
     <property key="OrderCustRequestShouldHaveFromPartyIdIfNotDraft">
         <value xml:lang="en">Customer Request should have a 'from' partyId if not in the draft status</value>
     </property>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=924647&r1=924646&r2=924647&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Thu Mar 18 05:45:28 2010
@@ -103,7 +103,14 @@ under the License.
 
     <simple-method method-name="updateCustRequest" short-description="Update Customer Request">
         <call-simple-method method-name="checkStatusCustRequest"/>
-        <field-to-result field="custRequest.statusId" result-name="oldStatusId"/>
+        <set field="oldStatusId" from-field="custRequest.statusId"/>
+        <field-to-result field="oldStatusId"/>
+        <now-timestamp field="nowTimestamp"/>
+        <set from-field="nowTimestamp" field="custRequest.lastModifiedDate"/>
+        <set from-field="userLogin.userLoginId" field="custRequest.lastModifiedByUserLogin"/>
+        <set-nonpk-fields map="parameters" value-field="custRequest"/>
+        <set field="custRequest.statusId" from-field="oldStatusId"/><!-- not update status yet -->
+        <store-value value-field="custRequest"/>
         <if-not-empty field="parameters.statusId">
             <if-compare-field field="custRequest.statusId" to-field="parameters.statusId" operator="not-equals">
                 <if-compare field="parameters.statusId" value="CRQ_CANCELLED" operator="equals">
@@ -141,11 +148,6 @@ under the License.
                 </if-not-empty>
             </if-compare-field>
         </if-not-empty>
-        <now-timestamp field="nowTimestamp"/>
-        <set from-field="nowTimestamp" field="custRequest.lastModifiedDate"/>
-        <set from-field="userLogin.userLoginId" field="custRequest.lastModifiedByUserLogin"/>
-        <set-nonpk-fields map="parameters" value-field="custRequest"/>
-        <store-value value-field="custRequest"/>
         
         <!-- if story is provided update the first item of the customer request -->
         <if-not-empty field="parameters.story">
@@ -445,6 +447,11 @@ under the License.
                     <fail-property property="OrderCustRequestShouldHaveFromPartyIdIfNotDraft" resource="OrderUiLabels"/>
                 </add-error>
             </if-empty>
+            <if-empty field="custRequest.custRequestName">
+                <add-error>
+                    <fail-property property="OrderCustRequestShouldHaveCustRequestNameIfNotDraft" resource="OrderUiLabels"/>
+                </add-error>
+            </if-empty>
         </if-compare>
         <check-errors/>