Search in sources :

Example 6 with DisbursementVoucherPayeeDetail

use of org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail 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 7 with DisbursementVoucherPayeeDetail

use of org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail in project cu-kfs by CU-CommunityApps.

the class DisbursementVoucherAction method updateAchSignupStatusFlagForPayee.

private void updateAchSignupStatusFlagForPayee(DisbursementVoucherDocument dvDoc) {
    DisbursementVoucherPayeeDetail dvPayee = dvDoc.getDvPayeeDetail();
    boolean signedupForACH = false;
    if (dvPayee != null) {
        String payeeTypeCode = dvPayee.getDisbursementVoucherPayeeTypeCode();
        String payeeIdNumber = dvPayee.getDisbVchrPayeeIdNumber();
        signedupForACH = SpringContext.getBean(PayeeACHService.class).isPayeeSignedUpForACH(payeeTypeCode, payeeIdNumber);
    }
    dvDoc.setAchSignUpStatusFlag(signedupForACH);
}
Also used : DisbursementVoucherPayeeDetail(org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail)

Aggregations

DisbursementVoucherPayeeDetail (org.kuali.kfs.fp.businessobject.DisbursementVoucherPayeeDetail)7 DisbursementVoucherDocument (org.kuali.kfs.fp.document.DisbursementVoucherDocument)4 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)2 RecurringDisbursementVoucherDocument (edu.cornell.kfs.fp.document.RecurringDisbursementVoucherDocument)2 MessageMap (org.kuali.kfs.krad.util.MessageMap)2 Person (org.kuali.rice.kim.api.identity.Person)2 DisbursementVoucherBatchSummaryLine (com.rsmart.kuali.kfs.fp.businessobject.DisbursementVoucherBatchSummaryLine)1 CuDisbursementVoucherPayeeDetail (edu.cornell.kfs.fp.businessobject.CuDisbursementVoucherPayeeDetail)1 Date (java.sql.Date)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 DisbursementVoucherNonEmployeeExpense (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense)1 DisbursementVoucherNonEmployeeTravel (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeTravel)1 DisbursementVoucherNonResidentAlienTax (org.kuali.kfs.fp.businessobject.DisbursementVoucherNonResidentAlienTax)1 DisbursementVoucherPreConferenceDetail (org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceDetail)1 DisbursementVoucherPreConferenceRegistrant (org.kuali.kfs.fp.businessobject.DisbursementVoucherPreConferenceRegistrant)1 NonResidentAlienTaxPercent (org.kuali.kfs.fp.businessobject.NonResidentAlienTaxPercent)1 DataDictionaryService (org.kuali.kfs.kns.service.DataDictionaryService)1 PersistableBusinessObject (org.kuali.kfs.krad.bo.PersistableBusinessObject)1