We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5524f39 commit a67bc7dCopy full SHA for a67bc7d
1 file changed
src/cp/constraints/target_working_time.py
@@ -54,12 +54,16 @@ def create(
54
if employee.hidden:
55
target_working_time = round(40 * 60 * 4.35)
56
else:
57
+ available_days = set(range(1, len(self._days) + 1)) - (
58
+ set(employee.vacation_days) | set(employee._forbidden_days) # pyright: ignore[reportPrivateUsage]
59
+ )
60
+
61
# maybe it effects the tool that working_time_domain is probably MUCH larger than
62
# target_working_time - TOLERANCE_LESS <= working_time_variable <= target_working_time + TOLERANCE_MORE
63
target_working_time = round(
64
max(
- employee.target_working_time * (1 - len(employee.vacation_days) / len(self._days))
- - employee.actual_working_time,
65
+ employee.target_working_time * len(available_days) / len(self._days),
66
+ -employee.actual_working_time,
67
0,
68
)
69
0 commit comments