Export gleich alle bezahlt

This commit is contained in:
cay 2026-03-27 12:27:09 +00:00
parent 46f5cd9720
commit 7f314c9f5e

View File

@ -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"`);