Feat/voucher docs (#664)

* feat: implement inbox document picker and linking functionality

* feat: implement self-billing invoice functionality

- Added support for registering self-billed invoices received from customers.
- Updated the invoice schema to include fields for self-billing metadata such as `is_self_billed`, `external_invoice_number`, `self_billing_agreement_ref`, and `received_date`.
- Created API route for handling self-billed invoice submissions, including validation and error handling.
- Implemented database migrations to add necessary columns and constraints for self-billing invoices.
- Developed tests to ensure correct behavior of self-billing invoice creation and validation rules.
- Updated Swedish localization files to include new terms related to self-billing.

* feat: enforce SIE import requirement for non-Fortnox providers in migration process

* feat: streamline invoice processing and enhance error logging across APIs
This commit is contained in:
Mattsson
2026-06-04 13:14:57 +02:00
committed by GitHub
parent c1be9f15dd
commit 3e42fc6f32
45 changed files with 2675 additions and 529 deletions
+15
View File
@@ -762,6 +762,21 @@ export interface Invoice {
// Conversion tracking (proforma -> invoice)
converted_from_id: string | null
// Self-billing received (mottagen självfaktura, ML 17 kap 15§). When
// `is_self_billed` is true the customer issued the invoice on our behalf;
// for us it is a sale. The counterparty's number lives in
// `external_invoice_number` and our own `invoice_number` stays null so we
// never consume our löpnummerserie (BFL 5 kap 6§).
is_self_billed?: boolean
external_invoice_number?: string | null
self_billing_agreement_ref?: string | null
received_date?: string | null
// Verifikation produced when the invoice was booked (registration entry).
// Lets the payment flow detect an already-booked sale and clear 1510 rather
// than re-recognising revenue.
journal_entry_id?: string | null
// Payment tracking
paid_at: string | null
paid_amount: number | null