diff --git a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java index 2f0b047674..f233957fe9 100644 --- a/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java +++ b/org.adempiere.base/src/org/compiere/model/MAllocationHdr.java @@ -437,6 +437,20 @@ public class MAllocationHdr extends X_C_AllocationHdr implements DocAction m_processMsg = "No Business Partner"; return DocAction.STATUS_Invalid; } + + // IDEMPIERE-1850 - validate date against related docs + if (line.getC_Invoice_ID() > 0) { + if (line.getC_Invoice().getDateAcct().after(getDateAcct())) { + m_processMsg = "Wrong allocation date"; + return DocAction.STATUS_Invalid; + } + } + if (line.getC_Payment_ID() > 0) { + if (line.getC_Payment().getDateAcct().after(getDateAcct())) { + m_processMsg = "Wrong allocation date"; + return DocAction.STATUS_Invalid; + } + } } setApprovalAmt(approval); //