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;
}
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;
}
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;
}
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()));
}
Aggregations