org.kuali.kfs.module.ar.document.validation.impl
Class CashControlDocumentRule

java.lang.Object
  extended by org.kuali.rice.kns.rules.DocumentRuleBase
      extended by org.kuali.rice.kns.rules.TransactionalDocumentRuleBase
          extended by org.kuali.kfs.module.ar.document.validation.impl.CashControlDocumentRule
All Implemented Interfaces:
AddCashControlDetailRule<CashControlDocument>, CashControlDetailRule, DeleteCashControlDetailRule<CashControlDocument>, GenerateReferenceDocumentRule<CashControlDocument>, org.kuali.rice.kns.rule.AddAdHocRoutePersonRule, org.kuali.rice.kns.rule.AddAdHocRouteWorkgroupRule, org.kuali.rice.kns.rule.AddNoteRule, org.kuali.rice.kns.rule.ApproveDocumentRule, org.kuali.rice.kns.rule.BusinessRule, org.kuali.rice.kns.rule.RouteDocumentRule, org.kuali.rice.kns.rule.SaveDocumentRule, org.kuali.rice.kns.rule.SendAdHocRequestsRule

public class CashControlDocumentRule
extends org.kuali.rice.kns.rules.TransactionalDocumentRuleBase
implements AddCashControlDetailRule<CashControlDocument>, DeleteCashControlDetailRule<CashControlDocument>, GenerateReferenceDocumentRule<CashControlDocument>

This class holds the business rules for the AR Cash Control Document


Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
CashControlDocumentRule()
           
 
Method Summary
 boolean checkAllAppDocsApproved(CashControlDocument cashControlDocument)
          This method checks if all application documents are in approved or in final state
 boolean checkCashControlDocumentHasDetails(CashControlDocument cashControlDocument)
          This method checks if the CashControlDocument has any details to be processed.
protected  boolean checkCustomerNumber(String customerNumber)
          This method checks that the customer number is valid and not an inactive customer when it is not empty
 boolean checkGLPEsCreated(CashControlDocument cashControlDocument)
          This method checks that the GLPEs have been created
 boolean checkGLPEsNotGenerated(CashControlDocument cashControlDocument)
          This method checks if GLPEs have been already generated
 boolean checkLineAmount(CashControlDocument document, CashControlDetail detail)
          This method checks the CashControlDetail line amount is not zero or negative.
 boolean checkPaymentMedium(CashControlDocument document)
          This method checks that payment medium has a valid value
 boolean checkRefDocNumber(CashControlDocument document)
          This method checks that reference document number is not null when payment medium is Cash.
 boolean processAddCashControlDetailBusinessRules(CashControlDocument transactionalDocument, CashControlDetail cashControlDetail)
          This method is called when a cash control detail is added
protected  boolean processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.rule.event.ApproveDocumentEvent approveEvent)
           
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
           
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
           
 boolean processDeleteCashControlDetailBusinessRules(CashControlDocument transactionalDocument, CashControlDetail cashControlDetail)
          This method is called when a cash control detail is deleted
 boolean processGenerateReferenceDocumentBusinessRules(CashControlDocument transactionalDocument)
          This method is called when a reference document is generated
 boolean validateBankCode(CashControlDocument document)
           
protected  boolean validateCashControlDetail(CashControlDocument document, CashControlDetail cashControlDetail)
          This method validates CashControlDetail
 boolean validateCashControlDetails(CashControlDocument cashControlDocument)
          This method validates cash control document's details
 
Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase
getDataDictionaryService, getDictionaryValidationService, getDocumentHelperService, getIdentityManagementService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getPersonService, getWorkflowInfoService, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processApproveDocument, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomSendAdHocRequests, processRouteDocument, processSaveDocument, processSendAdHocRequests, setMaxDictionaryValidationDepth, validateSensitiveDataValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG
Constructor Detail

CashControlDocumentRule

public CashControlDocumentRule()
Method Detail

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
Overrides:
processCustomSaveDocumentBusinessRules in class org.kuali.rice.kns.rules.DocumentRuleBase
See Also:
DocumentRuleBase.processCustomSaveDocumentBusinessRules(Document)

processCustomRouteDocumentBusinessRules

protected boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
Overrides:
processCustomRouteDocumentBusinessRules in class org.kuali.rice.kns.rules.DocumentRuleBase
See Also:
DocumentRuleBase.processCustomRouteDocumentBusinessRules(Document)

processCustomApproveDocumentBusinessRules

protected boolean processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.rule.event.ApproveDocumentEvent approveEvent)
Overrides:
processCustomApproveDocumentBusinessRules in class org.kuali.rice.kns.rules.DocumentRuleBase
See Also:
org.kuali.rice.kns.rules.TransactionalDocumentRuleBase#processCustomApproveDocumentBusinessRules(Document)

checkLineAmount

public boolean checkLineAmount(CashControlDocument document,
                               CashControlDetail detail)
This method checks the CashControlDetail line amount is not zero or negative.

Parameters:
document - the CashControldocument
detail - the CashControlDetail
Returns:
true is amount is valid, false otherwise

checkCashControlDocumentHasDetails

public boolean checkCashControlDocumentHasDetails(CashControlDocument cashControlDocument)
This method checks if the CashControlDocument has any details to be processed.

Parameters:
cashControlDocument - the CashControlDocument
Returns:
true if it has details, false otherwise

checkPaymentMedium

public boolean checkPaymentMedium(CashControlDocument document)
This method checks that payment medium has a valid value

Parameters:
document -
Returns:
true if valid, false otherwise

checkRefDocNumber

public boolean checkRefDocNumber(CashControlDocument document)
This method checks that reference document number is not null when payment medium is Cash.

Parameters:
document - CashControlDocument
Returns:
true if valid, false otherwise

checkGLPEsCreated

public boolean checkGLPEsCreated(CashControlDocument cashControlDocument)
This method checks that the GLPEs have been created

Parameters:
document - CashControlDocument
Returns:
true if not null, false otherwise

processAddCashControlDetailBusinessRules

public boolean processAddCashControlDetailBusinessRules(CashControlDocument transactionalDocument,
                                                        CashControlDetail cashControlDetail)
Description copied from interface: AddCashControlDetailRule
This method is called when a cash control detail is added

Specified by:
processAddCashControlDetailBusinessRules in interface AddCashControlDetailRule<CashControlDocument>
Parameters:
transactionalDocument - the cash control document
cashControlDetail - the detail to be added
Returns:
true if valid to be added, false otherwise
See Also:
AddCashControlDetailRule.processAddCashControlDetailBusinessRules(org.kuali.rice.kns.document.TransactionalDocument, org.kuali.kfs.module.ar.businessobject.CashControlDetail)

validateCashControlDetail

protected boolean validateCashControlDetail(CashControlDocument document,
                                            CashControlDetail cashControlDetail)
This method validates CashControlDetail

Parameters:
document - CashControlDocument
cashControlDetail - CashControlDetail
Returns:
true if CashControlDetail is valid, false otherwise

validateCashControlDetails

public boolean validateCashControlDetails(CashControlDocument cashControlDocument)
This method validates cash control document's details

Parameters:
cashControlDocument - CashControldocument
Returns:
true if valid, false otherwise

checkCustomerNumber

protected boolean checkCustomerNumber(String customerNumber)
This method checks that the customer number is valid and not an inactive customer when it is not empty

Parameters:
cashControlDetail -
Returns:
true if valid, false otherwise

checkGLPEsNotGenerated

public boolean checkGLPEsNotGenerated(CashControlDocument cashControlDocument)
This method checks if GLPEs have been already generated

Parameters:
cashControlDocument - the cash control document
Returns:
true if it was not generated, false otherwise

checkAllAppDocsApproved

public boolean checkAllAppDocsApproved(CashControlDocument cashControlDocument)
This method checks if all application documents are in approved or in final state

Parameters:
cashControlDocument -
Returns:
true if all application documents approved/final, false otherwise

processDeleteCashControlDetailBusinessRules

public boolean processDeleteCashControlDetailBusinessRules(CashControlDocument transactionalDocument,
                                                           CashControlDetail cashControlDetail)
Description copied from interface: DeleteCashControlDetailRule
This method is called when a cash control detail is deleted

Specified by:
processDeleteCashControlDetailBusinessRules in interface DeleteCashControlDetailRule<CashControlDocument>
Parameters:
transactionalDocument - the cash control document
cashControlDetail - the cash control detail being deleted
Returns:
true if allowed to delete, false otherwise
See Also:
DeleteCashControlDetailRule.processDeleteCashControlDetailBusinessRules(org.kuali.rice.kns.document.TransactionalDocument, org.kuali.kfs.module.ar.businessobject.CashControlDetail)

processGenerateReferenceDocumentBusinessRules

public boolean processGenerateReferenceDocumentBusinessRules(CashControlDocument transactionalDocument)
Description copied from interface: GenerateReferenceDocumentRule
This method is called when a reference document is generated

Specified by:
processGenerateReferenceDocumentBusinessRules in interface GenerateReferenceDocumentRule<CashControlDocument>
Parameters:
transactionalDocument - the cash control document
Returns:
true if reference document can be generated, false otherwise
See Also:
GenerateReferenceDocumentRule.processGenerateReferenceDocumentBusinessRules(org.kuali.rice.kns.document.TransactionalDocument)

validateBankCode

public boolean validateBankCode(CashControlDocument document)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.