Search in sources :

Example 1 with GlobalObjectWithIndirectCostRecoveryAccounts

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

the class GlobalIndirectCostRecoveryAccountsRule method processCustomApproveDocumentBusinessRules.

/**
 * @see org.kuali.kfs.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomApproveDocumentBusinessRules(org.kuali.kfs.kns.document.MaintenanceDocument)
 */
@Override
protected boolean processCustomApproveDocumentBusinessRules(MaintenanceDocument document) {
    boolean success = super.processCustomApproveDocumentBusinessRules(document);
    GlobalObjectWithIndirectCostRecoveryAccounts globalObjectWithIndirectCostRecoveryAccounts = (GlobalObjectWithIndirectCostRecoveryAccounts) getNewBo();
    if (ObjectUtils.isNotNull(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts()) && globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts().size() > 0) {
        success &= validateIndirectCostRecoveryAccounts(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts());
        if (success) {
            success &= checkICRAccountsTotalDistributionIs100PercentOnAllDetails(globalObjectWithIndirectCostRecoveryAccounts);
        }
    }
    return success;
}
Also used : GlobalObjectWithIndirectCostRecoveryAccounts(edu.cornell.kfs.coa.businessobject.GlobalObjectWithIndirectCostRecoveryAccounts)

Example 2 with GlobalObjectWithIndirectCostRecoveryAccounts

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

the class GlobalIndirectCostRecoveryAccountsRule method processCustomSaveDocumentBusinessRules.

/**
 * @see org.kuali.kfs.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomSaveDocumentBusinessRules(org.kuali.kfs.kns.document.MaintenanceDocument)
 */
@Override
protected boolean processCustomSaveDocumentBusinessRules(MaintenanceDocument document) {
    boolean success = super.processCustomSaveDocumentBusinessRules(document);
    GlobalObjectWithIndirectCostRecoveryAccounts globalObjectWithIndirectCostRecoveryAccounts = (GlobalObjectWithIndirectCostRecoveryAccounts) getNewBo();
    if (ObjectUtils.isNotNull(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts()) && globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts().size() > 0) {
        validateIndirectCostRecoveryAccounts(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts());
    }
    return success;
}
Also used : GlobalObjectWithIndirectCostRecoveryAccounts(edu.cornell.kfs.coa.businessobject.GlobalObjectWithIndirectCostRecoveryAccounts)

Example 3 with GlobalObjectWithIndirectCostRecoveryAccounts

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

the class GlobalIndirectCostRecoveryAccountsRule method processCustomRouteDocumentBusinessRules.

/**
 * @see org.kuali.kfs.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomRouteDocumentBusinessRules(org.kuali.kfs.kns.document.MaintenanceDocument)
 */
@Override
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
    boolean success = super.processCustomRouteDocumentBusinessRules(document);
    GlobalObjectWithIndirectCostRecoveryAccounts globalObjectWithIndirectCostRecoveryAccounts = (GlobalObjectWithIndirectCostRecoveryAccounts) getNewBo();
    if (ObjectUtils.isNotNull(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts()) && globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts().size() > 0) {
        success &= validateIndirectCostRecoveryAccounts(globalObjectWithIndirectCostRecoveryAccounts.getIndirectCostRecoveryAccounts());
        if (success) {
            success &= checkICRAccountsTotalDistributionIs100PercentOnAllDetails(globalObjectWithIndirectCostRecoveryAccounts);
        }
    }
    return success;
}
Also used : GlobalObjectWithIndirectCostRecoveryAccounts(edu.cornell.kfs.coa.businessobject.GlobalObjectWithIndirectCostRecoveryAccounts)

Example 4 with GlobalObjectWithIndirectCostRecoveryAccounts

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

the class GlobalObjectWithIndirectCostRecoveryAccountsServiceImplTest method testAccountGlobalUpdateIcrAccounts_ReplaceExisting.

@Test
public void testAccountGlobalUpdateIcrAccounts_ReplaceExisting() {
    GlobalObjectWithIndirectCostRecoveryAccounts accountGlobal = (CuAccountGlobal) AccountGlobalFixture.ACCT_GLOBAL_3333333_100_ACTIVE_1111111_2222222_98_2_INACTIVE.getAccountGlobal();
    AccountGlobalDetail accountGlobalDetail = AccountGlobalDetailFixture.ACCOUNT_GLOBAL_DETAIL_1111111_2222222_98_2.getAccountGlobalDetail();
    assertEquals("The Account Global Detail ICR accounts list should have 2 ICR accounts before update", 2, accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts().size());
    globalObjectWithIndirectCostRecoveryAccountsService.updateIcrAccounts(accountGlobal, accountGlobalDetail, accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts());
    assertEquals("The Account Global Detail ICR accounts list should have 3 ICR accounts after update", 3, accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts().size());
    assertTrue("Updated ICR accounts list should have contained ICR account 1111111 with 98% inactive", doesListContainIcr(accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts(), IndirectCostRecoveryAccountFixture.ICR_1111111_98_PERCENT_INACTIVE.getIndirectCostRecoveryAccountChange()));
    assertTrue("Updated ICR accounts list should have contained ICR account 2222222 with 2% inactive", doesListContainIcr(accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts(), IndirectCostRecoveryAccountFixture.ICR_2222222_2_PERCENT_INACTIVE.getIndirectCostRecoveryAccountChange()));
    assertTrue("Updated ICR accounts list should have contained ICR account 3333333 with 100% inactive", doesListContainIcr(accountGlobalDetail.getAccount().getIndirectCostRecoveryAccounts(), IndirectCostRecoveryAccountFixture.ICR_3333333_100_PERCENT_ACTIVE.getIndirectCostRecoveryAccountChange()));
}
Also used : GlobalObjectWithIndirectCostRecoveryAccounts(edu.cornell.kfs.coa.businessobject.GlobalObjectWithIndirectCostRecoveryAccounts) AccountGlobalDetail(org.kuali.kfs.coa.businessobject.AccountGlobalDetail) CuAccountGlobal(edu.cornell.kfs.coa.businessobject.CuAccountGlobal) Test(org.junit.Test)

Aggregations

GlobalObjectWithIndirectCostRecoveryAccounts (edu.cornell.kfs.coa.businessobject.GlobalObjectWithIndirectCostRecoveryAccounts)4 CuAccountGlobal (edu.cornell.kfs.coa.businessobject.CuAccountGlobal)1 Test (org.junit.Test)1 AccountGlobalDetail (org.kuali.kfs.coa.businessobject.AccountGlobalDetail)1