Search in sources :

Example 26 with BusinessObjectService

use of org.kuali.kfs.krad.service.BusinessObjectService in project cu-kfs by CU-CommunityApps.

the class AccountExtendedAttribute method setAppropriationAccountNumber.

/**
 * @param appropriationAccountNumber the appropriationAccountNumber to set
 */
public void setAppropriationAccountNumber(String appropriationAccountNumber) {
    this.appropriationAccountNumber = appropriationAccountNumber;
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    HashMap<String, String> keys = new HashMap<String, String>();
    keys.put("appropriationAccountNumber", appropriationAccountNumber);
    keys.put("subFundGroupCode", subFundGroupCode);
    appropriationAccount = (AppropriationAccount) bos.findByPrimaryKey(AppropriationAccount.class, keys);
// appropriationAccount.setAppropriationAccountNumber(appropriationAccountNumber);
}
Also used : HashMap(java.util.HashMap) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Example 27 with BusinessObjectService

use of org.kuali.kfs.krad.service.BusinessObjectService in project cu-kfs by CU-CommunityApps.

the class CUObjectCodeGlobal method setCgReportingCode.

/**
 * @param cgReportingCode the cgReportingCode to set
 */
public void setCgReportingCode(String cgReportingCode) {
    this.cgReportingCode = cgReportingCode;
    this.code = cgReportingCode;
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    HashMap<String, String> keys = new HashMap<String, String>();
    keys.put("chartOfAccountsCode", this.chartOfAccountsCode);
    // lookup table has class attribute defined as "code"
    keys.put("code", this.cgReportingCode);
    contractGrantReportingCode = (ContractGrantReportingCode) bos.findByPrimaryKey(ContractGrantReportingCode.class, keys);
}
Also used : HashMap(java.util.HashMap) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Example 28 with BusinessObjectService

use of org.kuali.kfs.krad.service.BusinessObjectService in project cu-kfs by CU-CommunityApps.

the class ObjectCodeExtendedAttribute method setCgReportingCode.

/**
 * @param cgReportingCode the cgReportingCode to set
 */
public void setCgReportingCode(String cgReportingCode) {
    this.cgReportingCode = cgReportingCode;
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    HashMap<String, String> keys = new HashMap<String, String>();
    keys.put("chartOfAccountsCode", this.chartOfAccountsCode);
    // lookup table has class attribute defined as "code"
    keys.put("code", this.cgReportingCode);
    contractGrantReportingCode = (ContractGrantReportingCode) bos.findByPrimaryKey(ContractGrantReportingCode.class, keys);
}
Also used : LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Example 29 with BusinessObjectService

use of org.kuali.kfs.krad.service.BusinessObjectService in project cu-kfs by CU-CommunityApps.

the class AccountGlobalRule method checkAppropriationAccount.

protected boolean checkAppropriationAccount(MaintenanceDocument document) {
    boolean success = true;
    String subFundGroupCode = newAccountGlobal.getSubFundGroupCode();
    String appropriationAccountNumber = newAccountGlobal.getAppropriationAccountNumber();
    BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
    if (StringUtils.isNotBlank(appropriationAccountNumber) && StringUtils.isNotBlank(subFundGroupCode)) {
        Map<String, String> fieldValues = new HashMap<String, String>();
        fieldValues.put(KFSPropertyConstants.SUB_FUND_GROUP_CODE, subFundGroupCode);
        fieldValues.put(CUKFSPropertyConstants.APPROPRIATION_ACCT_NUMBER, appropriationAccountNumber);
        Collection<AppropriationAccount> retVals = businessObjectService.findMatching(AppropriationAccount.class, fieldValues);
        if (retVals.isEmpty()) {
            success = false;
            putFieldError(CUKFSPropertyConstants.APPROPRIATION_ACCT_NUMBER, CUKFSKeyConstants.ERROR_DOCUMENT_ACCMAINT_APPROP_ACCT_NOT_GROUP_CODE, new String[] { appropriationAccountNumber, subFundGroupCode });
        } else {
            for (AppropriationAccount appropriationAccount : retVals) {
                if (!appropriationAccount.isActive()) {
                    putFieldError(CUKFSPropertyConstants.APPROPRIATION_ACCT_NUMBER, KFSKeyConstants.ERROR_INACTIVE, getFieldLabel(AccountGlobal.class, CUKFSPropertyConstants.APPROPRIATION_ACCT_NUMBER));
                    success = false;
                    break;
                }
            }
        }
    }
    return success;
}
Also used : AppropriationAccount(edu.cornell.kfs.coa.businessobject.AppropriationAccount) HashMap(java.util.HashMap) CuAccountGlobal(edu.cornell.kfs.coa.businessobject.CuAccountGlobal) AccountGlobal(org.kuali.kfs.coa.businessobject.AccountGlobal) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Example 30 with BusinessObjectService

use of org.kuali.kfs.krad.service.BusinessObjectService in project cu-kfs by CU-CommunityApps.

the class CuVendorAddressExtension method setPurchaseOrderTransmissionMethodCode.

/**
 * @param purchaseOrderTransmissionMethodCode the purchaseOrderTransmissionMethodCode to set
 */
public void setPurchaseOrderTransmissionMethodCode(String purchaseOrderTransmissionMethodCode) {
    this.purchaseOrderTransmissionMethodCode = purchaseOrderTransmissionMethodCode;
    BusinessObjectService bos = SpringContext.getBean(BusinessObjectService.class);
    HashMap<String, String> keys = new HashMap<String, String>();
    keys.put("purchaseOrderTransmissionMethodCode", purchaseOrderTransmissionMethodCode);
    purchaseOrderTransmissionMethod = (PurchaseOrderTransmissionMethod) bos.findByPrimaryKey(PurchaseOrderTransmissionMethod.class, keys);
}
Also used : HashMap(java.util.HashMap) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService)

Aggregations

BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)34 HashMap (java.util.HashMap)26 Map (java.util.Map)7 Account (org.kuali.kfs.coa.businessobject.Account)7 AppropriationAccount (edu.cornell.kfs.coa.businessobject.AppropriationAccount)6 ArrayList (java.util.ArrayList)6 List (java.util.List)5 AccountExtendedAttribute (edu.cornell.kfs.coa.businessobject.AccountExtendedAttribute)4 LinkedHashMap (java.util.LinkedHashMap)4 SubFundProgram (edu.cornell.kfs.coa.businessobject.SubFundProgram)3 ContractGrantReportingCode (edu.cornell.kfs.coa.businessobject.ContractGrantReportingCode)2 IndirectCostRecoveryAccount (org.kuali.kfs.coa.businessobject.IndirectCostRecoveryAccount)2 CheckReconciliation (com.rsmart.kuali.kfs.cr.businessobject.CheckReconciliation)1 CUObjectCodeGlobal (edu.cornell.kfs.coa.businessobject.CUObjectCodeGlobal)1 CuAccountGlobal (edu.cornell.kfs.coa.businessobject.CuAccountGlobal)1 MajorReportingCategory (edu.cornell.kfs.coa.businessobject.MajorReportingCategory)1 ObjectCodeExtendedAttribute (edu.cornell.kfs.coa.businessobject.ObjectCodeExtendedAttribute)1 AccountReversionImportService (edu.cornell.kfs.coa.service.AccountReversionImportService)1 AccountReversionTrickleDownInactivationService (edu.cornell.kfs.coa.service.AccountReversionTrickleDownInactivationService)1 EzraProposalAward (edu.cornell.kfs.module.ezra.businessobject.EzraProposalAward)1