IDEMPIERE-1850 CRITICAL / Allocation Date Issue / integrate patch suggested by Michal Zilincar

This commit is contained in:
Carlos Ruiz 2014-03-26 10:10:19 -05:00
parent a980daf1d8
commit 115211d74c
1 changed files with 14 additions and 0 deletions

View File

@ -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);
//