From 7f314c9f5e17abd53bb4fbdf2ac9a86550208ad8 Mon Sep 17 00:00:00 2001 From: cay Date: Fri, 27 Mar 2026 12:27:09 +0000 Subject: [PATCH] Export gleich alle bezahlt --- routes/billing.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/billing.js b/routes/billing.js index 57275b9..998440f 100644 --- a/routes/billing.js +++ b/routes/billing.js @@ -216,6 +216,12 @@ router.get('/export/csv', requireAdmin, async (req, res) => { ORDER BY m.last_name ASC `, [period]); + // Alle offenen Rechnungen dieser Periode als bezahlt markieren + await db.query( + "UPDATE invoices SET status='paid', paid_at=NOW() WHERE period=? AND status='open'", + [period] + ); + res.setHeader('Content-Type', 'text/csv; charset=utf-8'); res.setHeader('Content-Disposition', `attachment; filename="SEPA_${period}.csv"`);