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