use of org.kuali.kfs.coa.businessobject.AccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class GlobalIndirectCostRecoveryAccountsRule method buildMessageFromPrimaryKey.
private String buildMessageFromPrimaryKey(GlobalBusinessObjectDetailBase detail) {
StringBuilder message = new StringBuilder();
if (detail instanceof AccountGlobalDetail) {
AccountGlobalDetail accountGlobalDetail = (AccountGlobalDetail) detail;
message.append(accountGlobalDetail.getChartOfAccountsCode());
message.append("-");
message.append(accountGlobalDetail.getAccountNumber());
} else if (detail instanceof SubAccountGlobalDetail) {
SubAccountGlobalDetail subAccountGlobalDetail = (SubAccountGlobalDetail) detail;
message.append(subAccountGlobalDetail.getChartOfAccountsCode());
message.append("-");
message.append(subAccountGlobalDetail.getAccountNumber());
message.append("-");
message.append(subAccountGlobalDetail.getSubAccountNumber());
}
return message.toString();
}
use of org.kuali.kfs.coa.businessobject.AccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class CuAccountGlobal method updateGlobalDetailICRAccountCollection.
@Override
public void updateGlobalDetailICRAccountCollection(GlobalBusinessObjectDetailBase globalDetail, List<IndirectCostRecoveryAccount> updatedIcrAccounts) {
AccountGlobalDetail accountGlobalDetail = (AccountGlobalDetail) globalDetail;
accountGlobalDetail.getAccount().setIndirectCostRecoveryAccounts(updatedIcrAccounts);
}
use of org.kuali.kfs.coa.businessobject.AccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class CuAccountGlobal method createIndirectCostRecoveryAccountFromChange.
@Override
public IndirectCostRecoveryAccount createIndirectCostRecoveryAccountFromChange(GlobalBusinessObjectDetailBase globalDetail, IndirectCostRecoveryAccountChange newICR) {
AccountGlobalDetail accountGlobalDetail = (AccountGlobalDetail) globalDetail;
String chart = accountGlobalDetail.getChartOfAccountsCode();
String account = accountGlobalDetail.getAccountNumber();
IndirectCostRecoveryAccount icrAccount = new IndirectCostRecoveryAccount();
icrAccount.setAccountNumber(account);
icrAccount.setChartOfAccountsCode(chart);
icrAccount.setIndirectCostRecoveryAccountNumber(newICR.getIndirectCostRecoveryAccountNumber());
icrAccount.setIndirectCostRecoveryFinCoaCode(newICR.getIndirectCostRecoveryFinCoaCode());
icrAccount.setActive(newICR.isActive());
icrAccount.setAccountLinePercent(newICR.getAccountLinePercent());
return icrAccount;
}
use of org.kuali.kfs.coa.businessobject.AccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class CuAccountGlobal method getGlobalObjectDetailsAndIcrAccountsMap.
@Override
public Map<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>> getGlobalObjectDetailsAndIcrAccountsMap() {
Map<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>> globalObjectDetailsAndIcrAccountsMap = new HashMap<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>>();
List<AccountGlobalDetail> accountGlobalDetails = getAccountGlobalDetails();
if (ObjectUtils.isNotNull(accountGlobalDetails) && !accountGlobalDetails.isEmpty()) {
for (GlobalBusinessObjectDetailBase globalDetail : accountGlobalDetails) {
AccountGlobalDetail accountGlobalDetail = (AccountGlobalDetail) globalDetail;
accountGlobalDetail.refreshReferenceObject(KFSPropertyConstants.ACCOUNT);
List<IndirectCostRecoveryAccount> icrAccounts = accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts();
globalObjectDetailsAndIcrAccountsMap.put(globalDetail, icrAccounts);
}
}
return globalObjectDetailsAndIcrAccountsMap;
}
use of org.kuali.kfs.coa.businessobject.AccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class AccountGlobalRule method checkCgRequiredFields.
/**
* This method checks to make sure that if the contracts and grants fields are required they are entered correctly
*
* @param newAccount
* @return
*/
protected boolean checkCgRequiredFields(CuAccountGlobal newAccount) {
boolean result = true;
if (ObjectUtils.isNotNull(newAccount.getSubFundGroup())) {
if (getSubFundGroupService().isForContractsAndGrants(newAccount.getSubFundGroup())) {
result &= checkIcrTypeCodeAndSeriesIdentifierExistWhenSubFundIsCG(newAccount);
result &= checkContractControlAccountNumberRequired(newAccount);
result &= checkICRCollectionExistsWhenUpdatingToCGSubFund(newAccount, newAccount.getSubFundGroupCode());
} else {
result &= checkCGFieldNotFilledIn(newAccount, KFSPropertyConstants.FINANCIAL_ICR_SERIES_IDENTIFIER, newAccount.getSubFundGroupCode());
result &= checkCGFieldNotFilledIn(newAccount, KFSPropertyConstants.ACCT_INDIRECT_COST_RCVY_TYPE_CD, newAccount.getSubFundGroupCode());
result &= checkICRCollectionDoesNotExistWhenUpdatingToNonCGSubFund(newAccount, newAccount.getSubFundGroupCode());
}
} else {
if (ObjectUtils.isNotNull(newAccount.getAccountGlobalDetails()) && newAccount.getAccountGlobalDetails().size() > 0) {
boolean hasAtLeastOneAccountWithCGSubFund = false;
for (AccountGlobalDetail accountGlobalDetail : newAccount.getAccountGlobalDetails()) {
accountGlobalDetail.refreshReferenceObject(KFSPropertyConstants.ACCOUNT);
if (ObjectUtils.isNotNull(accountGlobalDetail.getAccount().getSubFundGroup())) {
if (!getSubFundGroupService().isForContractsAndGrants(accountGlobalDetail.getAccount().getSubFundGroup())) {
result &= checkCGFieldNotFilledIn(newAccount, KFSPropertyConstants.FINANCIAL_ICR_SERIES_IDENTIFIER, accountGlobalDetail.getAccount().getSubFundGroupCode());
result &= checkCGFieldNotFilledIn(newAccount, KFSPropertyConstants.ACCT_INDIRECT_COST_RCVY_TYPE_CD, accountGlobalDetail.getAccount().getSubFundGroupCode());
result &= checkCGFieldNotFilledIn(newAccount, accountGlobalDetail.getAccount(), KFSPropertyConstants.ACCT_INDIRECT_COST_RCVY_TYPE_CD);
result &= checkCGFieldNotFilledIn(newAccount, accountGlobalDetail.getAccount(), KFSPropertyConstants.FINANCIAL_ICR_SERIES_IDENTIFIER);
result &= checkICRCollectionDoesNotExistForExistingNonCGSubFund(newAccount, accountGlobalDetail, accountGlobalDetail.getAccount().getSubFundGroupCode());
} else {
result &= checkICRCollectionExistsForExistingCGSubFund(newAccount, accountGlobalDetail, accountGlobalDetail.getAccount().getSubFundGroupCode());
hasAtLeastOneAccountWithCGSubFund = true;
}
}
}
if (hasAtLeastOneAccountWithCGSubFund && icrTypeCodeOrSeriesIdentifierAreSet(newAccount)) {
result &= checkIcrTypeCodeAndSeriesIdentifierExistWhenSubFundIsCG(newAccount);
}
}
}
return result;
}
Aggregations