From 17bd54a3f4bb4bad157aaa540ab9a327a2f2d763 Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 21 Nov 2024 18:22:46 -0400 Subject: [PATCH] No descontar dias si la solicitud de vacacion no fue aprobada. --- .../com/primefactorsolutions/views/RequestEmployeeView.java | 4 ++-- .../java/com/primefactorsolutions/views/RequestsListView.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 5e8c437..dabdd23 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -246,7 +246,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter private double calculateHolidayUtilizedDays(final int year) { return requests.stream() .filter(this::verificationIsHoliday) - .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO) + .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO || req.getState() == TimeOffRequestStatus.APROBADO) .filter(req -> getStartDateYear(req) == year) .mapToDouble(TimeOffRequest::getDaysToBeTake) .sum(); @@ -255,7 +255,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter private double calculatePersonalDaysUtilized(final boolean isMale, final int year) { return requests.stream() .filter(req -> !verificationIsHoliday(req)) - .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO) + .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO || req.getState() == TimeOffRequestStatus.APROBADO) .filter(req -> !getStandardExclusions().contains(req.getCategory())) .filter(req -> !(isMale && getMaleSpecificExclusions().contains(req.getCategory()))) .filter(req -> !req.getCategory().name().startsWith("VACACION")) diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index 503092a..c6c4704 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -217,6 +217,7 @@ public class RequestsListView extends BaseView { int currentYear = LocalDate.now().getYear(); return employeeRequests.stream() .filter(Objects::nonNull) + .filter(request -> request.getState() == TimeOffRequestStatus.APROBADO || request.getState() == TimeOffRequestStatus.TOMADO) .filter(request -> request.getCategory() != TimeOffRequestType.PERMISOS_DE_SALUD) .filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ACTUAL) .filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ANTERIOR)