Implement proposal on Support Request [ 1566089 ] Limit Doc Action Access
Integrate development by Layda Salas sponsored by Idalica
This commit is contained in:
parent
c0a3ebdb58
commit
1d69ec3afc
|
@ -400,9 +400,14 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
}
|
}
|
||||||
setApprovalAmt(approval);
|
setApprovalAmt(approval);
|
||||||
//
|
//
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
|
||||||
return DocAction.STATUS_InProgress;
|
return DocAction.STATUS_InProgress;
|
||||||
} // prepareIt
|
} // prepareIt
|
||||||
|
|
||||||
|
@ -441,6 +446,11 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -477,8 +487,21 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
boolean retValue = reverseIt();
|
boolean retValue = reverseIt();
|
||||||
|
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
|
||||||
return retValue;
|
return retValue;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
|
@ -490,8 +513,18 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
|
@ -502,7 +535,18 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
boolean retValue = reverseIt();
|
boolean retValue = reverseIt();
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return retValue;
|
return retValue;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
@ -514,7 +558,18 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
boolean retValue = reverseIt();
|
boolean retValue = reverseIt();
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return retValue;
|
return retValue;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
@ -526,6 +581,16 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -331,6 +331,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
m_processMsg = "@PeriodClosed@";
|
m_processMsg = "@PeriodClosed@";
|
||||||
return DocAction.STATUS_Invalid;
|
return DocAction.STATUS_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
|
@ -373,6 +378,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -415,6 +425,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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()))
|
||||||
|
@ -479,6 +494,11 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
addDescription(Msg.getMsg(getCtx(), "Voided"));
|
addDescription(Msg.getMsg(getCtx(), "Voided"));
|
||||||
setStatementDifference(Env.ZERO);
|
setStatementDifference(Env.ZERO);
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
@ -491,6 +511,15 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
|
@ -503,6 +532,16 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -513,6 +552,16 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -523,6 +572,15 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,11 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
}
|
}
|
||||||
setStatementDifference(difference);
|
setStatementDifference(difference);
|
||||||
// setEndingBalance(getBeginningBalance().add(getStatementDifference()));
|
// setEndingBalance(getBeginningBalance().add(getStatementDifference()));
|
||||||
//
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
@ -493,6 +497,12 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -601,6 +611,14 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return false;
|
return false;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
@ -613,6 +631,15 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
@ -624,6 +651,16 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -634,6 +671,16 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -644,9 +691,19 @@ public class MCash extends X_C_Cash implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setProcessed(false);
|
setProcessed(false);
|
||||||
if (reverseCorrectIt())
|
if (reverseCorrectIt())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// After reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
return false;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -1088,6 +1088,10 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
checkMaterialPolicy(); // set MASI
|
checkMaterialPolicy(); // set MASI
|
||||||
createConfirmation();
|
createConfirmation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
|
@ -1130,6 +1134,11 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Outstanding (not processed) Incoming Confirmations ?
|
// Outstanding (not processed) Incoming Confirmations ?
|
||||||
MInOutConfirm[] confirmations = getConfirmations(true);
|
MInOutConfirm[] confirmations = getConfirmations(true);
|
||||||
for (int i = 0; i < confirmations.length; i++)
|
for (int i = 0; i < confirmations.length; i++)
|
||||||
|
@ -1628,6 +1637,10 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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())
|
||||||
|
@ -1662,6 +1675,11 @@ public class MInOut extends X_M_InOut 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);
|
||||||
|
@ -1675,6 +1693,16 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1687,6 +1715,11 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType()))
|
if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType()))
|
||||||
{
|
{
|
||||||
|
@ -1778,6 +1811,11 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
//
|
//
|
||||||
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
m_processMsg = reversal.getDocumentNo();
|
m_processMsg = reversal.getDocumentNo();
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocStatus(DOCSTATUS_Reversed); // may come from void
|
setDocStatus(DOCSTATUS_Reversed); // may come from void
|
||||||
|
@ -1792,6 +1830,16 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -1802,6 +1850,16 @@ public class MInOut extends X_M_InOut implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -340,6 +340,9 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
}
|
}
|
||||||
setIsInDispute(difference);
|
setIsInDispute(difference);
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
//
|
//
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
|
@ -382,6 +385,11 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -640,6 +648,15 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
|
@ -650,8 +667,17 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
|
@ -662,6 +688,16 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -672,6 +708,16 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -682,6 +728,16 @@ public class MInOutConfirm extends X_M_InOutConfirm implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,10 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
// TODO: Add up Amounts
|
// TODO: Add up Amounts
|
||||||
// setApprovalAmt();
|
// setApprovalAmt();
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
@ -373,6 +376,11 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -712,6 +720,11 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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()))
|
||||||
|
@ -749,6 +762,10 @@ public class MInventory extends X_M_Inventory 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;
|
||||||
|
@ -761,6 +778,14 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
|
@ -773,6 +798,11 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
if (!MPeriod.isOpen(getCtx(), getMovementDate(), dt.getDocBaseType()))
|
if (!MPeriod.isOpen(getCtx(), getMovementDate(), dt.getDocBaseType()))
|
||||||
{
|
{
|
||||||
|
@ -828,6 +858,10 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
|
|
||||||
// Update Reversed (this)
|
// Update Reversed (this)
|
||||||
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocStatus(DOCSTATUS_Reversed); // may come from void
|
setDocStatus(DOCSTATUS_Reversed); // may come from void
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
@ -842,6 +876,16 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -852,6 +896,16 @@ public class MInventory extends X_M_Inventory implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -1390,6 +1390,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Add up Amounts
|
// Add up Amounts
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
|
@ -1598,6 +1602,11 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -1898,6 +1907,11 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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()))
|
||||||
|
@ -1947,6 +1961,11 @@ public class MInvoice extends X_C_Invoice 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;
|
||||||
|
@ -1959,6 +1978,16 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1971,6 +2000,11 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType()))
|
if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType()))
|
||||||
{
|
{
|
||||||
|
@ -2101,6 +2135,10 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
if (alloc.processIt(DocAction.ACTION_Complete))
|
if (alloc.processIt(DocAction.ACTION_Complete))
|
||||||
alloc.save();
|
alloc.save();
|
||||||
}
|
}
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // reverseCorrectIt
|
} // reverseCorrectIt
|
||||||
|
@ -2112,6 +2150,16 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -2122,6 +2170,17 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -479,6 +479,11 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
|
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
return DocAction.STATUS_InProgress;
|
return DocAction.STATUS_InProgress;
|
||||||
} // prepareIt
|
} // prepareIt
|
||||||
|
@ -518,6 +523,11 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -542,14 +552,28 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boolean ok_to_void = false;
|
||||||
if (DOCSTATUS_Drafted.equals(getDocStatus())
|
if (DOCSTATUS_Drafted.equals(getDocStatus())
|
||||||
|| DOCSTATUS_Invalid.equals(getDocStatus()))
|
|| DOCSTATUS_Invalid.equals(getDocStatus()))
|
||||||
{
|
{
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
ok_to_void = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ok_to_void;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -560,13 +584,27 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boolean ok_to_close = false;
|
||||||
if (DOCSTATUS_Completed.equals(getDocStatus()))
|
if (DOCSTATUS_Completed.equals(getDocStatus()))
|
||||||
{
|
{
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
ok_to_close = true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ok_to_close;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -576,7 +614,22 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
*/
|
*/
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
return reverseCorrectIt(getGL_JournalBatch_ID()) != null;
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boolean ok_correct = (reverseCorrectIt(getGL_JournalBatch_ID()) != null);
|
||||||
|
|
||||||
|
if (! ok_correct)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ok_correct;
|
||||||
} // reverseCorrectIt
|
} // reverseCorrectIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -615,7 +668,22 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
*/
|
*/
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
return reverseAccrualIt (getGL_JournalBatch_ID()) != null;
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boolean ok_reverse = (reverseAccrualIt (getGL_JournalBatch_ID()) != null);
|
||||||
|
|
||||||
|
if (! ok_reverse)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return ok_reverse;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -658,6 +726,16 @@ public class MJournal extends X_GL_Journal implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,10 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Add up Amounts
|
// Add up Amounts
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
return DocAction.STATUS_InProgress;
|
return DocAction.STATUS_InProgress;
|
||||||
|
@ -418,6 +422,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
approveIt();
|
approveIt();
|
||||||
|
|
||||||
|
@ -481,6 +490,15 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info("voidIt - " + toString());
|
log.info("voidIt - " + toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
|
@ -491,6 +509,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MJournal[] journals = getJournals(true);
|
MJournal[] journals = getJournals(true);
|
||||||
for (int i = 0; i < journals.length; i++)
|
for (int i = 0; i < journals.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -526,6 +549,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
journal.save();
|
journal.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
|
@ -537,6 +565,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MJournal[] journals = getJournals(true);
|
MJournal[] journals = getJournals(true);
|
||||||
// check prerequisites
|
// check prerequisites
|
||||||
for (int i = 0; i < journals.length; i++)
|
for (int i = 0; i < journals.length; i++)
|
||||||
|
@ -582,6 +615,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
}
|
}
|
||||||
journal.save();
|
journal.save();
|
||||||
}
|
}
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -593,6 +631,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MJournal[] journals = getJournals(true);
|
MJournal[] journals = getJournals(true);
|
||||||
// check prerequisites
|
// check prerequisites
|
||||||
for (int i = 0; i < journals.length; i++)
|
for (int i = 0; i < journals.length; i++)
|
||||||
|
@ -636,6 +679,11 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
}
|
}
|
||||||
journal.save();
|
journal.save();
|
||||||
}
|
}
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -646,10 +694,22 @@ public class MJournalBatch extends X_GL_JournalBatch implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
log.info("reActivateIt - " + toString());
|
||||||
|
|
||||||
|
// Before reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// setProcessed(false);
|
// setProcessed(false);
|
||||||
if (reverseCorrectIt())
|
if (! reverseCorrectIt())
|
||||||
return true;
|
return false;
|
||||||
return false;
|
|
||||||
|
// After reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -324,6 +324,10 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
// Confirmation
|
// Confirmation
|
||||||
if (dt.isInTransit())
|
if (dt.isInTransit())
|
||||||
createConfirmation();
|
createConfirmation();
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
|
@ -380,6 +384,10 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Outstanding (not processed) Incoming Confirmations ?
|
// Outstanding (not processed) Incoming Confirmations ?
|
||||||
MMovementConfirm[] confirmations = getConfirmations(true);
|
MMovementConfirm[] confirmations = getConfirmations(true);
|
||||||
for (int i = 0; i < confirmations.length; i++)
|
for (int i = 0; i < confirmations.length; i++)
|
||||||
|
@ -630,6 +638,11 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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()))
|
||||||
|
@ -663,6 +676,10 @@ public class MMovement extends X_M_Movement 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);
|
||||||
|
@ -676,6 +693,15 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Close Not delivered Qty
|
// Close Not delivered Qty
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
@ -689,6 +715,11 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
if (!MPeriod.isOpen(getCtx(), getMovementDate(), dt.getDocBaseType()))
|
if (!MPeriod.isOpen(getCtx(), getMovementDate(), dt.getDocBaseType()))
|
||||||
{
|
{
|
||||||
|
@ -744,6 +775,11 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
reversal.save();
|
reversal.save();
|
||||||
m_processMsg = reversal.getDocumentNo();
|
m_processMsg = reversal.getDocumentNo();
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Update Reversed (this)
|
// Update Reversed (this)
|
||||||
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
addDescription("(" + reversal.getDocumentNo() + "<-)");
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
|
@ -760,6 +796,16 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -770,6 +816,16 @@ public class MMovement extends X_M_Movement implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -305,13 +305,10 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// User Validation
|
|
||||||
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
if (valid != null)
|
if (m_processMsg != null)
|
||||||
{
|
|
||||||
m_processMsg = valid;
|
|
||||||
return DocAction.STATUS_Invalid;
|
return DocAction.STATUS_Invalid;
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
|
@ -355,6 +352,11 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -401,6 +403,14 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
+ ": " + m_inventoryInfo);
|
+ ": " + m_inventoryInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// User Validation
|
||||||
|
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
|
||||||
|
if (valid != null)
|
||||||
|
{
|
||||||
|
m_processMsg = valid;
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_Close);
|
setDocAction(DOCACTION_Close);
|
||||||
return DocAction.STATUS_Completed;
|
return DocAction.STATUS_Completed;
|
||||||
|
@ -511,6 +521,15 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info("voidIt - " + toString());
|
log.info("voidIt - " + toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
|
@ -522,6 +541,15 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Close Not delivered Qty
|
// Close Not delivered Qty
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
|
@ -535,6 +563,16 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -545,6 +583,16 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -555,6 +603,16 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -1341,6 +1341,10 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
// if (!DOCACTION_Complete.equals(getDocAction())) don't set for just prepare
|
// if (!DOCACTION_Complete.equals(getDocAction())) don't set for just prepare
|
||||||
// setDocAction(DOCACTION_Complete);
|
// setDocAction(DOCACTION_Complete);
|
||||||
|
@ -1634,7 +1638,7 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
{
|
{
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
String DocSubTypeSO = dt.getDocSubTypeSO();
|
String DocSubTypeSO = dt.getDocSubTypeSO();
|
||||||
|
|
||||||
// Just prepare
|
// Just prepare
|
||||||
if (DOCACTION_Prepare.equals(getDocAction()))
|
if (DOCACTION_Prepare.equals(getDocAction()))
|
||||||
{
|
{
|
||||||
|
@ -1648,6 +1652,9 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
// Binding
|
// Binding
|
||||||
if (MDocType.DOCSUBTYPESO_Quotation.equals(DocSubTypeSO))
|
if (MDocType.DOCSUBTYPESO_Quotation.equals(DocSubTypeSO))
|
||||||
reserveStock(dt, getLines(true, "M_Product_ID"));
|
reserveStock(dt, getLines(true, "M_Product_ID"));
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
return DocAction.STATUS_Completed;
|
return DocAction.STATUS_Completed;
|
||||||
}
|
}
|
||||||
|
@ -1667,6 +1674,11 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -1963,8 +1975,13 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
*/
|
*/
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
MOrderLine[] lines = getLines(true, "M_Product_ID");
|
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
MOrderLine[] lines = getLines(true, "M_Product_ID");
|
||||||
for (int i = 0; i < lines.length; i++)
|
for (int i = 0; i < lines.length; i++)
|
||||||
{
|
{
|
||||||
MOrderLine line = lines[i];
|
MOrderLine line = lines[i];
|
||||||
|
@ -1988,6 +2005,11 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
if (!createReversals())
|
if (!createReversals())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
@ -2085,6 +2107,10 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Close Not delivered Qty - SO/PO
|
// Close Not delivered Qty - SO/PO
|
||||||
MOrderLine[] lines = getLines(true, "M_Product_ID");
|
MOrderLine[] lines = getLines(true, "M_Product_ID");
|
||||||
|
@ -2107,6 +2133,11 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
m_processMsg = "Cannot unreserve Stock (close)";
|
m_processMsg = "Cannot unreserve Stock (close)";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setProcessed(true);
|
setProcessed(true);
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
|
@ -2119,6 +2150,16 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return voidIt();
|
return voidIt();
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -2129,6 +2170,16 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -2139,6 +2190,12 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
|
||||||
String DocSubTypeSO = dt.getDocSubTypeSO();
|
String DocSubTypeSO = dt.getDocSubTypeSO();
|
||||||
|
@ -2178,6 +2235,10 @@ public class MOrder extends X_C_Order implements DocAction
|
||||||
{
|
{
|
||||||
log.info("Existing documents not modified - SubType=" + DocSubTypeSO);
|
log.info("Existing documents not modified - SubType=" + DocSubTypeSO);
|
||||||
}
|
}
|
||||||
|
// After reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
setProcessed(false);
|
setProcessed(false);
|
||||||
|
|
|
@ -1554,6 +1554,10 @@ public final class MPayment extends X_C_Payment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
@ -1595,7 +1599,12 @@ public final class MPayment extends X_C_Payment
|
||||||
String status = prepareIt();
|
String status = prepareIt();
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -1994,6 +2003,11 @@ public final class MPayment extends X_C_Payment
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
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()))
|
||||||
|
@ -2026,6 +2040,11 @@ public final class MPayment extends X_C_Payment
|
||||||
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;
|
||||||
|
@ -2038,6 +2057,14 @@ public final class MPayment extends X_C_Payment
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
setDocAction(DOCACTION_None);
|
setDocAction(DOCACTION_None);
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
@ -2049,6 +2076,10 @@ public final class MPayment extends X_C_Payment
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Std Period open?
|
// Std Period open?
|
||||||
Timestamp dateAcct = getDateAcct();
|
Timestamp dateAcct = getDateAcct();
|
||||||
|
@ -2150,6 +2181,10 @@ public final class MPayment extends X_C_Payment
|
||||||
bp.setTotalOpenBalance();
|
bp.setTotalOpenBalance();
|
||||||
bp.save(get_TrxName());
|
bp.save(get_TrxName());
|
||||||
}
|
}
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
m_processMsg = info.toString();
|
m_processMsg = info.toString();
|
||||||
return true;
|
return true;
|
||||||
|
@ -2175,6 +2210,17 @@ public final class MPayment extends X_C_Payment
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
|
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -2185,9 +2231,20 @@ public final class MPayment extends X_C_Payment
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info(toString());
|
log.info(toString());
|
||||||
if (reverseCorrectIt())
|
// Before reActivate
|
||||||
return true;
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
|
||||||
return false;
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (! reverseCorrectIt())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
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 *
|
||||||
|
@ -284,6 +284,10 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
}
|
}
|
||||||
setAmt(amt);
|
setAmt(amt);
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
return DocAction.STATUS_InProgress;
|
return DocAction.STATUS_InProgress;
|
||||||
} // prepareIt
|
} // prepareIt
|
||||||
|
@ -323,6 +327,11 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -353,6 +362,15 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info("voidIt - " + toString());
|
log.info("voidIt - " + toString());
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Revoke Credit
|
// Revoke Credit
|
||||||
return false;
|
return false;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
@ -365,6 +383,15 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
|
@ -375,6 +402,16 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -385,6 +422,16 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -395,6 +442,16 @@ public class MRMA extends X_M_RMA implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
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;
|
return false;
|
||||||
} // reActivateIt
|
} // reActivateIt
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,11 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
setTotalLines(totalLines);
|
setTotalLines(totalLines);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
return DocAction.STATUS_InProgress;
|
return DocAction.STATUS_InProgress;
|
||||||
} // prepareIt
|
} // prepareIt
|
||||||
|
@ -314,6 +319,11 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -340,7 +350,20 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info("voidIt - " + toString());
|
log.info("voidIt - " + toString());
|
||||||
return closeIt();
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!closeIt())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -351,6 +374,11 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Close Not delivered Qty
|
// Close Not delivered Qty
|
||||||
MRequisitionLine[] lines = getLines();
|
MRequisitionLine[] lines = getLines();
|
||||||
BigDecimal totalLines = Env.ZERO;
|
BigDecimal totalLines = Env.ZERO;
|
||||||
|
@ -384,6 +412,11 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
setTotalLines(totalLines);
|
setTotalLines(totalLines);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // closeIt
|
} // closeIt
|
||||||
|
|
||||||
|
@ -394,6 +427,16 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -404,6 +447,16 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -414,10 +467,21 @@ public class MRequisition extends X_M_Requisition implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
log.info("reActivateIt - " + toString());
|
||||||
|
// Before reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// setProcessed(false);
|
// setProcessed(false);
|
||||||
if (reverseCorrectIt())
|
if (! reverseCorrectIt())
|
||||||
return true;
|
return false;
|
||||||
return false;
|
|
||||||
|
// After reActivate
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REACTIVATE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
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 *
|
||||||
|
@ -325,6 +325,10 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
m_justPrepared = true;
|
m_justPrepared = true;
|
||||||
if (!DOCACTION_Complete.equals(getDocAction()))
|
if (!DOCACTION_Complete.equals(getDocAction()))
|
||||||
setDocAction(DOCACTION_Complete);
|
setDocAction(DOCACTION_Complete);
|
||||||
|
@ -366,6 +370,11 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
if (!DocAction.STATUS_InProgress.equals(status))
|
if (!DocAction.STATUS_InProgress.equals(status))
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return DocAction.STATUS_Invalid;
|
||||||
|
|
||||||
// Implicit Approval
|
// Implicit Approval
|
||||||
if (!isApproved())
|
if (!isApproved())
|
||||||
approveIt();
|
approveIt();
|
||||||
|
@ -393,7 +402,21 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
public boolean voidIt()
|
public boolean voidIt()
|
||||||
{
|
{
|
||||||
log.info("voidIt - " + toString());
|
log.info("voidIt - " + toString());
|
||||||
return closeIt();
|
|
||||||
|
// Before Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!closeIt())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After Void
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
} // voidIt
|
} // voidIt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -404,6 +427,14 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
public boolean closeIt()
|
public boolean closeIt()
|
||||||
{
|
{
|
||||||
log.info("closeIt - " + toString());
|
log.info("closeIt - " + toString());
|
||||||
|
// Before Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
// After Close
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
// Close Not delivered Qty
|
// Close Not delivered Qty
|
||||||
// setDocAction(DOCACTION_None);
|
// setDocAction(DOCACTION_None);
|
||||||
|
@ -417,6 +448,16 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
public boolean reverseCorrectIt()
|
public boolean reverseCorrectIt()
|
||||||
{
|
{
|
||||||
log.info("reverseCorrectIt - " + toString());
|
log.info("reverseCorrectIt - " + toString());
|
||||||
|
// Before reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseCorrect
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSECORRECT);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseCorrectionIt
|
} // reverseCorrectionIt
|
||||||
|
|
||||||
|
@ -427,6 +468,16 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
public boolean reverseAccrualIt()
|
public boolean reverseAccrualIt()
|
||||||
{
|
{
|
||||||
log.info("reverseAccrualIt - " + toString());
|
log.info("reverseAccrualIt - " + toString());
|
||||||
|
// Before reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// After reverseAccrual
|
||||||
|
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_REVERSEACCRUAL);
|
||||||
|
if (m_processMsg != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} // reverseAccrualIt
|
} // reverseAccrualIt
|
||||||
|
|
||||||
|
@ -437,6 +488,16 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
|
||||||
public boolean reActivateIt()
|
public boolean reActivateIt()
|
||||||
{
|
{
|
||||||
log.info("reActivateIt - " + toString());
|
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;
|
||||||
|
|
||||||
// setProcessed(false);
|
// setProcessed(false);
|
||||||
return false;
|
return false;
|
||||||
} // 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 *
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
* For the text or an alternative of this public license, you may reach us *
|
* For the text or an alternative of this public license, you may reach us *
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
|
* Contributor(s) : Layda Salas - globalqss *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.model;
|
package org.compiere.model;
|
||||||
|
|
||||||
|
@ -21,6 +22,8 @@ package org.compiere.model;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: ModelValidator.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $
|
* @version $Id: ModelValidator.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $
|
||||||
|
*
|
||||||
|
* 2007/02/26 laydasalasc - globalqss - Add new timings for all before/after events on documents
|
||||||
*/
|
*/
|
||||||
public interface ModelValidator
|
public interface ModelValidator
|
||||||
{
|
{
|
||||||
|
@ -34,13 +37,37 @@ public interface ModelValidator
|
||||||
public static final int TYPE_DELETE = 3;
|
public static final int TYPE_DELETE = 3;
|
||||||
public static final int CHANGETYPE_DELETE = 3;
|
public static final int CHANGETYPE_DELETE = 3;
|
||||||
|
|
||||||
/** Called before document is prepared */
|
/** Called before document is prepared */
|
||||||
public static final int TIMING_BEFORE_PREPARE = 1;
|
public static final int TIMING_BEFORE_PREPARE = 1;
|
||||||
public static final int DOCTIMING_BEFORE_PREPARE = 1;
|
public static final int DOCTIMING_BEFORE_PREPARE = 1; // Compatibility with Compiere 260c
|
||||||
/** Called after document is processed */
|
/** Called before document is void */
|
||||||
public static final int TIMING_AFTER_COMPLETE = 9;
|
public static final int TIMING_BEFORE_VOID = 2;
|
||||||
public static final int DOCTIMING_AFTER_COMPLETE = 9;
|
/** Called before document is close */
|
||||||
|
public static final int TIMING_BEFORE_CLOSE = 3;
|
||||||
|
/** Called before document is reactivate */
|
||||||
|
public static final int TIMING_BEFORE_REACTIVATE = 4;
|
||||||
|
/** Called before document is reversecorrect */
|
||||||
|
public static final int TIMING_BEFORE_REVERSECORRECT = 5;
|
||||||
|
/** Called before document is reverseaccrual */
|
||||||
|
public static final int TIMING_BEFORE_REVERSEACCRUAL = 6;
|
||||||
|
/** Called before document is completed */
|
||||||
|
public static final int TIMING_BEFORE_COMPLETE = 7;
|
||||||
|
/** Called after document is prepared */
|
||||||
|
public static final int TIMING_AFTER_PREPARE = 8;
|
||||||
|
/** Called after document is completed */
|
||||||
|
public static final int TIMING_AFTER_COMPLETE = 9;
|
||||||
|
public static final int DOCTIMING_AFTER_COMPLETE = 9; // Compatibility with Compiere 260c
|
||||||
|
/** Called after document is void */
|
||||||
|
public static final int TIMING_AFTER_VOID = 10;
|
||||||
|
/** Called after document is closed */
|
||||||
|
public static final int TIMING_AFTER_CLOSE = 11;
|
||||||
|
/** Called after document is reactivated */
|
||||||
|
public static final int TIMING_AFTER_REACTIVATE = 12;
|
||||||
|
/** Called after document is reversecorrect */
|
||||||
|
public static final int TIMING_AFTER_REVERSECORRECT = 13;
|
||||||
|
/** Called after document is reverseaccrual */
|
||||||
|
public static final int TIMING_AFTER_REVERSEACCRUAL = 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize Validation
|
* Initialize Validation
|
||||||
* @param engine validation engine
|
* @param engine validation engine
|
||||||
|
@ -89,5 +116,5 @@ public interface ModelValidator
|
||||||
* if not null, the pocument will be marked as Invalid.
|
* if not null, the pocument will be marked as Invalid.
|
||||||
*/
|
*/
|
||||||
public String docValidate (PO po, int timing);
|
public String docValidate (PO po, int timing);
|
||||||
|
|
||||||
} // ModelValidator
|
} // ModelValidator
|
||||||
|
|
Loading…
Reference in New Issue