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