Author: ashish
Date: Thu Jun 14 18:46:19 2012
New Revision: 1350371
URL: http://svn.apache.org/viewvc?rev=1350371&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/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified:
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1350371&r1=1350370&r2=1350371&view=diff
==============================================================================
---
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
(original)
+++
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Thu Jun 14 18:46:19 2012
@@ -3318,6 +3318,9 @@ public class OrderServices {
if (shipGroupIdx < 0) {
return ServiceUtil.returnError("Invalid shipGroupSeqId [" +
shipGroupSeqId + "]");
}
+ if (quantity.compareTo(BigDecimal.ONE) < 0) {
+ return ServiceUtil.returnError("Quantity must be >0, use cancel
item to cancel completely!");
+ }
// obtain a shopping cart object for updating
ShoppingCart cart = null;
@@ -3444,7 +3447,7 @@ public class OrderServices {
return ServiceUtil.returnError(e.getMessage());
}
- if (groupQty.compareTo(BigDecimal.ZERO) == 0) {
+ if (groupQty.compareTo(BigDecimal.ONE) < 0) {
return ServiceUtil.returnError("Quantity must be >0, use
cancel item to cancel completely!");
}