Fix: Quartalssumme korrekt (alle inkl. Storno), Netto ausgeblendet (SW by-v977)
This commit is contained in:
parent
6104132714
commit
ed6dd8da13
5 changed files with 13 additions and 16 deletions
|
|
@ -408,7 +408,7 @@ async def serve_media(path: str, request: _Request):
|
|||
raise _HE(404, "Nicht gefunden.")
|
||||
return _media_response(filepath)
|
||||
|
||||
APP_VER = "976" # muss mit APP_VER in app.js übereinstimmen
|
||||
APP_VER = "977" # muss mit APP_VER in app.js übereinstimmen
|
||||
|
||||
@app.get("/.well-known/assetlinks.json")
|
||||
async def assetlinks():
|
||||
|
|
|
|||
|
|
@ -467,18 +467,16 @@ def get_quarterly(year: int, q: int, admin=Depends(require_admin)):
|
|||
# Nach Datum sortieren
|
||||
entries.sort(key=lambda e: (e.get("created_at") or ""))
|
||||
|
||||
# Summen: Originalrechnungen positiv + Stornos negativ
|
||||
total_net = sum(e["amount_net"] for e in entries if e["status"] != "cancelled")
|
||||
total_tax = sum(e.get("tax_amount") or 0 for e in entries if e["status"] != "cancelled")
|
||||
total_gross = sum(e["amount_gross"] for e in entries if e["status"] != "cancelled")
|
||||
# Summen: alle Einträge — Storno (-) und Original (+) heben sich gegenseitig auf
|
||||
total_gross = sum(e.get("amount_gross") or 0 for e in entries)
|
||||
total_tax = sum(e.get("tax_amount") or 0 for e in entries)
|
||||
|
||||
return {
|
||||
"period": period,
|
||||
"invoices": entries,
|
||||
"total_net": round(total_net, 2),
|
||||
"total_tax": round(total_tax, 2),
|
||||
"total_gross": round(total_gross, 2),
|
||||
"count": len(entries),
|
||||
"period": period,
|
||||
"invoices": entries,
|
||||
"total_tax": round(total_tax, 2),
|
||||
"total_gross": round(total_gross, 2),
|
||||
"count": len(entries),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '976'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '977'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -4356,12 +4356,11 @@ window.Page_admin = (() => {
|
|||
const escape = v => `"${String(v || '').replace(/"/g, '""')}"`;
|
||||
|
||||
const statusLabel = { paid: 'Bezahlt', sent: 'Versendet', cancelled: 'Storniert (Original)', storno: 'Stornorechnung' };
|
||||
const header = 'Nummer;Empfaenger;E-Mail;Datum;Leistungszeitraum;Nettobetrag;Bruttobetrag;Eingegangener Betrag;Status;Versendet am;Zahlungseingang\n';
|
||||
const header = 'Nummer;Empfaenger;E-Mail;Datum;Leistungszeitraum;Betrag;Eingegangener Betrag;Status;Versendet am;Zahlungseingang\n';
|
||||
const csvRows = data.invoices.map(inv => [
|
||||
inv.invoice_number,
|
||||
inv.recipient_name, inv.recipient_email || '',
|
||||
fmtDate(inv.created_at), inv.service_period || '',
|
||||
fmtEur(inv.amount_net),
|
||||
fmtEur(inv.amount_gross),
|
||||
inv.paid_amount != null ? fmtEur(inv.paid_amount) : '',
|
||||
statusLabel[inv.status] || inv.status,
|
||||
|
|
@ -4411,7 +4410,7 @@ window.Page_admin = (() => {
|
|||
}).join('');
|
||||
resultEl.innerHTML = `
|
||||
<div style="font-size:var(--text-xs);font-weight:700;color:var(--c-text-secondary);margin-bottom:var(--space-2)">
|
||||
${_esc(data.period || `Q${q} ${year}`)} — ${data.count} Rechnung(en) · Brutto: ${_fmtE(data.total_gross)}
|
||||
${_esc(data.period || `Q${q} ${year}`)} — ${data.count} Buchung(en) · Summe: ${_fmtE(data.total_gross)}
|
||||
</div>
|
||||
<div class="adm-table-scroll">
|
||||
<table class="adm-table">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v976';
|
||||
const CACHE_VERSION = 'by-v977';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue