This commit is contained in:
parent
97b9e515bf
commit
305a5c53f3
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user