Author: ashish
Date: Thu Jun 14 18:44:37 2012
New Revision: 1350370
URL:
http://svn.apache.org/viewvc?rev=1350370&view=revLog:
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/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1350370&r1=1350369&r2=1350370&view=diff==============================================================================
--- ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jun 14 18:44:37 2012
@@ -3437,6 +3437,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;
@@ -3570,7 +3573,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));
}