You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2011/02/07 02:56:54 UTC

svn commit: r1067840 - in /ofbiz/trunk/applications/order: config/ entitydef/ script/org/ofbiz/order/quote/ script/org/ofbiz/order/test/ servicedef/ src/org/ofbiz/order/shoppingcart/ webapp/ordermgr/WEB-INF/ webapp/ordermgr/quote/ widget/ordermgr/

Author: hansbak
Date: Mon Feb  7 01:56:53 2011
New Revision: 1067840

URL: http://svn.apache.org/viewvc?rev=1067840&view=rev
Log:
add quoteterm fields to be the same as ordeterm fields, add maintenance screens to the quote, copy quoteterms to orderterms when creating order from quote

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/test/QuoteTests.xml
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/servicedef/services_quote.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/quote/CopyQuote.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl
    ofbiz/trunk/applications/order/widget/ordermgr/FieldLookupForms.xml
    ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml
    ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml
    ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Mon Feb  7 01:56:53 2011
@@ -2799,6 +2799,9 @@
         <value xml:lang="zh_CN">新建报价角色</value>
         <value xml:lang="zh_TW">新建報價角色</value>
     </property>
+    <property key="OrderCreateOrderQuoteTerm">
+        <value xml:lang="en">Create New Quote Term</value>
+    </property>
     <property key="OrderCreateOrderQuoteWorkEfforts">
         <value xml:lang="de">Offerte Arbeitseinsatz erstellen</value>
         <value xml:lang="en">Create Quote Work Efforts</value>
@@ -6586,6 +6589,9 @@
         <value xml:lang="zh">编辑询价角色</value>
         <value xml:lang="zh_TW">修改報價角色</value>
     </property>
+        <property key="OrderOrderQuoteEditTerm">
+        <value xml:lang="en">Edit Quote Term</value>
+    </property>
     <property key="OrderOrderQuoteEditWorkEfforts">
         <value xml:lang="de">Offertarbeitseinsatz bearbeiten</value>
         <value xml:lang="en">Edit Quote Work Efforts</value>
@@ -6788,6 +6794,9 @@
         <value xml:lang="zh">询价角色列表</value>
         <value xml:lang="zh_TW">列出報價角色</value>
     </property>
+        <property key="OrderOrderQuoteListTerms">
+        <value xml:lang="en">List Quote Terms</value>
+    </property>
     <property key="OrderOrderQuoteManualUnitPrice">
         <value xml:lang="de">Manueller Stückpreis</value>
         <value xml:lang="en">Manual Unit Price</value>
@@ -6920,6 +6929,12 @@
         <value xml:lang="zh_CN">报价技能类型标识</value>
         <value xml:lang="zh_TW">報價技能類型ID</value>
     </property>
+    <property key="OrderOrderQuoteTerms">
+        <value xml:lang="en">Quote Term</value>
+    </property>
+    <property key="OrderOrderQuoteTermList">
+        <value xml:lang="en">Quote Term List</value>
+    </property>
     <property key="OrderOrderQuoteType">
         <value xml:lang="de">Offerttyp</value>
         <value xml:lang="en">Quote Type</value>
@@ -12694,4 +12709,7 @@
         <value xml:lang="zh">项目名称</value>
         <value xml:lang="zh_TW">專案名稱</value>
     </property>
-</resource>
+    <property key="QuoteTermDescription">
+        <value xml:lang="en">Term Description</value>
+    </property>
+</resource>
\ No newline at end of file

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Mon Feb  7 01:56:53 2011
@@ -1496,6 +1496,9 @@ under the License.
       <field name="quoteItemSeqId" type="id-ne"></field>
       <field name="termValue" type="numeric"></field>
       <field name="uomId" type="id"></field>
+      <field name="termDays" type="numeric"></field>
+      <field name="textValue" type="description"></field>
+      <field name="description" type="description"></field>
       <prim-key field="termTypeId"/>
       <prim-key field="quoteId"/>
       <prim-key field="quoteItemSeqId"/>

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?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Mon Feb  7 01:56:53 2011
@@ -247,6 +247,15 @@ under the License.
                 <call-service service-name="createQuoteCoefficient" in-map-name="createQuoteCoefficientInMap"/>
             </iterate>
         </if-compare>
+        <if-compare field="parameters.copyQuoteTerms" value="Y" operator="equals">
+            <get-related value-field="quote" relation-name="QuoteTerm" list="quoteTerms"/>
+            <iterate list="quoteTerms" entry="quoteTerm">
+                <clear-field field="createQuoteTermInMap"/>
+                <set-service-fields service-name="createQuoteTerm" to-map="createQuoteTermInMap" map="quoteTerm"/>
+                <set from-field="quoteIdTo" field="createQuoteTermInMap.quoteId"/>
+                <call-service service-name="createQuoteTerm" in-map-name="createQuoteTermInMap"/>
+            </iterate>
+        </if-compare>
 
         <check-errors/>
     </simple-method>
@@ -934,4 +943,21 @@ under the License.
             <remove-value value-field="quoteWorkEffort"/>
         </if-not-empty>
     </simple-method>
+    <simple-method method-name="createQuoteTerm" short-description="Create a QuoteTerm">
+        <make-value value-field="newEntity" entity-name="QuoteTerm"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+        <create-value value-field="newEntity"/>
+    </simple-method>
+    <simple-method method-name="updateQuoteTerm" short-description="Update a QuoteTerm">
+        <make-value value-field="newEntity" entity-name="QuoteTerm"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+        <store-value value-field="newEntity"/>
+    </simple-method>
+    <simple-method method-name="deleteQuoteTerm" short-description="Delete a QuoteTerm">
+        <make-value value-field="newEntity" entity-name="QuoteTerm"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <remove-value value-field="newEntity"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/test/QuoteTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/test/QuoteTests.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/test/QuoteTests.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/test/QuoteTests.xml Mon Feb  7 01:56:53 2011
@@ -126,4 +126,109 @@ under the License.
         </entity-one>
         <check-errors/>
     </simple-method>
+    <simple-method method-name="testCreateQuoteTerm" short-description="update a request" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set-current-user-login value-field="userLogin"/>
+        <set field="serviceCtx.termTypeId" value="FIN_PAYMENT_DISC"/>
+        <set field="serviceCtx.quoteId" value="CQ10000"/>
+        <set field="serviceCtx.quoteItemSeqId" value="00001"/>
+        <set field="termValue" value="40" type="Long"/>
+        <set field="serviceCtx.termValue" from-field="termValue"/>
+        <set field="termDays" value="4" type="Long"/>
+        <set field="serviceCtx.termDays" from-field="termDays"/>
+        <set field="serviceCtx.uomId" value="CNY"/>
+        <set field="serviceCtx.description" value="create quoteterm"/>
+        <call-service service-name="createQuoteTerm" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <and>
+                <if-compare-field field="serviceResult.quoteId" operator="equals" to-field="serviceCtx.quoteId"/>
+                <if-compare-field field="serviceResult.quoteItemSeqId" operator="equals" to-field="serviceCtx.quoteItemSeqId"/>
+                <if-compare-field field="serviceResult.termTypeId" operator="equals" to-field="serviceCtx.termTypeId"/>
+                <not><if-empty field="serviceResult.termTypeId"/></not>
+                <not><if-empty field="serviceResult.termValue"/></not>
+                <not><if-empty field="serviceResult.termDays"/></not>
+                <not><if-empty field="serviceResult.uomId"/></not>
+                <not><if-empty field="serviceResult.description"/></not>
+            </and>
+        </assert>
+        <!-- Confirm that a matching Quoteterm was created -->
+        <entity-one value-field="quoteTerm" entity-name="QuoteTerm">
+            <field-map field-name="termTypeId" from-field="serviceCtx.termTypeId"/>
+            <field-map field-name="quoteId" from-field="serviceResult.quoteId"/>
+            <field-map field-name="quoteItemSeqId" from-field="serviceCtx.quoteItemSeqId"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="quoteTerm"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testUpdateQuoteTerm" short-description="update a request" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set-current-user-login value-field="userLogin"/>
+        <set field="serviceCtx.termTypeId" value="FIN_PAYMENT_DISC"/>
+        <set field="serviceCtx.quoteId" value="CQ10000"/>
+        <set field="serviceCtx.quoteItemSeqId" value="00001"/>
+        <set field="termValue" value="30" type="Long"/>
+        <set field="serviceCtx.termValue" from-field="termValue"/>
+        <set field="termDays" value="3" type="Long"/>
+        <set field="serviceCtx.termDays" from-field="termDays"/>
+        <set field="serviceCtx.uomId" value="CNY"/>
+        <set field="serviceCtx.description" value="update quoteterm"/>
+        <call-service service-name="updateQuoteTerm" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <and>
+                <if-compare-field field="serviceResult.quoteId" operator="equals" to-field="serviceCtx.quoteId"/>
+                <if-compare-field field="serviceResult.quoteItemSeqId" operator="equals" to-field="serviceCtx.quoteItemSeqId"/>
+                <if-compare-field field="serviceResult.termTypeId" operator="equals" to-field="serviceCtx.termTypeId"/>
+                <not><if-empty field="serviceResult.termValue"/></not>
+                <not><if-empty field="serviceResult.termDays"/></not>
+                <not><if-empty field="serviceResult.uomId"/></not>
+                <not><if-empty field="serviceResult.description"/></not>
+            </and>
+        </assert>
+        <!-- Confirm that a matching Quoteterm was updated -->
+        <entity-one value-field="quoteTerm" entity-name="QuoteTerm">
+            <field-map field-name="termTypeId" from-field="serviceCtx.termTypeId"/>
+            <field-map field-name="quoteId" from-field="serviceResult.quoteId"/>
+            <field-map field-name="quoteItemSeqId" from-field="serviceCtx.quoteItemSeqId"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="quoteTerm"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testDeleteQuoteTerm" short-description="update a request" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set-current-user-login value-field="userLogin"/>
+        <set field="serviceCtx.termTypeId" value="FIN_PAYMENT_DISC"/>
+        <set field="serviceCtx.quoteId" value="CQ10000"/>
+        <set field="serviceCtx.quoteItemSeqId" value="00001"/>
+        <call-service service-name="deleteQuoteTerm" in-map-name="quoteTermMap">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <if-compare-field field="serviceResult.quoteId" operator="equals" to-field="serviceCtx.quoteId"/>
+            <if-compare-field field="serviceResult.quoteItemSeqId" operator="equals" to-field="serviceCtx.quoteItemSeqId"/>
+            <if-compare-field field="serviceResult.termTypeId" operator="equals" to-field="serviceCtx.termTypeId"/>
+        </assert>
+        <entity-one value-field="quoteTerm" entity-name="QuoteTerm">
+            <field-map field-name="termTypeId" from-field="serviceCtx.termTypeId"/>
+            <field-map field-name="quoteId" from-field="serviceCtx.quoteId"/>
+            <field-map field-name="quoteItemSeqId" from-field="serviceCtx.quoteItemSeqId"/>
+        </entity-one>
+        <assert>
+            <if-empty field="quoteTerm"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Mon Feb  7 01:56:53 2011
@@ -1090,4 +1090,27 @@ under the License.
         <attribute name="orderItem" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
         <attribute name="orderAdjustment " type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/>
     </service>
+    <service name="createQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
+        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="createQuoteTerm">
+        <description>
+            Create a new Quate term.
+        </description>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="updateQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
+        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="updateQuoteTerm">
+        <description>
+            Edit the Quate term.
+        </description>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="deleteQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
+        location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="deleteQuoteTerm">
+        <description>
+            delete the Quate term.
+        </description>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+    </service>
 </services>

Modified: ofbiz/trunk/applications/order/servicedef/services_quote.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_quote.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_quote.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_quote.xml Mon Feb  7 01:56:53 2011
@@ -61,6 +61,7 @@ under the License.
         <attribute name="copyQuoteCoefficients" type="String" mode="IN" optional="true"/>
         <attribute name="copyQuoteItems" type="String" mode="IN" optional="true"/>
         <attribute name="copyQuoteAdjustments" type="String" mode="IN" optional="true"/>
+        <attribute name="copyQuoteTerms" type="String" mode="IN" optional="true"/>
     </service>
     <service name="checkUpdateQuoteStatus" default-entity-name="Quote" engine="simple"
                 location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="checkUpdateQuoteStatus" auth="true">

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Mon Feb  7 01:56:53 2011
@@ -2780,6 +2780,16 @@ public class ShoppingCart implements Ite
         orderTerm.put("textValue", textValue);
         return addOrderTerm(orderTerm);
     }
+    
+    public int addOrderTerm(String termTypeId, BigDecimal termValue, Long termDays, String textValue, String description) {
+        GenericValue orderTerm = this.getDelegator().makeValue("OrderTerm");
+        orderTerm.put("termTypeId", termTypeId);
+        orderTerm.put("termValue", termValue);
+        orderTerm.put("termDays", termDays);
+        orderTerm.put("textValue", textValue);
+        orderTerm.put("description", description);
+        return addOrderTerm(orderTerm);
+    }
 
     /** Add an orderTerm to the order */
     public int addOrderTerm(GenericValue orderTerm) {

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Mon Feb  7 01:56:53 2011
@@ -30,6 +30,7 @@ import javolution.util.FastList;
 import javolution.util.FastMap;
 
 import org.apache.commons.lang.math.NumberUtils;
+import org.ofbiz.base.conversion.MiscConverters.DecimalFormatToString;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.UtilDateTime;
@@ -678,11 +679,13 @@ public class ShoppingCartServices {
         List<GenericValue>quoteAdjs = null;
         List<GenericValue>quoteRoles = null;
         List<GenericValue>quoteAttributes = null;
+        List<GenericValue>quoteTerms = null;
         try {
             quoteItems = quote.getRelated("QuoteItem", UtilMisc.toList("quoteItemSeqId"));
             quoteAdjs = quote.getRelated("QuoteAdjustment");
             quoteRoles = quote.getRelated("QuoteRole");
             quoteAttributes = quote.getRelated("QuoteAttribute");
+            quoteTerms = quote.getRelated("QuoteTerm");
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
@@ -709,6 +712,23 @@ public class ShoppingCartServices {
             }
         }
 
+        // set the order term
+        if (UtilValidate.isNotEmpty(quoteTerms)) {
+            // create order term from quote term
+            for(GenericValue quoteTerm : quoteTerms) {
+            	BigDecimal termValue = BigDecimal.ZERO;
+                if (UtilValidate.isNotEmpty(quoteTerm.getString("termValue"))){
+                    termValue = new BigDecimal(quoteTerm.getString("termValue"));
+                }
+                long termDays = 0;
+                if (UtilValidate.isNotEmpty(quoteTerm.getString("termDays"))) {
+                    termDays = Long.parseLong(quoteTerm.getString("termDays").trim());
+                }
+                
+                cart.addOrderTerm(quoteTerm.getString("termTypeId"), termValue, termDays, quoteTerm.getString("textValue"),quoteTerm.getString("description"));
+            }
+        }
+        
         // set the attribute information
         if (UtilValidate.isNotEmpty(quoteAttributes)) {
             for(GenericValue quoteAttribute : quoteAttributes) {

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Feb  7 01:56:53 2011
@@ -264,6 +264,83 @@ under the License.
         <event type="service" invoke="quickShipEntireOrder"/>
         <response name="success" type="request-redirect" value="orderview"><redirect-parameter name="orderId"/></response>
         <response name="error" type="view" value="orderview"/>
+    </request-map>    
+    <request-map uri="createQuoteTerm">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createQuoteTerm"/>
+        <response name="success" type="request-redirect" value="ListQuoteTerms">
+            <redirect-parameter name="quoteId"/>
+        </response>
+        <response name="error" type="request-redirect" value="EditQuoteTerm">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+    </request-map>
+    <request-map uri="createQuoteTermFromItem">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createQuoteTerm"/>
+        <response name="success" type="request-redirect" value="EditQuoteItem">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+        <response name="error" type="request-redirect" value="EditQuoteTermItem">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+    </request-map>
+    <request-map uri="updateQuoteTermFromItem">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="updateQuoteTerm"/>
+        <response name="success" type="request-redirect" value="EditQuoteItem">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+        <response name="error" type="request-redirect" value="EditQuoteTermItem">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+            <redirect-parameter name="termTypeId"/>
+            <redirect-parameter name="termDays"/>
+            <redirect-parameter name="textValue"/>
+            <redirect-parameter name="uomId"/>
+            <redirect-parameter name="description"/>
+            <redirect-parameter name="termValue"/>
+        </response>
+    </request-map>    
+    <request-map uri="updateQuoteTerm">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="updateQuoteTerm"/>
+        <response name="success" type="request-redirect" value="ListQuoteTerms">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+        <response name="error" type="request-redirect" value="EditQuoteTerm">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+            <redirect-parameter name="termTypeId"/>
+            <redirect-parameter name="termDays"/>
+            <redirect-parameter name="textValue"/>
+            <redirect-parameter name="uomId"/>
+            <redirect-parameter name="description"/>
+            <redirect-parameter name="termValue"/>
+        </response>
+    </request-map>
+    <request-map uri="deleteQuoteTermFromItem">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="deleteQuoteTerm"/>
+        <response name="success" type="request-redirect" value="EditQuoteItem">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+        <response name="error" type="view" value="EditQuoteItem"/>
+    </request-map>
+    <request-map uri="deleteQuoteTerm">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="deleteQuoteTerm"/>
+        <response name="success" type="request-redirect" value="ListQuoteTerms">
+            <redirect-parameter name="quoteId"/>
+            <redirect-parameter name="quoteItemSeqId"/>
+        </response>
+        <response name="error" type="view" value="ListQuoteTerms"/>
     </request-map>
     <request-map uri="quickDropShipOrder">
         <security https="true" auth="true"/>
@@ -1403,13 +1480,13 @@ under the License.
     <request-map uri="createQuote">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="createQuote"/>
-        <response name="success" type="view" value="EditQuote"/>
+        <response name="success" type="view" value="ViewQuote"/>
         <response name="error" type="view" value="EditQuote"/>
     </request-map>
     <request-map uri="updateQuote">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="updateQuote"/>
-        <response name="success" type="view" value="EditQuote"/>
+        <response name="success" type="view" value="ViewQuote"/>
         <response name="error" type="view" value="EditQuote"/>
     </request-map>
     <request-map uri="copyQuote">
@@ -1439,12 +1516,15 @@ under the License.
     <request-map uri="createQuoteItem">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="createQuoteItem"/>
-        <response name="success" type="view" value="EditQuoteItem"/>
+        <response name="success" type="request-redirect" value="ListQuoteItems">
+            <redirect-parameter name="quoteId"/>
+        </response>
     </request-map>
     <request-map uri="updateQuoteItem">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="updateQuoteItem"/>
-        <response name="success" type="view" value="EditQuoteItem"/>
+        <response name="success" type="view" value="ListQuoteItems"/>
+        <response name="error" type="view" value="EditQuoteItem"/>
     </request-map>
     <request-map uri="removeQuoteItem">
         <security https="true" auth="true"/>
@@ -1749,6 +1829,18 @@ under the License.
         <response name="success" type="view" value="ProductUomDropDownOnly" save-last-view="true"/>
     </request-map>
     
+    <request-map uri="ListQuoteTerms">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="ListQuoteTerms" save-last-view="true"/>
+    </request-map>
+    <request-map uri="EditQuoteTerm">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="EditQuoteTerm" save-last-view="true"/>
+    </request-map>
+    <request-map uri="EditQuoteTermItem">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="EditQuoteTermItem" save-last-view="true"/>
+    </request-map>
     <!--
         These are just examples of reports developed using JasperReport and not really
         useful reports. In order to run them you'll have to follow the notes in the
@@ -1946,5 +2038,8 @@ under the License.
     <view-map name="SendCompletionMail" type="screen" page="component://order/widget/ordermgr/OrderViewScreens.xml#SendOrderCompletion"/>
     <view-map name="ReturnHistory" type="screen" page="component://order/widget/ordermgr/OrderReturnScreens.xml#OrderReturnHistory"/>
     <view-map name="ProductUomDropDownOnly" type="screen" page="component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#ProductUomDropDownOnly"/>
+    <view-map name="EditQuoteTerm" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteTerm"/>
+    <view-map name="EditQuoteTermItem" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteTermItem"/>
+    <view-map name="ListQuoteTerms" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ListQuoteTerms"/>
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/quote/CopyQuote.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/quote/CopyQuote.ftl?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/quote/CopyQuote.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/quote/CopyQuote.ftl Mon Feb  7 01:56:53 2011
@@ -26,6 +26,7 @@ under the License.
         ${uiLabelMap.OrderOrderQuoteRoles}&nbsp;<input type="checkbox" name="copyQuoteRoles" value="Y" checked="checked" />
         ${uiLabelMap.OrderOrderQuoteAttributes}&nbsp;<input type="checkbox" name="copyQuoteAttributes" value="Y" checked="checked" />
         ${uiLabelMap.OrderOrderQuoteCoefficients}&nbsp;<input type="checkbox" name="copyQuoteCoefficients" value="Y" checked="checked" />
+        ${uiLabelMap.OrderOrderQuoteTerms}&nbsp;<input type="checkbox" name="copyQuoteTerms" value="Y" checked="checked" />
     </div>
     <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonCopy}"/>
 </form>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl Mon Feb  7 01:56:53 2011
@@ -28,17 +28,27 @@ under the License.
     <div class="screenlet-body">
         <table cellspacing="0" class="basic-table">
             <tr valign="bottom" class="header-row">
-                <td width="10%">${uiLabelMap.ProductItem}</td>
-                <td width="35%">${uiLabelMap.ProductProduct}</td>
+                <td width="15%">${uiLabelMap.ProductItem}</td>
+                <td width="20%">${uiLabelMap.ProductProduct}</td>
                 <td width="10%" align="right">${uiLabelMap.ProductQuantity}</td>
                 <td width="10%" align="right">${uiLabelMap.OrderSelAmount}</td>
+                <td width="5%" align="right">&nbsp;</td>
                 <td width="10%" align="right">${uiLabelMap.OrderOrderQuoteUnitPrice}</td>
                 <td width="10%" align="right">${uiLabelMap.OrderAdjustments}</td>
                 <td width="10%" align="right">${uiLabelMap.CommonSubtotal}</td>
-                <td width="5%" align="right">&nbsp;</td>
+            </tr>
+            <tr valign="bottom" class="header-row">
+                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${uiLabelMap.OrderOrderTermType}</td>
+                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${uiLabelMap.OrderOrderTermValue}</td>
+                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${uiLabelMap.OrderOrderTermDays}</td>
+                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${uiLabelMap.QuoteTermDescription}</td>
+                <td></td>
+                <td></td>
+                <td></td>
+                <td align="right">&nbsp;</td>
             </tr>
             <#assign totalQuoteAmount = 0.0>
-            <#assign alt_row = false>
+            <#assign alt_row = false/>
             <#list quoteItems as quoteItem>
                 <#if quoteItem.productId?exists>
                     <#assign product = quoteItem.getRelatedOne("Product")>
@@ -57,15 +67,17 @@ under the License.
                 </#list>
                 <#assign totalQuoteItemAmount = quoteItemAmount + totalQuoteItemAdjustmentAmount>
                 <#assign totalQuoteAmount = totalQuoteAmount + totalQuoteItemAmount>
-                <tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
-                    <td valign="top">
+                
+                <tr <#if alt_row>class="alternate-row" </#if>>
+                    <td >
                         <div>
-                        <#if showQuoteManagementLinks?exists && quoteItem.isPromo?default("N") == "N">
+                        <#if showQuoteManagementLinks?exists && quoteItem.isPromo?default("N") == "N" && quote.statusId=="QUO_CREATED">
                             <a href="<@o...@ofbizUrl>" class="buttontext">${quoteItem.quoteItemSeqId}</a>
                         <#else>
                             ${quoteItem.quoteItemSeqId}
                         </#if>
                         </div>
+                        <#assign quoteTerms = delegator.findByAnd("QuoteTerm", {"quoteId" : quoteItem.quoteId, "quoteItemSeqId" : quoteItem.quoteItemSeqId})>
                     </td>
                     <td valign="top">
                         <div>
@@ -83,17 +95,31 @@ under the License.
                             </#if>
                         </div>
                     </td>
+                    <td></td>
                     <td align="right" valign="top">${quoteItem.quantity?if_exists}</td>
                     <td align="right" valign="top">${quoteItem.selectedAmount?if_exists}</td>
                     <td align="right" valign="top"><@ofbizCurrency amount=quoteItem.quoteUnitPrice isoCode=quote.currencyUomId/></td>
                     <td align="right" valign="top"><@ofbizCurrency amount=totalQuoteItemAdjustmentAmount isoCode=quote.currencyUomId/></td>
                     <td align="right" valign="top"><@ofbizCurrency amount=totalQuoteItemAmount isoCode=quote.currencyUomId/></td>
                 </tr>
+                <#list quoteTerms as quoteTerm>
+                <#assign termDescription = delegator.findByPrimaryKey("TermType",{"termTypeId":quoteTerm.termTypeId})>
+                <tr <#if alt_row>class="alternate-row" </#if>>
+                    <td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${termDescription.description?if_exists}</td>
+                    <td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${quoteTerm.termValue?if_exists}</td>
+                    <td valign="top"><#if quoteTerm.termDays?exists>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${quoteTerm.termDays?if_exists}</#if></td>
+                    <td valign="top"><#if quoteTerm.description?exists>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${quoteTerm.description}</#if></td>
+                    <td align="right" valign="top"></td>
+                    <td align="right" valign="top"></td>
+                    <td align="right" valign="top"></td>
+                    <td align="right" valign="top"></td>
+                </tr>
+                </#list>
                 <#-- now show adjustment details per line item -->
                 <#list quoteItemAdjustments as quoteItemAdjustment>
                     <#assign adjustmentType = quoteItemAdjustment.getRelatedOne("OrderAdjustmentType")>
-                    <tr>
-                        <td align="right" colspan="5"><span class="label">${adjustmentType.get("description",locale)?if_exists}</span></td>
+                    <tr class="alternate-row">
+                        <td align="right" colspan="4"><span class="label">${adjustmentType.get("description",locale)?if_exists}</span></td>
                         <td align="right"><@ofbizCurrency amount=quoteItemAdjustment.amount isoCode=quote.currencyUomId/></td>
                         <td>&nbsp;</td>
                     </tr>
@@ -103,7 +129,7 @@ under the License.
             </#list>
             <tr><td colspan="10"><hr /></td></tr>
             <tr>
-                <td align="right" colspan="6" class="label">${uiLabelMap.CommonSubtotal}</td>
+                <td align="right" colspan="7" class="label">${uiLabelMap.CommonSubtotal}</td>
                 <td align="right"><@ofbizCurrency amount=totalQuoteAmount isoCode=quote.currencyUomId/></td>
             </tr>
             <tr><td colspan="5"></td><td colspan="6"><hr /></td></tr>
@@ -125,7 +151,7 @@ under the License.
             <tr><td colspan="5"></td><td colspan="6"><hr /></td></tr>
             </#if>
             <tr>
-                <td align="right" colspan="6" class="label">${uiLabelMap.OrderGrandTotal}</td>
+                <td align="right" colspan="7" class="label">${uiLabelMap.OrderGrandTotal}</td>
                 <td align="right">
                     <@ofbizCurrency amount=grandTotalQuoteAmount isoCode=quote.currencyUomId/>
                 </td>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/FieldLookupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/FieldLookupForms.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/FieldLookupForms.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/FieldLookupForms.xml Mon Feb  7 01:56:53 2011
@@ -423,16 +423,10 @@ under the License.
         <field name="quoteId"><hidden/></field>
         <field name="quoteItemSeqId"><hidden/></field>
         <field name="quoteItemSeqId" title="${uiLabelMap.OrderOrderQuoteItemSeqId}" widget-style="buttontext" use-when="${bsh:isPromo==null}">
-            <hyperlink also-hidden="false" description="${quoteItemSeqId}" target="EditQuoteItem">
-                <parameter param-name="quoteId"/>
-                <parameter param-name="quoteItemSeqId"/>
-            </hyperlink>
+            <hyperlink also-hidden="false" target-type="plain" description="${quoteItemSeqId}" target="javascript:set_value('${quoteItemSeqId}')"/>
         </field>
         <field name="quoteItemSeqId" title="${uiLabelMap.OrderOrderQuoteItemSeqId}" widget-style="buttontext" use-when="${bsh:isPromo!=null&amp;&amp;isPromo.equals(&quot;N&quot;)}">
-            <hyperlink also-hidden="false" description="${quoteItemSeqId}" target="EditQuoteItem">
-                <parameter param-name="quoteId"/>
-                <parameter param-name="quoteItemSeqId"/>
-            </hyperlink>
+            <hyperlink also-hidden="false" target-type="plain" description="${quoteItemSeqId}" target="javascript:set_value('${quoteItemSeqId}')"/>
         </field>
         <field name="quoteItemSeqId" title="${uiLabelMap.OrderOrderQuoteItemSeqId}" use-when="${bsh:isPromo!=null&amp;&amp;isPromo.equals(&quot;Y&quot;)}"><display/></field>
         <field name="productId">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml Mon Feb  7 01:56:53 2011
@@ -135,24 +135,36 @@ under the License.
         </menu-item>
 
         <menu-item name="EditQuote" title="${uiLabelMap.OrderOrderQuote}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
             <link target="EditQuote">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
             </link>
         </menu-item>
 
         <menu-item name="ListQuoteRoles" title="${uiLabelMap.OrderOrderQuoteRoles}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
             <link target="ListQuoteRoles">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
             </link>
         </menu-item>
 
         <menu-item name="ListQuoteItems" title="${uiLabelMap.OrderOrderQuoteItems}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
             <link target="ListQuoteItems">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
             </link>
         </menu-item>
 
         <menu-item name="ListQuoteAttributes" title="${uiLabelMap.OrderOrderQuoteAttributes}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
             <link target="ListQuoteAttributes">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
             </link>
@@ -160,7 +172,10 @@ under the License.
 
         <menu-item name="ListQuoteCoefficients" title="${uiLabelMap.OrderOrderQuoteCoefficients}">
             <condition>
-                <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                <and>
+                    <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                    <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+                </and>
             </condition>
             <link target="ListQuoteCoefficients">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
@@ -169,7 +184,10 @@ under the License.
 
         <menu-item name="ManageQuotePrices" title="${uiLabelMap.OrderOrderQuotePrices}">
             <condition>
-                <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                <and>
+                    <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                    <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+                </and>
             </condition>
             <link target="ManageQuotePrices">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
@@ -178,7 +196,10 @@ under the License.
 
         <menu-item name="ListQuoteAdjustments" title="${uiLabelMap.OrderOrderQuoteAdjustments}">
             <condition>
-                <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                <and>
+                    <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                    <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+                </and>
             </condition>
             <link target="ListQuoteAdjustments">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
@@ -187,7 +208,10 @@ under the License.
 
         <menu-item name="ViewQuoteProfit" title="${uiLabelMap.OrderViewQuoteProfit}">
             <condition>
-                <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                <and>
+                    <if-has-permission permission="ORDERMGR" action="_QUOTE_PRICE"/>
+                    <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+                </and>
             </condition>
             <link target="ViewQuoteProfit">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
@@ -195,10 +219,21 @@ under the License.
         </menu-item>
 
         <menu-item name="QuoteWorkEfforts" title="${uiLabelMap.OrderOrderQuoteWorkEfforts}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
             <link target="ListQuoteWorkEfforts">
                 <parameter param-name="quoteId" from-field="quote.quoteId"/>
             </link>
         </menu-item>
+        <menu-item name="QuoteTerms" title="${uiLabelMap.OrderOrderQuoteTerms}">
+            <condition>
+                <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+            </condition>
+            <link target="ListQuoteTerms">
+                <parameter param-name="quoteId" from-field="parameters.quoteId"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="QuoteSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
@@ -338,5 +373,39 @@ under the License.
             </link>
         </menu-item>
     </menu>
+    <menu name="quoteTermSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
+        menu-container-style="button-bar button-style-2">
+        <menu-item name="EditQuoteTerm" title="${uiLabelMap.OrderCreateOrderQuoteTerm}" >
+            <condition>
+                    <and>
+                        <if-empty field="parameters.quoteItemSeqId"/>
+                        <not><if-empty field="quote.quoteId"/></not>
+                    </and>
+            </condition>
+            <link target="EditQuoteTerm" text="" style="buttontext">
+                <parameter param-name="quoteId" from-field="parameters.quoteId"/>
+            </link>
+        </menu-item>
+        <menu-item name="EditQuoteTermItem" title="${uiLabelMap.OrderCreateOrderQuoteTerm}" >
+            <condition>
+                    <and>
+                        <not><if-empty field="parameters.quoteItemSeqId"/></not>
+                        <not><if-empty field="quote.quoteId"/></not>
+                    </and>
+            </condition>
+            <link target="EditQuoteTermItem" text="" style="buttontext">
+                <parameter param-name="quoteId" from-field="parameters.quoteId"/>
+                <parameter param-name="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+            </link>
+        </menu-item>
+    </menu>
+    <menu name="quoteItemSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
+        menu-container-style="button-bar button-style-2">
+        <menu-item name="EditQuoteTerm" title="${uiLabelMap.OrderCreateOrderQuoteTerm}" >
+            <link target="EditQuoteItem" text="${uiLabelMap.OrderCreateOrderQuoteItem}" style="buttontext">
+                <parameter param-name="quoteId" from-field="quote.quoteId"/>
+            </link>
+        </menu-item>
+    </menu>
 
 </menus>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml Mon Feb  7 01:56:53 2011
@@ -456,4 +456,89 @@ under the License.
         <field name="note"><textarea/></field>
         <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
+    <form name="ListQuoteTerms" type="list" list-name="quoteTerms"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar" paginate-target="ListQuoteTerms">
+        <auto-fields-entity entity-name="QuoteTerm" default-field-type="display"/>
+        <field name="termTypeId" >
+            <display-entity entity-name="TermType" description="${description}" key-field-name="termTypeId"/>
+        </field>
+        <field name="uomId" title="${uiLabelMap.OrderOrderQuoteUomId}">
+            <display-entity entity-name="Uom" description="${description}" key-field-name="uomId"/>
+        </field>
+        <field name="editLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="EditQuoteTerm" description="${uiLabelMap.CommonEdit}" also-hidden="false">
+                <parameter param-name="termTypeId"/>
+                <parameter param-name="quoteItemSeqId"/>
+                <parameter param-name="quoteId"/>
+                <parameter param-name="target" value="updateQuoteTerm"/>
+                <parameter param-name="tabButtonItems" value="QuoteTerms"/>
+            </hyperlink>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="deleteQuoteTerm" description="${uiLabelMap.CommonRemove}" also-hidden="false">
+                <parameter param-name="termTypeId"/>
+                <parameter param-name="quoteItemSeqId"/>
+                <parameter param-name="quoteId"/>
+            </hyperlink>
+        </field>
+    </form>
+    <form name="ListQuoteTermItem" extends="ListQuoteTerms">
+        <field name="editLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="EditQuoteTermItem" description="${uiLabelMap.CommonEdit}" also-hidden="false">
+                <parameter param-name="termTypeId"/>
+                <parameter param-name="quoteItemSeqId"/>
+                <parameter param-name="quoteId"/>
+                <parameter param-name="target" value="updateQuoteTermFromItem"/>
+                <parameter param-name="tabButtonItems" value="ListQuoteItems"/>
+            </hyperlink>
+        </field>
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="deleteQuoteTermFromItem" description="${uiLabelMap.CommonRemove}" also-hidden="false">
+                <parameter param-name="termTypeId"/>
+                <parameter param-name="quoteItemSeqId"/>
+                <parameter param-name="quoteId"/>
+            </hyperlink>
+        </field>
+    </form>
+    <form name="EditQuoteTerm" type="single" target="updateQuoteTerm" title="" default-map-name="quoteTerm"
+        header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <entity-one entity-name="StatusItem" value-field="currentStatus" auto-field-map="false">
+                <field-map field-name="statusId" from-field="quote.statusId"/>
+            </entity-one>
+            <set field="tabButtonItem" from-field="parameters.tabButtonItems"/>
+        </actions>
+        <alt-target use-when="quoteTerm==null" target="createQuoteTerm"/>
+        <auto-fields-entity entity-name="QuoteTerm" default-field-type="edit"/>
+        <field name="tabButtonItems"><hidden value="${tabButtonItem}"/></field>
+        <field name="quoteItemSeqId" tooltip="${uiLabelMap.CommonRequired}">
+            <drop-down>
+                <entity-options description="${quoteItemSeqId} - [${productId}]" entity-name="QuoteItem">
+                    <entity-constraint name="quoteId" operator="equals" value="${quoteId}"/>
+                    <entity-order-by field-name="quoteItemSeqId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="quoteItemSeqId" use-when="quoteItemSeqId!=null" tooltip="${uiLabelMap.CommonRequired}"><display/></field>
+        <field name="termTypeId" tooltip="${uiLabelMap.CommonRequired}">
+            <drop-down current-description="">
+                <entity-options description="${description}" entity-name="TermType" key-field-name="termTypeId"/>
+            </drop-down>
+        </field>
+        <field name="termTypeId" use-when="termTypeId!=null" tooltip="${uiLabelMap.CommonRequired}">
+            <display-entity entity-name="TermType" description="${description} [${termTypeId}]" key-field-name="termTypeId"/>
+        </field>
+        <field name="quoteId"><hidden/></field>
+        
+        <field name="uomId">
+            <drop-down current-description="">
+                <entity-options description="${description}" entity-name="Uom" key-field-name="uomId"/>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+    <form name="EditQuoteTermItem" type="single" target="updateQuoteTermFromItem" title="" default-map-name="quoteTerm"
+        header-row-style="header-row" default-table-style="basic-table" extends="EditQuoteTerm">
+        <alt-target use-when="quoteTerm==null" target="createQuoteTermFromItem"/>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml?rev=1067840&r1=1067839&r2=1067840&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml Mon Feb  7 01:56:53 2011
@@ -313,12 +313,8 @@ under the License.
             <widgets>
                 <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
                     <decorator-section name="body">
+                        <include-menu name="quoteItemSubTabBar" location="component://order/widget/ordermgr/OrderMenus.xml"/>
                         <screenlet title="${uiLabelMap.OrderOrderQuoteListItems}">
-                            <container>
-                                <link target="EditQuoteItem" text="${uiLabelMap.OrderCreateOrderQuoteItem}" style="buttontext">
-                                    <parameter param-name="quoteId" from-field="quote.quoteId"/>
-                                </link>
-                            </container>
                             <include-form name="ListQuoteItems" location="component://order/widget/ordermgr/QuoteForms.xml"/>
                         </screenlet>
                     </decorator-section>
@@ -337,18 +333,27 @@ under the License.
 
                 <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>
                 <entity-one entity-name="QuoteItem" value-field="quoteItem"/>
+                <entity-and entity-name="QuoteTerm" list="quoteTerms">
+                    <field-map field-name="quoteId"  from-field="parameters.quoteId"/>
+                    <field-map field-name="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+                </entity-and>
             </actions>
             <widgets>
                 <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
                     <decorator-section name="body">
-                        <screenlet title="${uiLabelMap.OrderOrderQuoteEditItems}">
-                            <container>
-                                <link target="EditQuoteItem" text="${uiLabelMap.OrderCreateOrderQuoteItem}" style="buttontext">
-                                    <parameter param-name="quoteId" from-field="quote.quoteId"/>
-                                </link>
-                            </container>
-                            <include-form name="EditQuoteItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
-                        </screenlet>
+                        <container>
+                            <include-menu name="quoteTermSubTabBar" location="component://order/widget/ordermgr/OrderMenus.xml"/>
+                        </container>
+                        <container style="lefthalf">
+                            <screenlet title="${uiLabelMap.OrderOrderQuoteEditItems}" >
+                                <include-form name="EditQuoteItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                                </screenlet>
+                        </container>
+                        <container style="righthalf">
+                            <screenlet title="${uiLabelMap.OrderOrderQuoteTermList}">
+                                <include-form name="ListQuoteTermItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                            </screenlet>
+                        </container>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -686,6 +691,15 @@ under the License.
             <condition>
                 <not><if-empty field="quoteItems"/></not>
             </condition>
+            <actions>
+                <entity-and list="quoteItemList" entity-name="QuoteItem">
+                    <field-map field-name="quoteId" from-field="parameters.quoteId"/>
+                </entity-and>
+                <entity-one value-field="quote" entity-name="Quote">
+                    <field-map field-name="quoteId" from-field="parameters.quoteId"/>
+                </entity-one>
+                <set field="quoteStatusId" from-field="quote.statusId"/>
+            </actions>
             <widgets>
                 <platform-specific>
                     <html><html-template location="component://order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl"/></html>
@@ -693,4 +707,76 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="EditQuoteTerm">
+        <section>
+            <actions>
+                <set field="titleProperty" value="${uiLabelMap.OrderOrderQuoteEditTerm}"/>
+                <set field="tabButtonItem" value="QuoteTerms"/>
+                <set field="quoteId" from-field="parameters.quoteId"/>
+                <set field="termTypeId" from-field="parameters.termTypeId"/>
+                <set field="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+                <entity-one entity-name="QuoteTerm" value-field="quoteTerm"/>
+                <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>
+                <set field="target" from-field="parameters.target"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.OrderOrderQuoteEditTerm}">
+                            <include-form name="EditQuoteTerm" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="EditQuoteTermItem">
+        <section>
+            <actions>
+                <set field="titleProperty" value="${uiLabelMap.OrderOrderQuoteEditTerm}"/>
+                <set field="tabButtonItem" value="ListQuoteItems"/>
+                <set field="quoteId" from-field="parameters.quoteId"/>
+                <set field="termTypeId" from-field="parameters.termTypeId"/>
+                <set field="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+                <entity-one entity-name="QuoteTerm" value-field="quoteTerm"/>
+                <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>
+                <set field="target" from-field="parameters.target"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.OrderOrderQuoteEditTerm}">
+                            <include-form name="EditQuoteTermItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="ListQuoteTerms">
+        <section>
+            <actions>
+                <set field="titleProperty" value="${uiLabelMap.OrderOrderQuoteEditTerm}"/>
+                <set field="tabButtonItem" value="QuoteTerms"/>
+                <set field="quoteId" from-field="parameters.quoteId"/>
+                <set field="termTypeId" from-field="parameters.termTypeId"/>
+                <set field="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+                <entity-one entity-name="QuoteTerm" value-field="quoteTerm"/>
+                <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>
+                <entity-and entity-name="QuoteTerm" list="quoteTerms">
+                    <field-map field-name="quoteId"  from-field="parameters.quoteId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-menu name="quoteTermSubTabBar" location="component://order/widget/ordermgr/OrderMenus.xml"/>
+                        <screenlet title="${uiLabelMap.OrderOrderQuoteTermList}">
+                            <include-form name="ListQuoteTerms" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>