feat: widget icons, dark theme tables, breadcrumb removal, bookkeeping rework, personal equipment pages, PDF/order improvements

This commit is contained in:
Matthias Hochmeister
2026-04-14 10:35:40 +02:00
parent 4c4fb01e68
commit 4fbea8af81
41 changed files with 679 additions and 659 deletions

View File

@@ -413,10 +413,16 @@ async function getRequestById(id: number) {
linkedBestellungen = bestellungen.rows;
} catch { /* table may not exist */ }
// Determine im_haus: true if any linked bestellung has status lieferung_pruefen or abgeschlossen
const imHaus = (linkedBestellungen as { status: string }[]).some(
(b) => b.status === 'lieferung_pruefen' || b.status === 'abgeschlossen',
);
return {
anfrage: reqResult.rows[0],
positionen: positionenWithEigenschaften,
linked_bestellungen: linkedBestellungen,
im_haus: imHaus,
};
}

View File

@@ -1019,12 +1019,12 @@ async function stornoTransaktion(id: number, userId: string) {
try {
const result = await pool.query(
`UPDATE buchhaltung_transaktionen
SET status = 'storniert'
SET status = 'entwurf'
WHERE id = $1 AND status IN ('gebucht', 'freigegeben')
RETURNING *`,
[id, userId]
);
if (result.rows[0]) await logAudit(id, 'storniert', {}, userId);
if (result.rows[0]) await logAudit(id, 'storniert_zu_entwurf', {}, userId);
return result.rows[0] || null;
} catch (error) {
logger.error('BuchhaltungService.stornoTransaktion failed', { error, id });