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 dfc0a20f73..2284cecc88 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_AllocationHdr.java @@ -254,8 +254,7 @@ public class Doc_AllocationHdr extends Doc // if not using clearing accounts, then don't post amtsource // change the allocationsource to be writeoff + discount allocationSource = line.getDiscountAmt().add(line.getWriteOffAmt()); - - + payAcct = getPaymentAcct(as, line.getC_Payment_ID()); } else { // Normal behavior -- unchanged if using clearing accounts @@ -437,7 +436,7 @@ public class Doc_AllocationHdr extends Doc || getC_Currency_ID() != line.getInvoiceC_Currency_ID())) // allocation <> invoice currency { p_Error = createRealizedGainLoss (line, as, fact, bpAcct, invoice, payAcct, payment, - allocationSource, allocationAccounted); + allocationSourceForRGL, allocationAccounted); if (p_Error != null) return null; }