Files
accounted/app/api
Jakob Wennberg c93a97bb4e fix(invoices): force 0% VAT on recurring and bulk-created invoices when the company is not VAT registered (#1838)
Issue #1719: moms lands on an invoice even though momskrysset
(company_settings.vat_registered) is off. The web and v1 create/update
routes, the MCP commit, and the webshop route all zero every line via
buildInvoiceWriteData, but two paths insert invoices directly and never
consult vat_registered:

1. executeRecurringSchedule (cron + run-now): the schedule dialog
   defaults template lines to 25%, stores vat_rate with no gate, and the
   spawn falls back to the customer default (25% for Swedish customers)
   for null-rate lines. The generated invoice carried 25% output VAT and
   could be auto-emailed to the customer and booked against 2611.
2. POST /api/v1/.../invoices/bulk-create: same fallback, same direct
   insert.

Both now mirror buildInvoiceWriteData: when vat_registered is false,
every line is forced to 0% at spawn/create time, and the header lands as
treatment 'exempt' with moms_ruta and reverse_charge_text null.

Self-billed received invoices deliberately keep their stated VAT: the
counterparty issued that document, and the books must mirror it
(ML 16 kap 23 §). Credit notes keep mirroring the invoice they credit.


Claude-Session: https://claude.ai/code/session_01SyDuePXxUFowaPBKpAv8SF

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 09:35:31 +02:00
..
2026-07-24 16:36:35 +02:00
2026-07-25 22:56:17 +02:00
2026-07-23 16:16:55 +02:00
2026-07-05 03:05:09 +02:00
2026-07-08 09:54:46 +02:00
2026-07-08 09:54:46 +02:00