Search in sources :

Example 6 with RecurringDisbursementVoucherDocument

use of edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class RecurringDisbursementVoucherDocumentServiceImpl method saveDisbursementVouchers.

private void saveDisbursementVouchers(List<DisbursementVoucherDocument> dvs, RecurringDisbursementVoucherDocument recurringDV) {
    for (DisbursementVoucherDocument dv : dvs) {
        try {
            dv.getDocumentHeader().setDocumentDescription(recurringDV.getDocumentHeader().getDocumentDescription());
            dv.getDocumentHeader().setExplanation(buildDVExplanation(recurringDV));
            getDocumentService().saveDocument(dv);
            getBusinessObjectService().save(recurringDV.getRecurringDisbursementVoucherDetails());
            updateGLPEDatesAndAddRecurringDocumentLinks(dv, recurringDV.getDocumentNumber());
        } catch (WorkflowException e) {
            ;
            LOG.error("saveDisbursementVouchers: There was an error trying to save our route the created Disbursement Voucher documents: ", e);
            throw new RuntimeException(e);
        }
    }
}
Also used : WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) RecurringDisbursementVoucherDocument(edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument) CuDisbursementVoucherDocument(edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)

Example 7 with RecurringDisbursementVoucherDocument

use of edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class CuDisbursementVoucherPayeeStateAndCountryValidation method validate.

@Override
public boolean validate(AttributedDocumentEvent event) {
    boolean isValid = true;
    DisbursementVoucherDocument dvDocument = (DisbursementVoucherDocument) accountingDocumentForValidation;
    DisbursementVoucherPayeeDetail payeeDetail = dvDocument.getDvPayeeDetail();
    GlobalVariables.getMessageMap().addToErrorPath(KFSPropertyConstants.DOCUMENT);
    // Verify that state code and country code are not both blank.
    if (StringUtils.isBlank(payeeDetail.getDisbVchrPayeeStateCode()) && StringUtils.isBlank(payeeDetail.getDisbVchrPayeeCountryCode())) {
        GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(KFSConstants.GENERAL_PAYMENT_TAB_ERRORS, CUKFSKeyConstants.ERROR_DOCUMENT_DV_BLANK_STATE_AND_COUNTRY);
        isValid = false;
    }
    if (dvDocument instanceof RecurringDisbursementVoucherDocument) {
        String payeeTypeCode = payeeDetail.getDisbursementVoucherPayeeTypeCode();
        String paymentReasonCode = payeeDetail.getDisbVchrPaymentReasonCode();
        Integer vendorHeaderId = payeeDetail.getDisbVchrVendorHeaderIdNumberAsInteger();
        if (getCuDisbursementVoucherTaxService().isForeignVendorAndTaxReviewRequired(payeeTypeCode, paymentReasonCode, vendorHeaderId)) {
            GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(KFSConstants.GENERAL_PAYMENT_TAB_ERRORS, CUKFSKeyConstants.ERROR_RCDV_NO_FOREIGN_VENDORS);
            isValid = false;
        }
    }
    GlobalVariables.getMessageMap().removeFromErrorPath(KFSPropertyConstants.DOCUMENT);
    return isValid;
}
Also used : RecurringDisbursementVoucherDocument(edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument) DisbursementVoucherPayeeDetail(org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail) DisbursementVoucherDocument(org.kuali.kfs.fp.document.DisbursementVoucherDocument) RecurringDisbursementVoucherDocument(edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)

Example 8 with RecurringDisbursementVoucherDocument

use of edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument in project cu-kfs by CU-CommunityApps.

the class RecurringDisbursementVoucherAction method openRecurringDetailsTab.

private void openRecurringDetailsTab(ActionForm form) {
    RecurringDisbursementVoucherForm recurringForm = (RecurringDisbursementVoucherForm) form;
    RecurringDisbursementVoucherDocument recurringDV = (RecurringDisbursementVoucherDocument) recurringForm.getDocument();
    if (!recurringDV.getRecurringDisbursementVoucherDetails().isEmpty()) {
        String recurringDetailsTabKey = CuFPConstants.RecurringDisbursementVoucherDocumentConstants.RECURRING_DETAILS_TAB_NAME + recurringDV.getRecurringDisbursementVoucherDetails().size();
        recurringForm.getTabStates().put(recurringDetailsTabKey, CuFPConstants.OPEN);
    }
}
Also used : RecurringDisbursementVoucherDocument(edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)

Aggregations

RecurringDisbursementVoucherDocument (edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)8 DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)6 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)4 RecurringDisbursementVoucherDetail (edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherDetail)2 ArrayList (java.util.ArrayList)2 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)2 RecurringDisbursementVoucherPDPStatus (edu.cornell.kfs.fp.businessobject.RecurringDisbursementVoucherPDPStatus)1 ScheduledSourceAccountingLine (edu.cornell.kfs.fp.businessobject.ScheduledSourceAccountingLine)1 Date (java.sql.Date)1 Timestamp (java.sql.Timestamp)1 DisbursementVoucherPayeeDetail (org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail)1 SourceAccountingLine (org.kuali.kfs.sys.businessobject.SourceAccountingLine)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1 WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)1 Person (org.kuali.rice.kim.api.identity.Person)1