IDEMPIERE-4324 NPE - Allocation when the payment is Zero (#104)
This commit is contained in:
parent
35c64ce77f
commit
3339d1395d
|
@ -272,12 +272,13 @@ public class Doc_AllocationHdr extends Doc
|
||||||
{
|
{
|
||||||
fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()),
|
fl = fact.createLine (line, getPaymentAcct(as, line.getC_Payment_ID()),
|
||||||
getC_Currency_ID(), line.getAmtSource(), null);
|
getC_Currency_ID(), line.getAmtSource(), null);
|
||||||
if (fl != null && payment != null)
|
if (fl != null && payment != null) {
|
||||||
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
fl.setAD_Org_ID(payment.getAD_Org_ID());
|
||||||
if (payment.getReversal_ID() > 0 )
|
if (payment.getReversal_ID() > 0 )
|
||||||
allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate());
|
allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance().negate());
|
||||||
else
|
else
|
||||||
allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance());
|
allocPayAccounted = allocPayAccounted.add(fl.getAcctBalance());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (line.getC_CashLine_ID() != 0)
|
else if (line.getC_CashLine_ID() != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue