From 83f5ee7d1796911daa936b7f5a5f94baf1f35054 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 15 May 2018 09:04:45 +0200 Subject: [PATCH] IDEMPIERE-3135 Bug Completing Bank Statements when using calendar & accounting periods per org: A potential wrong/test validation for open period is being performed in the class: BankStatement / IDEMPIERE-480 --- .../src/org/compiere/model/MBankStatement.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index 13776817ff..7f1bf5e5e9 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -312,23 +312,25 @@ public class MBankStatement extends X_C_BankStatement implements DocAction } // Lines BigDecimal total = Env.ZERO; - Timestamp minDate = getStatementDate(); - Timestamp maxDate = minDate; + // IDEMPIERE-480 changed the way accounting is posted, now lines post just with the accounting date of the statement header + // so, it is unnecessary to validate the period of lines + // Timestamp minDate = getStatementDate(); + // Timestamp maxDate = minDate; for (int i = 0; i < lines.length; i++) { MBankStatementLine line = lines[i]; if (!line.isActive()) continue; total = total.add(line.getStmtAmt()); - if (line.getDateAcct().before(minDate)) - minDate = line.getDateAcct(); - if (line.getDateAcct().after(maxDate)) - maxDate = line.getDateAcct(); + // if (line.getDateAcct().before(minDate)) + // minDate = line.getDateAcct(); + // if (line.getDateAcct().after(maxDate)) + // maxDate = line.getDateAcct(); } setStatementDifference(total); setEndingBalance(getBeginningBalance().add(total)); - MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, 0); - MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, 0); + // MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()); + // MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()); m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null)