diff --git a/base/src/org/compiere/model/MBankStatement.java b/base/src/org/compiere/model/MBankStatement.java
index 240600b173..268714f28d 100644
--- a/base/src/org/compiere/model/MBankStatement.java
+++ b/base/src/org/compiere/model/MBankStatement.java
@@ -34,12 +34,16 @@ import org.compiere.util.Msg;
/**
* Bank Statement Model
*
-* @author Eldir Tomassen/Jorg Janke
+* @author Eldir Tomassen/Jorg Janke
* @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
*
BF [ 1933645 ] Wrong balance Bank Statement
* @see http://sourceforge.net/tracker/?func=detail&atid=879332&aid=1933645&group_id=176962
* FR [ 2520591 ] Support multiples calendar for Org
-* @see http://sourceforge.net/tracker2/?func=detail&atid=879335&aid=2520591&group_id=176962
+* @see http://sourceforge.net/tracker2/?func=detail&atid=879335&aid=2520591&group_id=176962
+* @author Teo Sarca, http://www.arhipac.ro
+* FR [ 2616330 ] Use MPeriod.testPeriodOpen instead of isOpen
+* https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2616330&group_id=176962
+*
* @version $Id: MBankStatement.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
*/
public class MBankStatement extends X_C_BankStatement implements DocAction
@@ -318,11 +322,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
return DocAction.STATUS_Invalid;
// Std Period open?
- if (!MPeriod.isOpen(getCtx(), getStatementDate(), MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()))
- {
- m_processMsg = "@PeriodClosed@";
- return DocAction.STATUS_Invalid;
- }
+ MPeriod.testPeriodOpen(getCtx(), getStatementDate(), MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID());
MBankStatementLine[] lines = getLines(true);
if (lines.length == 0)
{
@@ -344,12 +344,8 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
}
setStatementDifference(total);
setEndingBalance(getBeginningBalance().add(total));
- if (!MPeriod.isOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, 0)
- || !MPeriod.isOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, 0))
- {
- m_processMsg = "@PeriodClosed@";
- return DocAction.STATUS_Invalid;
- }
+ MPeriod.testPeriodOpen(getCtx(), minDate, MDocType.DOCBASETYPE_BankStatement, 0);
+ MPeriod.testPeriodOpen(getCtx(), maxDate, MDocType.DOCBASETYPE_BankStatement, 0);
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
if (m_processMsg != null)
@@ -469,11 +465,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
// Std Period open?
else
{
- if (!MPeriod.isOpen(getCtx(), getStatementDate(), MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID()))
- {
- m_processMsg = "@PeriodClosed@";
- return false;
- }
+ MPeriod.testPeriodOpen(getCtx(), getStatementDate(), MDocType.DOCBASETYPE_BankStatement, getAD_Org_ID());
MFactAcct.deleteEx(Table_ID, getC_BankStatement_ID(), get_TrxName());
}