Search in sources :

Example 1 with LaborBenefitRateCategory

use of org.kuali.kfs.module.ld.businessobject.LaborBenefitRateCategory in project cu-kfs by CU-CommunityApps.

the class AccountExtensionRule method checkLaborBenefitCategoryCode.

// TODO This should no longer be required as laborBenefitCategoryCode is now in the base table and add to
// the list of fields the have existence checks.
@SuppressWarnings("deprecation")
protected boolean checkLaborBenefitCategoryCode(MaintenanceDocument document) {
    boolean success = true;
    String laborBenefitCategoryCode = newAccount.getLaborBenefitRateCategoryCode();
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    // no validation is performed.
    if (!StringUtils.isBlank(laborBenefitCategoryCode)) {
        Map<String, Object> fieldValues = new HashMap<String, Object>();
        fieldValues.put("laborBenefitRateCategoryCode", laborBenefitCategoryCode);
        Collection<LaborBenefitRateCategory> retVals = bos.findMatching(LaborBenefitRateCategory.class, fieldValues);
        if (retVals.isEmpty()) {
            success = false;
            putFieldError("laborBenefitRateCategoryCode", KFSKeyConstants.ERROR_EXISTENCE, " Labor Benefit Rate Category Code " + laborBenefitCategoryCode);
        }
    }
    return success;
}
Also used : HashMap(java.util.HashMap) LaborBenefitRateCategory(org.kuali.kfs.module.ld.businessobject.LaborBenefitRateCategory) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Aggregations

HashMap (java.util.HashMap)1 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)1 LaborBenefitRateCategory (org.kuali.kfs.module.ld.businessobject.LaborBenefitRateCategory)1