use of edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute in project cu-kfs by CU-CommunityApps.
the class CuContractsGrantsInvoiceDocumentServiceImpl method findPurchaseOrderNumberForInvoiceOptionAccount.
protected String findPurchaseOrderNumberForInvoiceOptionAccount(ContractsGrantsInvoiceDocument document) {
String purchaseOrderNumber = StringUtils.EMPTY;
List<InvoiceAccountDetail> invoiceAccountDetails = document.getAccountDetails();
if (CollectionUtils.isNotEmpty(invoiceAccountDetails)) {
Account invoiceAccount = invoiceAccountDetails.get(0).getAccount();
AwardAccountExtendedAttribute awardAccountExtension = findAwardAccountExtendedAttribute(invoiceAccountDetails.get(0).getProposalNumber(), invoiceAccount.getChartOfAccountsCode(), invoiceAccount.getAccountNumber());
if (ObjectUtils.isNotNull(awardAccountExtension)) {
purchaseOrderNumber = awardAccountExtension.getAccountPurchaseOrderNumber();
}
}
return purchaseOrderNumber;
}
use of edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute in project cu-kfs by CU-CommunityApps.
the class CuContractsGrantsInvoiceDocumentServiceImpl method findPurchaseOrderNumberForInvoiceOptionContractControlAndScheduled.
protected String findPurchaseOrderNumberForInvoiceOptionContractControlAndScheduled(ContractsGrantsInvoiceDocument document) {
String purchaseOrderNumber = StringUtils.EMPTY;
List<InvoiceAccountDetail> invoiceAccountDetails = document.getAccountDetails();
if (CollectionUtils.isNotEmpty(invoiceAccountDetails)) {
Account contractControlAccount = determineContractControlAccount(invoiceAccountDetails.get(0));
if (ObjectUtils.isNotNull(contractControlAccount)) {
AwardAccountExtendedAttribute awardAccountExtension = findAwardAccountExtendedAttribute(invoiceAccountDetails.get(0).getProposalNumber(), contractControlAccount.getChartOfAccountsCode(), contractControlAccount.getAccountNumber());
if (ObjectUtils.isNotNull(awardAccountExtension)) {
purchaseOrderNumber = awardAccountExtension.getAccountPurchaseOrderNumber();
}
}
}
return purchaseOrderNumber;
}
use of edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute in project cu-kfs by CU-CommunityApps.
the class CuAwardMaintainableImpl method prepareForSave.
@Override
public void prepareForSave() {
super.prepareForSave();
if (CollectionUtils.isNotEmpty(getAward().getAwardAccounts())) {
for (AwardAccount awardAccount : getAward().getAwardAccounts()) {
AwardAccountExtendedAttribute extension;
if (ObjectUtils.isNotNull(awardAccount.getExtension())) {
extension = (AwardAccountExtendedAttribute) awardAccount.getExtension();
} else {
extension = new AwardAccountExtendedAttribute();
awardAccount.setExtension(extension);
}
extension.setAccountNumber(awardAccount.getAccountNumber());
extension.setChartOfAccountsCode(awardAccount.getChartOfAccountsCode());
extension.setProposalNumber(getAward().getProposalNumber());
}
}
}
use of edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute in project cu-kfs by CU-CommunityApps.
the class CuContractsGrantsInvoiceDocumentServiceImpl method findAwardAccountExtendedAttribute.
protected AwardAccountExtendedAttribute findAwardAccountExtendedAttribute(String proposalNumber, String chartOfAccountsCode, String accountNumber) {
Map<String, Object> primaryKeys = new HashMap<String, Object>();
primaryKeys.put(KFSPropertyConstants.PROPOSAL_NUMBER, proposalNumber);
primaryKeys.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, chartOfAccountsCode);
primaryKeys.put(KFSPropertyConstants.ACCOUNT_NUMBER, accountNumber);
AwardAccountExtendedAttribute awardAccountExtension = businessObjectService.findByPrimaryKey(AwardAccountExtendedAttribute.class, primaryKeys);
return awardAccountExtension;
}
Aggregations