Export gleich alle bezahlt
This commit is contained in:
parent
46f5cd9720
commit
7f314c9f5e
@ -216,6 +216,12 @@ router.get('/export/csv', requireAdmin, async (req, res) => {
|
|||||||
ORDER BY m.last_name ASC
|
ORDER BY m.last_name ASC
|
||||||
`, [period]);
|
`, [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-Type', 'text/csv; charset=utf-8');
|
||||||
res.setHeader('Content-Disposition', `attachment; filename="SEPA_${period}.csv"`);
|
res.setHeader('Content-Disposition', `attachment; filename="SEPA_${period}.csv"`);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user