use of com.axelor.apps.base.db.EventsPlanningLine in project axelor-open-suite by axelor.
the class PublicHolidayHrService method getImposedDayNumber.
public int getImposedDayNumber(Employee employee, LocalDate startDate, LocalDate endDate) {
EventsPlanning imposedDays = employee.getImposedDayEventsPlanning();
if (imposedDays == null || imposedDays.getEventsPlanningLineList() == null || imposedDays.getEventsPlanningLineList().isEmpty()) {
return 0;
}
List<EventsPlanningLine> imposedDayList = eventsPlanningLineRepo.all().filter("self.eventsPlanning = ?1 AND self.date BETWEEN ?2 AND ?3", imposedDays, startDate, endDate).fetch();
return imposedDayList.size();
}
use of com.axelor.apps.base.db.EventsPlanningLine in project axelor-open-suite by axelor.
the class PublicHolidayService method computePublicHolidayDays.
public BigDecimal computePublicHolidayDays(LocalDate fromDate, LocalDate toDate, WeeklyPlanning weeklyPlanning, EventsPlanning publicHolidayPlanning) {
BigDecimal publicHolidayDays = BigDecimal.ZERO;
List<EventsPlanningLine> publicHolidayDayList = eventsPlanningLineRepo.all().filter("self.eventsPlanning = ?1 AND self.date BETWEEN ?2 AND ?3", publicHolidayPlanning, fromDate, toDate).fetch();
for (EventsPlanningLine publicHolidayDay : publicHolidayDayList) {
publicHolidayDays = publicHolidayDays.add(BigDecimal.valueOf(weeklyPlanningService.getWorkingDayValueInDays(weeklyPlanning, publicHolidayDay.getDate())));
}
return publicHolidayDays;
}
Aggregations