IDEMPIERE-4220 payment could not be committed due to wrong invoice date

This commit is contained in:
Carlos Ruiz 2020-04-23 00:30:12 +02:00
parent 281912af45
commit 0b663af8ab
1 changed files with 4 additions and 0 deletions

View File

@ -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())