Search in sources :

Example 31 with DisbursementVoucherDocument

use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method deleteNonEmployeeExpenseLine.

/**
 * Deletes a non employee travel expense line.
 */
public ActionForward deleteNonEmployeeExpenseLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
    DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) dvForm.getDocument();
    int deleteIndex = getLineToDelete(request);
    dvDocument.getDvNonEmployeeTravel().getDvNonEmployeeExpenses().remove(deleteIndex);
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 32 with DisbursementVoucherDocument

use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method printDisbursementVoucherCoverSheet.

/**
 * Calls service to generate the disbursement voucher cover sheet as a pdf.
 */
public ActionForward printDisbursementVoucherCoverSheet(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
    // get directory of template
    String directory = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(KFSConstants.EXTERNALIZABLE_HELP_URL_KEY);
    DisbursementVoucherDocument document = (DisbursementVoucherDocument) SpringContext.getBean(DocumentService.class).getByDocumentHeaderId(request.getParameter(KFSPropertyConstants.DOCUMENT_NUMBER));
    // set workflow document back into form to prevent document authorizer "invalid (null)
    // document.documentHeader.workflowDocument" since we are bypassing form submit and just linking directly to the action
    dvForm.getDocument().getDocumentHeader().setWorkflowDocument(document.getDocumentHeader().getWorkflowDocument());
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DisbursementVoucherCoverSheetService coverSheetService = SpringContext.getBean(DisbursementVoucherCoverSheetService.class);
    coverSheetService.generateDisbursementVoucherCoverSheet(document, baos);
    String fileName = document.getDocumentNumber() + "_cover_sheet.pdf";
    WebUtils.saveMimeOutputStreamAsFile(response, "application/pdf", baos, fileName);
    return (null);
}
Also used : DisbursementVoucherCoverSheetService(org.kuali.kfs.fp.document.service.DisbursementVoucherCoverSheetService) ConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService) ByteArrayOutputStream(java.io.ByteArrayOutputStream) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 33 with DisbursementVoucherDocument

use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method clearTravelMileageAmount.

/**
 * Clears the travel mileage amount
 */
public ActionForward clearTravelMileageAmount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
    DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) dvForm.getDocument();
    DisbursementVoucherNonEmployeeTravel dvNet = dvDocument.getDvNonEmployeeTravel();
    if (dvNet != null) {
        clearTravelMileageAmount(dvNet);
    }
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : DisbursementVoucherNonEmployeeTravel(org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 34 with DisbursementVoucherDocument

use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method execute.

/**
 * @see org.kuali.kfs.sys.web.struts.KualiAccountingDocumentActionBase#execute(org.apache.struts.action.ActionMapping,
 *      org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 */
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    ActionForward dest = super.execute(mapping, form, request, response);
    DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
    if (form != null) {
        DisbursementVoucherDocument dvDoc = (DisbursementVoucherDocument) dvForm.getDocument();
        if (dvDoc != null) {
            DisbursementVoucherNonEmployeeTravel dvNet = dvDoc.getDvNonEmployeeTravel();
            if (dvNet != null) {
                // clear values derived from travelMileageAmount if that amount has been (manually) cleared
                Integer amount = dvNet.getDvPersonalCarMileageAmount();
                if ((amount == null) || (amount.intValue() == 0)) {
                    clearTravelMileageAmount(dvNet);
                }
                // clear values derived from perDiemRate if that amount has been (manually) cleared
                KualiDecimal rate = dvNet.getDisbVchrPerdiemRate();
                if ((rate == null) || rate.isZero()) {
                    clearTravelPerDiem(dvNet);
                }
            }
            updateAchSignupStatusFlagForPayee(dvDoc);
        }
    }
    return dest;
}
Also used : DisbursementVoucherNonEmployeeTravel(org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) ActionForward(org.apache.struts.action.ActionForward) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 35 with DisbursementVoucherDocument

use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method deletePrePaidEmployeeExpenseLine.

/**
 * Deletes a pre paid travel expense line.
 */
public ActionForward deletePrePaidEmployeeExpenseLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
    DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) dvForm.getDocument();
    int deleteIndex = getLineToDelete(request);
    dvDocument.getDvNonEmployeeTravel().getDvPrePaidEmployeeExpenses().remove(deleteIndex);
    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Also used : DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Aggregations

DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)44 RecurringDisbursementVoucherDocument (edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)10 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)8 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)7 ArrayList (java.util.ArrayList)6 List (java.util.List)4 DisbursementVoucherNonEmployeeTravel (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel)4 DisbursementVoucherPayeeDetail (org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail)4 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)4 Date (java.sql.Date)3 DisbursementVoucherNonEmployeeExpense (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense)3 DisbursementVoucherTaxService (org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService)3 SourceAccountingLine (org.kuali.kfs.sys.businessobject.SourceAccountingLine)3 VendorDetail (org.kuali.kfs.vnd.businessobject.VendorDetail)3 BatchDisbursementVoucherDocument (com.rsmart.kuali.kfs.fp.document.BatchDisbursementVoucherDocument)2 CuDisbursementVoucherPayeeDetail (edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)2 RecurringDisbursementVoucherDetail (edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherDetail)2 HashMap (java.util.HashMap)2 DisbursementVoucherPreConferenceRegistrant (org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceRegistrant)2 DisbursementVoucherTravelService (org.kuali.kfs.fp.document.service.DisbursementVoucherTravelService)2