From 812b3944d975f110bc5b620cf2e2e56cb4fd8a7a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 10 Dec 2014 15:03:10 -0500 Subject: [PATCH] IDEMPIERE-2330 Reserved Qty is incorrect when voiding Shipment --- org.adempiere.base/src/org/compiere/model/MOrder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index ecedb713ce..6f70fcc5ef 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -2405,6 +2405,10 @@ public class MOrder extends X_C_Order implements DocAction so.setLink_Order_ID(0); so.saveEx(); } + + if (!createReversals()) + return false; + MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID); for (int i = 0; i < lines.length; i++) { @@ -2448,9 +2452,6 @@ public class MOrder extends X_C_Order implements DocAction // UnLink All Requisitions MRequisitionLine.unlinkC_Order_ID(getCtx(), get_ID(), get_TrxName()); - if (!createReversals()) - return false; - /* globalqss - 2317928 - Reactivating/Voiding order must reset posted */ MFactAcct.deleteEx(MOrder.Table_ID, getC_Order_ID(), get_TrxName()); setPosted(false); @@ -2551,7 +2552,7 @@ public class MOrder extends X_C_Order implements DocAction /** * Close Document. - * Cancel not delivered Qunatities + * Cancel not delivered Quantities * @return true if success */ public boolean closeIt()