From 533302fbc13846f9d465daffcea04d9f6fafd899 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 16 Oct 2013 16:35:48 -0500 Subject: [PATCH] IDEMPIERE-1447 Posting fails on reversal shipment with services --- org.adempiere.base/src/org/compiere/acct/Doc_InOut.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java index fa79852c77..4ed5eb844b 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_InOut.java @@ -168,6 +168,7 @@ public class Doc_InOut extends Doc for (int i = 0; i < p_lines.length; i++) { DocLine line = p_lines[i]; + MProduct product = line.getProduct(); BigDecimal costs = null; if (!isReversal(line)) { @@ -178,7 +179,6 @@ public class Doc_InOut extends Doc // end MZ if (costs == null || costs.signum() == 0) // zero costs OK { - MProduct product = line.getProduct(); if (product.isStocked()) { //ok if we have purchased zero cost item from vendor before @@ -227,6 +227,10 @@ public class Doc_InOut extends Doc if (!dr.updateReverseLine (MInOut.Table_ID, m_Reversal_ID, line.getReversalLine_ID(),Env.ONE)) { + if (! product.isStocked()) { // ignore service + fact.remove(dr); + continue; + } p_Error = "Original Shipment/Receipt not posted yet"; return null; }