Search in sources :

Example 11 with DisbursementVoucherDocument

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);
}
Also used : DisbursementVoucherTaxService(org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 12 with DisbursementVoucherDocument

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);
}
Also used : DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 13 with DisbursementVoucherDocument

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);
}
Also used : DictionaryValidationService(org.kuali.kfs.kns.service.DictionaryValidationService) DisbursementVoucherNonEmployeeExpense(org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 14 with DisbursementVoucherDocument

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);
}
Also used : DictionaryValidationService(org.kuali.kfs.kns.service.DictionaryValidationService) DisbursementVoucherPreConferenceRegistrant(org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceRegistrant) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument)

Example 15 with DisbursementVoucherDocument

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);
}
Also used : DisbursementVoucherTaxService(org.kuali.kfs.fp.document.service.DisbursementVoucherTaxService) 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