use of org.kuali.kfs.core.api.datetime.DateTimeService in project cu-kfs by CU-CommunityApps.
the class CuDisbursementVoucherDefaultDueDateServiceImplTest method buildMockDateTimeService.
protected DateTimeService buildMockDateTimeService(Calendar currentCalendar) {
DateTimeService service = Mockito.mock(DateTimeService.class);
Mockito.when(service.getCurrentCalendar()).thenReturn(currentCalendar);
return service;
}
use of org.kuali.kfs.core.api.datetime.DateTimeService in project cu-kfs by CU-CommunityApps.
the class VendorRule method validateW9SignedDate.
protected boolean validateW9SignedDate(VendorDetail vDetail) {
if (ObjectUtils.isNotNull(vDetail.getVendorHeader().getVendorW9ReceivedIndicator()) && vDetail.getVendorHeader().getVendorW9ReceivedIndicator()) {
if (SpringContext.getBean(ParameterService.class).getParameterValueAsBoolean(VendorDetail.class, VendorParameterConstants.W9_SIGNED_DATE_REQUIRED) && ObjectUtils.isNotNull(vDetail.getVendorHeader().getVendorW9ReceivedIndicator())) {
DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class);
Date today = dateTimeService.getCurrentDate();
if (ObjectUtils.isNotNull(vDetail.getVendorHeader().getVendorW9SignedDate())) {
Date signedDate = vDetail.getVendorHeader().getVendorW9SignedDate();
if (today.compareTo(signedDate) <= 0) {
putFieldError(VendorPropertyConstants.VENDOR_W9SIGNED_DATE, VendorKeyConstants.ERROR_VENDOR_W8ANDW9_SIGNED_AFTER_TODAY);
return false;
}
} else {
putFieldError(VendorPropertyConstants.VENDOR_W9SIGNED_DATE, VendorKeyConstants.ERROR_VENDOR_W9SINGED_DATE_REQUIRED);
return false;
}
}
}
return true;
}
Aggregations