svn commit: r550151 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/quote/QuoteServices.xml webapp/ordermgr/quote/QuoteForms.xml

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

svn commit: r550151 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/quote/QuoteServices.xml webapp/ordermgr/quote/QuoteForms.xml

lektran
Author: lektran
Date: Sat Jun 23 18:57:53 2007
New Revision: 550151

URL: http://svn.apache.org/viewvc?view=rev&rev=550151
Log:
Quotes now honour their StatusValidChange entries

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteForms.xml

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml?view=diff&rev=550151&r1=550150&r2=550151
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Sat Jun 23 18:57:53 2007
@@ -129,6 +129,22 @@
         <check-errors/>
         <entity-one entity-name="Quote" value-name="quote" auto-field-map="true"/>
         <check-errors/>
+        <if-empty field-name="parameters.statusId">
+            <set field="parameters.statusId" from-field="quote.statusId"/>
+        </if-empty>
+        <if-compare-field field-name="quote.statusId" operator="not-equals" to-field-name="parameters.statusId">
+            <!-- check if the status change is a valid change -->
+            <entity-and entity-name="StatusValidChange" list-name="validChange">
+                <field-map field-name="statusId" env-name="quote.statusId"/>
+                <field-map field-name="statusIdTo" env-name="parameters.statusId"/>
+            </entity-and>
+                    
+            <if-empty field-name="validChange">
+                <add-error><fail-message message="The status change from ${quote.statusId} to ${parameters.statusId} is not a valid change"/></add-error>
+                <log level="error" message="The status change from ${quote.statusId} to ${parameters.statusId} is not a valid change"/>
+                <check-errors/>
+            </if-empty>
+        </if-compare-field>
         <set-nonpk-fields map-name="parameters" value-name="quote"/>
         <store-value value-name="quote"/>
         <check-errors/>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteForms.xml?view=diff&rev=550151&r1=550150&r2=550151
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteForms.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteForms.xml Sat Jun 23 18:57:53 2007
@@ -98,6 +98,11 @@
     </form>
     <form name="EditQuote" type="single" target="updateQuote" title="" default-map-name="quote"
         default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <actions>
+            <entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false">
+                <field-map field-name="statusId" env-name="quote.statusId"/>
+            </entity-one>
+        </actions>
         <alt-target use-when="quote==null" target="createQuote"/>
         <auto-fields-entity entity-name="Quote" default-field-type="edit"/>
         <field name="quoteId" title="${uiLabelMap.OrderOrderQuoteId}" widget-style="tabletext"><display/></field>
@@ -119,9 +124,9 @@
         <field name="partyId" title="${uiLabelMap.PartyPartyId}"><lookup target-form-name="LookupPartyName"/></field>
         <field name="issueDate" title="${uiLabelMap.OrderOrderQuoteIssueDate}"></field>
         <field name="statusId" title="${uiLabelMap.CommonStatus}" widget-style="selectBox">
-            <drop-down allow-empty="false">
-                <entity-options entity-name="StatusItem" description="${description}">
-                    <entity-constraint name="statusTypeId" value="QUOTE_STATUS"/>
+            <drop-down allow-empty="false" current-description="${currentStatus.description}">
+                <entity-options entity-name="StatusValidChangeToDetail" key-field-name="statusIdTo" description="${transitionName} (${description})">
+                    <entity-constraint name="statusId" value="${quote.statusId}"/>
                     <entity-order-by field-name="sequenceId"/>
                 </entity-options>
             </drop-down>