svn commit: r1350369 - /ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

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

svn commit: r1350369 - /ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

ashish-18
Author: ashish
Date: Thu Jun 14 18:43:45 2012
New Revision: 1350369

URL: http://svn.apache.org/viewvc?rev=1350369&view=rev
Log:
Applied bug fix from trunk r1350368.
Applied bug fix from jira issue - OFBIZ-4933 - Add/Update order item does not accept the negative quantity.
When user update the order item and enter the negative item quantity then system should throw an error message.
Thanks Deepak!

Modified:
    ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1350369&r1=1350368&r2=1350369&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release12.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jun 14 18:43:45 2012
@@ -3501,6 +3501,9 @@ public class OrderServices {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                     "OrderShipGroupSeqIdInvalid", UtilMisc.toMap("shipGroupSeqId", shipGroupSeqId), locale));
         }
+        if (quantity.compareTo(BigDecimal.ONE) < 0) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OrderItemQtyMustBePositive", locale));
+        }
 
         // obtain a shopping cart object for updating
         ShoppingCart cart = null;
@@ -3632,7 +3635,7 @@ public class OrderServices {
                 return ServiceUtil.returnError(e.getMessage());
             }
 
-            if (groupQty.compareTo(BigDecimal.ZERO) == 0) {
+            if (groupQty.compareTo(BigDecimal.ONE) < 0) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                         "OrderItemQtyMustBePositive", locale));
             }