Buchungskalender: Abschluss – S2 Rechnungsnummer unter einer Sperre, unique-Index; S3 Storno mit Ursprungs-Aussteller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Opus 5.5 committed 2026-10-07 15:21:19 +00:00
1 parent 435dd0b746
commit 727613d0e2
4 files changed
+87 -19

No files matched your search

+1 -1
View File
@@ -291,7 +291,7 @@ export async function storniere(ctx, anfrageId, { grund = '', erstattungCent = 0
let stornoRechnung = null
if (a.rechnungId) {
const orig = await ladeRechnung(a.rechnungId)
if (orig) stornoRechnung = await rechnungEinmal(ctx, a, 'storno', { bezugNummer: orig.nummer, now })
if (orig) stornoRechnung = await rechnungEinmal(ctx, a, 'storno', { bezugNummer: orig.nummer, bezug: orig, now })
}
const anfrage = await aktualisiereAnfrage(a.$id, { status: 'storniert', stornoGrund: text(grund, 500), storniertAt: iso(ms(now)) })
return { anfrage, stornoRechnung, neu: true }