correcciones
All checks were successful
PR Builder / Build-PR (pull_request) Successful in 2m38s

This commit is contained in:
jesus.pelaez 2024-11-14 22:31:29 -04:00
parent 97b9e515bf
commit 305a5c53f3

View File

@ -244,22 +244,21 @@ public class RequestEmployeeView extends Div implements HasUrlParameter<String>
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"))