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