changes to the fix
This commit is contained in:
+7
-12
@@ -3314,7 +3314,6 @@ def admin_invoices():
|
||||
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:
|
||||
@@ -3323,28 +3322,24 @@ def admin_invoices():
|
||||
amt = 0.0
|
||||
item["amount_eur"] = amt
|
||||
|
||||
if not isinstance(item.get("booking_data"), dict):
|
||||
item["booking_data"] = {}
|
||||
|
||||
except PyMongoError:
|
||||
flash("Rechnungen konnten nicht geladen werden.", "error")
|
||||
finally:
|
||||
if client:
|
||||
client.close()
|
||||
|
||||
# Load instance requests for admin review
|
||||
instance_requests = []
|
||||
try:
|
||||
req_client, req_col = _get_collection("instance_requests")
|
||||
instance_requests = list(req_col.find().sort("created_at", -1))
|
||||
for item in instance_requests:
|
||||
item["id"] = str(item.get("_id"))
|
||||
for prov in instance_requests:
|
||||
prov["id"] = str(prov.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
|
||||
if not isinstance(prov.get("booking_data"), dict):
|
||||
prov["booking_data"] = {}
|
||||
|
||||
except PyMongoError:
|
||||
flash("Instanz-Anfragen konnten nicht geladen werden.", "error")
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<p><strong>Buchung:</strong> {{ item.booking_package_label or item.booking_package }} | <strong>Flow:</strong> {{ item.booking_flow }}</p>
|
||||
<p><strong>Zugewiesener Admin:</strong> {{ item.assigned_admin_display_name or item.assigned_admin_username or 'Nicht gesetzt' }}{% if item.assigned_admin_email %} | <strong>E-Mail:</strong> {{ item.assigned_admin_email }}{% endif %}</p>
|
||||
<p><strong>Unterlagen:</strong> {{ item.paperwork_status or 'Offen' }}{% if item.consent_accepted %} | Einwilligung bestätigt{% endif %}</p>
|
||||
<p><strong>Kontaktdaten:</strong> {{ item.booking_data.contact_person }} | {{ item.booking_data.contact_email }} | {{ item.booking_data.billing_city }}</p>
|
||||
<p><strong>Kontaktdaten:</strong> {{ item.booking_data.get('contact_person', '-') }} | {{ item.booking_data.get('contact_email', '-') }} | {{ item.booking_data.get('billing_city', '-') }}</p>
|
||||
{% endif %}
|
||||
{% if item.pdf_path %}
|
||||
<p><strong>PDF:</strong> <a href="{{ url_for('static', filename=item.pdf_path) }}" target="_blank" rel="noopener">Ansehen</a>
|
||||
@@ -78,7 +78,7 @@
|
||||
<p><strong>Nutzer:</strong> {{ prov.username }} | <strong>Subdomain:</strong> {{ prov.subdomain }}</p>
|
||||
<p><strong>Paket:</strong> {{ prov.package_label or prov.package }} | <strong>Betrag:</strong> {{ '%.2f'|format(prov.amount_eur or 0) }} EUR</p>
|
||||
<p><strong>Status:</strong> {{ prov.provision_status or 'not_started' }}{% if prov.provision_error %} | <strong>Fehler:</strong> {{ prov.provision_error }}{% endif %}</p>
|
||||
<p><strong>Kontaktdaten:</strong> {{ item.get('booking_data', {}).get('contact_person', '-') }} | {{ item.get('booking_data', {}).get('contact_email', '-') }} | {{ item.get('booking_data', {}).get('billing_city', '-') }}</p>
|
||||
<p><strong>Kontaktdaten:</strong> {{ prov.booking_data.get('contact_person', '-') }} | {{ prov.booking_data.get('contact_email', '-') }} | {{ prov.booking_data.get('billing_city', '-') }}</p>
|
||||
<form method="post" style="display:inline-block; margin-right:0.6rem;">
|
||||
<input type="hidden" name="action" value="create_from_provision">
|
||||
<input type="hidden" name="prov_id" value="{{ prov.id }}">
|
||||
|
||||
Reference in New Issue
Block a user