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