From 305a5c53f3462da1c4e164b045c1aa42596fe33c Mon Sep 17 00:00:00 2001 From: ricardo051199 Date: Thu, 14 Nov 2024 22:31:29 -0400 Subject: [PATCH] correcciones --- .../views/RequestEmployeeView.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index 6737dc5..58b4ab6 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -244,22 +244,21 @@ public class RequestEmployeeView extends Div implements HasUrlParameter private double calculateHolidayUtilizedDays(final int year) { return requests.stream() .filter(this::verificationIsHoliday) + .filter(this::verificationIsHoliday) + .filter(req -> req.getState() == TimeOffRequestStatus.APROBADO) + .filter(req -> req.getState() == TimeOffRequestStatus.EN_USO) + .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO) .filter(req -> getStartDateYear(req) == year) .mapToDouble(TimeOffRequest::getDaysToBeTake) .sum(); } - private double calculateVacationUtilizedDays(final int year) { - return requests.stream() - .filter(req -> req.getCategory().name().startsWith("VACACION")) - .filter(req -> getStartDateYear(req) == year || getStartDateYear(req) == year - 1) - .mapToDouble(TimeOffRequest::getDaysBalance) - .sum(); - } - private double calculatePersonalDaysUtilized(final boolean isMale, final int year) { return requests.stream() .filter(req -> !verificationIsHoliday(req)) + .filter(req -> req.getState() == TimeOffRequestStatus.APROBADO) + .filter(req -> req.getState() == TimeOffRequestStatus.EN_USO) + .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO) .filter(req -> !getStandardExclusions().contains(req.getCategory())) .filter(req -> !(isMale && getMaleSpecificExclusions().contains(req.getCategory()))) .filter(req -> !req.getCategory().name().startsWith("VACACION"))