From 093c79943aa2e6a25cdc214a14b3b34035b9d529 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Mon, 14 Oct 2019 17:25:45 +0200 Subject: [PATCH] IDEMPIERE-4071 Realized/UnrealizedGainLoss / clear accounts when only one org --- .../src/org/compiere/acct/Doc_AllocationHdr.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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 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; }