use of org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase in project cu-kfs by CU-CommunityApps.
the class GlobalIndirectCostRecoveryAccountsRule method checkICRAccountsTotalDistributionIs100PercentOnAllDetails.
protected boolean checkICRAccountsTotalDistributionIs100PercentOnAllDetails(GlobalObjectWithIndirectCostRecoveryAccounts globalObjectWithIndirectCostRecoveryAccounts) {
boolean result = true;
if (!globalObjectWithIndirectCostRecoveryAccounts.hasIcrAccounts()) {
return true;
} else {
for (GlobalBusinessObjectDetailBase globalDetail : globalObjectWithIndirectCostRecoveryAccounts.getGlobalObjectDetailsAndIcrAccountsMap().keySet()) {
if (!checkICRAccountTotalDistributionOnDetailWillBe100PercentAfterUpdate(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts(), globalObjectWithIndirectCostRecoveryAccounts.getGlobalObjectDetailsAndIcrAccountsMap().get(globalDetail), globalDetail, globalObjectWithIndirectCostRecoveryAccounts)) {
putFieldError(globalObjectWithIndirectCostRecoveryAccounts.getGlobalDetailsPropertyName(), CUKFSKeyConstants.ERROR_DOCUMENT_GLB_MAINT_ICR_ACCOUNT_TOTAL_NOT_100_PERCENT, new String[] { buildMessageFromPrimaryKey(globalDetail) });
result = false;
}
}
}
return result;
}
use of org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase in project cu-kfs by CU-CommunityApps.
the class SubAccountGlobal method getGlobalObjectDetailsAndIcrAccountsMap.
@Override
public Map<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>> getGlobalObjectDetailsAndIcrAccountsMap() {
Map<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>> globalObjectDetailsAndIcrAccountsMap = new HashMap<GlobalBusinessObjectDetailBase, List<IndirectCostRecoveryAccount>>();
List<SubAccountGlobalDetail> subAccountGlobalDetails = getSubAccountGlobalDetails();
if (ObjectUtils.isNotNull(subAccountGlobalDetails) && !subAccountGlobalDetails.isEmpty()) {
for (GlobalBusinessObjectDetailBase globalDetail : subAccountGlobalDetails) {
List<IndirectCostRecoveryAccount> existingIcrAccounts = new ArrayList<IndirectCostRecoveryAccount>();
SubAccountGlobalDetail subAccountGlobalDetail = (SubAccountGlobalDetail) globalDetail;
subAccountGlobalDetail.refreshReferenceObject(KFSPropertyConstants.SUB_ACCOUNT);
List<A21IndirectCostRecoveryAccount> a21IcrAccounts = subAccountGlobalDetail.getSubAccount().getA21SubAccount().getA21IndirectCostRecoveryAccounts();
for (A21IndirectCostRecoveryAccount a21ICRAccount : a21IcrAccounts) {
IndirectCostRecoveryAccount icrAcct = new IndirectCostRecoveryAccount();
icrAcct.setChartOfAccountsCode(a21ICRAccount.getChartOfAccountsCode());
icrAcct.setAccountNumber(a21ICRAccount.getAccountNumber());
icrAcct.setIndirectCostRecoveryAccountNumber(a21ICRAccount.getIndirectCostRecoveryAccountNumber());
icrAcct.setIndirectCostRecoveryFinCoaCode(a21ICRAccount.getIndirectCostRecoveryFinCoaCode());
icrAcct.setAccountLinePercent(a21ICRAccount.getAccountLinePercent());
icrAcct.setActive(a21ICRAccount.isActive());
existingIcrAccounts.add(icrAcct);
}
globalObjectDetailsAndIcrAccountsMap.put(globalDetail, existingIcrAccounts);
}
}
return globalObjectDetailsAndIcrAccountsMap;
}
use of org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase 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;
}
Aggregations