Search in sources :

Example 1 with ContractsGrantsInvoiceDocumentForm

use of org.kuali.kfs.module.ar.document.web.struts.ContractsGrantsInvoiceDocumentForm 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 ContractsGrantsInvoiceDocumentForm

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

the class CuContractsGrantsInvoiceDocumentAction method prorateBill.

@Override
public ActionForward prorateBill(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ContractsGrantsInvoiceDocumentForm contractsGrantsInvoiceDocumentForm = (ContractsGrantsInvoiceDocumentForm) form;
    KualiDecimal budgetTotalAmount = findAwardBudgetTotal(contractsGrantsInvoiceDocumentForm);
    if (budgetTotalAmount == null || budgetTotalAmount.isLessEqual(KualiDecimal.ZERO)) {
        String budgetTotalAmountString = budgetTotalAmount != null ? budgetTotalAmount.toString() : "0";
        GlobalVariables.getMessageMap().putError(KFSConstants.GLOBAL_ERRORS, CUKFSKeyConstants.ERROR_DOCUMENT_CONTRACT_GRANT_INVOICE_PRORATE_NO_AWARD_BUDGET_TOTAL, budgetTotalAmountString);
        LOG.error("prorateBill, Prorate is not valid as the budgetTotalAmount is " + budgetTotalAmount);
        return mapping.findForward(KFSConstants.MAPPING_BASIC);
    }
    return super.prorateBill(mapping, form, request, response);
}
Also used : ContractsGrantsInvoiceDocumentForm(org.kuali.kfs.module.ar.document.web.struts.ContractsGrantsInvoiceDocumentForm) KualiDecimal(org.kuali.kfs.core.api.util.type.KualiDecimal)

Aggregations

ContractsGrantsInvoiceDocumentForm (org.kuali.kfs.module.ar.document.web.struts.ContractsGrantsInvoiceDocumentForm)2 ActionForward (org.apache.struts.action.ActionForward)1 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)1 ContractsGrantsInvoiceDocument (org.kuali.kfs.module.ar.document.ContractsGrantsInvoiceDocument)1