fix: Stellenanteil in Prozentangabe und jeweiliges Monatsende als Datum eintragen
This commit is contained in:
1 parent
0d390f79b4
commit
b05849e673
4 files changed
+38
-19
No files matched your search
+10
-6
@@ -5,7 +5,7 @@ Es werden KEINE Sheets programmatisch erzeugt oder kopiert –
|
||||
ausschließlich die vorhandenen Sheets mit Daten befüllt.
|
||||
"""
|
||||
|
||||
from datetime import date
|
||||
import calendar
|
||||
from pathlib import Path
|
||||
|
||||
from openpyxl import load_workbook
|
||||
@@ -95,18 +95,22 @@ def _fill_sheet(ws, record: EmployeeRecord, employee_name: str, field_map: dict)
|
||||
value = record.funktion
|
||||
elif source_field == "Tätigkeit":
|
||||
value = record.taetigkeit
|
||||
elif source_field == "Ort":
|
||||
elif source_field in ("Ort", "Ort 2"):
|
||||
value = "Dresden"
|
||||
elif source_field == "Datum":
|
||||
value = date.today().strftime("%d.%m.%Y")
|
||||
parts = record.monat.split(".")
|
||||
if len(parts) == 2:
|
||||
month = int(parts[0])
|
||||
year = int(parts[1])
|
||||
last_day = calendar.monthrange(year, month)[1]
|
||||
value = f"{last_day:02d}.{month:02d}.{year}"
|
||||
else:
|
||||
value = ""
|
||||
else:
|
||||
continue
|
||||
formatted = _format_value(value, m.format)
|
||||
_set_cell_value(ws, m.target_cell, formatted)
|
||||
|
||||
# Datum zusätzlich ins Unterschriftsfeld
|
||||
_set_cell_value(ws, "J95", date.today().strftime("%d.%m.%Y"))
|
||||
|
||||
|
||||
def generate_activity_reports(
|
||||
employee_records: dict[str, list[EmployeeRecord]],
|
||||
|
||||
Reference in new issue
Block a user