Search in sources :

Example 1 with ContractsGrantsInvoiceDocument

use of org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument in project cu-kfs by CU-CommunityApps.

the class CuContractsGrantsInvoiceDocumentAction method validateBillingPeriod.

protected ActionForward validateBillingPeriod(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument = ((ContractsGrantsInvoiceDocumentForm) form).getContractsGrantsInvoiceDocument();
    ActionForward forward = null;
    String warningMessage = getContractsGrantsInvoiceDocumentWarningMessage(contractsGrantsInvoiceDocument);
    if (StringUtils.isNotEmpty(warningMessage)) {
        forward = promptForFinalBillConfirmation(mapping, form, request, response, KFSConstants.ROUTE_METHOD, warningMessage, contractsGrantsInvoiceDocument);
    }
    return forward;
}
Also used : ContractsGrantsInvoiceDocumentForm(org.kuali.kfs.module.ar.document.web.struts.ContractsGrantsInvoiceDocumentForm) ContractsGrantsInvoiceDocument(org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument) ActionForward(org.apache.struts.action.ActionForward)

Example 2 with ContractsGrantsInvoiceDocument

use of org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument in project cu-kfs by CU-CommunityApps.

the class CuContractsGrantsInvoiceCreateDocumentServiceImpl method createCGInvoiceDocumentByAwardInfo.

/*
     * CUMod: KFSPTS-23675
     * Add creationProcessType method argument.
     */
@Override
public ContractsGrantsInvoiceDocument createCGInvoiceDocumentByAwardInfo(ContractsAndGrantsBillingAward awd, List<ContractsAndGrantsBillingAwardAccount> accounts, String chartOfAccountsCode, String organizationCode, List<ErrorMessage> errorMessages, List<ContractsGrantsLetterOfCreditReviewDetail> accountDetails, String locCreationType, ContractsAndGrantsInvoiceDocumentCreationProcessType creationProcessType) {
    ContractsGrantsInvoiceDocument cgInvoiceDocument = super.createCGInvoiceDocumentByAwardInfo(awd, accounts, chartOfAccountsCode, organizationCode, errorMessages, accountDetails, locCreationType, creationProcessType);
    // CUMod: KFSPTS-12866
    populateDocumentDescription(cgInvoiceDocument);
    return cgInvoiceDocument;
}
Also used : ContractsGrantsInvoiceDocument(org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)

Example 3 with ContractsGrantsInvoiceDocument

use of org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceDocumentServiceImpl method getAwardBilledToDateAmountExcludingDocument.

@Override
public KualiDecimal getAwardBilledToDateAmountExcludingDocument(String proposalNumber, String documentNumber) {
    Map<String, String> fieldValues = new HashMap<>();
    fieldValues.put(ArPropertyConstants.ContractsGrantsInvoiceDocumentFields.PROPOSAL_NUMBER, proposalNumber);
    fieldValues.put(KFSPropertyConstants.DOCUMENT_HEADER + "." + KFSPropertyConstants.WORKFLOW_DOCUMENT_STATUS_CODE, StringUtils.join(financialSystemDocumentService.getSuccessfulDocumentStatuses(), "|"));
    fieldValues.put(KFSPropertyConstants.DOCUMENT_NUMBER, SearchOperator.NOT + documentNumber);
    Collection<ContractsGrantsInvoiceDocument> invoiceDocuments = retrieveAllCGInvoicesByCriteria(fieldValues);
    final KualiDecimal milestoneTotal = getMilestonesBilledToDateAmount(proposalNumber);
    final KualiDecimal billTotal = getPredeterminedBillingBilledToDateAmount(proposalNumber);
    final KualiDecimal nonScheduledTotal = calculateTotalInvoiceAmount(invoiceDocuments);
    return milestoneTotal.add(billTotal).add(nonScheduledTotal);
}
Also used : HashMap(java.util.HashMap) AbstractKualiDecimal(org.kuali.kfs.core.api.util.type.AbstractKualiDecimal) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) ContractsGrantsInvoiceDocument(org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)

Example 4 with ContractsGrantsInvoiceDocument

use of org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceDocumentServiceImpl method getInvoicesByAward.

@Override
public Map<String, List<ContractsGrantsInvoiceDocument>> getInvoicesByAward(Collection<ContractsGrantsInvoiceDocument> invoices) {
    Map<String, List<ContractsGrantsInvoiceDocument>> invoicesByAward = new HashMap<>();
    for (ContractsGrantsInvoiceDocument invoice : invoices) {
        String proposalNumber = invoice.getInvoiceGeneralDetail().getProposalNumber();
        if (invoicesByAward.containsKey(proposalNumber)) {
            invoicesByAward.get(proposalNumber).add(invoice);
        } else {
            List<ContractsGrantsInvoiceDocument> invoicesByProposalNumber = new ArrayList<>();
            invoicesByProposalNumber.add(invoice);
            invoicesByAward.put(proposalNumber, invoicesByProposalNumber);
        }
    }
    return invoicesByAward;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ContractsGrantsInvoiceDocument(org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)

Example 5 with ContractsGrantsInvoiceDocument

use of org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument in project cu-kfs by CU-CommunityApps.

the class ContractsGrantsInvoiceDocumentServiceImpl method calculateTotalPaymentsToDateByAward.

@Override
public KualiDecimal calculateTotalPaymentsToDateByAward(ContractsAndGrantsBillingAward award) {
    KualiDecimal totalPayments = KualiDecimal.ZERO;
    Map<String, Object> criteria = new HashMap<>();
    criteria.put(ArPropertyConstants.ContractsGrantsInvoiceDocumentFields.PROPOSAL_NUMBER, award.getProposalNumber());
    Collection<ContractsGrantsInvoiceDocument> cgInvoiceDocs = businessObjectService.findMatching(ContractsGrantsInvoiceDocument.class, criteria);
    for (ContractsGrantsInvoiceDocument cgInvoiceDoc : cgInvoiceDocs) {
        totalPayments = totalPayments.add(getCustomerInvoiceDocumentService().calculateAppliedPaymentAmount(cgInvoiceDoc));
    }
    return totalPayments;
}
Also used : HashMap(java.util.HashMap) AbstractKualiDecimal(org.kuali.kfs.core.api.util.type.AbstractKualiDecimal) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal) ContractsGrantsInvoiceDocument(org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)

Aggregations

ContractsGrantsInvoiceDocument (org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)18 HashMap (java.util.HashMap)8 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)7 AwardExtendedAttribute (edu.cornell.kfs.module.cg.businessobject.AwardExtendedAttribute)5 Award (org.kuali.kfs.module.cg.businessobject.Award)5 AbstractKualiDecimal (org.kuali.kfs.core.api.util.type.AbstractKualiDecimal)4 WorkflowException (org.kuali.kfs.kew.api.exception.WorkflowException)4 DocumentBase (org.kuali.kfs.krad.document.DocumentBase)3 InvoiceAccountDetail (org.kuali.kfs.module.ar.businessobject.InvoiceAccountDetail)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ContractsAndGrantsBillingAward (org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward)2 ErrorMessage (org.kuali.kfs.krad.util.ErrorMessage)2 AccountsReceivableDocumentHeader (org.kuali.kfs.module.ar.businessobject.AccountsReceivableDocumentHeader)2 ContractsGrantsInvoiceDetail (org.kuali.kfs.module.ar.businessobject.ContractsGrantsInvoiceDetail)2 InvoiceGeneralDetail (org.kuali.kfs.module.ar.businessobject.InvoiceGeneralDetail)2 CuArParameterKeyConstants (edu.cornell.kfs.module.ar.CuArParameterKeyConstants)1 CuArPropertyConstants (edu.cornell.kfs.module.ar.CuArPropertyConstants)1 CustomerExtendedAttribute (edu.cornell.kfs.module.ar.businessobject.CustomerExtendedAttribute)1 CuContractsGrantsInvoiceDocumentService (edu.cornell.kfs.module.ar.document.service.CuContractsGrantsInvoiceDocumentService)1