|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.rice.kns.rules.DocumentRuleBase
org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
org.kuali.kfs.coa.document.validation.impl.AccountRule
public class AccountRule
Business rule(s) applicable to AccountMaintenance documents.
Field Summary | |
---|---|
protected AccountService |
accountService
|
protected static String |
ACCT_CAPITAL_SUBFUNDGROUP
|
protected static String |
ACCT_PREFIX_RESTRICTION
|
protected BalanceService |
balanceService
|
protected static String |
BUDGET_RECORDING_LEVEL_MIXED
|
protected ContractsAndGrantsModuleService |
contractsAndGrantsModuleService
|
protected static String |
ENDOWMENT_FUND_CD
|
protected static String |
GENERAL_FUND_CD
|
protected GeneralLedgerPendingEntryService |
generalLedgerPendingEntryService
|
protected static org.apache.log4j.Logger |
LOG
|
protected Account |
newAccount
|
protected Account |
oldAccount
|
protected static org.kuali.rice.kns.service.ParameterService |
parameterService
|
protected static String |
PLANT_FUND_CD
|
protected static String |
RESTRICTED_CD_RESTRICTED
|
protected static String |
RESTRICTED_CD_TEMPORARILY_RESTRICTED
|
protected static String |
RESTRICTED_CD_UNRESTRICTED
|
protected static String |
RESTRICTED_FUND_CD
|
protected static SubFundGroupService |
subFundGroupService
|
Fields inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase |
---|
financialSystemUserService, personService |
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase |
---|
boDictionaryService, boService, businessObjectAuthorizationService, configService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, priorErrorPath, roleService, workflowDocumentService |
Constructor Summary | |
---|---|
AccountRule()
|
Method Summary | |
---|---|
protected boolean |
accountNumberStartsWithAllowedPrefix(String accountNumber,
List<String> illegalValues)
This method tests whether the accountNumber passed in is prefixed with an allowed prefix, or an illegal one. |
protected boolean |
areGuidelinesRequired(Account account)
This method determines whether the guidelines are required, based on business rules. |
protected boolean |
areTwoUsersTheSame(org.kuali.rice.kim.bo.Person user1,
org.kuali.rice.kim.bo.Person user2)
This method checks to see if two users are the same Person using their identifiers |
protected boolean |
checkAccountExpirationDateValidTodayOrEarlier(Account newAccount)
This method checks to see if the account expiration date is today's date or earlier |
protected boolean |
checkAccountGuidelinesValidation(AccountGuideline accountGuideline)
This method validates that the account guidelines object is valid |
protected boolean |
checkCGFieldNotFilledIn(Account account,
String propertyName)
This method checks to see if the contracts and grants fields are filled in or not |
protected boolean |
checkCgRequiredFields(Account newAccount)
This method checks to make sure that if the contracts and grants fields are required they are entered correctly |
protected boolean |
checkCloseAccount(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if the user is trying to close the account and if so if any rules are being violated Calls the additional rule checkAccountExpirationDateValidTodayOrEarlier |
protected boolean |
checkContractControlAccountNumberRequired(Account newAccount)
This method checks to make sure that if the contract control account exists it is the same as the Account that we are working on |
protected boolean |
checkContractsAndGrants(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if any Contracts and Grants business rules were violated Calls the following sub-rules: checkCgRequiredFields checkCgIncomeStreamRequired |
protected boolean |
checkEmptyValues(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks the basic rules for empty values in an account and associated objects with this account If guidelines are required for this Business Object it checks to make sure that it is filled out It also checks for partially filled out reference keys on the following: continuationAccount incomeStreamAccount endowmentIncomeAccount reportsToAccount contractControlAccount indirectCostRecoveryAcct |
protected boolean |
checkExpirationDate(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if any expiration date field rules were violated |
protected boolean |
checkFringeBenefitAccountRule(Account newAccount)
the fringe benefit account (otherwise known as the reportsToAccount) is required if the fringe benefit code is set to N. |
protected boolean |
checkFundGroup(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if any Fund Group rules were violated Specifically: if we are dealing with a "GF" (General Fund) we cannot have an account with a budget recording level of "M" (Mixed) |
protected boolean |
checkGeneralRules(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks some of the general business rules associated with this document Calls the following rules: accountNumberStartsWithAllowedPrefix isNonSystemSupervisorEditingAClosedAccount hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate checkFringeBenefitAccountRule checkUserStatusAndType (on fiscal officer, supervisor and manager) ensures that the fiscal officer, supervisor and manager are not the same isContinuationAccountExpired |
protected boolean |
checkIncomeStreamAccountRule()
the income stream account is required if account's sub fund group code's fund group code is either GF or CG. |
protected boolean |
checkIncomeStreamValid(Account newAccount)
This method checks to see if the income stream account is required |
protected boolean |
checkSubFundGroup(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if any SubFund Group rules were violated Specifically: if SubFundGroup is empty or not "PFCMR" we cannot have a campus code or building code if SubFundGroup is "PFCMR" then campus code and building code "must" be entered and be valid codes |
protected boolean |
checkUniqueAccountNumber(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method checks to see if account is allowed to cross chart; and if not makes sure that the account number is unique in the whole system. |
org.kuali.rice.kns.service.ParameterService |
getParameterService()
|
SubFundGroupService |
getSubFundGroupService()
|
protected boolean |
hasDefaultRestrictedStatusCode(Account account)
Checks whether the account restricted status code is the default from the sub fund group. |
protected boolean |
hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate(Account account)
This method tests whether a given account has the T - Temporary value for Restricted Status Code, but does not have a Restricted Status Date, which is required when the code is T. |
protected boolean |
isContinuationAccountExpired(Account newAccount)
This method tests whether the continuation account entered (if any) has expired or not. |
protected boolean |
isNonSystemSupervisorEditingAClosedAccount(org.kuali.rice.kns.document.MaintenanceDocument document,
org.kuali.rice.kim.bo.Person user)
This method tests whether an account is being ReOpened by anyone except a system supervisor. |
protected boolean |
isSupervisorSameAsFiscalOfficer(Account account)
This method is a helper method for checking if the supervisor user is the same as the fiscal officer Calls areTwoUsersTheSame(Person, Person) |
protected boolean |
isSupervisorSameAsManager(Account account)
This method is a helper method for checking if the supervisor user is the same as the manager Calls areTwoUsersTheSame(Person, Person) |
protected boolean |
isUpdatedExpirationDateInvalid(org.kuali.rice.kns.document.MaintenanceDocument maintDoc)
This method checks to see if the new expiration date is different from the old expiration and if it has if it is invalid |
protected boolean |
processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This method calls the following rules: checkAccountGuidelinesValidation checkEmptyValues checkGeneralRules checkCloseAccount checkContractsAndGrants checkExpirationDate checkFundGroup checkSubFundGroup checkFiscalOfficerIsValidKualiUser this rule will fail on routing |
protected boolean |
processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This method calls the route rules but does not fail if any of them fail (this only happens on routing) |
protected String |
replaceTokens(String errorConstant)
This method is a helper method that replaces error tokens with values for contracts and grants labels |
void |
setAccountService(AccountService accountService)
Sets the accountService attribute value. |
void |
setBalanceService(BalanceService balanceService)
This method sets the balanceService |
void |
setContractsAndGrantsModuleService(ContractsAndGrantsModuleService contractsAndGrantsModuleService)
Sets the contractsAndGrantsModuleService attribute value. |
void |
setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)
This method sets the generalLedgerPendingEntryService |
void |
setupConvenienceObjects()
This method sets the convenience objects like newAccount and oldAccount, so you have short and easy handles to the new and old objects contained in the maintenance document. |
Methods inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase |
---|
getFinancialSystemUserService, getKfsUserService |
Methods inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase |
---|
apcRuleFails, applyApcRule, checkEmptyBOField, checkEmptyDocumentField, checkEmptyValue, checkForPartiallyFilledOutReferenceForeignKeys, clearErrorPath, consolidateFieldNames, dataDictionaryValidate, errorAlreadyExists, getBoDictionaryService, getBoService, getBusinessObjectAuthorizationService, getConfigService, getDateTimeService, getDdService, getDictionaryValidationService, getDocumentHelperService, getFieldLabel, getFieldLabel, getHumanReadablePrimaryKeyFieldNames, getMaintDocDictionaryService, getNewBo, getOldBo, getPersistenceService, getPersistenceStructureService, getPersonService, getRoleService, getWorkflowDocumentService, isCorrectMaintenanceClass, isDocumentInactivatingBusinessObject, isDocumentValidForSave, primaryKeyCheck, processAddCollectionLineBusinessRules, processApproveDocument, processCustomAddCollectionLineBusinessRules, processCustomApproveDocumentBusinessRules, processGlobalApproveDocumentBusinessRules, processGlobalRouteDocumentBusinessRules, processGlobalSaveDocumentBusinessRules, processInactivationBlockChecking, processInactivationBlockChecking, processRouteDocument, processSaveDocument, putDocumentError, putDocumentError, putFieldError, putFieldError, putFieldError, putFieldErrorWithShortLabel, putGlobalError, putGlobalError, putGlobalError, putGlobalsError, putGlobalsError, putInactivationBlockingErrorOnPage, resumeErrorPath, setBoDictionaryService, setBoService, setBusinessObjectAuthorizationService, setConfigService, setDdService, setDictionaryValidationService, setDocumentHelperService, setMaintDocDictionaryService, setNewBo, setPersistenceService, setPersistenceStructureService, setPersonService, setupBaseConvenienceObjects, setWorkflowDocumentService, showErrorMap, validateDocumentStructure, validateDuplicateIdentifierInDataDictionary, validateGlobalBusinessObjectPersistable, validateMaintenanceDocument |
Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase |
---|
getDataDictionaryService, getIdentityManagementService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getWorkflowInfoService, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, processCustomSendAdHocRequests, processSendAdHocRequests, setMaxDictionaryValidationDepth, validateSensitiveDataValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger LOG
protected static final String ACCT_PREFIX_RESTRICTION
protected static final String ACCT_CAPITAL_SUBFUNDGROUP
protected static final String GENERAL_FUND_CD
protected static final String RESTRICTED_FUND_CD
protected static final String ENDOWMENT_FUND_CD
protected static final String PLANT_FUND_CD
protected static final String RESTRICTED_CD_RESTRICTED
protected static final String RESTRICTED_CD_UNRESTRICTED
protected static final String RESTRICTED_CD_TEMPORARILY_RESTRICTED
protected static final String BUDGET_RECORDING_LEVEL_MIXED
protected static SubFundGroupService subFundGroupService
protected static org.kuali.rice.kns.service.ParameterService parameterService
protected GeneralLedgerPendingEntryService generalLedgerPendingEntryService
protected BalanceService balanceService
protected AccountService accountService
protected ContractsAndGrantsModuleService contractsAndGrantsModuleService
protected Account oldAccount
protected Account newAccount
Constructor Detail |
---|
public AccountRule()
Method Detail |
---|
public void setupConvenienceObjects()
setupConvenienceObjects
in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
setupConvenienceObjects
in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
processCustomSaveDocumentBusinessRules
in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
MaintenanceDocumentRuleBase.processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)
protected boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
processCustomRouteDocumentBusinessRules
in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
MaintenanceDocumentRuleBase.processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)
protected boolean checkEmptyValues(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean checkAccountGuidelinesValidation(AccountGuideline accountGuideline)
accountGuideline
-
protected boolean areGuidelinesRequired(Account account)
account
- - the populated Account bo to be evaluated
protected boolean accountNumberStartsWithAllowedPrefix(String accountNumber, List<String> illegalValues)
accountNumber
- - The Account Number to be tested.illegalValues
- - An Array of Strings of the unallowable prefixes.
protected boolean isNonSystemSupervisorEditingAClosedAccount(org.kuali.rice.kns.document.MaintenanceDocument document, org.kuali.rice.kim.bo.Person user)
document
- - populated document containing the old and new accountsuser
- - the user who is trying to possibly reopen the account
protected boolean hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate(Account account)
account
-
protected boolean hasDefaultRestrictedStatusCode(Account account)
account
-
protected boolean checkGeneralRules(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean isContinuationAccountExpired(Account newAccount)
newAccount
-
protected boolean checkFringeBenefitAccountRule(Account newAccount)
newAccount
-
protected boolean isSupervisorSameAsFiscalOfficer(Account account)
areTwoUsersTheSame(Person, Person)
accountGlobals
-
protected boolean isSupervisorSameAsManager(Account account)
areTwoUsersTheSame(Person, Person)
accountGlobals
-
protected boolean areTwoUsersTheSame(org.kuali.rice.kim.bo.Person user1, org.kuali.rice.kim.bo.Person user2)
user1
- user2
-
protected boolean checkCloseAccount(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean checkAccountExpirationDateValidTodayOrEarlier(Account newAccount)
newAccount
-
protected boolean checkContractsAndGrants(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean checkIncomeStreamValid(Account newAccount)
newAccount
-
protected boolean checkCgRequiredFields(Account newAccount)
newAccount
-
protected String replaceTokens(String errorConstant)
errorConstant
-
protected boolean checkContractControlAccountNumberRequired(Account newAccount)
newAccount
-
protected boolean checkExpirationDate(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean isUpdatedExpirationDateInvalid(org.kuali.rice.kns.document.MaintenanceDocument maintDoc)
maintDoc
-
protected boolean checkFundGroup(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean checkSubFundGroup(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
protected boolean checkIncomeStreamAccountRule()
newAccount
-
protected boolean checkCGFieldNotFilledIn(Account account, String propertyName)
account
- propertyName
- - property to attach error to
protected boolean checkUniqueAccountNumber(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
maintenanceDocument
-
public void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)
generalLedgerPendingEntryService
- public void setBalanceService(BalanceService balanceService)
balanceService
- public final void setAccountService(AccountService accountService)
accountService
- The accountService to set.public void setContractsAndGrantsModuleService(ContractsAndGrantsModuleService contractsAndGrantsModuleService)
contractsAndGrantsModuleService
- The contractsAndGrantsModuleService to set.public SubFundGroupService getSubFundGroupService()
public org.kuali.rice.kns.service.ParameterService getParameterService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |