changes
This commit is contained in:
@@ -3313,6 +3313,16 @@ def admin_invoices():
|
|||||||
invoices = list(col.find().sort("created_at", -1))
|
invoices = list(col.find().sort("created_at", -1))
|
||||||
for item in invoices:
|
for item in invoices:
|
||||||
item["id"] = str(item.get("_id"))
|
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:
|
except PyMongoError:
|
||||||
flash("Rechnungen konnten nicht geladen werden.", "error")
|
flash("Rechnungen konnten nicht geladen werden.", "error")
|
||||||
finally:
|
finally:
|
||||||
@@ -3326,6 +3336,16 @@ def admin_invoices():
|
|||||||
instance_requests = list(req_col.find().sort("created_at", -1))
|
instance_requests = list(req_col.find().sort("created_at", -1))
|
||||||
for item in instance_requests:
|
for item in instance_requests:
|
||||||
item["id"] = str(item.get("_id"))
|
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:
|
except PyMongoError:
|
||||||
flash("Instanz-Anfragen konnten nicht geladen werden.", "error")
|
flash("Instanz-Anfragen konnten nicht geladen werden.", "error")
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
@@ -51,46 +51,6 @@
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="panel">
|
|
||||||
<h2>Instanz-Anfragen</h2>
|
|
||||||
<p>Hier siehst du den Status deiner angeforderten Instanzen/Buchungen, die vom Admin geprüft werden.</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="table-wrap">
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Anfrage</th>
|
|
||||||
<th>Paket</th>
|
|
||||||
<th>Subdomain</th>
|
|
||||||
<th>Betrag</th>
|
|
||||||
<th>Status</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for prov in instance_requests %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ prov.booking_number or prov.booking_number }}</td>
|
|
||||||
<td>{{ prov.package_label or prov.package }}</td>
|
|
||||||
<td>{{ prov.subdomain }}</td>
|
|
||||||
<td>{{ '%.2f'|format(prov.amount_eur or 0) }} EUR</td>
|
|
||||||
<td>
|
|
||||||
{{ prov.provision_status or 'not_started' }}
|
|
||||||
<form method="post" action="{{ url_for('instance_request_delete') }}" style="display:inline-block; margin-left:0.6rem;">
|
|
||||||
<input type="hidden" name="prov_id" value="{{ prov.id }}">
|
|
||||||
<button type="submit" class="danger">Löschen</button>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% else %}
|
|
||||||
<tr>
|
|
||||||
<td colspan="5">Keine Provisionierungsanfragen vorhanden.</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.panel { margin-bottom: 1rem; }
|
.panel { margin-bottom: 1rem; }
|
||||||
.table-wrap { background: #fff; border: 1px solid #d8e1e8; border-radius: 14px; padding: 1rem; overflow-x: auto; }
|
.table-wrap { background: #fff; border: 1px solid #d8e1e8; border-radius: 14px; padding: 1rem; overflow-x: auto; }
|
||||||
|
|||||||
Reference in New Issue
Block a user