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