Pauschale 8,60 nur bei Ist-Stunden >= geplanter Anwesenheit (6h)
This commit is contained in:
1 parent
a1f229a502
commit
ebd67c7be1
2 files changed
+13
No files matched your search
@@ -45,6 +45,7 @@ def build_field_dict(
|
|||||||
creation_date = date.today()
|
creation_date = date.today()
|
||||||
|
|
||||||
plan_value: str = config["plan_hours_value"]
|
plan_value: str = config["plan_hours_value"]
|
||||||
|
plan_threshold: float = float(plan_value)
|
||||||
pauschale_prefix: str = config["pdf_pauschale_prefix"]
|
pauschale_prefix: str = config["pdf_pauschale_prefix"]
|
||||||
pauschale_present_value: str = config["pauschale_present_value"]
|
pauschale_present_value: str = config["pauschale_present_value"]
|
||||||
ort_field: str = config["pdf_field_ort"]
|
ort_field: str = config["pdf_field_ort"]
|
||||||
@@ -65,7 +66,11 @@ def build_field_dict(
|
|||||||
if entry.is_present:
|
if entry.is_present:
|
||||||
fields[f"ist.{idx}"] = entry.hours_german()
|
fields[f"ist.{idx}"] = entry.hours_german()
|
||||||
fields[f"plan.{idx}"] = plan_value
|
fields[f"plan.{idx}"] = plan_value
|
||||||
|
# Pauschale only if actual hours >= planned threshold
|
||||||
|
if entry.hours is not None and entry.hours >= plan_threshold:
|
||||||
fields[f"{pauschale_prefix}.{idx}"] = pauschale_present_value
|
fields[f"{pauschale_prefix}.{idx}"] = pauschale_present_value
|
||||||
|
else:
|
||||||
|
fields[f"{pauschale_prefix}.{idx}"] = "0"
|
||||||
else:
|
else:
|
||||||
fields[f"ist.{idx}"] = ""
|
fields[f"ist.{idx}"] = ""
|
||||||
fields[f"plan.{idx}"] = ""
|
fields[f"plan.{idx}"] = ""
|
||||||
|
|||||||
@@ -109,6 +109,14 @@ class TestPresentDay:
|
|||||||
fields = build_field_dict(_make_attendance(_present(3, 6.0)), cfg, date(2026, 2, 1))
|
fields = build_field_dict(_make_attendance(_present(3, 6.0)), cfg, date(2026, 2, 1))
|
||||||
assert fields["pauschale_5.0"] == "1"
|
assert fields["pauschale_5.0"] == "1"
|
||||||
|
|
||||||
|
def test_pauschale_above_threshold(self, cfg):
|
||||||
|
fields = build_field_dict(_make_attendance(_present(3, 7.5)), cfg, date(2026, 2, 1))
|
||||||
|
assert fields["pauschale_5.0"] == "1"
|
||||||
|
|
||||||
|
def test_pauschale_below_threshold(self, cfg):
|
||||||
|
fields = build_field_dict(_make_attendance(_present(3, 5.0)), cfg, date(2026, 2, 1))
|
||||||
|
assert fields["pauschale_5.0"] == "0"
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Absent days (K, KK, E, F, P, U)
|
# Absent days (K, KK, E, F, P, U)
|
||||||
|
|||||||
Reference in new issue
Block a user