FR [ 1776045 ] Add ReActivate action to GL Journal
https://sourceforge.net/tracker/?func=detail&atid=879335&aid=1776045&group_id=176962
This commit is contained in:
parent
a314fcc615
commit
7ca9882951
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -39,6 +39,7 @@ import org.compiere.util.Msg;
|
||||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||||
* <li>BF [ 1619150 ] Usability/Consistency: reversed gl journal description
|
* <li>BF [ 1619150 ] Usability/Consistency: reversed gl journal description
|
||||||
* <li>BF [ 1775358 ] GL Journal DateAcct/C_Period_ID issue
|
* <li>BF [ 1775358 ] GL Journal DateAcct/C_Period_ID issue
|
||||||
|
* <li>FR [ 1776045 ] Add ReActivate action to GL Journal
|
||||||
* @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
|
* @author victor.perez@e-evolution.com, e-Evolution http://www.e-evolution.com
|
||||||
* <li>FR [ 1948157 ] Is necessary the reference for document reverse
|
* <li>FR [ 1948157 ] Is necessary the reference for document reverse
|
||||||
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
|
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
|
||||||
|
|
@ -48,6 +49,11 @@ import org.compiere.util.Msg;
|
||||||
*/
|
*/
|
||||||
public class MJournal extends X_GL_Journal implements DocAction
|
public class MJournal extends X_GL_Journal implements DocAction
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 5461368562157627495L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard Constructor
|
* Standard Constructor
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
|
@ -754,12 +760,19 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
if (m_processMsg != null)
|
if (m_processMsg != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// teo_sarca - FR [ 1776045 ] Add ReActivate action to GL Journal
|
||||||
|
MPeriod.testPeriodOpen(getCtx(), getDateAcct(), getC_DocType_ID(), getAD_Org_ID());
|
||||||
|
MFactAcct.deleteEx(MJournal.Table_ID, get_ID(), get_TrxName());
|
||||||
|
setPosted(false);
|
||||||
|
setProcessed(false);
|
||||||
|
setDocAction(DOCACTION_Complete);
|
||||||
|
|
||||||
// After reActivate
|
// After reActivate
|
||||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
if (m_processMsg != null)
|
if (m_processMsg != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -26,6 +26,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
import org.compiere.process.DocAction;
|
import org.compiere.process.DocAction;
|
||||||
import org.compiere.process.DocumentEngine;
|
import org.compiere.process.DocumentEngine;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
|
|
@ -41,10 +42,17 @@ import org.compiere.util.Msg;
|
||||||
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
|
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
|
||||||
* <li> FR [ 2520591 ] Support multiples calendar for Org
|
* <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, www.arhipac.ro
|
||||||
|
* <li>FR [ 1776045 ] Add ReActivate action to GL Journal
|
||||||
* @version $Id: MJournalBatch.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
|
* @version $Id: MJournalBatch.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -2494833602067696046L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new Journal Batch by copying
|
* Create new Journal Batch by copying
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
|
@ -738,9 +746,22 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
if (m_processMsg != null)
|
if (m_processMsg != null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// setProcessed(false);
|
for (MJournal journal : getJournals(true))
|
||||||
if (! reverseCorrectIt())
|
{
|
||||||
return false;
|
if (DOCSTATUS_Completed.equals(journal.getDocStatus()))
|
||||||
|
{
|
||||||
|
if (journal.processIt(DOCACTION_Re_Activate))
|
||||||
|
{
|
||||||
|
journal.saveEx();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new AdempiereException(journal.getProcessMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setProcessed(false);
|
||||||
|
setDocAction(DOCACTION_Complete);
|
||||||
|
|
||||||
// After reActivate
|
// After reActivate
|
||||||
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
|
|
||||||
|
|
@ -990,6 +990,7 @@ public class DocumentEngine implements DocAction
|
||||||
{
|
{
|
||||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||||
|
options[index++] = DocumentEngine.ACTION_ReActivate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/********************
|
/********************
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue