SAFTCheck

totals.reconciliation

Block totals reconcile against child documents

NumberOfEntries must count every document (cancelled included); TotalDebit and TotalCredit must equal the line amounts without VAT, cancelled documents excluded, within 0.01.

What this checks

Each block-level total inside SourceDocuments must reconcile with the documents underneath:

  • NumberOfEntries = number of documents in the section (Invoice / WorkDocument / Payment), cancelled documents included.
  • TotalDebit = sum of the lines' DebitAmount, and TotalCredit = sum of the lines' CreditAmount. These are amounts without VAT, not the documents' GrossTotal. Cancelled documents are left out: status A or F in SalesInvoices, A in WorkingDocuments and Payments.
  • MovementOfGoods.TotalQuantityIssued = sum of the lines' Quantity, cancelled movements left out.

Tolerance is 0.01. Source: Portaria n.º 302/2016, which defines these fields as control sums.

Why AT cares

The block totals are the integrity checksum AT validates on intake. An off-by-one count is usually a draft document that didn't flush; a sub-cent drift is a rounding mismatch between the ERP's line-level engine and the SAF-T aggregator.

Examples

FieldDeclaredActualVerdict
SalesInvoices.NumberOfEntries1212 (including 1 cancelled)✓
SalesInvoices.NumberOfEntries1112✗ one document missing from the count
SalesInvoices.TotalCredit1234.561234.56 (lines without VAT)✓
SalesInvoices.TotalCredit1518.511234.56✗ VAT included by mistake
SalesInvoices.TotalCredit1234.571234.56✓ within the 0.01 tolerance

How to fix

  1. Re-run the SAF-T extract from your ERP after closing any drafts.
  2. If your ERP allows manual override of the block aggregates, set them to the SAFTCheck-reported "actual" values.
  3. If the discrepancy is a known per-line rounding bug in your ERP, escalate it with the vendor — these aggregates are computed downstream of the lines.

Other rules