use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherAction method clearNonResidentAlienTaxLines.
/**
* Calls service to clear tax accounting lines and updates nra tax line string in action form.
*/
public ActionForward clearNonResidentAlienTaxLines(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
DisbursementVoucherDocument document = (DisbursementVoucherDocument) dvForm.getDocument();
DisbursementVoucherTaxService taxService = SpringContext.getBean(DisbursementVoucherTaxService.class);
/* call service to clear previous lines */
taxService.clearNRATaxLines(document);
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 performLookup.
/**
* Hook into performLookup to switch the payee lookup based on the payee type selected.
*/
@Override
public ActionForward performLookup(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
DisbursementVoucherDocument document = (DisbursementVoucherDocument) dvForm.getDocument();
return super.performLookup(mapping, form, request, response);
}
use of org.kuali.kfs.fp.document.DisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherAction method addPrePaidNonEmployeeExpenseLine.
/**
* Adds a new employee pre paid travel expense line.
*/
public ActionForward addPrePaidNonEmployeeExpenseLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) dvForm.getDocument();
DisbursementVoucherNonEmployeeExpense newExpenseLine = dvForm.getNewPrePaidNonEmployeeExpenseLine();
// validate line
GlobalVariables.getMessageMap().addToErrorPath(KFSPropertyConstants.NEW_PREPAID_EXPENSE_LINE);
SpringContext.getBean(DictionaryValidationService.class).validateBusinessObject(newExpenseLine);
// Ensure all fields are filled in before attempting to add a new expense line
if (StringUtils.isBlank(newExpenseLine.getDisbVchrPrePaidExpenseCode())) {
GlobalVariables.getMessageMap().putError(KFSPropertyConstants.DISB_VCHR_PRE_PAID_EXPENSE_CODE, KFSKeyConstants.ERROR_DV_PREPAID_EXPENSE_CODE);
}
if (StringUtils.isBlank(newExpenseLine.getDisbVchrPrePaidExpenseCompanyName())) {
GlobalVariables.getMessageMap().putError(KFSPropertyConstants.DISB_VCHR_PRE_PAID_EXPENSE_COMPANY_NAME, KFSKeyConstants.ERROR_DV_PREPAID_EXPENSE_COMPANY_NAME);
}
if (ObjectUtils.isNull(newExpenseLine.getDisbVchrExpenseAmount())) {
GlobalVariables.getMessageMap().putError(KFSPropertyConstants.DISB_VCHR_EXPENSE_AMOUNT, KFSKeyConstants.ERROR_DV_PREPAID_EXPENSE_AMOUNT);
}
GlobalVariables.getMessageMap().removeFromErrorPath(KFSPropertyConstants.NEW_PREPAID_EXPENSE_LINE);
// current one.
if (!GlobalVariables.getMessageMap().hasErrors()) {
newExpenseLine.setDocumentNumber(dvDocument.getDocumentNumber());
dvDocument.getDvNonEmployeeTravel().addDvPrePaidEmployeeExpenseLine(newExpenseLine);
DisbursementVoucherNonEmployeeExpense newNewNonEmployeeExpenseLine = new DisbursementVoucherNonEmployeeExpense();
newNewNonEmployeeExpenseLine.setFinancialDocumentLineNumber(newExpenseLine.getFinancialDocumentLineNumber() + 1);
dvForm.setNewPrePaidNonEmployeeExpenseLine(newNewNonEmployeeExpenseLine);
}
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 addPreConfRegistrantLine.
/**
* Adds a new pre conference registrant line.
*/
public ActionForward addPreConfRegistrantLine(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) dvForm.getDocument();
DisbursementVoucherPreConferenceRegistrant newRegistrantLine = dvForm.getNewPreConferenceRegistrantLine();
// validate line
GlobalVariables.getMessageMap().addToErrorPath(KFSPropertyConstants.NEW_PRECONF_REGISTRANT_LINE);
SpringContext.getBean(DictionaryValidationService.class).validateBusinessObject(newRegistrantLine);
GlobalVariables.getMessageMap().removeFromErrorPath(KFSPropertyConstants.NEW_PRECONF_REGISTRANT_LINE);
if (!GlobalVariables.getMessageMap().hasErrors()) {
dvDocument.addDvPrePaidRegistrantLine(newRegistrantLine);
dvForm.setNewPreConferenceRegistrantLine(new DisbursementVoucherPreConferenceRegistrant());
}
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 clearNonResidentAlienTaxInfo.
/**
* Calls service to clear tax info.
*/
public ActionForward clearNonResidentAlienTaxInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
DisbursementVoucherForm dvForm = (DisbursementVoucherForm) form;
DisbursementVoucherDocument document = (DisbursementVoucherDocument) dvForm.getDocument();
DisbursementVoucherTaxService taxService = SpringContext.getBean(DisbursementVoucherTaxService.class);
/* call service to clear previous lines */
taxService.clearNRATaxInfo(document);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Aggregations