Erster Versuch zweiter Schritt, configs ausgefüllt
This commit is contained in:
1 parent
2faa1689dd
commit
15d49acfc8
8 files changed
+35
-17
No files matched your search
@@ -20,7 +20,10 @@ _REQUIRED_KEYS = [
|
||||
"month_mapping",
|
||||
"valid_status_codes",
|
||||
"plan_hours_value",
|
||||
"pauschale_value",
|
||||
"pdf_field_ort",
|
||||
"pdf_field_erstellungsdatum",
|
||||
"pdf_pauschale_prefix",
|
||||
"pauschale_present_value",
|
||||
]
|
||||
|
||||
# Singleton cache so the file is only read once per process
|
||||
|
||||
+8
-5
@@ -44,14 +44,17 @@ def build_field_dict(
|
||||
creation_date = date.today()
|
||||
|
||||
plan_value: str = config["plan_hours_value"]
|
||||
pauschale_value: str = config["pauschale_value"]
|
||||
pauschale_prefix: str = config["pdf_pauschale_prefix"]
|
||||
pauschale_present_value: str = config["pauschale_present_value"]
|
||||
ort_field: str = config["pdf_field_ort"]
|
||||
datum_field: str = config["pdf_field_erstellungsdatum"]
|
||||
|
||||
fields: Dict[str, str] = {
|
||||
"person.name": attendance.person.name,
|
||||
"monat_jahr": attendance.monat_jahr,
|
||||
"antragsnummer": config["antragsnummer"],
|
||||
"ort": config["ort"],
|
||||
"erstellungsdatum": creation_date.strftime("%d.%m.%Y"),
|
||||
ort_field: config["ort"],
|
||||
datum_field: creation_date.strftime("%d.%m.%Y"),
|
||||
}
|
||||
|
||||
for idx, entry in enumerate(attendance.entries):
|
||||
@@ -61,11 +64,11 @@ def build_field_dict(
|
||||
if entry.is_present:
|
||||
fields[f"ist.{idx}"] = entry.hours_german()
|
||||
fields[f"plan.{idx}"] = plan_value
|
||||
fields[f"pauschale.{idx}"] = pauschale_value
|
||||
fields[f"{pauschale_prefix}.{idx}"] = pauschale_present_value
|
||||
else:
|
||||
fields[f"ist.{idx}"] = ""
|
||||
fields[f"plan.{idx}"] = ""
|
||||
fields[f"pauschale.{idx}"] = ""
|
||||
fields[f"{pauschale_prefix}.{idx}"] = "0"
|
||||
|
||||
return fields
|
||||
|
||||
|
||||
Reference in new issue
Block a user