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

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

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

hansbak-2
Author: hansbak
Date: Wed Feb 23 03:57:33 2011
New Revision: 1073587

URL: http://svn.apache.org/viewvc?rev=1073587&view=rev
Log:
add possibility to have quote terms also on the quote level

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    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/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=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Wed Feb 23 03:57:33 2011
@@ -12710,6 +12710,9 @@
         <value xml:lang="zh">项目名称</value>
         <value xml:lang="zh_TW">專案名稱</value>
     </property>
+    <property key="QuoteEmpty">
+        <value xml:lang="en">Empty for total quote</value>
+    </property>
     <property key="QuoteTermDescription">
         <value xml:lang="en">Term Description</value>
     </property>

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=1073587&r1=1073586&r2=1073587&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 Wed Feb 23 03:57:33 2011
@@ -36,6 +36,7 @@ under the License.
                <property-to-field field="errorPartyPerf" resource="AccountingErrorUiLabels" property="AccountingPartyAcctgPreferenceNotDefine"/>
                <log level="warning" message="errorPartyPerf" />
            </else>
+          
         </if-not-empty>
 
         <if-not-empty field="customMethod">
@@ -402,6 +403,13 @@ under the License.
             <fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunRemoveQuoteItem"/>
         </check-permission>
         <check-errors/>
+        <entity-and list="quoteTermList" entity-name="QuoteTerm">
+            <field-map field-name="quoteId" from-field="parameters.quoteId"/>
+            <field-map field-name="quoteItemSeqId" from-field="parameters.quoteItemSeqId"/>
+        </entity-and>
+        <if-not-empty field="quoteTermList">
+            <remove-list list="quoteTermList"/>
+        </if-not-empty>
         <entity-one entity-name="QuoteItem" value-field="quoteItem" auto-field-map="true"/>
         <remove-related value-field="quoteItem" relation-name="QuoteAdjustment"/>
         <check-errors/>
@@ -945,6 +953,9 @@ under the License.
     </simple-method>
     <simple-method method-name="createQuoteTerm" short-description="Create a QuoteTerm">
         <make-value value-field="newEntity" entity-name="QuoteTerm"/>
+        <if-empty field="parameters.quoteItemSeqId">
+            <set field="parameters.quoteItemSeqId" value="_NA_"/>
+        </if-empty>
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
         <create-value value-field="newEntity"/>

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Wed Feb 23 03:57:33 2011
@@ -1098,6 +1098,7 @@ under the License.
         </description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <override name="quoteItemSeqId" type="String" mode="IN" optional="true"/>
     </service>
     <service name="updateQuoteTerm" engine="simple" default-entity-name="QuoteTerm"
         location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="updateQuoteTerm">

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Wed Feb 23 03:57:33 2011
@@ -1104,7 +1104,6 @@ public class OrderServices {
            while (orderTermIter.hasNext()) {
                GenericValue orderTerm = orderTermIter.next();
                orderTerm.set("orderId", orderId);
-               orderTerm.set("orderItemSeqId","_NA_");
                toBeStored.add(orderTerm);
            }
        }

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=1073587&r1=1073586&r2=1073587&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 Wed Feb 23 03:57:33 2011
@@ -2782,9 +2782,13 @@ public class ShoppingCart implements Ite
         return addOrderTerm(orderTerm);
     }
     
-    public int addOrderTerm(String termTypeId, BigDecimal termValue, Long termDays, String textValue, String description) {
+    public int addOrderTerm(String termTypeId, String orderItemSeqId,BigDecimal termValue, Long termDays, String textValue, String description) {
         GenericValue orderTerm = this.getDelegator().makeValue("OrderTerm");
         orderTerm.put("termTypeId", termTypeId);
+        if (UtilValidate.isEmpty(orderItemSeqId)) {
+         orderItemSeqId = "_NA_";
+        }
+        orderTerm.put("orderItemSeqId", orderItemSeqId);
         orderTerm.put("termValue", termValue);
         orderTerm.put("termDays", termDays);
         orderTerm.put("textValue", textValue);

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=1073587&r1=1073586&r2=1073587&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 Wed Feb 23 03:57:33 2011
@@ -744,8 +744,9 @@ public class ShoppingCartServices {
                 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"));
+                String orderItemSeqId = quoteTerm.getString("quoteItemSeqId");
+                cart.addOrderTerm(quoteTerm.getString("termTypeId"), orderItemSeqId,termValue, termDays, quoteTerm.getString("textValue"),quoteTerm.getString("description"));
+                List orderTerms = cart.getOrderTerms();
             }
         }
         

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=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Wed Feb 23 03:57:33 2011
@@ -273,7 +273,6 @@ under the License.
         </response>
         <response name="error" type="request-redirect" value="EditQuoteTerm">
             <redirect-parameter name="quoteId"/>
-            <redirect-parameter name="quoteItemSeqId"/>
         </response>
     </request-map>
     <request-map uri="createQuoteTermFromItem">

Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml?rev=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml Wed Feb 23 03:57:33 2011
@@ -500,6 +500,10 @@ under the License.
             </hyperlink>
         </field>
     </form>
+    <form name="ListQuoteInfo" extends="ListQuoteTerms">
+        <field name="editLink"><hidden/></field>
+        <field name="deleteLink"><hidden/></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>
@@ -511,9 +515,9 @@ under the License.
         <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">
+        <field name="quoteItemSeqId" tooltip="${uiLabelMap.QuoteEmpty}">
+            <drop-down allow-empty="true">
+                <entity-options description="${quoteItemSeqId}" entity-name="QuoteItem">
                     <entity-constraint name="quoteId" operator="equals" value="${quoteId}"/>
                     <entity-order-by field-name="quoteItemSeqId"/>
                 </entity-options>

Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml?rev=1073587&r1=1073586&r2=1073587&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml (original)
+++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml Wed Feb 23 03:57:33 2011
@@ -347,12 +347,19 @@ under the License.
                         <container style="lefthalf">
                             <screenlet title="${uiLabelMap.OrderOrderQuoteEditItems}" >
                                 <include-form name="EditQuoteItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
-                                </screenlet>
+                            </screenlet>
                         </container>
                         <container style="righthalf">
-                            <screenlet title="${uiLabelMap.OrderOrderQuoteTermList}">
-                                <include-form name="ListQuoteTermItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
-                            </screenlet>
+                            <section>
+                                <condition>
+                                    <not><if-empty field="quoteItemSeqId"/></not>
+                                </condition>
+                                <widgets>
+                                    <screenlet title="${uiLabelMap.OrderOrderQuoteTermList}">
+                                        <include-form name="ListQuoteTermItem" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                                    </screenlet>
+                                </widgets>
+                            </section>
                         </container>
                     </decorator-section>
                 </decorator-screen>
@@ -637,9 +644,8 @@ under the License.
             <widgets>
                 <label text="${note}" style="tabletext"/>
                 <include-screen name="ViewQuoteInfo"/>
-                <container style="leftclear">
+                <container style="clear"/>
                     <include-screen name="ViewQuoteItemInfo"/>
-                </container>
             </widgets>
             <fail-widgets>
                 <label style="h3">${uiLabelMap.OrderNoQuoteFound}</label>
@@ -648,6 +654,12 @@ under the License.
     </screen>
     <screen name="ViewQuoteInfo">
         <section>
+            <actions>
+                <entity-and entity-name="QuoteTerm" list="quoteTerms">
+                    <field-map field-name="quoteId"  from-field="parameters.quoteId"/>
+                    <field-map field-name="quoteItemSeqId" value="_NA_"/>
+                </entity-and>
+            </actions>
             <widgets>
                 <container style="lefthalf">
                     <include-screen name="quoteInfo"/>
@@ -655,6 +667,7 @@ under the License.
                 <container style="righthalf">
                     <include-screen name="quoteDate"/>
                     <include-screen name="quoteRoles"/>
+                    <include-screen name="ListQuoteInfo"/>
                 </container>
             </widgets>
         </section>
@@ -668,6 +681,18 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="ListQuoteInfo">
+        <section>
+            <condition>
+                <not><if-empty field="quoteTerms"/></not>
+            </condition>
+            <widgets>
+                <screenlet title="${uiLabelMap.OrderOrderQuoteTermList}">
+                    <include-form name="ListQuoteInfo" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+                </screenlet>
+            </widgets>
+        </section>
+    </screen>
     <screen name="quoteDate">
         <section>
             <widgets>