"Applied fix from trunk for revision: 1851353"

------------------------------------------------------------------------
r1851353 | paulfoxworthy | 2019-01-15 14:53:51 +0100 (mar. 15 janv. 2019) | 11 lignes

Fixed: In packing, only use reservations with stock on hand
(OFBIZ-9677)

During packing, OFBiz looks for reservations (OrderItemShipGrpInvRes)
for the order item. Some reservations are for back ordered items not on hand.
These reservations should not be used during packing, but they are.

Fixed additional problem in r1850914 when a single reservation has a
quantity that exactly matches the quantity to pack.


------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851361 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-01-15 14:14:14 +00:00
parent 6b162efacc
commit e362efdfd9
@@ -146,7 +146,8 @@ public class PackingSession implements java.io.Serializable {
GenericValue res = EntityUtil.getFirst(reservations);
BigDecimal resQty = numAvailableItems(res);
if (resQty.compareTo(quantity) > 0) {
// If reservation has enough for the quantity required
if (resQty.compareTo(quantity) >= 0) {
int checkCode = this.checkLineForAdd(res, orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, packageSeqId, update);
this.createPackLineItem(checkCode, res, orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, weight, packageSeqId);
}