Files
accounted/packs/inkop-eu-tjanster-omvand-moms-25.yaml
Mattsson e113e9c099 fix(vat,documents): EU reverse-charge packs feed ruta 20/21; daily reanchor cron for floating supplier-invoice underlag (#2095)
Two user reports (Anders, 2026-08-25 + 2026-08-29):

1. The seeded standardmallar "Inkop EU-varor/-tjanster, omvand moms 25%"
   booked the cost on 4010/6540, which no momsdeklaration ruta reads, so the
   fiktiv moms filled ruta 30/48 while ruta 20/21 (inkopsvarde) stayed 0;
   Skatteverket rejects that (FK004, ML 13 kap). The packs now book directly
   on the basis accounts 4515/4535 (ACCOUNT_RUTA -> ruta 20/21); the
   transaction-picker path already skips its own basis emission for basis
   debit accounts, so no double counting. Regression test pins every
   reverse-charge pack to a 44xx/45xx business debit. Prod rows update via
   the existing pack sync cron (upsert on pack_slug).

2. A kontantmetod payment verifikat stayed "Underlag saknas" although the
   invoice PDF was attached and eligible on every static condition: the
   inline anchorSupplierInvoiceDocument silently did nothing (prod case
   2026-08-28, verified in audit_log: no document_attachments update between
   the payment booking and the user's manual re-upload). The helper now
   verifies the guarded update actually matched a row instead of claiming
   success on zero rows, logs its silent bail branches, and a new daily cron
   (/api/documents/reanchor/cron) re-runs the anchor for any floating
   retained document with a posted verifikat, replacing the pattern of
   one-off repair migrations (20260727180000, 20260824150000). The sweep
   names the FK in its embed and is idempotent; locked/closed periods are
   skipped as before.


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

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-01 10:16:07 +02:00

32 lines
851 B
YAML

# Konteringspaket. Schema: lib/packs/schema.ts
# Validated by `npm run validate:packs` (CI gate).
meta:
slug: inkop-eu-tjanster-omvand-moms-25
order: 3
name: 'Inköp EU-tjänster, omvänd moms 25%'
category: eu_trade
entity_type: all
description: >-
Köp av tjänster från annat EU-land. Omvänd skattskyldighet — du redovisar både utgående och ingående moms.
lines:
- account: '4535'
label: 'Inköp tjänster från annat EU-land 25%'
side: debit
type: business
ratio: 1.0
- account: '2614'
label: 'Utgående moms omvänd skattskyldighet 25%'
side: credit
type: vat
vat_rate: 0.25
- account: '2645'
label: 'Beräknad ingående moms 25%'
side: debit
type: vat
vat_rate: 0.25
- account: '1930'
label: 'Företagskonto'
side: credit
type: settlement
ratio: 1.0