The problem
- →Missing or malformed BG-22 — without the "Preceding Invoice Reference" section, the recipient doesn't know VAT was partially already paid. Possible rejection at tax audit.
- →Double VAT invoicing — if VAT is recalculated on the quote total instead of the residual, the client pays VAT twice. Major accounting error, likely tax audit adjustment.
- →Manual balance calculation — referencing N deposits with their respective pre-tax amounts manually is error-prone. No consumer tool automates BG-22.
Our solution
- →Automatic BG-22 generation — convertToBalance reads parent_invoice_ids and builds the BG-22 section with exact references for each deposit. FNFE schematron validation guaranteed.
- →Balance = quote total − sum of deposits — automatic calculation, VAT only on residual. 0 double invoicing, 0 client-side recalculation.
- →Type 380 + continuous ISCA chain — the invoice enters the SHA-256 chain with contiguous sequence_number. Full cycle quote → deposits → balance traced and verifiable.
6 type 380 guarantees
Automatic balance calculation
quote_total - sum(deposits) calculated without intervention. Scell reads parent_invoice_ids and does the arithmetic. 0 accounting errors, 0 manual recalculation.
EN16931-compliant BG-22
The BG-22 tag group (Preceding Invoice Reference) is automatically generated with exact references of each deposit. FNFE schematron validation guaranteed.
Type 380 (Final invoice)
Clear distinction deposit (386) / balance (380) in EDI. Transparent client accounting. invoiceTypeCode correctly positioned in CII XML.
Cross-reference parent_invoice_ids
Each deposit cited individually in the BG-22 section of the balance. 30-second audit: a single endpoint to see the complete cycle (quote → deposits → balance).
Continuous ISCA chain
The balance enters the same SHA-256 chain as the quote and deposits. Contiguous sequence_number. Full cycle integrity verifiable via /fiscal/integrity.
Compatible buyer registry
The balance invoice inherits the buyer_id snapshotted at issuance. Buyer data is frozen — modifying the buyers registry does not impact issued documents.
Frequently asked questions
Ready to close your first deposit/balance cycle?
Free sandbox. No credit card required. BG-22 calculated in 1 call.