Observaciones-vacaciones #83

Merged
alex merged 11 commits from Observaciones-vacaciones into main 2024-11-25 02:17:52 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 8177371159 - Show all commits

View File

@ -257,7 +257,7 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter<Str
private double calculateHolidayUtilizedDays(final int year) { private double calculateHolidayUtilizedDays(final int year) {
return requests.stream() return requests.stream()
.filter(this::verificationIsHoliday) .filter(this::verificationIsHoliday)
.filter(req -> req.getState() == TimeOffRequestStatus.TOMADO) .filter(req -> req.getState() == TimeOffRequestStatus.TOMADO || req.getState() == TimeOffRequestStatus.APROBADO)
.filter(req -> getStartDateYear(req) == year) .filter(req -> getStartDateYear(req) == year)
.mapToDouble(TimeOffRequest::getDaysToBeTake) .mapToDouble(TimeOffRequest::getDaysToBeTake)
.sum(); .sum();
@ -266,7 +266,7 @@ public class RequestEmployeeView extends BaseView implements HasUrlParameter<Str
private double calculatePersonalDaysUtilized(final boolean isMale, final int year) { private double calculatePersonalDaysUtilized(final boolean isMale, final int year) {
return requests.stream() return requests.stream()
.filter(req -> !verificationIsHoliday(req)) .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 -> !getStandardExclusions().contains(req.getCategory()))
.filter(req -> !(isMale && getMaleSpecificExclusions().contains(req.getCategory()))) .filter(req -> !(isMale && getMaleSpecificExclusions().contains(req.getCategory())))
.filter(req -> !req.getCategory().name().startsWith("VACACION")) .filter(req -> !req.getCategory().name().startsWith("VACACION"))

View File

@ -212,6 +212,7 @@ public class RequestsListView extends BaseView {
int currentYear = LocalDate.now().getYear(); int currentYear = LocalDate.now().getYear();
return employeeRequests.stream() return employeeRequests.stream()
.filter(Objects::nonNull) .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.PERMISOS_DE_SALUD)
.filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ACTUAL) .filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ACTUAL)
.filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ANTERIOR) .filter(request -> request.getCategory() != TimeOffRequestType.VACACION_GESTION_ANTERIOR)