Search in sources :

Example 1 with ContractAndGrantsProposal

use of org.kuali.kfs.integration.cg.ContractAndGrantsProposal in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceDocumentServiceImpl method buildAwardFieldsMap.

private Map<String, Object> buildAwardFieldsMap(ContractsAndGrantsBillingAward award) {
    Map<String, Object> awardFieldsMap = new HashMap<>();
    KualiDecimal billing = getAwardBilledToDateAmount(award.getProposalNumber());
    KualiDecimal payments = calculateTotalPaymentsToDateByAward(award);
    KualiDecimal receivable = billing.subtract(payments);
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.BILLINGS, billing);
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.PAYMENTS, payments);
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.RECEIVABLES, receivable);
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.PROPOSAL_NUMBER, award.getProposalNumber());
    if (ObjectUtils.isNotNull(award.getAwardBeginningDate())) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_BEGINNING_DATE, award.getAwardBeginningDate());
    }
    if (ObjectUtils.isNotNull(award.getAwardEndingDate())) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_ENDING_DATE, award.getAwardEndingDate());
    }
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_TOTAL_AMOUNT, award.getAwardTotalAmount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_ADDENDUM_NUMBER, award.getAwardAddendumNumber());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_ALLOCATED_UNIVERSITY_COMPUTING_SERVICES_AMOUNT, award.getAwardAllocatedUniversityComputingServicesAmount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.FEDERAL_PASS_THROUGH_FUNDED_AMOUNT, award.getFederalPassThroughFundedAmount());
    if (ObjectUtils.isNotNull(award.getAwardEntryDate())) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_ENTRY_DATE, award.getAwardEntryDate());
    }
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AGENCY_FUTURE_1_AMOUNT, award.getAgencyFuture1Amount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AGENCY_FUTURE_2_AMOUNT, award.getAgencyFuture2Amount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AGENCY_FUTURE_3_AMOUNT, award.getAgencyFuture3Amount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_DOCUMENT_NUMBER, award.getAwardDocumentNumber());
    if (ObjectUtils.isNotNull(award.getAwardLastUpdateDate())) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_LAST_UPDATE_DATE, award.getAwardLastUpdateDate());
    }
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.FEDERAL_PASS_THROUGH_INDICATOR, award.getFederalPassThroughIndicator());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_DIRECT_COST_AMOUNT, award.getAwardDirectCostAmount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_INDIRECT_COST_AMOUNT, award.getAwardIndirectCostAmount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.GRANT_DESCRIPTION_CODE, award.getGrantDescriptionCode());
    final ContractAndGrantsProposal proposal = award.getProposal();
    if (ObjectUtils.isNotNull(proposal)) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.GRANT_NUMBER, proposal.getGrantNumber());
    }
    awardFieldsMap.put(KFSPropertyConstants.AGENCY_NUMBER, award.getAgencyNumber());
    awardFieldsMap.put(KFSPropertyConstants.AGENCY + "." + KFSPropertyConstants.FULL_NAME, award.getAgency().getFullName());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.FEDERAL_PASS_THROUGH_AGENCY_NUMBER, award.getFederalPassThroughAgencyNumber());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AGENCY_ANALYST_NAME, award.getAgencyAnalystName());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.ANALYST_TELEPHONE_NUMBER, award.getAnalystTelephoneNumber());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.BILLING_FREQUENCY_CODE, award.getBillingFrequencyCode());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.AWARD_PROJECT_TITLE, award.getAwardProjectTitle());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AWARD_PURPOSE_CODE, award.getAwardPurposeCode());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + KFSPropertyConstants.ACTIVE, award.isActive());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.EXCLUDED_FROM_INVOICING, award.isExcludedFromInvoicing());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.ADDITIONAL_FORMS_REQUIRED, award.isAdditionalFormsRequiredIndicator());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.ADDITIONAL_FORMS_DESCRIPTION, award.getAdditionalFormsDescription());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.INSTRUMENT_TYPE_CODE, award.getInstrumentTypeCode());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.MIN_INVOICE_AMOUNT, award.getMinInvoiceAmount());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.AUTO_APPROVE, award.getAutoApproveIndicator());
    awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.FUNDING_EXPIRATION_DATE, award.getFundingExpirationDate());
    if (ObjectUtils.isNotNull(award.getAwardPrimaryProjectDirector())) {
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArConstants.AWARD_PROJECT_DIRECTOR + "." + KFSPropertyConstants.NAME, award.getAwardPrimaryProjectDirector().getProjectDirector().getName());
    }
    if (ObjectUtils.isNotNull(award.getAwardPrimaryFundManager())) {
        final Person fundManager = award.getAwardPrimaryFundManager().getFundManager();
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.PRIMARY_FUND_MANAGER + "." + KFSPropertyConstants.NAME, fundManager.getName());
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.PRIMARY_FUND_MANAGER + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.EMAIL, fundManager.getEmailAddress());
        awardFieldsMap.put(KFSPropertyConstants.AWARD + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.PRIMARY_FUND_MANAGER + "." + ArPropertyConstants.ContractsAndGrantsBillingAwardFields.PHONE, fundManager.getPhoneNumber());
    }
    return awardFieldsMap;
}
Also used : ContractAndGrantsProposal(org.kuali.kfs.integration.cg.ContractAndGrantsProposal) HashMap(java.util.HashMap) AbstractKualiDecimal(org.kuali.kfs.core.api.util.type.AbstractKualiDecimal) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) Person(org.kuali.kfs.kim.api.identity.Person)

Aggregations

HashMap (java.util.HashMap)1 AbstractKualiDecimal (org.kuali.kfs.core.api.util.type.AbstractKualiDecimal)1 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)1 ContractAndGrantsProposal (org.kuali.kfs.integration.cg.ContractAndGrantsProposal)1 Person (org.kuali.kfs.kim.api.identity.Person)1