Search in sources :

Example 1 with AwardAccountExtendedAttribute

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;
}
Also used : Account(org.kuali.kfs.coa.businessobject.Account) InvoiceAccountDetail(org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail) AwardAccountExtendedAttribute(edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute)

Example 2 with AwardAccountExtendedAttribute

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;
}
Also used : Account(org.kuali.kfs.coa.businessobject.Account) InvoiceAccountDetail(org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail) AwardAccountExtendedAttribute(edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute)

Example 3 with AwardAccountExtendedAttribute

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());
        }
    }
}
Also used : AwardAccount(org.kuali.kfs.module.cg.businessobject.AwardAccount) AwardAccountExtendedAttribute(edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute)

Example 4 with AwardAccountExtendedAttribute

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;
}
Also used : HashMap(java.util.HashMap) AwardAccountExtendedAttribute(edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute)

Aggregations

AwardAccountExtendedAttribute (edu.cornell.kfs.module.cg.businessobject.AwardAccountExtendedAttribute)4 Account (org.kuali.kfs.coa.businessobject.Account)2 InvoiceAccountDetail (org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail)2 HashMap (java.util.HashMap)1 AwardAccount (org.kuali.kfs.module.cg.businessobject.AwardAccount)1