From 6ed966a30774e08c5fc7b9e8cac9a224e1431643 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 17 Dec 2013 11:47:12 -0500 Subject: [PATCH] IDEMPIERE-1532 Reversed Allocation document has wrong TrxDate / based on patch from Thomas Bayen (tbayen) --- org.adempiere.base/src/org/compiere/model/MPayment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 9ddbe060b3..96447ccfb5 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -2200,6 +2200,7 @@ public final class MPayment extends X_C_Payment Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo(), get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); + alloc.setDateAcct(getDateAcct()); // in case date acct is different from datetrx in payment; IDEMPIERE-1532 tbayen if (!alloc.save()) { log.severe("P.Allocations not created"); @@ -2628,10 +2629,11 @@ public final class MPayment extends X_C_Payment // Create automatic Allocation MAllocationHdr alloc = new MAllocationHdr (getCtx(), false, - ( accrual ? dateAcct : getDateTrx() ), + getDateTrx(), getC_Currency_ID(), Msg.translate(getCtx(), "C_Payment_ID") + ": " + reversal.getDocumentNo(), get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); + alloc.setDateAcct(dateAcct); // dateAcct variable already take into account the accrual parameter alloc.saveEx(get_TrxName()); // Original Allocation