svn commit: r508580 - in /ofbiz/trunk/applications: accounting/entitydef/ accounting/src/org/ofbiz/accounting/invoice/ order/entitydef/ order/src/org/ofbiz/order/shoppingcart/ order/webapp/ordermgr/WEB-INF/actions/entry/ order/webapp/ordermgr/entry/ or...

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

svn commit: r508580 - in /ofbiz/trunk/applications: accounting/entitydef/ accounting/src/org/ofbiz/accounting/invoice/ order/entitydef/ order/src/org/ofbiz/order/shoppingcart/ order/webapp/ordermgr/WEB-INF/actions/entry/ order/webapp/ordermgr/entry/ or...

sichen
Author: sichen
Date: Fri Feb 16 12:58:29 2007
New Revision: 508580

URL: http://svn.apache.org/viewvc?view=rev&rev=508580
Log:
Add 'description' (type description) field to AgreementTerm, OrderTerm and InvoiceTerm entities to allow for terms that aren't necessarily numeric in nature (EG: supplier shipping method, etc.)
Modify ShoppingCart/ShoppingCartHelper/ShoppingCartEvents.addOrderTerm, ShoppingCartHelper.selectAgreement and InvoiceServices.createInvoiceTerms methods to make them aware of the new description fields
Display OrderTerm.description in order headers and PDF
Fix order PDF so that there's a line break after each order term

Modified:
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/trunk/applications/order/entitydef/entitymodel.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderterms.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/order/orderheaderinfo.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderterms.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderterms.ftl
    ofbiz/trunk/applications/party/entitydef/entitymodel.xml

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Fri Feb 16 12:58:29 2007
@@ -956,6 +956,7 @@
       <field name="invoiceItemSeqId" type="id"></field>
       <field name="termValue" type="currency-amount"></field>
       <field name="termDays" type="numeric"></field>
+      <field name="description" type="description"></field>
       <field name="uomId" type="id"></field>
       <prim-key field="invoiceTermId"/>
       <relation type="one" fk-name="INVCE_TRM_TRM" rel-entity-name="TermType">

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Fri Feb 16 12:58:29 2007
@@ -1929,6 +1929,7 @@
                 createInvoiceTermContext.put("termTypeId", term.get("termTypeId"));
                 createInvoiceTermContext.put("termValue", term.get("termValue"));
                 createInvoiceTermContext.put("termDays", term.get("termDays"));
+                createInvoiceTermContext.put("description", term.get("description"));
                 createInvoiceTermContext.put("uomId", term.get("uomId"));
                 createInvoiceTermContext.put("userLogin", userLogin);
 

Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Fri Feb 16 12:58:29 2007
@@ -1073,6 +1073,7 @@
       <field name="orderItemSeqId" type="id-ne"></field>
       <field name="termValue" type="currency-amount"></field>
       <field name="termDays" type="numeric"></field>
+      <field name="description" type="description"></field>
       <field name="uomId" type="id"></field>
       <prim-key field="termTypeId"/>
       <prim-key field="orderId"/>

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?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Fri Feb 16 12:58:29 2007
@@ -2459,10 +2459,16 @@
 
     /** Add an orderTerm to the order */
     public int addOrderTerm(String termTypeId,Double termValue,Long termDays) {
+        return addOrderTerm(termTypeId, termValue, termDays, null);
+    }
+    
+    /** Add an orderTerm to the order */
+    public int addOrderTerm(String termTypeId,Double termValue,Long termDays, String description) {
         GenericValue orderTerm = GenericValue.create(delegator.getModelEntity("OrderTerm"));
         orderTerm.put("termTypeId", termTypeId);
         orderTerm.put("termValue", termValue);
         orderTerm.put("termDays", termDays);
+        orderTerm.put("description", description);
         return addOrderTerm(orderTerm);
     }
 

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Fri Feb 16 12:58:29 2007
@@ -933,6 +933,7 @@
         String termValue = request.getParameter("termValue");
         String termDays = request.getParameter("termDays");
         String termIndex = request.getParameter("termIndex");
+        String description = request.getParameter("description");
         Locale locale = UtilHttp.getLocale(request);
 
         Double dTermValue = null;
@@ -966,7 +967,7 @@
             cartHelper.removeOrderTerm(Integer.parseInt(termIndex));
         }
 
-        Map result = cartHelper.addOrderTerm(termTypeId, dTermValue, lTermDays);
+        Map result = cartHelper.addOrderTerm(termTypeId, dTermValue, lTermDays, description);
         if (ServiceUtil.isError(result)) {
             request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(result));
             return "error";

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Fri Feb 16 12:58:29 2007
@@ -922,7 +922,8 @@
                            String termTypeId = (String) agreementTerm.get("termTypeId");
                            Double termValue = (Double) agreementTerm.get("termValue");
                            Long termDays = (Long) agreementTerm.get("termDays");
-                           cart.addOrderTerm(termTypeId, termValue, termDays);
+                           String description = agreementTerm.getString("description");
+                           cart.addOrderTerm(termTypeId, termValue, termDays, description);
                       }
                   }
             } catch (GenericEntityException e) {
@@ -948,8 +949,12 @@
     }
 
     public Map addOrderTerm(String termTypeId,Double termValue,Long termDays) {
+        return addOrderTerm(termTypeId, termValue, termDays, null);
+    }
+
+    public Map addOrderTerm(String termTypeId,Double termValue,Long termDays, String description) {
         Map result = null;
-        this.cart.addOrderTerm(termTypeId,termValue,termDays);
+        this.cart.addOrderTerm(termTypeId,termValue,termDays,description);
         result = ServiceUtil.returnSuccess();
         return result;
     }

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderterms.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderterms.bsh?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderterms.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderterms.bsh Fri Feb 16 12:58:29 2007
@@ -42,5 +42,6 @@
        context.put("termTypeId",orderTerm.getString("termTypeId"));
        context.put("termValue",orderTerm.get("termValue"));
        context.put("termDays",orderTerm.get("termDays"));
+       context.put("description",orderTerm.get("description"));
     }
 }

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/order/orderheaderinfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/order/orderheaderinfo.ftl?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/order/orderheaderinfo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/order/orderheaderinfo.ftl Fri Feb 16 12:58:29 2007
@@ -55,20 +55,22 @@
                 <td align="left" valign="top" width="80%">
                    <table>
                      <tr>
-                       <td width="33%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermType}</b></div></td>
-                       <td width="33%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermValue}</b></div></td>
-                       <td width="33%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermDays}</b></div></td>
+                       <td width="35%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermType}</b></div></td>
+                       <td width="10%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermValue}</b></div></td>
+                       <td width="10%"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermDays}</b></div></td>
+                       <td width="45%"><div class="tabletext"><b>${uiLabelMap.CommonDescription}</b></div></td>
                      </tr>
-                     <tr><td colspan="3"><hr class="sepbar"/></td></tr>
+                     <tr><td colspan="4"><hr class="sepbar"/></td></tr>
                      <#assign index=0/>
                      <#list orderTerms as orderTerm>
                        <tr>
-                         <td width="33%"><div class="tabletext">${orderTerm.getRelatedOne("TermType").get("description",locale)}</div></td>
-                         <td width="33%"><div class="tabletext">${orderTerm.termValue?default("")}</div></td>
-                         <td width="33%"><div class="tabletext">${orderTerm.termDays?default("")}</div></td>
+                         <td width="35%"><div class="tabletext">${orderTerm.getRelatedOne("TermType").get("description",locale)}</div></td>
+                         <td width="10%"><div class="tabletext">${orderTerm.termValue?default("")}</div></td>
+                         <td width="10%"><div class="tabletext">${orderTerm.termDays?default("")}</div></td>
+                         <td width="45%"><div class="tabletext">${orderTerm.description?default("")}</div></td>
                        </tr>
                        <#if orderTerms.size()&lt;index>
-                         <tr><td colspan="3"><hr class="sepbar"/></td></tr>
+                         <tr><td colspan="4"><hr class="sepbar"/></td></tr>
                        </#if>
                        <#assign index=index+1/>
                      </#list>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderterms.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderterms.ftl?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderterms.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderterms.ftl Fri Feb 16 12:58:29 2007
@@ -28,7 +28,7 @@
             <input type="hidden" name="finalizeMode" value="term"/>
              <table width="100%" border="0" cellpadding="1" cellspacing="0">
                <tr>
-                <td colspan="4">
+                <td colspan="5">
                   <a href="<@ofbizUrl>setOrderTerm?createNew=Y</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCreateNew}</a>
                 </td>
                </tr>
@@ -36,15 +36,17 @@
                 <td><div class="tabletext"><b>${uiLabelMap.OrderOrderTermType}</b></div></td>
                 <td><div class="tabletext"><b>${uiLabelMap.OrderOrderTermValue}</b></div></td>
                 <td><div class="tabletext"><b>${uiLabelMap.OrderOrderTermDays}</b></div></td>
+                <td><div class="tabletext"><b>${uiLabelMap.CommonDescription}</b></div></td>
                 <td align="right">&nbsp;</td>
                </tr>
-               <tr><td colspan="4"><hr class='sepbar'></td></tr>
+               <tr><td colspan="5"><hr class='sepbar'></td></tr>
                 <#assign index=0>
                 <#list orderTerms as orderTerm>
                   <tr>
                   <td><div class="tabletext">${orderTerm.getRelatedOne("TermType").get("description",locale)}</div></td>
                   <td><div class="tabletext">${orderTerm.termValue?default("")}</div></td>
                   <td><div class="tabletext">${orderTerm.termDays?default("")}</div></td>
+                  <td><div class="tabletext">${orderTerm.description?default("")}</div></td>
                   <td align="right">
                     <a href="<@ofbizUrl>setOrderTerm?termIndex=${index}&createNew=Y</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonUpdate}</a>
                         &nbsp;&nbsp;&nbsp;&nbsp;
@@ -52,7 +54,7 @@
                   </td>
                   </tr>
                   <#if orderTerms.size()&lt;index >
-                    <tr><td colspan="4"><hr class='sepbar'></td></tr>
+                    <tr><td colspan="5"><hr class='sepbar'></td></tr>
                   </#if>
                   <#assign index=index+1>
                 </#list>
@@ -103,6 +105,15 @@
                     <td width="5">&nbsp;</td>
                     <td width="74%">
                       <input type="text" class="inputBox" size="30" maxlength="60" name="termDays" value="${termDays?if_exists}"/>
+                    </td>
+                  </tr>
+                  <tr>
+                    <td width="26%" align="right" valign="top">
+                       <div class="tabletext">${uiLabelMap.CommonDescription}</div>
+                    </td>
+                    <td width="5">&nbsp;</td>
+                    <td width="74%">
+                      <input type="text" class="inputBox" size="30" maxlength="255" name="description" value="${description?if_exists}"/>
                     </td>
                   </tr>
                   <tr><td colspan="3" align="middle"><input type="submit" class="smallSubmit" value="${uiLabelMap.CommonAdd}"/></td></tr>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl Fri Feb 16 12:58:29 2007
@@ -120,8 +120,8 @@
              <#if orderTerms?has_content>
              <fo:table-row>
                <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderOrderTerms}: </fo:block></fo:table-cell>
-               <fo:table-cell white-space-collapse="false"><fo:block><#list orderTerms as orderTerm>${orderTerm.getRelatedOne("TermType").get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")}
-</#list></fo:block></fo:table-cell>
+               <fo:table-cell white-space-collapse="false"><#list orderTerms as orderTerm><fo:block>${orderTerm.getRelatedOne("TermType").get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")} ${orderTerm.description?default("")}
+</fo:block></#list></fo:table-cell>
              </fo:table-row>
              </#if>
           </fo:table-body>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderterms.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderterms.ftl?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderterms.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderterms.ftl Fri Feb 16 12:58:29 2007
@@ -25,18 +25,20 @@
     <div class="screenlet-body">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
-        <td width="60%" align="left"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermType}</b></div></td>
-        <td width="20%" align="center"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermValue}</b></div></td>
-        <td width="20%" align="center"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermDays}</b></div></td>
+        <td width="35%" align="left"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermType}</b></div></td>
+        <td width="15%" align="center"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermValue}</b></div></td>
+        <td width="15%" align="center"><div class="tabletext"><b>${uiLabelMap.OrderOrderTermDays}</b></div></td>
+        <td width="35%" align="center"><div class="tabletext"><b>${uiLabelMap.CommonDescription}</b></div></td>
       </tr>
-      <tr><td colspan="3"><hr class='sepbar'></td></tr>
+      <tr><td colspan="4"><hr class='sepbar'></td></tr>
       <#list orderTerms as orderTerm>
           <tr>
-            <td width="60%" align="left"><div class="tabletext">${orderTerm.getRelatedOne("TermType").get("description", locale)}</div></td>
-            <td width="20%" align="center"><div class="tabletext">${orderTerm.termValue?default("")}</div></td>
-            <td width="20%" align="center"><div class="tabletext">${orderTerm.termDays?default("")}</div></td>
+            <td width="35%" align="left"><div class="tabletext">${orderTerm.getRelatedOne("TermType").get("description", locale)}</div></td>
+            <td width="15%" align="center"><div class="tabletext">${orderTerm.termValue?default("")}</div></td>
+            <td width="15%" align="center"><div class="tabletext">${orderTerm.termDays?default("")}</div></td>
+            <td width="35%" align="center"><div class="tabletext">${orderTerm.description?default("")}</div></td>
           </tr>
-          <tr><td colspan="3">&nbsp;</td></tr>
+          <tr><td colspan="4">&nbsp;</td></tr>
       </#list>
      </table>
     </div>

Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?view=diff&rev=508580&r1=508579&r2=508580
==============================================================================
--- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Fri Feb 16 12:58:29 2007
@@ -318,6 +318,7 @@
       <field name="thruDate" type="date-time"></field>
       <field name="termValue" type="currency-amount"></field>
       <field name="termDays" type="numeric"></field>
+      <field name="description" type="description"></field>
       <prim-key field="agreementTermId"/>
       <relation type="one" fk-name="AGRMNT_TERM_TTYP" rel-entity-name="TermType">
         <key-map field-name="termTypeId"/>