IDEMPIERE-5039 Negative Lost Sales Quantity / fix unit test IDEMPIERE-4587 (#1002)

This commit is contained in:
Carlos Ruiz 2021-11-25 02:34:51 +01:00 committed by GitHub
parent 9e2922c7c8
commit 755a49db08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -290,10 +290,11 @@ public class PurchaseOrderTest extends AbstractTestCase {
order.load(trxName);
assertEquals(DocAction.STATUS_Completed, order.getDocStatus());
line1.load(trxName);
assertEquals(0, line1.getQtyReserved().compareTo(MINUS_THREE));
// IDEMPIERE-5039 - when reservations go negative they are changed to zero
assertEquals(0, line1.getQtyReserved().compareTo(Env.ZERO));
newQtyOrdered = getQtyOrdered(ctx, PRODUCT_MULCH, trxName);
assertEquals(0, qtyOrderedOriginal.add(MINUS_THREE).compareTo(newQtyOrdered));
assertEquals(0, qtyOrderedOriginal.compareTo(newQtyOrdered));
// create a new material receipt for the -3 reversed
MInOut receipt2 = new MInOut(order, DOCTYPE_RECEIPT, order.getDateOrdered());