Portugal SAF-T: reconcile debit, credit and totals

Locate the field, identify its scope, and fix the source export deliberately.

Open this fictional example →

Keep accounting and invoicing separate

PT-BALANCE compares debit and credit lines inside one GeneralLedgerEntries transaction. PT-TOTAL compares declared section totals with the recognized amounts, and PT-COUNT compares NumberOfEntries with the actual transactions or invoices. A balanced transaction can still describe the wrong business event. The report establishes arithmetic consistency only and leaves accounting truth unchecked.

SalesInvoices uses a different scope. Each invoice line selects a debit or credit amount; the lite checker flags both or neither. NetTotal is compared with line amounts for a single-sided document. GrossTotal must equal NetTotal plus TaxPayable. Mixed debit and credit sides are reported for review because the simple net comparison needs additional document context. Cancelled invoice amounts are excluded from the section debit and credit sums while the document remains part of the entry count.

Trace a total back to its lines

In the fictional billing example one credit line contains 100.00, the net total is 100.00, tax is 23.00 and gross is 123.00. Change GrossTotal to 124.00 to trigger PT-GROSS at that field. Review discounts, settlement amounts, exemptions and rounding before changing tax. The simple percentage estimate is a plausibility warning, with no determination that a tax rate or exemption is legally appropriate.

Customer, product and accounting references are checked against the corresponding master identifiers present in this file. External correction references cannot be proven without the referenced export and the complete chain. ATCUD checks cover shape only; they do not authenticate a series code. The sentinel 0 needs historical and applicability context. Hash values and signature chains require full cryptographic and export context and remain unchecked.

Understand the XSD example

The example linked below inserts UnexpectedForTest at the end of AuditFile. Our own small MIT test schema rejects that child at the reported line. It is not an AT schema and accepts much less detail for teaching purposes. The original AT download contains XSD 1.1 assertions, unsupported by the existing XSD 1.0 engine. Uploading that original leaves the XSD layer unexecuted; no assertions are silently removed. Independent rules alone cannot establish official XSD validity.

Primary sources and limits

AT 1.04_01 XSD is the structure reference, retrieved 6 November 2026, revision 17 May 2022. OECD terms do not automatically license AT adaptations. Our explanation and checks are independently written. No official Portuguese instructions or rulepack are copied.

XML syntax, supplied XSD, independent business checks, plausibility and unverified context remain separate. No AT certification/SVAT, legal suitability, accounting truth or submission acceptance is promised. No amounts or identifiers are automatically repaired. Use an authorised complete XSD 1.1 environment separately for the official original.

Portugal SAF-T validator →