From 3339d1395da170cbdca27e9b8bf0dbcecefbe03b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 8 Jun 2020 14:08:39 +0200 Subject: [PATCH] IDEMPIERE-4324 NPE - Allocation when the payment is Zero (#104) --- .../src/org/compiere/acct/Doc_AllocationHdr.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java index 5a346ab36a..7eb169d1b4 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -272,12 +272,13 @@ public class Doc_AllocationHdr extends Doc { fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()), getC_Currency_ID(), line.getAmtSource(), null); - if (fl != null && payment != null) + if (fl != null && payment != null) { fl.setAD_Org_ID(payment.getAD_Org_ID()); - if (payment.getReversal_ID() > 0 ) - allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate()); - else - allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance()); + if (payment.getReversal_ID() > 0 ) + allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate()); + else + allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance()); + } } else if (line.getC_CashLine_ID() != 0) {