Skip to content

feat(invoice)!: structured supply period, carried as Swico S1 /31/ - #11

Merged
borgoat merged 1 commit into
mainfrom
feat/invoice-supply-period
Sep 23, 2026
Merged

borgoat merged 1 commit into
mainfrom
feat/invoice-supply-period

Conversation

@borgoat

@borgoat borgoat commented Sep 23, 2026

Copy link
Copy Markdown
Member

What

  • supply is now structured and required: a day, a YYYY-MM month, or a {from, to} period (SupplyPeriod in invoice/model.py).
  • Printed in the invoice's locale (Juli 2026, 15.07.2026, 1. Juli – 30. Sept. 2026); the ledger draft narration is unchanged for the month form.
  • Carried in the QR-bill's Swico S1 billing information as /31/; dropped right after /32/ when the 140-character budget runs out.
  • JSON Schema lists every accepted input form, so editors don't flag the 2026-07 shorthand.
  • New test: IBAN + SCOR QR-bill carries the unstructured message and the full S1 line, including a 21-character reference.
  • Docs: a "Supply period" section in the invoicing guide with the legal basis (Art. 26 Abs. 2 lit. c MWSTG; Art. 226(7) VAT Directive).

Breaking

Existing invoice files with free-text supply fail at load. The error names the fix (supply: Juli 2026 → supply: 2026-07), recognising month names in every invoice language.

Checks

make check green (369 passed). Sample invoices render; the domestic one prints Juli 2026 and its payload ends in …/30/267359056/31/260701260731/32/8.1/40/0:30.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WhmPdqQaLz2gA83BXhn9XP

`supply` was free text ("Juli 2026"), so the QR-bill's billing information
could not carry the VAT date and the printed period was whatever was typed.
It is now a required, structured field: a day (2026-07-15), a calendar
month (2026-07), or a period ({from: 2026-07-01, to: 2026-09-30}). It is
printed in the invoice's locale (a month still reads "Juli 2026") and goes
into the S1 element as /31/ (YYMMDD, or YYMMDDYYMMDD for a period), dropped
right after /32/ when the 140-character budget runs out.

Also adds a payload test for an IBAN + SCOR QR-bill, which was untested:
every field (unstructured message, full S1) is carried, including a
21-character reference.

BREAKING CHANGE: invoice files must set `supply` to a date, a YYYY-MM
month or a {from, to} period. Free text is refused at load, and the error
names the replacement (`supply: Juli 2026` → `supply: 2026-07`).

Claude-Session: https://claude.ai/code/session_01WhmPdqQaLz2gA83BXhn9XP
@borgoat
borgoat merged commit 9cf01c0 into main Sep 23, 2026
8 checks passed
@borgoat
borgoat deleted the feat/invoice-supply-period branch October 8, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant