From 81773711596cc8e1205523b5cc69e3d27dde43a4 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 d97697c..ff29559 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -257,7 +257,7 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter req.getState() == TimeOffRequestStatus.TOMADO) + .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO || req.getState() == TimeOffRequestStatus.APROBADO) .filter(req -> getStartDateYear(req) == year) .mapToDouble(TimeOffRequest::getDaysToBeTake) .sum(); @@ -266,7 +266,7 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter !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 be2b461..2735067 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -212,6 +212,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)