Search in sources :

Example 6 with AccountReversionGlobalDetail

use of edu.cornell.kfs.coa.businessobject.AccountReversionGlobalDetail in project cu-kfs by CU-CommunityApps.

the class AccountReversionGlobalRule method checkAllObjectCodesForValidity.

/**
 * This method loops through each of the AccountReversionGlobalDetail objects, checking that the entered object codes for
 * each of them are compatible with the AccountReversionGlobalAccount specified.
 *
 * @param globalAcctRev the global account reversion to check
 * @param acct the AccountReversionGlobalOrganization with a new chart to check against all of the object codes
 * @return true if there are no conflicts, false if otherwise
 */
public boolean checkAllObjectCodesForValidity(AccountReversionGlobal globalAcctRev, AccountReversionGlobalAccount acct) {
    boolean success = true;
    for (AccountReversionGlobalDetail detail : globalAcctRev.getAccountReversionGlobalDetails()) {
        if (!validObjectCode(globalAcctRev.getUniversityFiscalYear(), acct.getChartOfAccountsCode(), detail.getAccountReversionObjectCode())) {
            success = false;
            GlobalVariables.getMessageMap().putError(CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER, CUKFSKeyConstants.ERROR_DOCUMENT_GLOBAL_ACCT_REVERSION_OBJECT_CODE_INVALID, new String[] { globalAcctRev.getUniversityFiscalYear().toString(), acct.getChartOfAccountsCode(), detail.getAccountReversionObjectCode(), acct.getChartOfAccountsCode(), acct.getAccountNumber() });
        }
    }
    return success;
}
Also used : AccountReversionGlobalDetail(edu.cornell.kfs.coa.businessobject.AccountReversionGlobalDetail)

Aggregations

AccountReversionGlobalDetail (edu.cornell.kfs.coa.businessobject.AccountReversionGlobalDetail)6 AccountReversionGlobal (edu.cornell.kfs.coa.businessobject.AccountReversionGlobal)3 AccountReversionGlobalAccount (edu.cornell.kfs.coa.businessobject.AccountReversionGlobalAccount)2 ReversionCategory (edu.cornell.kfs.coa.businessobject.ReversionCategory)2 AccountReversionService (edu.cornell.kfs.coa.service.AccountReversionService)1