use of edu.cornell.kfs.coa.businessobject.AccountReversionGlobalAccount in project cu-kfs by CU-CommunityApps.
the class AccountReversionGlobalRule method areAllAccountsValid.
/**
* This method tests if all the AccountReversionGlobalAccount objects associated with the given global account
* reversion pass all of their tests.
*
* @param globalAcctRev the global account reversion to check
* @return true if valid, false otherwise
*/
public boolean areAllAccountsValid(AccountReversionGlobal globalAcctRev) {
boolean success = true;
if (globalAcctRev.getAccountReversionGlobalAccounts().size() == 0) {
putFieldError(KFSConstants.MAINTENANCE_ADD_PREFIX + "accountReversionGlobalAccounts.organizationCode", CUKFSKeyConstants.ERROR_DOCUMENT_GLOBAL_ACCT_REVERSION_NO_ACCOUNTS);
success = false;
} else {
success &= checkAllAccountReversionsExistOrAllFieldsAreDefined(globalAcctRev);
for (int i = 0; i < globalAcctRev.getAccountReversionGlobalAccounts().size(); i++) {
AccountReversionGlobalAccount acct = globalAcctRev.getAccountReversionGlobalAccounts().get(i);
String errorPath = MAINTAINABLE_ERROR_PREFIX + "accountReversionGlobalAccounts[" + i + "]";
GlobalVariables.getMessageMap().addToErrorPath(errorPath);
success &= checkAllObjectCodesForValidity(globalAcctRev, acct);
success &= checkAccountValidity(acct);
success &= checkAccountChartValidity(acct);
success &= validateAccountFundGroup(acct);
success &= validateAccountSubFundGroup(acct);
GlobalVariables.getMessageMap().removeFromErrorPath(errorPath);
}
}
return success;
}
Aggregations