This commit is contained in:
2026-08-28 00:18:26 +02:00
parent 0a74773ca6
commit 4de752cae3
2 changed files with 20 additions and 40 deletions
+20
View File
@@ -3313,6 +3313,16 @@ def admin_invoices():
invoices = list(col.find().sort("created_at", -1))
for item in invoices:
item["id"] = str(item.get("_id"))
# Fehlerbehebung: Betrag für das Template in Float umwandeln
amt = item.get("amount_eur", 0)
if isinstance(amt, str):
try:
amt = float(amt.replace('.', '').replace(',', '.'))
except ValueError:
amt = 0.0
item["amount_eur"] = amt
except PyMongoError:
flash("Rechnungen konnten nicht geladen werden.", "error")
finally:
@@ -3326,6 +3336,16 @@ def admin_invoices():
instance_requests = list(req_col.find().sort("created_at", -1))
for item in instance_requests:
item["id"] = str(item.get("_id"))
# Fehlerbehebung: Betrag auch hier sicher in Float umwandeln
amt = item.get("amount_eur", 0)
if isinstance(amt, str):
try:
amt = float(amt.replace('.', '').replace(',', '.'))
except ValueError:
amt = 0.0
item["amount_eur"] = amt
except PyMongoError:
flash("Instanz-Anfragen konnten nicht geladen werden.", "error")
finally: