From 115211d74cdff7f91892ef26aa94483d3a26a140 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 26 Mar 2014 10:10:19 -0500 Subject: [PATCH] IDEMPIERE-1850 CRITICAL / Allocation Date Issue / integrate patch suggested by Michal Zilincar --- .../src/org/compiere/model/MAllocationHdr.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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); //