diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index a1af3d15d6..6d9b0f0fcd 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -2339,6 +2339,10 @@ public class MPayment extends X_C_Payment Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [1]", get_TrxName()); alloc.setAD_Org_ID(getAD_Org_ID()); alloc.setDateAcct(getDateAcct()); // in case date acct is different from datetrx in payment + MInvoice invoice = MInvoice.get(getCtx(), getC_Invoice_ID()); + if (invoice.getDateAcct().after(alloc.getDateAcct())) { + alloc.setDateAcct(invoice.getDateAcct()); + } alloc.saveEx(); MAllocationLine aLine = null; if (isReceipt())