Vacaciones #79

Merged
jesus.pelaez merged 36 commits from Vacaciones into En-desarrollo 2024-11-24 01:19:42 +00:00
Showing only changes of commit bf3fadbae3 - Show all commits

View File

@ -500,9 +500,14 @@ public class RequestRegisterView extends VerticalLayout {
handleExistingRequests(request); handleExistingRequests(request);
} }
requestService.saveTimeOffRequest(request); long differentDays = ChronoUnit.DAYS.between(LocalDate.now(), request.getStartDate());
Notification.show("Solicitud guardada correctamente."); if (differentDays >= -15 && differentDays <= 90) {
closeForm(); requestService.saveTimeOffRequest(request);
Notification.show("Solicitud guardada correctamente.");
closeForm();
} else {
Notification.show("La fecha de inicio debe encontrarse dentro del rango de 15 días a 3 meses de anticipación.");
}
} }
private TimeOffRequest prepareRequest() { private TimeOffRequest prepareRequest() {