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 2012/06/14 20:42:38 UTC
svn commit: r1350368 -
/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Author: ashish
Date: Thu Jun 14 18:42:38 2012
New Revision: 1350368
URL: http://svn.apache.org/viewvc?rev=1350368&view=rev
Log:
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/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1350368&r1=1350367&r2=1350368&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jun 14 18:42:38 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));
}