You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/05/14 16:02:00 UTC

svn commit: r774770 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

Author: ashish
Date: Thu May 14 14:02:00 2009
New Revision: 774770

URL: http://svn.apache.org/viewvc?rev=774770&view=rev
Log:
Applied patch from jira issue OFBIZ-2473 (Show Term value and Term days while creating both types of order)

Thanks Vivek Mishra for your contribution.

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java

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?rev=774770&r1=774769&r2=774770&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Thu May 14 14:02:00 2009
@@ -1166,12 +1166,15 @@
 
         BigDecimal termValue = null;
         Long termDays = null;
+        Boolean checkTermValueAndDays = true;
 
         if (termValueStr.trim().equals("")) {
             termValue = null;
+            checkTermValueAndDays = false;
         }
         if (termDaysStr.trim().equals("")) {
             termDays = null;
+            checkTermValueAndDays = false;
         }
         if (UtilValidate.isEmpty(termTypeId)) {
             request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderOrderTermTypeIsRequired", locale));
@@ -1181,14 +1184,14 @@
             request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderOrderTermValueError", UtilMisc.toMap("orderTermValue",UtilValidate.isSignedFloatMsg), locale));
             return "error";
         }
-        if (termValue != null) {
+        if (checkTermValueAndDays) {
             termValue = new BigDecimal(termValueStr);
         }
         if (!UtilValidate.isInteger(termDaysStr)) {
             request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderOrderTermDaysError", UtilMisc.toMap("orderTermDays",UtilValidate.isLongMsg), locale));
             return "error";
         }
-        if (termDays != null) {
+        if (checkTermValueAndDays) {
             termDays = Long.valueOf(termDaysStr);
         }
         if ((termIndex != null) && (!"-1".equals(termIndex)) && (UtilValidate.isInteger(termIndex))) {