IDEMPIERE-2578 / IDEMPIERE-1715

This commit is contained in:
Carlos Ruiz 2015-04-15 11:26:09 -05:00
parent 5e37d9aee4
commit 804116fe13
1 changed files with 26 additions and 5 deletions

View File

@ -545,6 +545,12 @@ public class MProduction extends X_M_Production implements DocAction {
@Override @Override
public boolean voidIt() { public boolean voidIt() {
if (log.isLoggable(Level.INFO)) log.info(toString());
// Before Void
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
if (m_processMsg != null)
return false;
if (DOCSTATUS_Closed.equals(getDocStatus()) if (DOCSTATUS_Closed.equals(getDocStatus())
|| DOCSTATUS_Reversed.equals(getDocStatus()) || DOCSTATUS_Reversed.equals(getDocStatus())
|| DOCSTATUS_Voided.equals(getDocStatus())) || DOCSTATUS_Voided.equals(getDocStatus()))
@ -595,6 +601,11 @@ public class MProduction extends X_M_Production implements DocAction {
return reverseCorrectIt(); return reverseCorrectIt();
} }
// After Void
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
if (m_processMsg != null)
return false;
setProcessed(true); setProcessed(true);
setDocAction(DOCACTION_None); setDocAction(DOCACTION_None);
return true; return true;
@ -752,8 +763,8 @@ public class MProduction extends X_M_Production implements DocAction {
@Override @Override
public boolean reverseAccrualIt() { public boolean reverseAccrualIt() {
if (log.isLoggable(Level.INFO)) log.info(toString()); if (log.isLoggable(Level.INFO)) log.info(toString());
// Before reverseCorrect // Before reverseAccrual
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT); m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
if (m_processMsg != null) if (m_processMsg != null)
return false; return false;
@ -761,8 +772,8 @@ public class MProduction extends X_M_Production implements DocAction {
if (reversal == null) if (reversal == null)
return false; return false;
// After reverseCorrect // After reverseAccrual
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT); m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
if (m_processMsg != null) if (m_processMsg != null)
return false; return false;
@ -773,7 +784,17 @@ public class MProduction extends X_M_Production implements DocAction {
@Override @Override
public boolean reActivateIt() { public boolean reActivateIt() {
throw new UnsupportedOperationException(); if (log.isLoggable(Level.INFO)) log.info("reActivateIt - " + toString());
// Before reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
if (m_processMsg != null)
return false;
// After reActivate
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
if (m_processMsg != null)
return false;
return false;
} }
@Override @Override