FR [ 2616330 ] Use MPeriod.testPeriodOpen instead of isOpen

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2616330&group_id=176962

Implemented for MBankStatement
This commit is contained in:
teo_sarca 2009-05-06 07:04:22 +00:00
parent c9e983e3fb
commit 19ec6b94bd
1 changed files with 10 additions and 18 deletions

View File

@ -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
* <li> BF [ 1933645 ] Wrong balance Bank Statement
* @see http://sourceforge.net/tracker/?func=detail&atid=879332&aid=1933645&group_id=176962
* <li> 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
* <li>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());
}