workDaySheet.setUnjustifiedTime(workDaySheet.getWorkSchedule().getWorkScheduleType() .getFixedWorkPeriod().getWorkPeriodDuration());
    public WorkDaySheet calculateDailyBalance(WorkDaySheet workDaySheet, YearMonthDay day,            boolean isDayHoliday) {        if (workDaySheet.getWorkSchedule() != null && !isDayHoliday) {            Timeline timeline = new Timeline(workDaySheet.getWorkSchedule().getWorkScheduleType());            List<Leave> dayOccurrences = getLeavesByType(workDaySheet.getLeaves(),                    JustificationType.OCCURRENCE);            if (dayOccurrences.isEmpty()) {                List<Leave> timeLeaves = getLeavesByType(workDaySheet.getLeaves(),                        JustificationType.TIME);                List<Leave> balanceLeaves = getLeavesByType(workDaySheet.getLeaves(),                        JustificationType.BALANCE);                if (!workDaySheet.getAssiduousnessRecords().isEmpty() || !timeLeaves.isEmpty()) {                    Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES                            .getAttributes().iterator();                    timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), workDaySheet                            .getLeaves(), attributesIt, day);                    workDaySheet = workDaySheet.getWorkSchedule().calculateWorkingPeriods(workDaySheet,                            day, timeline, timeLeaves);                } else {                    workDaySheet.setBalanceTime(Duration.ZERO.minus(                            workDaySheet.getWorkSchedule().getWorkScheduleType().getNormalWorkPeriod()                                    .getWorkPeriodDuration()).toPeriod());                    if (balanceLeaves.isEmpty()) {                        workDaySheet.setNotes(workDaySheet.getNotes().concat("FALTA INJ"));                    }                }                workDaySheet.discountBalanceLeaveInFixedPeriod(balanceLeaves);            }        } else {            final WeekDay dayOfWeek = WeekDay.fromJodaTimeToWeekDay(day.toDateTimeAtMidnight());            final EnumSet<WeekDay> enumSetWeekDay = EnumSet.range(WeekDay.MONDAY, WeekDay.FRIDAY);            if (!isDayHoliday && !workDaySheet.getAssiduousnessRecords().isEmpty()                    && enumSetWeekDay.contains(dayOfWeek)) {                final Timeline timeline = new Timeline(day);                Iterator<AttributeType> attributesIt = DomainConstants.WORKED_ATTRIBUTES.getAttributes()                        .iterator();                timeline.plotListInTimeline(workDaySheet.getAssiduousnessRecords(), workDaySheet                        .getLeaves(), attributesIt, day);                final Duration worked = timeline.calculateWorkPeriodDuration(null, timeline                        .getTimePoints().iterator().next(), new TimePoint(defaultStartWorkDay,                        AttributeType.NULL), new TimePoint(defaultStartWorkDay, AttributeType.NULL),                        null);                workDaySheet.setBalanceTime(worked.toPeriod());            }        }        return workDaySheet;    }