use of edu.cornell.kfs.coa.businessobject.SubAccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class SubAccountGlobalRule method processCustomAddCollectionLineBusinessRules.
/**
* @see org.kuali.kfs.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomAddCollectionLineBusinessRules(org.kuali.kfs.kns.document.MaintenanceDocument, java.lang.String, org.kuali.kfs.krad.bo.PersistableBusinessObject)
*/
@Override
public boolean processCustomAddCollectionLineBusinessRules(MaintenanceDocument document, String collectionName, PersistableBusinessObject line) {
boolean success = true;
success &= super.processCustomAddCollectionLineBusinessRules(document, collectionName, line);
if (line instanceof SubAccountGlobalDetail) {
SubAccountGlobalDetail detail = (SubAccountGlobalDetail) line;
success &= checkSubAccountDetail(detail);
}
return success;
}
use of edu.cornell.kfs.coa.businessobject.SubAccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class SubAccountGlobalRule method checkSubAccountDetails.
/**
* Checks that at least one sub account is entered.
*
* @return true if at least one sub account entered, false otherwise
*/
public boolean checkSubAccountDetails() {
boolean success = true;
SubAccountGlobal newSubAccountGlobal = (SubAccountGlobal) super.getNewBo();
List<SubAccountGlobalDetail> details = newSubAccountGlobal.getSubAccountGlobalDetails();
// check if there are any accounts
if (details.size() == 0) {
putFieldError(KFSConstants.MAINTENANCE_ADD_PREFIX + CUKFSPropertyConstants.SUB_ACCOUNT_GLBL_CHANGE_DETAILS + "." + KFSPropertyConstants.ACCOUNT_NUMBER, CUKFSKeyConstants.ERROR_DOCUMENT_GLOBAL_SUS_ACCOUNT_NO_SUB_ACCOUNTS);
success = false;
}
return success;
}
use of edu.cornell.kfs.coa.businessobject.SubAccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class SubAccountGlobalRule method checkCgRules.
/**
* Checks CG rules.
*
* @param document
* @return true if valid, false otherwise
*/
protected boolean checkCgRules(MaintenanceDocument document) {
boolean success = true;
SubAccountGlobal newSubAccountGlobal = (SubAccountGlobal) super.getNewBo();
List<SubAccountGlobalDetail> subAccountGlobalDetails = newSubAccountGlobal.getSubAccountGlobalDetails();
for (SubAccountGlobalDetail subAccountGlobalDetail : subAccountGlobalDetails) {
success &= checkCgRules(newSubAccountGlobal, subAccountGlobalDetail);
}
return success;
}
use of edu.cornell.kfs.coa.businessobject.SubAccountGlobalDetail in project cu-kfs by CU-CommunityApps.
the class GlobalIndirectCostRecoveryAccountsRuleTest method testSubAccountGlobalCheckICRAccountTotalDistributionOnDetailWillBe100PercentAfterUpdate_Fail.
@Test
public void testSubAccountGlobalCheckICRAccountTotalDistributionOnDetailWillBe100PercentAfterUpdate_Fail() {
LOG.debug("enter testSubAccountGlobalCheckICRAccountTotalDistributionOnDetailWillBe100PercentAfterUpdate_Fail");
SubAccountGlobal subAccountGlobal = (SubAccountGlobal) SubAccountGlobalFixture.SUB_ACCT_GLOBAL_1111111_2222222_98_2.getSubAccountGlobal();
SubAccountGlobalDetail subAccountGlobalDetail = SubAccountGlobalDetailFixture.SUB_ACCOUNT_GLOBAL_DETAIL_3333333_100_INACTIVATE.getSubAccountGlobalDetail();
List<IndirectCostRecoveryAccount> existingIcrAccountsOnDetail = new ArrayList<IndirectCostRecoveryAccount>();
existingIcrAccountsOnDetail.addAll(subAccountGlobalDetail.getSubAccount().getA21SubAccount().getA21IndirectCostRecoveryAccounts());
LOG.debug("updates");
List<IndirectCostRecoveryAccountChange> updates = subAccountGlobal.getIndirectCostRecoveryAccounts();
logDetailsForIcrAccountChanges(updates);
LOG.debug("existing");
logDetailsForIcrAccounts(existingIcrAccountsOnDetail);
boolean result = globalIndirectCostRecoveryAccountsRule.checkICRAccountTotalDistributionOnDetailWillBe100PercentAfterUpdate(updates, existingIcrAccountsOnDetail, subAccountGlobalDetail, subAccountGlobal);
assertFalse("Updated Sub Account Global ICR account distribution should NOT have been 100%", result);
}
Aggregations