Compare commits

...

2 Commits

Author SHA1 Message Date
Aiirondev_dev 10ae98245c Make the Mahnungen accueally dependent on the student_ausleih_dauer
Release Inventarsystem / release-docker (push) Successful in 2m17s
2026-08-23 21:59:16 +02:00
Aiirondev_dev 359a8f8ab1 Make the Mahnungen accueally dependent on the student_ausleih_dauer
Release Inventarsystem / release-docker (push) Successful in 2m19s
2026-08-23 21:45:02 +02:00
+4 -5
View File
@@ -1516,6 +1516,7 @@ def update_appointment_statuses():
student_card = _decrypt_student_card_doc(card) if '_decrypt_student_card_doc' in globals() else card
student_name = student_card.get('SchülerName', target_ausweis_id)
student_class = student_card.get('Klasse', '')
student_ausleih_dauer = student_card.get('StandardAusleihdauer', 14)
# Gegenstandsdetails laden
item_name = "Unbekannter Artikel"
@@ -1530,8 +1531,8 @@ def update_appointment_statuses():
except Exception:
pass
# STUFE 2: >= 28 Tage überfällig -> Ausweis sperren, Stufe 2 setzen & Admins benachrichtigen
if days_overdue >= 28 and mahnstufe < 2:
# STUFE 2: >= 2 * student_ausleih_dauer Tage überfällig -> Ausweis sperren, Stufe 2 setzen & Admins benachrichtigen
if days_overdue >= (int(student_ausleih_dauer) * 2) and mahnstufe < 2:
ausleihungen.update_one(
{'_id': appt['_id']},
{'$set': {'Mahnstufe': 2, 'LastUpdated': current_time}}
@@ -1573,7 +1574,7 @@ def update_appointment_statuses():
app.logger.warning(f"Mahnstufe 2 & Ausweis-Sperre für Schülerausweis '{student_name}' ({target_ausweis_id}) gesetzt.")
# STUFE 1: >= 14 Tage überfällig -> Stufe 1 setzen & Admins benachrichtigen
elif days_overdue >= 14 and mahnstufe == 0:
elif days_overdue >= int(student_ausleih_dauer) and mahnstufe == 0:
ausleihungen.update_one(
{'_id': appt['_id']},
{'$set': {'Mahnstufe': 1, 'LastUpdated': current_time}}
@@ -3751,8 +3752,6 @@ def mahnungen_admin():
item_name = item_doc.get('Name', item_id)
item_code = item_doc.get('Code_4', '')
# ENTFERNT: item_name = f"{item_name} ({item_code})" - Wir übergeben es separat ans Frontend
raw_user = str(record.get('User') or '')
decrypted_user = decrypt_text(raw_user)
ausweis_id = (decrypted_user if decrypted_user else raw_user).strip().upper()