From 5952da8f9721676fcd04deea904375f87d209d53 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 24 Feb 2020 19:21:34 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"IDEMPIERE-4189=20Fix=20potential=20NP?= =?UTF-8?q?E=20in=20generate=20shipment=20-=20based=20on=20patch=20from=20?= =?UTF-8?q?Martin=20Sch=C3=B6nbeck"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 04001e1055de4b7358efbe78957cfdb6cb131791. --- .../src/org/compiere/process/InOutGenerate.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index 6b0bc97153..c3dba63b85 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -257,11 +257,14 @@ public class InOutGenerate extends SvrProcess BigDecimal onHand = Env.ZERO; BigDecimal toDeliver = line.getQtyOrdered() .subtract(line.getQtyDelivered()); - // Nothing to Deliver - if (toDeliver.signum() == 0) - continue; - MProduct product = line.getProduct(); + // Nothing to Deliver + if (product != null && toDeliver.signum() == 0) + continue; + + // or it's a charge - Bug#: 1603966 + if (line.getC_Charge_ID()!=0 && toDeliver.signum() == 0) + continue; // Check / adjust for confirmations BigDecimal unconfirmedShippedQty = Env.ZERO; @@ -295,11 +298,6 @@ public class InOutGenerate extends SvrProcess createLine (order, line, toDeliver, null, false); continue; } - if (product == null) - { - // code must never arrive here - but for safety against NPE - continue; - } // Stored Product String MMPolicy = product.getMMPolicy();