IDEMPIERE-4324 NPE - Allocation when the payment is Zero (#104)

This commit is contained in:
Carlos Ruiz 2020-06-08 14:08:39 +02:00 committed by GitHub
parent 35c64ce77f
commit 3339d1395d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -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)
{