Summenfelder berechnen: Anwesenheitstage, Pauschale 8,60-Summe, Gesamtpauschale
This commit is contained in:
1 parent
ebd67c7be1
commit
4001bb78f5
2 files changed
+47
No files matched your search
@@ -59,6 +59,8 @@ def build_field_dict(
|
||||
datum_field: creation_date.strftime("%d.%m.%Y"),
|
||||
}
|
||||
|
||||
pauschale_5_count: int = 0
|
||||
|
||||
for idx, entry in enumerate(attendance.entries):
|
||||
fields[f"datum.{idx}"] = entry.date_german()
|
||||
fields[f"anwesend.{idx}"] = entry.status
|
||||
@@ -69,6 +71,7 @@ def build_field_dict(
|
||||
# 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
|
||||
pauschale_5_count += 1
|
||||
else:
|
||||
fields[f"{pauschale_prefix}.{idx}"] = "0"
|
||||
else:
|
||||
@@ -76,6 +79,13 @@ def build_field_dict(
|
||||
fields[f"plan.{idx}"] = ""
|
||||
fields[f"{pauschale_prefix}.{idx}"] = "0"
|
||||
|
||||
# Summary fields (replicate PDF JavaScript calculations)
|
||||
pauschale_5_euro = pauschale_5_count * 8.6
|
||||
fields["pauschale_5_sum"] = f"{pauschale_5_euro:.2f}".replace(".", ",")
|
||||
fields["pauschale_25_sum"] = "0,00"
|
||||
fields["pauschale_sum"] = f"{pauschale_5_euro:.2f}".replace(".", ",")
|
||||
fields["anwesend_sum"] = str(pauschale_5_count)
|
||||
|
||||
return fields
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user