Search in sources :

Example 1 with GlobalBusinessObjectDetailBase

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;
}
Also used : GlobalBusinessObjectDetailBase(org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase)

Example 2 with GlobalBusinessObjectDetailBase

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;
}
Also used : A21IndirectCostRecoveryAccount(org.kuali.kfs.coa.businessobject.A21IndirectCostRecoveryAccount) HashMap(java.util.HashMap) A21IndirectCostRecoveryAccount(org.kuali.kfs.coa.businessobject.A21IndirectCostRecoveryAccount) IndirectCostRecoveryAccount(org.kuali.kfs.coa.businessobject.IndirectCostRecoveryAccount) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) GlobalBusinessObjectDetailBase(org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase)

Example 3 with GlobalBusinessObjectDetailBase

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;
}
Also used : HashMap(java.util.HashMap) IndirectCostRecoveryAccount(org.kuali.kfs.coa.businessobject.IndirectCostRecoveryAccount) ArrayList(java.util.ArrayList) List(java.util.List) GlobalBusinessObjectDetailBase(org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase) AccountGlobalDetail(org.kuali.kfs.coa.businessobject.AccountGlobalDetail)

Aggregations

GlobalBusinessObjectDetailBase (org.kuali.kfs.krad.bo.GlobalBusinessObjectDetailBase)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 IndirectCostRecoveryAccount (org.kuali.kfs.coa.businessobject.IndirectCostRecoveryAccount)2 A21IndirectCostRecoveryAccount (org.kuali.kfs.coa.businessobject.A21IndirectCostRecoveryAccount)1 AccountGlobalDetail (org.kuali.kfs.coa.businessobject.AccountGlobalDetail)1