SAF-T models
Reference for the SAF-T semantic models used in the Sovos Intelligence Query Builder.
What this domain is
Models in scope: 63 (the full accessible SAF-T family).
SAF-T (Standard Audit File for Tax) is a normalized, country-agnostic model of a company's complete accounting and tax records, based on the OECD SAF-T 2.0 specification and its national variants (Romanian D406, Portuguese SAF-T PT, French FEC, Polish JPK). It is the canonical source for anything grounded in the books: the general ledger, sales/purchase invoices, payments, stock movements, fixed assets, master data (customers, suppliers, products, chart of accounts), and tax codes.
Don't use SAF-T for live e-invoicing flows (that is CN) or for prepared VAT-return figures (that is VAT Filing).
How SAF-T is organized (family map)
The 63 models form a header to child hierarchy across several families. The main "fact" tables have _LINES children, which in turn have _ANALYSIS, _TAX_INFORMATION, and reference children.
| Family | Header / main | Child & related models |
|---|---|---|
| General ledger | SAFT_TRANSACTIONS (GL document) |
SAFT_TRANSACTIONS_LINES, _LINES_ANALYSIS, _LINES_TAX_INFORMATION; SAFT_JOURNALS; SAFT_GENERAL_LEDGER_ACCOUNTS |
| Sales/Purchase invoices | SAFT_INVOICES |
SAFT_INVOICES_LINES, _LINES_ANALYSIS, _LINES_MOVEMENT_REFERENCES, _LINES_ORDER_REFERENCES, _LINES_TAX_INFORMATION, SAFT_INVOICES_TAX_INFORMATION_TOTALS |
| Payments | SAFT_PAYMENTS |
SAFT_PAYMENTS_LINES, _LINES_ANALYSIS, _LINES_TAX_INFORMATION, _TAX_INFORMATION_TOTALS |
| Stock / inventory | SAFT_STOCK_MOVEMENTS, SAFT_PHYSICAL_STOCKS |
SAFT_STOCK_MOVEMENTS_LINES, _LINES_TAX_INFORMATION; SAFT_PHYSICAL_STOCKS_CHARACTERISTICS; SAFT_MOVEMENT_TYPES |
| Fixed assets | SAFT_ASSETS |
SAFT_ASSETS_SUPPLIERS, _TRANSACTIONS, _TRANSACTIONS_VALUATIONS, _VALUATIONS, _VALUATIONS_DEPRECIATION_FOR_PERIOD |
| Counterparts (customers/suppliers) | SAFT_COUNTERPARTS |
_ADDRESSES, _BALANCES, _BANK_ACCOUNTS, _CONTACTS, _CONTACTS_TITLES, _TAX_REGISTRATIONS |
| Audit-file header / entity | SAFT_HEADERS |
_ADDRESSES, _BANK_ACCOUNTS, _CONTACTS, _CONTACTS_TITLES, _OTHER_CRITERIA, _TAX_REGISTRATIONS |
| Owners | SAFT_OWNERS |
_ADDRESSES, _BANK_ACCOUNTS, _CONTACTS, _CONTACTS_TITLES, _TAX_REGISTRATIONS |
| Products | SAFT_PRODUCTS |
SAFT_PRODUCTS_TAXES |
| Tax codes | SAFT_TAX_CODES |
SAFT_TAX_CODES_BASE_RATES, SAFT_TAX_CODES_DETAILS |
| Analytical roll-ups (FACT) | - | SAFT_FACT_SALES_TOP_CUSTOMERS, SAFT_FACT_SALES_TOP_PRODUCTS, SAFT_FACT_SALES_PRODUCTS_CUSTOMERS, SAFT_FACT_PURCHASES_TOP_PRODUCTS, SAFT_FACT_PURCHASES_TOP_SUPPLIERS |
| Reference / dimensions | - | SAFT_ANALYSIS_TYPES, SAFT_TAXONOMIES, SAFT_UOM_TABLES |
SAF-T conventions (apply to every model)
- DIRECTION consolidates sales and purchases
-
DIRECTION = 'Outbound'means sales/customer-side.'Inbound'means purchase/supplier-side. Filter or group by it. The counterpart join key is(COUNTERPARTID, DIRECTION). - Standard join keys between SAF-T tables
-
TRANSACTIONID: GL transaction header to its lines/analysis/tax children (also referenced by payments and stock lines).JOURNALID:SAFT_JOURNALSto transactions.- Invoice key
(DIRECTION, INVOICENUMBER, INVOICEDATE, INVOICETYPE [, INVOICELINENUMBER]): invoice header to lines to line children. PAYMENTREFERENCE: payment header to payment children.MOVEMENTREFERENCE: stock-movement header to lines.MOVEMENTTYPE:SAFT_MOVEMENT_TYPES.ACCOUNTID:SAFT_GENERAL_LEDGER_ACCOUNTS.(TAXTYPE, TAXCODE):SAFT_TAX_CODES/_DETAILS/_BASE_RATES(andSAFT_PRODUCTS_TAXES).PRODUCTCODE:SAFT_PRODUCTS(and invoice lines, stock, physical stock).ASSETID:SAFT_ASSETS.(ANALYSISTYPE, ANALYSISID):SAFT_ANALYSIS_TYPES.(COUNTERPARTID, DIRECTION):SAFT_COUNTERPARTS(and its sub-tables). Legacy aliasesCUSTOMERID/SUPPLIERIDappear on FACT tables.REGISTRATIONNUMBER(entity tax id):SAFT_HEADERSand its sub-tables.OWNERID/REGISTRATIONNUMBER:SAFT_OWNERSand its sub-tables.
- Period dimensioning
-
PERIOD(month 1 to 12) plusPERIODYEAR(and sometimesPERIODMONTH). Master/header tables usePERIODSTART/END. - Foreign currency
-
The
(CURRENCYAMOUNT, CURRENCYCODE, EXCHANGERATE)triplet. Base amounts are in the file's default currency. - Country-agnostic UNIONs
-
Almost every model is a
UNION ALLacross country-specific sources. Columns that apply to only one country areNULLon the others. See per-model notes. -
_TAX_INFORMATION_TOTALSgrain - One row per (document, tax code) header total, not per line. Use it to reconcile line tax to document totals.
- Tenancy/lineage columns
-
On every model:
ORGANIZATIONID,COMPANYID,SOURCECOMPANYID,SOURCECOUNTRY,FILEIMPORTID,DATASOURCE.
SAF-T worked examples
- Monthly net/gross by direction (from the invoice header)
-
CODE
SELECT PERIODYEAR, PERIOD, DIRECTION, COUNT(*) AS INVOICES, SUM(NETTOTAL) AS NET, SUM(GROSSTOTAL) AS GROSS FROM SAFT_INVOICES WHERE PERIODYEAR = '2025' GROUP BY PERIODYEAR, PERIOD, DIRECTION ORDER BY PERIOD, DIRECTION; - VAT by tax code, reconciling line detail to the code master
-
CODE
SELECT ti.TAXTYPE, ti.TAXCODE, tc.DESCRIPTION, SUM(ti.TAXBASE) AS BASE, SUM(ti.TAXAMOUNT) AS TAX FROM SAFT_INVOICES_LINES_TAX_INFORMATION ti LEFT JOIN SAFT_TAX_CODES_DETAILS tc ON tc.TAXTYPE = ti.TAXTYPE AND tc.TAXCODE = ti.TAXCODE WHERE ti.PERIODYEAR = '2025' GROUP BY ti.TAXTYPE, ti.TAXCODE, tc.DESCRIPTION ORDER BY TAX DESC; - Top customers by sales, from the pre-built FACT roll-up (simple)
-
CODE
SELECT * FROM SAFT_FACT_SALES_TOP_CUSTOMERS ORDER BY /* the model's amount/measure column */ 1 LIMIT 20;
When in doubt about which columns a specific SAF-T model exposes, check its entry below.
SAFT_ANALYSIS_TYPES
Grain: one row per analytical-accounting dimension value (cost center / project / dept, keyed by ANALYSISTYPE+ANALYSISID).
Purpose: reference list of managerial / analytical dimensions used in the file; joined from transaction / payment / invoice analysis tables.
| Field | Type | Description | Example / notes |
|---|---|---|---|
| ANALYSISTYPE | text | Dimension type (cost center, project…). Entity-defined | Key with ANALYSISID |
| ANALYSISTYPEDESCRIPTION | text | Description of the dimension entry | |
| ANALYSISID | text | Specific value within type (e.g. CC100) | Key with ANALYSISTYPE |
| ANALYSISIDDESCRIPTION | text | Description of the specific value | |
| SOURCECOUNTRY | text | Country regime | global |
| SOURCECOMPANYID | text | Source ERP company (PROJECT_ID) | global |
| ORGANIZATIONID | text | Platform org | global |
| COMPANYID | text | Platform company | global |
| FILEIMPORTID | text | Import batch | global |
| DATASOURCE | text | Source connector | global |
Keys: (ANALYSISTYPE, ANALYSISID). Attributes: descriptions. Measures: none. Joins: <- SAFT_INVOICES_LINES_ANALYSIS, payment/transaction analysis tables on (ANALYSISTYPE, ANALYSISID).
SAFT_ASSETS
Grain: one row per fixed asset.
Purpose: fixed-asset master data (identification, acquisition, put-in-service, selection period).
| Field | Type | Description | Example / notes |
|---|---|---|---|
| ASSETID | VARCHAR(35) | Asset PK | "A1"."A10" |
| ACCOUNTID | VARCHAR(70) | FK -> SAFT_GENERAL_LEDGER_ACCOUNTS | "1011" |
| DESCRIPTION | VARCHAR(256) | Free-text asset description | "Asset 1" |
| PURCHASEORDERDATE | DATE | PO date | |
| DATEOFACQUISITION | DATE | Acquisition date | 2022-02-01 |
| STARTUPDATE | DATE | Put-into-service date | 2022-02-28 |
| COUNTRY | VARCHAR(300) | ISO2 country | RO |
| SOURCECOUNTRY | text | Country regime | |
| SELECTIONSTARTDATE / SELECTIONENDDATE | date | File selection window | |
| PERIODSTART / PERIODEND | num 1-12 | Selection period months | |
| PERIODSTARTYEAR / PERIODENDYEAR | num | Period years | |
| SOURCECOMPANYID, ORGANIZATIONID, COMPANYID, FILEIMPORTID, DATASOURCE | text | tenancy | global |
This model also includes the hidden system columns ID, MATCH_ID, STATUS, and ROW_ID_.
SAFT_ASSETS_SUPPLIERS
Grain: one row per supplier-address record for an asset acquisition.
Purpose: suppliers that fixed assets were bought from (with address).
| Field | Type | Description | Notes |
|---|---|---|---|
| SUPPLIERNAME | text | Supplier legal/commercial name | |
| SUPPLIERID | text | FK -> SAFT_COUNTERPARTS (DIRECTION='Inbound') | |
| STREETNAME, NUMBER, ADDITIONALADDRESSDETAIL, BUILDING, CITY, POSTALCODE, REGION, COUNTRY | text | Address parts | REGION=RO-xx, COUNTRY ISO2 |
| ADDRESSTYPE | text | Address type | StreetAddress… |
| ASSETID | text | FK -> SAFT_ASSETS | |
| SOURCECOUNTRY, SOURCECOMPANYID, ORGANIZATIONID, COMPANYID, FILEIMPORTID, DATASOURCE | text | tenancy | global |
Keys: ASSETID (FK), SUPPLIERID (FK to counterparts, Inbound). Measures: none. Joins: -> SAFT_ASSETS on ASSETID; -> SAFT_COUNTERPARTS on COUNTERPARTID/SUPPLIERID + DIRECTION='Inbound'.
SAFT_ASSETS_TRANSACTIONS
Grain: one row per asset transaction (acquisition / disposal / transfer / revaluation).
Purpose: transactions affecting fixed assets in the period; supplier address inlined for acquisitions.
| Field | Type | Description | Example / notes |
|---|---|---|---|
| ASSETTRANSACTIONID | text | Transaction PK | |
| ASSETID | text | FK -> SAFT_ASSETS | |
| ASSETTRANSACTIONTYPE | text | Type code | 10,20,…,130 |
| ASSETTRANSACTIONDATE | date | Transaction date | |
| DESCRIPTION | text | Free text | |
| TRANSACTIONID | text | FK -> SAFT_TRANSACTIONS | |
| ACQUISITIONANDPRODUCTIONCOSTSONTRANSACTION | num | Cost on txn | measure |
| BOOKVALUEONTRANSACTION | num | Book value on txn | measure |
| ASSETTRANSACTIONAMOUNT | num | Txn amount | measure |
| SUPPLIERID, SUPPLIERNAME | text | Supplier (inline) | |
| SUPPLIERSTREETNAME/NUMBER/ADDITIONALADDRESSDETAIL/BUILDING/CITY/POSTALCODE/REGION/COUNTRY/ADDRESSTYPE | text | Inlined supplier address | acquisitions only |
| SELECTIONSTARTDATE/ENDDATE, PERIODSTART/END, PERIODSTARTYEAR/ENDYEAR, MONTH | date/num | Period dims | MONTH 1-12 |
| tenancy cols | text | global |
Keys: ASSETTRANSACTIONID (PK), ASSETID/TRANSACTIONID/SUPPLIERID (FK). Measures: the three amount cols. Joins: -> SAFT_ASSETS (ASSETID); -> SAFT_ASSETS_TRANSACTIONS_VALUATIONS on txn id fields; -> SAFT_TRANSACTIONS (TRANSACTIONID).
SUPPLIER* means "acquisition" only.
SAFT_ASSETS_TRANSACTIONS_VALUATIONS
Grain: one row per valuation entry within an asset transaction.
Purpose: cost/valuation impact of an asset transaction.
| Field | Type | Description | Notes |
|---|---|---|---|
| ASSETID | text | FK -> SAFT_ASSETS | |
| ASSETTRANSACTIONID | text | FK -> SAFT_ASSETS_TRANSACTIONS | |
| ASSETTRANSACTIONDATE | date | Txn date | |
| ASSETTRANSACTIONTYPE | text | Type code | 10.130 |
| ASSETVALUATIONTYPE | text | Valuation type (accounting/fiscal) | ERP-defined |
| ACQUISITIONANDPRODUCTIONCOSTSONTRANSACTION | num | Cost | measure |
| BOOKVALUEONTRANSACTION | num | Book value | measure |
| ASSETTRANSACTIONAMOUNT | num | Amount | measure |
| MONTH | num 1-12 | Reporting month | |
| tenancy cols | text | global |
Keys: (ASSETID, ASSETTRANSACTIONID) FK. Joins: -> SAFT_ASSETS_TRANSACTIONS on transaction identifying fields.
SAFT_ASSETS_VALUATIONS
Grain: one row per asset valuation within the reporting period.
Purpose: acquisition cost, revaluation, depreciation, book value per asset.
| Field | Type | Description | Notes |
|---|---|---|---|
| ASSETID | text | FK -> SAFT_ASSETS | |
| ASSETVALUATIONTYPE | text | Valuation type | |
| VALUATIONCLASS | text | Tax-authority asset class | |
| ACQUISITIONANDPRODUCTIONCOSTSBEGIN / …END | num | APC begin/end | measure |
| INVESTMENTSUPPORT | num/text | Grants/state aid | |
| ASSETLIFEYEAR / ASSETLIFEMONTH | num | Useful life | |
| ASSETADDITION / TRANSFERS / ASSETDISPOSAL | num | Movements | measures |
| BOOKVALUEBEGIN / BOOKVALUEEND | num | Book value | measures |
| DEPRECIATIONMETHOD | text | Method | |
| DEPRECIATIONPERCENTAGE | num | Annual rate % | |
| DEPRECIATIONFORPERIOD / APPRECIATIONFORPERIOD | num | Period dep/appr | measures |
| ACCUMULATEDDEPRECIATION | num | Accum dep | measure |
| EXTRAORDINARYDEPRECIATIONMETHOD | text | Extra dep method | |
| EXTRAORDINARYDEPRECIATIONAMOUNTFORPERIOD | num | Extra dep amount | measure |
| SELECTIONSTART/ENDDATE, PERIODSTART/END(+YEAR) | date/num | Period dims | |
| tenancy cols | text | global |
Keys: ASSETID (FK). Measures: many amount cols. Joins: -> SAFT_ASSETS (ASSETID); -> SAFT_ASSETS_VALUATIONS_DEPRECIATION_FOR_PERIOD.
SAFT_ASSETS_VALUATIONS_DEPRECIATION_FOR_PERIOD
Grain: one row per extraordinary-depreciation entry against an asset valuation.
Purpose: impairment / accelerated depreciation entries in the period.
| Field | Type | Description | Notes |
|---|---|---|---|
| ASSETVALUATIONTYPE | text | Valuation type | |
| EXTRAORDINARYDEPRECIATIONMETHOD | text | Method | |
| EXTRAORDINARYDEPRECIATIONAMOUNTFORPERIOD | num | Amount | measure |
| ASSETID | text | FK -> SAFT_ASSETS | |
| tenancy cols | text | global |
Keys: ASSETID (FK). Joins: -> SAFT_ASSETS_VALUATIONS on asset+valuation identifying fields.
SAFT_COUNTERPARTS
Grain: one row per counterpart (customer OR supplier) per DIRECTION.
Purpose: consolidated customer+supplier master data with opening/closing balances. Consolidates customer and supplier master data across countries; some country-specific fields are NULL on rows from other countries.
| Field | Type | Description | Example / notes |
|---|---|---|---|
| DIRECTION | VARCHAR(300) | Outbound=customer / Inbound=supplier | |
| COUNTERPARTID | text | Counterpart PK (SAF-T CustomerID/SupplierID) | join with DIRECTION |
| COUNTERPARTNAME | text | Legal/commercial name | |
| REGISTRATIONNUMBER | text | Home-jurisdiction tax ID | NULL for PT rows |
| ACCOUNTID | text | FK -> GLA | |
| SELFBILLINGINDICATOR | text | Yes/No | |
| OPENINGDEBITBALANCE / OPENINGCREDITBALANCE | num(38,2) | Opening balances | measures; NULL for PT rows |
| CLOSINGDEBITBALANCE / CLOSINGCREDITBALANCE | num(38,2) | Closing balances | measures; NULL for PT rows |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION). Measures: four balance cols. Joins: <- SAFT_INVOICES, FACT tables, and _ADDRESSES/_CONTACTS/_BANK_ACCOUNTS/_TAX_REGISTRATIONS/_BALANCES on (COUNTERPARTID, DIRECTION); -> GLA on ACCOUNTID.
PT-sourced rows carry NULL balances + NULL RegistrationNumber (country consolidation).
SAFT_COUNTERPARTS_ADDRESSES
Grain: one row per counterpart address.
Purpose: addresses of customers/suppliers.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | join with DIRECTION |
| REGISTRATIONNUMBER | text | Tax ID | |
| STREETNAME, NUMBER, ADDITIONALADDRESSDETAIL, BUILDING, CITY, POSTALCODE, REGION, COUNTRY | text | Address parts | |
| ADDRESSTYPE | text | Address type | NULL for PT rows |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION) FK. Joins: -> SAFT_COUNTERPARTS.
PT branch fills address from customer table with NULL AddressType/Building
SAFT_COUNTERPARTS_BALANCES
Grain: one row per counterpart account balance for the period.
Purpose: opening/closing receivable (Outbound) / payable (Inbound) balances per counterpart.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| COUNTERPARTNAME | text | Name | |
| REGISTRATIONNUMBER | text | Tax ID | |
| ACCOUNTID | text | FK -> GLA | |
| SELFBILLINGINDICATOR | text | Yes/No | |
| OPENINGDEBIT/CREDITBALANCE, CLOSINGDEBIT/CREDITBALANCE | num | Balances | measures |
| SELECTIONSTART/ENDDATE, PERIODSTART/END(+YEAR) | date/num | Period dims | |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION), ACCOUNTID. Measures: four balances. Joins: -> SAFT_COUNTERPARTS (COUNTERPARTID+DIRECTION); -> GLA (ACCOUNTID).
SAFT_COUNTERPARTS_BANK_ACCOUNTS
Grain: one row per counterpart bank account.
Purpose: IBAN/BIC/bank identification of customers & suppliers.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| REGISTRATIONNUMBER | text | Tax ID | |
| IBANNUMBER | text | IBAN | |
| BANKACCOUNTNUMBER | text | Non-IBAN acct no | |
| BANKACCOUNTNAME | text | Holder name | |
| SORTCODE | text | Routing/sort code | |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION) FK. Joins: -> SAFT_COUNTERPARTS.
SAFT_COUNTERPARTS_CONTACTS
Grain: one row per contact person at a counterpart.
Purpose: contact persons of customers/suppliers. UNION RO customer+supplier+PT (PT maps CONTACT->FirstName, most name parts NULL).
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| REGISTRATIONNUMBER | text | Tax ID | NULL for PT |
| TITLE, FIRSTNAME, INITIALS, LASTNAMEPREFIX, LASTNAME, BIRTHNAME, SALUTATION | text | Name parts | mostly NULL for PT |
| TELEPHONE, FAX, EMAIL, WEBSITE | text | Contact info | |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION) FK. Joins: -> SAFT_COUNTERPARTS; <- SAFT_COUNTERPARTS_CONTACTS_TITLES.
SAFT_COUNTERPARTS_CONTACTS_TITLES
Grain: one row per (contact, title).
Purpose: academic/professional titles of counterpart contacts.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| REGISTRATIONNUMBER | text | Tax ID | |
| FIRSTNAME, LASTNAME | text | Contact identity | link to contacts |
| OTHERTITLES | text | Other titles | |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION) + (FIRSTNAME, LASTNAME) to contacts. Joins: -> SAFT_COUNTERPARTS_CONTACTS.
SAFT_COUNTERPARTS_TAX_REGISTRATIONS
Grain: one row per counterpart tax registration.
Purpose: VAT/other tax IDs of customers & suppliers. UNION RO cust+supp+PT (PT maps CustomerTaxId->TaxNumber, rest NULL).
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| REGISTRATIONNUMBER | text | Home tax ID | |
| TAXREGISTRATIONNUMBER | text | Reg no under tax type | |
| TAXTYPE | text | VAT/TVA/WHT/… (key w/ TAXCODE) | numeric RO codes seen |
| TAXNUMBER | text | Reg no under authority | |
| TAXAUTHORITY | text | Issuing authority | ANAF |
| TAXVERIFICATIONDATE | date | Last verified | |
| tenancy cols | text | global |
Keys: (COUNTERPARTID, DIRECTION) FK. Joins: -> SAFT_COUNTERPARTS.
SAFT_FACT_PURCHASES_TOP_PRODUCTS
Grain: one aggregated row per product per period (purchase side).
Purpose: analytical rollup of purchase-invoice lines by product (Inbound). Top-purchased-products.
| Field | Type | Description | Notes |
|---|---|---|---|
| ID | text | Surrogate row id | |
| ENTITYID | text | Reporting entity | |
| PRODUCTID | num | Internal product id | |
| PRODUCTCODE | text | FK -> SAFT_PRODUCTS | |
| PRODUCTDESCRIPTION | text | Product name | |
| QUANTITY | num | Qty | measure |
| DEBITAMOUNT / CREDITAMOUNT | num | Debit/credit (mutually exclusive) | measures |
| DOCUMENTTOTAL | num | Aggregate doc total | measure |
| TOTALNUMBERDOCUMENTS | num | # docs | measure |
| PERIOD | num 1-12 | Period | |
| tenancy cols | text | global |
Keys: PRODUCTCODE (join), ENTITYID. Measures: QUANTITY/DEBIT/CREDIT/DOCUMENTTOTAL/TOTALNUMBERDOCUMENTS. Derived from SAFT_INVOICES_LINES where invoice DIRECTION='Inbound'.
SAFT_FACT_PURCHASES_TOP_SUPPLIERS
Grain: one aggregated row per supplier per period.
Purpose: purchase invoices rolled up by supplier (Inbound). Top-suppliers.
| Field | Type | Description | Notes |
|---|---|---|---|
| ID | text | Row id | |
| ENTITYID | text | Reporting entity | |
| SUPPLIERINTERNALID | text | Internal supplier id | |
| SUPPLIERID | text | FK -> SAFT_COUNTERPARTS (Inbound); legacy alias of COUNTERPARTID | |
| SUPPLIERTAXID | text | Supplier VAT | |
| COMPANYNAME | text | Supplier name | |
| ACCOUNTID | text | FK -> GLA | |
| NETTOTAL / GROSSTOTAL | num | Totals | measures |
| TOTALDOCUMENTS | num | # docs | measure |
| PERIOD | num 1-12 | Period | |
| tenancy cols | text | global |
Keys: SUPPLIERID (=COUNTERPARTID Inbound), ACCOUNTID. Measures: NET/GROSS/TOTALDOCUMENTS. Derived from SAFT_INVOICES where DIRECTION='Inbound'.
SAFT_FACT_SALES_PRODUCTS_CUSTOMERS
Grain: one aggregated row per (product, customer, period).
Purpose: sales-invoice lines rolled up by product+customer (Outbound). Product-mix-per-customer.
| Field | Type | Description | Notes |
|---|---|---|---|
| ID | text | Row id | |
| ENTITYID | text | Reporting entity | |
| PRODUCTID | num | Internal product id | |
| PRODUCTCODE | VARCHAR(50) | FK -> SAFT_PRODUCTS | |
| PRODUCTDESCRIPTION | VARCHAR(256) | Product name | |
| CUSTOMERID | VARCHAR(256) | FK -> SAFT_COUNTERPARTS (Outbound); legacy alias | |
| CUSTOMERNAME | VARCHAR(256) | Customer name | |
| QUANTITY | num(20,3) | Qty | measure |
| DEBITAMOUNT / CREDITAMOUNT | num(20,6) | Debit/credit | measures |
| DOCUMENTTOTAL | num(20,6) | Aggregate total | measure |
| TOTALNUMBERDOCUMENTS | num | # docs | measure |
| PERIOD | num 1-12 | Period | |
| tenancy cols | text | global |
Keys: PRODUCTCODE, CUSTOMERID (=COUNTERPARTID Outbound). Derived from SAFT_INVOICES + LINES where DIRECTION='Outbound'.
SAFT_FACT_SALES_TOP_CUSTOMERS
Grain: one aggregated row per customer per period.
Purpose: sales invoices rolled up by customer (Outbound). Top-customers.
| Field | Type | Description | Notes |
|---|---|---|---|
| ID | text | Row id | |
| ENTITYID | text | Reporting entity | |
| CUSTOMERINTERNALID | text | Internal customer id | |
| CUSTOMERID | VARCHAR(256) | FK -> SAFT_COUNTERPARTS (Outbound); legacy alias | |
| CUSTOMERTAXID | VARCHAR(50) | Customer VAT | |
| COMPANYNAME | VARCHAR(256) | Customer name | |
| ACCOUNTID | VARCHAR(256) | FK -> GLA | |
| NETTOTAL / GROSSTOTAL | num(20,6) | Totals | measures |
| TOTALDOCUMENTS | num | # docs | measure |
| PERIOD | num 1-12 | Period | |
| tenancy cols | text | global |
Keys: CUSTOMERID (=COUNTERPARTID Outbound), ACCOUNTID. Derived from SAFT_INVOICES where DIRECTION='Outbound'.
SAFT_FACT_SALES_TOP_PRODUCTS
Grain: one aggregated row per product per period (sales side).
Purpose: sales-invoice lines rolled up by product (Outbound). Top-products.
| Field | Type | Description | Notes |
|---|---|---|---|
| ID, ENTITYID | text | Row / entity | |
| PRODUCTID | num | Internal product id | |
| PRODUCTCODE | text | FK -> SAFT_PRODUCTS | |
| PRODUCTDESCRIPTION | text | Product name | |
| QUANTITY | num | Qty | measure |
| DEBITAMOUNT / CREDITAMOUNT | num | Debit/credit | measures |
| DOCUMENTTOTAL | num | Aggregate total | measure |
| TOTALNUMBERDOCUMENTS | num | # docs | measure |
| PERIOD | num 1-12 | Period | |
| tenancy cols | text | global |
Keys: PRODUCTCODE. Derived from SAFT_INVOICES_LINES where DIRECTION='Outbound'.
SAFT_GENERAL_LEDGER_ACCOUNTS
Grain: one row per GL account (chart of accounts).
Purpose: chart of accounts + opening/closing balances. Chart variant set by header TAXACCOUNTINGBASIS.
| Field | Type | Description | Example / notes |
|---|---|---|---|
| ACCOUNTID | text | Account PK | |
| ACCOUNTDESCRIPTION | text | Account label | |
| STANDARDACCOUNTID | text | Mapping to standard CoA | |
| ACCOUNTTYPE | text | Asset/Liability/… | RO values: Activ / Pasiv / Bifunctional |
| GROUPINGCATEGORY / GROUPINGCODE | text | Hierarchy rollup | |
| ACCOUNTCREATIONDATE | date | Created | |
| OPENINGDEBIT/CREDITBALANCE, CLOSINGDEBIT/CREDITBALANCE | num(18,2) | Balances | measures |
| SELECTIONSTART/ENDDATE, PERIODSTART/END(+YEAR), REPORTINGSTART/ENDDATE | date/num | Period dims | |
| tenancy cols | text | global |
Keys: ACCOUNTID (PK). Measures: four balances. Joins: <- SAFT_COUNTERPARTS, SAFT_ASSETS, SAFT_INVOICES(_LINES), transactions, FACT tables on ACCOUNTID.
SAFT_HEADERS
Grain: one row per submitted SAF-T file (segment).
Purpose: file header. Covers reporting entity, period, currency, tax-accounting basis, software, schema version.
| Field | Type | Description | Example / notes |
|---|---|---|---|
| AUDITFILEVERSION | VARCHAR(9) | Schema version | "2.0" |
| AUDITFILECOUNTRY | VARCHAR(2) | File country ISO2 | RO |
| AUDITFILEREGION | text | Region | RO-xx |
| AUDITFILEDATECREATED | date | Generated date | |
| SOFTWARECOMPANYNAME / SOFTWAREID / SOFTWAREVERSION | text | Producing software | |
| REGISTRATIONNUMBER | VARCHAR(35) | Entity tax ID (JOIN KEY to header sub-tables) | "0013241086" |
| NAME | VARCHAR(70) | Entity legal name | company legal name |
| DEFAULTCURRENCYCODE | VARCHAR(3) | Base currency | RON |
| TAXREPORTINGJURISDICTION | text | Filing jurisdiction | |
| COMPANYENTITY / TAXENTITY | text | Sub-entity / division | |
| DOCUMENTTYPE | text | SAF-T doc type | |
| HEADERCOMMENT | text | Free comment | |
| SEGMENTINDEX / TOTALSEGMENTSINSEQUENCE | num | Multi-file segmentation | |
| TAXACCOUNTINGBASIS | VARCHAR(18) | Accounting basis -> drives CoA variant | A / I / IFRS / BANK / INSURANCE / NORMA39... |
| SELECTIONSTART/ENDDATE, PERIODSTART/END(+YEAR) | date/num | Reporting-period selection window and period bounds. | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (join key to header sub-tables). Joins: <- SAFT_HEADERS_ADDRESSES/_CONTACTS/_BANK_ACCOUNTS/_TAX_REGISTRATIONS/_OTHER_CRITERIA on REGISTRATIONNUMBER.
The PERIOD-related columns (PERIODSTART, PERIODEND, and their year variants) are NULL on this model.
SAFT_HEADERS_ADDRESSES
Grain: one row per address of the reporting entity.
Purpose: entity addresses (legal seat, postal, billing…).
| Field | Type | Description | Notes |
|---|---|---|---|
| REGISTRATIONNUMBER | text | FK -> SAFT_HEADERS | |
| STREETNAME, NUMBER, ADDITIONALADDRESSDETAIL, BUILDING, CITY, POSTALCODE, REGION, COUNTRY | text | Address parts | |
| ADDRESSTYPE | text | Address type | |
| tenancy cols (no SOURCECOUNTRY column here) | text | ORGANIZATIONID/COMPANYID, and so on. Present |
Keys: REGISTRATIONNUMBER (FK). Joins: -> SAFT_HEADERS.
SAFT_HEADERS_BANK_ACCOUNTS
Grain: one row per bank account of the reporting entity.
Purpose: the company's own IBAN/BIC/bank accounts (vs counterpart ones).
| Field | Type | Description | Notes |
|---|---|---|---|
| REGISTRATIONNUMBER | text | FK -> SAFT_HEADERS | |
| IBANNUMBER, BANKACCOUNTNUMBER, BANKACCOUNTNAME, SORTCODE | text | Bank details | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (FK). Joins: -> SAFT_HEADERS.
SAFT_HEADERS_CONTACTS
Grain: one row per contact person of the reporting entity.
Purpose: entity's own contacts (employees/reps).
| Field | Type | Description | Notes |
|---|---|---|---|
| REGISTRATIONNUMBER | text | FK -> SAFT_HEADERS | |
| TITLE, FIRSTNAME, INITIALS, LASTNAMEPREFIX, LASTNAME, BIRTHNAME, SALUTATION | text | Name parts | |
| TELEPHONE, FAX, EMAIL, WEBSITE | text | Contact info | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (FK). Joins: -> SAFT_HEADERS; <- SAFT_HEADERS_CONTACTS_TITLES.
SAFT_HEADERS_CONTACTS_TITLES
Grain: one row per (entity contact, title).
Purpose: titles of the entity's contact persons.
| Field | Type | Description | Notes |
|---|---|---|---|
| REGISTRATIONNUMBER | text | FK -> SAFT_HEADERS | |
| OTHERTITLES | text | Titles | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (FK, plus FirstName/LastName to contacts). Joins: -> SAFT_HEADERS_CONTACTS.
SAFT_HEADERS_OTHER_CRITERIA
Grain: one row per additional selection criterion of the file.
Purpose: extra filters applied when generating the SAF-T file.
| Field | Type | Description | Notes |
|---|---|---|---|
| REGISTRATIONNUMBER | text | FK -> SAFT_HEADERS | |
| TAXREPORTINGJURISDICTION | text | Filing jurisdiction | |
| OTHERCRITERIA | text | Free-text criterion | |
| SELECTIONSTART/ENDDATE, PERIODSTART/END(+YEAR) | date/num | Period dims | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (FK). Joins: -> SAFT_HEADERS.
SAFT_HEADERS_TAX_REGISTRATIONS
Grain: one row per tax registration of the reporting entity.
Purpose: entity's own VAT/tax IDs across jurisdictions.
| Field | Type | Description | Notes |
|---|---|---|---|
| TAXREGISTRATIONNUMBER | text | Reg no under a tax type | |
| TAXTYPE | text | VAT/TVA/WHT/… | RO numeric codes |
| TAXNUMBER | text | Reg no under authority | |
| TAXAUTHORITY | text | Issuing authority | ANAF |
| TAXVERIFICATIONDATE | date | Last verified | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: REGISTRATIONNUMBER (implicit, from header). Joins: -> SAFT_HEADERS.
An entity has multiple rows in this model when it is VAT-registered in more than one country.
SAFT_INVOICES
Grain: one row per invoice header (sales OR purchase), keyed by DIRECTION.
Purpose: sales+purchase invoice headers. Consolidates sales and purchase invoice headers across countries; some country-specific columns (e.g. ATCUD, HASH) are NULL on rows from other countries.
Selected fields (full set is large; grouped):
| Field | Type | Description | Example / notes |
|---|---|---|---|
| DIRECTION | VARCHAR(300) | Outbound/Inbound | "Outbound" |
| INVOICENUMBER | text | Invoice no | "FT 2025/126", "NC 2025/3" |
| INVOICEDATE | DATE | Issue date | 2025-10-14 |
| INVOICETYPE | text | Type code | "FT" (invoice), "NC" (credit note); many numeric codes |
| SELFBILLINGINDICATOR | text | Yes/No | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS (+DIRECTION) | "2818798" |
| COUNTERPARTNAME | text | Counterpart name | "JumpStart Demo Ventures" |
| NETTOTAL / GROSSTOTAL | num(15,2) | Net / gross | 10000 / 12300 |
| AMOUNT | num | Doc amount (default ccy) | |
| CURRENCYAMOUNT / CURRENCYCODE / EXCHANGERATE | num/text | FX triplet | |
| SHIPPINGCOSTSAMOUNTTOTAL | num | Shipping total | |
| ACCOUNTID | text | FK -> GLA | |
| GLPOSTINGDATE | date | GL posting date | |
| PERIOD / PERIODYEAR | num | Period | PERIOD=month; |
| BATCHID, PAYMENTTERMS, PAYMENTMECHANISM, RECEIPTNUMBERS | text | Payment/posting refs | PAYMENTMECHANISM codes 1/10/20/30/42/48/49/97/ZZZ |
| SHIPFROM* (Country,Region,City,PostalCode,StreetName,Building,Number,LocationId,AdditionalAddressDetail,WarehouseId,Ucr,DeliveryId,DeliveryDate,AddressType) | text/date | Ship-from address | |
| SHIPTO* (same set minus Warehouse/Ucr) | text/date | Ship-to address | |
| BRANCHSTORENUMBER | text | POS/branch | |
| SETTLEMENTDATE / SETTLEMENTDISCOUNT | date/text | Settlement | |
| ATCUD, HASH, HASHCONTROL, EACCODE, SYSTEMENTRYDATE, MOVEMENTSTARTTIME, MOVEMENTENDTIME, INVOICESTATUS, INVOICESTATUSDATE, REASON, SERIES, INVOICEINTERNALTYPE, INVOICESEQUENCENUMBER, NUMBEROFLINES, TAXPAYABLE, SIGNEDNETTOTAL, SIGNEDGROSSTOTAL, SIGNEDTAXPAYABLE, BALANCE, SIGNEDBALANCE | text/num/ts | PT-variant fields - NULL for RO/generic rows | INVOICESTATUS in {N,A,F,S,R} |
| tenancy cols | text | global |
Keys: (DIRECTION, INVOICENUMBER, INVOICEDATE, INVOICETYPE); COUNTERPARTID+DIRECTION (FK), ACCOUNTID (FK). Measures: NET/GROSS/AMOUNT/TAXPAYABLE/BALANCE/signed variants/shipping. Joins: -> SAFT_INVOICES_LINES on invoice id fields; -> SAFT_COUNTERPARTS; -> GLA; SAFT_INVOICES_TAX_INFORMATION_TOTALS (not in batch).
Heavy NULL-padded UNION (RO rows have PT fields NULL). Hidden system columns: ID, MATCH_ID, STATUS, ROW_ID_, and TOTALCOUNT.
SAFT_INVOICES_LINES
Grain: one row per invoice line item (sales OR purchase).
Purpose: invoice detail lines - qty, unit price, amounts, product ref, addresses. Consolidates invoice detail lines across countries.
Selected fields (grouped):
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| INVOICENUMBER, INVOICEDATE, INVOICETYPE | text/date | Parent invoice key | |
| INVOICELINENUMBER | text | Line no (join to lines) | |
| SEQUENTIALLINENUMBER | num | Stable ingestion sequence | |
| ACCOUNTID | text | FK -> GLA | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS (+DIRECTION) | |
| GOODSSERVICESID | text | G/S | |
| PRODUCTCODE | text | FK -> SAFT_PRODUCTS | |
| PRODUCTDESCRIPTION, DESCRIPTION | text | Names | |
| QUANTITY | num(38,8) | Qty | measure |
| INVOICEUOM | text | UoM | |
| UOMTOUOMBASECONVERSIONFACTOR | num | UoM conversion | |
| UNITPRICE | num(38,8) | Unit price | measure |
| DEBITCREDITINDICATOR | text | D/C | |
| DEBITAMOUNT / CREDITAMOUNT | num(15,2) | PT-only debit/credit (NULL for RO/generic; NULL in the SALES/PURCHASES branches) | |
| INVOICELINEAMOUNT | num(38,2) | Line net (default ccy) | measure |
| INVOICELINECURRENCYCODE/AMOUNT/EXCHANGERATE | text/num | FX triplet | |
| TAXBASE, SETTLEMENTAMOUNT, TAXEXEMPTIONCODE | num/text | PT-branch tax fields (NULL for RO) | exemption codes M01/M02/… |
| SHIPPINGCOSTSAMOUNT/CURRENCYCODE/CURRENCYAMOUNT/EXCHANGERATE | num/text | Shipping | |
| TAXPOINTDATE | date | VAT chargeability date | |
| CREDITNOTEREFERENCE / CREDITNOTEREASON | text | Credit-note refs | |
| SHIPFROM* / SHIPTO* (full address sets) | text/date | Addresses | |
| INVOICESTATUS, SERIES, INVOICEINTERNALTYPE, INVOICESEQUENCENUMBER, SIGNEDTAXPAYABLE, SIGNEDGROSSTOTAL, SIGNEDBALANCE | text/num | PT-branch header echoes (NULL for RO) | |
| PERIOD / PERIODYEAR / PERIODMONTH | num | Period dims | |
| tenancy cols | text | global |
Keys: (DIRECTION, INVOICENUMBER, INVOICEDATE, INVOICETYPE, INVOICELINENUMBER); PRODUCTCODE, ACCOUNTID, COUNTERPARTID (FK). Measures: QUANTITY/UNITPRICE/INVOICELINEAMOUNT/DEBIT/CREDIT/TAXBASE. Joins: -> SAFT_INVOICES; -> SAFT_PRODUCTS (PRODUCTCODE); <- SAFT_INVOICES_LINES_ANALYSIS/_MOVEMENT_REFERENCES/_ORDER_REFERENCES; line tax in SAFT_INVOICES_LINES_TAX_INFORMATION (not in batch).
DEBIT/CREDIT + several columns explicitly NULL AS. in the RO/generic UNION branches - populated only in the PT branch.
SAFT_INVOICES_LINES_MOVEMENT_REFERENCES
Grain: one row per link from an invoice line to a stock-movement document.
Purpose: references from invoice lines to delivery/stock movements. UNION RO sales+purchase (purchase branch NULLs InvoiceType).
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| INVOICENUMBER, INVOICEDATE, INVOICETYPE, INVOICELINENUMBER, SEQUENTIALLINENUMBER | text/date/num | Line key | InvoiceType NULL on purchase branch |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| MOVEMENTREFERENCE | text | FK -> SAFT_STOCK_MOVEMENTS | |
| date | FROMDATE / TODATE / DELIVERYDATE | Movement dates | |
| PERIOD / PERIODYEAR / PERIODMONTH | num | Period | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: line key; MOVEMENTREFERENCE (FK). Joins: -> SAFT_INVOICES_LINES; -> SAFT_STOCK_MOVEMENTS (not in batch).
SAFT_INVOICES_LINES_ANALYSIS
Grain: one row per analytical allocation on an invoice line.
Purpose: managerial-accounting (cost center/project) allocations of invoice lines. UNION RO sales+purchase line analysis.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| INVOICENUMBER, INVOICEDATE, INVOICETYPE, INVOICELINENUMBER, SEQUENTIALLINENUMBER | text/date/num | Line key | |
| ACCOUNTID | text | FK -> GLA | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| ANALYSISTYPE / ANALYSISID | text | FK -> SAFT_ANALYSIS_TYPES | |
| AMOUNT | num | Allocated amount | measure |
| CURRENCYCODE / CURRENCYAMOUNT / EXCHANGERATE | text/num | FX triplet | |
| PERIOD / PERIODYEAR / PERIODMONTH | num | Period | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: line key + (ANALYSISTYPE, ANALYSISID). Joins: -> SAFT_INVOICES_LINES; -> SAFT_ANALYSIS_TYPES.
SAFT_INVOICES_LINES_ORDER_REFERENCES
Grain: one row per link from an invoice line to an order document.
Purpose: references from invoice lines to purchase/sales orders. UNION RO sales+purchase.
| Field | Type | Description | Notes |
|---|---|---|---|
| DIRECTION | text | Outbound/Inbound | |
| INVOICENUMBER, INVOICEDATE, INVOICETYPE, INVOICELINENUMBER, SEQUENTIALLINENUMBER | text/date/num | Line key | |
| COUNTERPARTID | text | FK -> SAFT_COUNTERPARTS | |
| ORIGINATINGON | date | Order origination date | |
| ORDERDATE | date | Order date | |
| PERIOD / PERIODYEAR / PERIODMONTH | num | Period | |
| COUNTRY | text | ISO2 | |
| tenancy cols | text | global |
Keys: line key. Joins: -> SAFT_INVOICES_LINES.
SAFT_TRANSACTIONS_LINES_TAX_INFORMATION
Grain: one row per tax entry on a GL transaction line.
Purpose: per-line tax breakdown for GL transactions.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RecordId | VARCHAR | GL line id within transaction | key |
| TransactionId | VARCHAR | FK → SAFT_TRANSACTIONS | key |
| JournalId | VARCHAR | FK → SAFT_JOURNALS | key |
| TransactionType | VARCHAR | Transaction type | attribute |
| Period / PeriodYear | NUMBER | month 1-12 / year | |
| TaxType | VARCHAR | Tax type; join w/ TaxCode → SAFT_TAX_CODES(_DETAILS) | VAT,TVA,WHT,TAX-IMP,150,604,… |
| TaxCode | VARCHAR | Specific code under TaxType | L1-L26,A1-A5,N1,N2,150010,… |
| TaxPercentage | NUMBER | Rate % applied | measure |
| TaxBase | NUMBER | Taxable base, default currency | measure |
| TaxBaseDescription | VARCHAR | Base qualifier ('net of tax' and so on.) | attribute |
| TaxAmount | NUMBER | Tax amount, default currency | measure |
| TaxCurrencyCode | VARCHAR | ISO FX code of tax | RON,EUR,… |
| TaxCurrencyAmount | NUMBER | Tax in foreign currency | measure |
| TaxExchangeRate | NUMBER | FX rate | measure |
| TaxExemptionReason | VARCHAR | Exemption reason (export, ICS, reverse charge) | attribute |
| TaxDeclarationPeriod | VARCHAR | Declaration period (YYYY-MM) | attribute |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | VARCHAR | scoping/lineage |
Keys: (RecordId,TransactionId,JournalId); (TaxType,TaxCode). Measures: TaxPercentage, TaxBase, TaxAmount + FX.
SAFT_INVOICES_TAX_INFORMATION_TOTALS
- Grain
- One row = an invoice header-level tax total, summarized per tax code (per invoice, per tax code). Not per line.
- Purpose
-
Header-level tax totals used to validate that the sum of line tax amounts equals the document tax total. Joins to
SAFT_INVOICESon the invoice-identifying fields and toSAFT_TAX_CODESon(TAXTYPE, TAXCODE).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| Direction | TEXT | Outbound (sales) / Inbound (purchase). |
Outbound, Inbound |
| InvoiceNumber | TEXT | Invoice document number. | invoice-key component |
| InvoiceDate | DATE | Invoice issue date. | invoice-key component |
| InvoiceType | TEXT | Invoice-type code. | 380,381,FT,NC,… |
| AccountId | TEXT | FK → SAFT_GENERAL_LEDGER_ACCOUNTS. | |
| CounterPartId | TEXT | FK → SAFT_COUNTERPARTS on (COUNTERPARTID, DIRECTION). |
Outbound=customer, Inbound=supplier |
| TaxType | TEXT | Type of tax; join key with TaxCode. | VAT,TVA,WHT,numeric codes |
| TaxCode | TEXT | Tax code under TaxType. | L1…, A1…, 604010… |
| TaxPercentage | NUMBER | Tax-rate percentage. | |
| TaxBase | NUMBER | Taxable base, file default currency. | measure |
| TaxBaseDescription | TEXT | Free-text base qualifier. | |
| TaxAmount | NUMBER | Tax total for this code on the document. | measure |
| CurrencyCode | TEXT | ISO 4217 code when in a foreign currency. | RON, EUR, USD,… |
| CurrencyAmount | NUMBER | Main amount in foreign currency. | pair with ExchangeRate |
| ExchangeRate | NUMBER | FX rate to reporting currency. | |
| TaxExemptionReason | TEXT | Exemption reason (free text). | |
| TaxDeclarationPeriod | TEXT | Declaration period (YYYY-MM). | |
| Period / PeriodYear / PeriodMonth | TEXT | Period dimensioning. | 1…12 |
| Country | TEXT | ISO country the record applies to. | RO, PT, FR, DE,… |
| SourceCountry | TEXT | UPPER(SDA_COUNTRY) source regime. | RO |
| SourceCompanyId | TEXT | Source-ERP company id. | lineage |
| OrganizationId | TEXT | Platform organization. | tenancy |
| CompanyId | TEXT | Platform company (SDA_COMPANY_ID). |
tenancy |
| FileImportId | TEXT | Ingestion batch id. | lineage |
| DataSource | TEXT | Source connector/system. | lineage |
- Keys vs attributes vs measures
-
Keys: invoice key
(DIRECTION, INVOICENUMBER, INVOICEDATE, INVOICETYPE)plus(TAXTYPE, TAXCODE). FKsACCOUNTID,(COUNTERPARTID, DIRECTION). Measures:TaxAmount,TaxBase,TaxPercentage,CurrencyAmount,ExchangeRate. Rest attributes. - Joins
-
→
SAFT_INVOICES(invoice key). →SAFT_TAX_CODES/_DETAILSon(TAXTYPE, TAXCODE). →SAFT_GENERAL_LEDGER_ACCOUNTS. →SAFT_COUNTERPARTS. - Notes
-
This is the header-total counterpart to
SAFT_INVOICES_LINES_TAX_INFORMATION. Use it to reconcile line tax sums to document totals. Do not join it to lines without aggregating, or amounts multiply. Currently RO-only UNION (RO sales + RO purchase). Hidden system columns present.
SAFT_TRANSACTIONS
Grain: one row per accounting document (GL transaction header).
Purpose: headers of general-ledger accounting transactions posted in the period.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| TransactionId | VARCHAR | PK of the accounting entry/journal voucher; join key from lines | key |
| JournalId | VARCHAR | FK → SAFT_JOURNALS | key |
| TransactionDate | DATE | GL posting date (distinct from doc date) | |
| TransactionType | VARCHAR | Transaction type; source-ERP-defined (normal, reversal, opening, closing) | attribute |
| Description | VARCHAR | Free-text header description | attribute |
| DebitAmount | NUMBER(18,2) | Debit in default currency; mutually excl. with credit | measure |
| CreditAmount | NUMBER(18,2) | Credit in default currency | measure |
| CustomerId | VARCHAR | FK → counterpart (Outbound); legacy | key |
| SupplierId | VARCHAR | FK → counterpart (Inbound); legacy | key |
| SourceId | VARCHAR | User/source that created doc in ERP | attribute |
| BatchId | VARCHAR | Posting batch id | attribute |
| SystemId | VARCHAR | Internal ERP system id | attribute |
| SystemEntryDate | (date/ts) | When doc entered ERP | attribute |
| GlPostingDate | DATE | GL posting date; may differ from doc date | attribute |
| Period | NUMBER | Reporting month 1-12 | 1-12 |
| PeriodYear | NUMBER | Reporting year | |
| SourceCountry | VARCHAR | Numeric/source-country indicator (from UPPER(COUNTRY)) | RO etc. |
| SourceCompanyId | VARCHAR | Source ERP company id (PROJECT_ID) | attribute |
| OrganizationId | VARCHAR | Platform org id | tenant |
| CompanyId | VARCHAR | Platform company id | tenant |
| FileImportId | VARCHAR | Ingestion batch id | attribute |
| DataSource | VARCHAR | Connector/source | SAFT |
Keys: TransactionId (PK), JournalId/CustomerId/SupplierId (FK). Measures: DebitAmount, CreditAmount. Rest attributes/tenant.
SAFT_TRANSACTIONS_LINES
Grain: one row per GL posting line (debit or credit) within a transaction.
Purpose: detail debit/credit postings against an account.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RecordId | VARCHAR | Line id within transaction; (RecordId+TransactionId)=unique | key |
| TransactionId | VARCHAR | FK → SAFT_TRANSACTIONS | key |
| JournalId | VARCHAR | FK → SAFT_JOURNALS | key |
| TransactionDate | DATE | GL posting date | |
| TransactionType | VARCHAR | Transaction type | attribute |
| Period / PeriodYear | NUMBER | month 1-12 / year | |
| AccountId | VARCHAR | FK → SAFT_GENERAL_LEDGER_ACCOUNTS | key |
| ValueDate | DATE | Value date; may differ from TransactionDate | attribute |
| SourceDocumentId | VARCHAR | Ref to source doc (invoice/payment/ and so on.) | attribute |
| CustomerId / SupplierId | VARCHAR | FK → counterpart (Outbound/Inbound); legacy | key |
| Description | VARCHAR | Line description | attribute |
| DebitAmount | NUMBER(18,2) | Debit in default currency (excl. w/ credit) | measure |
| DebitCurrencyCode | VARCHAR | ISO 4217 FX code of debit | RON,EUR,USD,GBP,CHF,PLN,HUF,CZK |
| DebitCurrencyAmount | NUMBER | Debit in foreign currency | measure |
| DebitExchangeRate | NUMBER | FX rate for debit | measure |
| CreditAmount | NUMBER(18,2) | Credit in default currency | measure |
| CreditCurrencyCode | VARCHAR | ISO 4217 FX code of credit | as above |
| CreditCurrencyAmount | NUMBER | Credit in foreign currency | measure |
| CreditExchangeRate | NUMBER | FX rate for credit | measure |
| SourceCountry | VARCHAR | source-country | |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | VARCHAR | scoping/lineage | tenant/attr |
Keys: RecordId+TransactionId, JournalId, AccountId, CustomerId/SupplierId. Measures: debit/credit amounts + FX.
SAFT_TRANSACTIONS_LINES_ANALYSIS
Grain: one row per analytical allocation on a GL transaction line.
Purpose: managerial-accounting splits (cost center/project/ and so on) of a GL line.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| JournalId | VARCHAR | FK → SAFT_JOURNALS | key |
| TransactionId | VARCHAR | FK → SAFT_TRANSACTIONS | key |
| RecordId | VARCHAR | GL line id within transaction | key |
| TransactionType | VARCHAR | Transaction type | attribute |
| AnalysisType | VARCHAR | Analytical dimension (cost center/project/dept); join w/ AnalysisId → SAFT_ANALYSIS_TYPES | key |
| AnalysisId | VARCHAR | Value within AnalysisType (e.g. CC100) | key |
| AnalysisAmount | NUMBER | Amount allocated, default currency | measure |
| AnalysisCurrencyCode | VARCHAR | ISO FX code | RON,EUR,… |
| AnalysisCurrencyAmount | NUMBER | Amount in foreign currency | measure |
| AnalysisExchangeRate | NUMBER | FX rate | measure |
| Period / PeriodYear | NUMBER | month 1-12 / year | |
| Country | VARCHAR | ISO-2 country | RO,PT,… |
| SourceCountry | VARCHAR | source-country | |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | VARCHAR | scoping/lineage |
Keys: (JournalId,TransactionId,RecordId) line ref; (AnalysisType,AnalysisId). Measures: analysis amounts.
SAFT_INVOICES_LINES_TAX_INFORMATION
- Grain
- One row = the tax breakdown for a single invoice line (per invoice line, per tax entry). For VAT, this is the per-line tax detail.
- Purpose
-
Tax information (type, code, base, amount, rate) recorded against each invoice line. Joins to
SAFT_INVOICES_LINESon the line-identifying fields and toSAFT_TAX_CODESon(TAXTYPE, TAXCODE).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| Direction | TEXT | Outbound (sales) or Inbound (purchase). |
Outbound, Inbound |
| InvoiceNumber | TEXT | Invoice document number. | line-key component |
| InvoiceDate | DATE | Invoice issue date. | line-key component |
| InvoiceType | TEXT | Invoice-type code (tax-authority taxonomy). | 380, 381, FT, NC (see full list in notes) |
| InvoiceLineNumber | TEXT | Line identifier; joins to SAFT_INVOICES_LINES. | line-key component |
| SequentialLineNumber | TEXT | Stable ingestion-assigned line sequence within the document. | NULL on PT branch |
| AccountId | TEXT | FK → SAFT_GENERAL_LEDGER_ACCOUNTS. | NULL on PT branch |
| CounterPartId | TEXT | FK → SAFT_COUNTERPARTS (join on (COUNTERPARTID, DIRECTION)). |
Outbound=customer id, Inbound=supplier id |
| TaxType | TEXT | Type of tax; join key with TaxCode → SAFT_TAX_CODES. | VAT, TVA, WHT, TAX-IMP, numeric codes 604,633… |
| TaxCode | TEXT | Specific tax code under TaxType. | L1…L14, A1…A5, N1,N2, 150010,604010… |
| TaxCountryRegion | TEXT | Country/region code where tax applies (PT branch only). | RO-AB,RO-CJ,RO-B (Romanian county codes); NULL on RO/generic branch |
| TaxPercentage | NUMBER | Tax-rate percentage applied. | statutory VAT rate |
| TaxBase | NUMBER | Taxable amount, in file default currency. | NULL on PT branch |
| TaxBaseDescription | TEXT | Free-text qualifier of the base (e.g. "net of tax"). | NULL on PT branch |
| TaxAmount | NUMBER | Tax amount, in file default currency. | measure |
| TaxCurrencyCode | TEXT | ISO 4217 code when tax is in a foreign currency. | RON, EUR, USD, GBP, CHF, PLN, HUF, CZK; NULL on PT branch |
| TaxCurrencyAmount | NUMBER | Tax amount in the foreign currency. | pair with TaxExchangeRate |
| TaxExchangeRate | NUMBER | FX rate to reporting currency. | NULL on PT branch |
| TaxExemptionReason | TEXT | Free-text exemption reason (export, intra-community, reverse charge). | NULL on PT branch |
| TaxDeclarationPeriod | TEXT | VAT declaration period (typically YYYY-MM). | NULL on PT branch |
| Period | TEXT | Reporting month (1-12) or YYYY-MM. | 1…12 |
| PeriodYear | TEXT | Reporting year. | NULL on PT branch |
| PeriodMonth | TEXT | Reporting month 1-12. | 1…12 |
| SourceCountry | TEXT | UPPER(COUNTRY) of source regime. | RO |
| SourceCompanyId | TEXT | Source-ERP company id (PROJECT_ID). | tenancy/lineage |
| OrganizationId | TEXT | Platform organization. | tenancy |
| CompanyId | TEXT | Platform company (SDA_COMPANY_ID). |
primary tenancy key |
| FileImportId | TEXT | Ingestion batch id. | lineage |
| DataSource | TEXT | Source connector/system. | lineage |
- Keys vs attributes vs measures
-
Keys: line key
(DIRECTION, INVOICENUMBER, INVOICEDATE, INVOICETYPE, INVOICELINENUMBER). FKs(TAXTYPE, TAXCODE),ACCOUNTID,(COUNTERPARTID, DIRECTION). Measures:TaxAmount,TaxBase,TaxPercentage,TaxCurrencyAmount,TaxExchangeRate. Rest attributes. - Joins
-
→
SAFT_INVOICES_LINES(line key). →SAFT_TAX_CODES/SAFT_TAX_CODES_DETAILSon(TAXTYPE, TAXCODE). →SAFT_GENERAL_LEDGER_ACCOUNTSonACCOUNTID. →SAFT_COUNTERPARTSon(COUNTERPARTID, DIRECTION). - Notes
-
Country UNION (RO/PT sales + purchases). PT branch NULLs
TaxBase,SequentialLineNumber,AccountId, and currency/exchange/exemption fields. RO/generic branch NULLsTaxCountryRegion.TaxType/TaxCodemix ISO-style labels (VAT/WHT), Portuguese country tokens (TVA), and numeric ERP codes. Hidden system columns (ID,MATCH_ID,STATUS,ROW_ID_,TOTALCOUNT) present.
SAFT_JOURNALS
Grain: one row per accounting journal.
Purpose: reference list of journals under which GL transactions are posted.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| JournalId | VARCHAR(18) | PK; join key from SAFT_TRANSACTIONS | SUPADJ, WO-ISS, IC, IC-CNT, PO-RCT |
| Description | VARCHAR(256) | Journal description | "Supplier open item adjustments", "Workorder Issue" |
| Type | VARCHAR(9) | Journal type classification | CREDITORA, JOURNALEN |
| Country | VARCHAR(300) | ISO-2 country | RO |
| SourceCountry | VARCHAR(300) | source-country | |
| OrganizationId / CompanyId | VARCHAR | tenant | UUIDs present |
| DataSource | VARCHAR(300) | connector | SAFT |
| FileImportId | VARCHAR | ingestion batch |
Keys: JournalId (PK). All others attributes/tenant. No measures.
SAFT_MOVEMENT_TYPES
Grain: one row per stock-movement type code.
Purpose: reference list of stock-movement types.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| MovementType | VARCHAR | PK; join from stock movements/lines | 10,20,30,…,180 |
| Description | VARCHAR | Type description | attribute |
| Country / SourceCountry | VARCHAR | country | RO,PT,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: MovementType (PK). No measures.
SAFT_OWNERS
Grain: one row per stock-location owner.
Purpose: owners of physical stock locations (consignment/third-party warehouses).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | Owner tax id in home jurisdiction | key (sub-tables join here) |
| OwnerId | VARCHAR | PK of owner; join from SAFT_PHYSICAL_STOCKS | key |
| Name | VARCHAR | Owner name | attribute |
| AccountId | VARCHAR | FK → SAFT_GENERAL_LEDGER_ACCOUNTS | key |
| SelectionStartDate / SelectionEndDate | DATE | SAF-T file period bounds | attribute |
| PeriodStart / PeriodEnd | NUMBER | start/end month 1-12 | |
| PeriodStartYear / PeriodEndYear | NUMBER | year components | |
| Country / SourceCountry | VARCHAR | country | RO,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: OwnerId (PK), RegistrationNumber (used by sub-tables), AccountId (FK). No measures.
SAFT_OWNERS_ADDRESSES
Grain: one row per owner address.
Purpose: addresses of stock-location owners.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | FK → SAFT_OWNERS (owner tax id) | key |
| StreetName | VARCHAR | Street/PO box | attribute |
| Number | VARCHAR | House/street number | attribute |
| AdditionalAddressDetail | VARCHAR | Apt/floor/wing | attribute |
| Building | VARCHAR | Building id | attribute |
| City | VARCHAR | City/district | attribute |
| PostalCode | VARCHAR | Postal code | attribute |
| Region | VARCHAR | ISO 3166-2 subdivision | RO-AB … RO-B |
| Country | VARCHAR | ISO-2 country of address | RO,PT,… |
| AddressType | VARCHAR | StreetAddress/PostalAddress/BillingAddress/ShipToAddress/ShipFromAddress | |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: RegistrationNumber (FK to owner). No measures.
Unlike most SAF-T models, this model doesn't expose a SourceCountry column (SDA_COUNTRY).
SAFT_OWNERS_BANK_ACCOUNTS
Grain: one row per owner bank account.
Purpose: bank accounts of stock-location owners.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | FK → SAFT_OWNERS | key |
| OwnerId | VARCHAR | FK → SAFT_OWNERS | key |
| IbanNumber | VARCHAR | IBAN (ISO 13616) | attribute |
| BankAccountNumber | VARCHAR | Non-IBAN account no. | attribute |
| BankAccountName | VARCHAR | Account holder name | attribute |
| SortCode | VARCHAR | Bank routing/sort code | attribute |
| Country / SourceCountry | VARCHAR | country | RO,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: OwnerId/RegistrationNumber (FK). No measures.
SAFT_OWNERS_CONTACTS
Grain: one row per owner contact person.
Purpose: contact persons at stock-location owners.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | FK → SAFT_OWNERS | key |
| Title | VARCHAR | Title/salutation (Mr, Dr) | attribute |
| FirstName / Initials / LastNamePrefix / LastName / BirthName | VARCHAR | Name parts | attribute |
| Salutation | VARCHAR | Addressing salutation | attribute |
| Telephone / Fax / Email / Website | VARCHAR | Contact channels | attribute |
| Country / SourceCountry | VARCHAR | country | RO,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: RegistrationNumber (FK). No measures.
SAFT_OWNERS_CONTACTS_TITLES
Grain: one row per additional title held by an owner contact.
Purpose: academic/professional titles of owner contacts.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | FK → SAFT_OWNERS | key |
| FirstName / LastName | VARCHAR | Contact name (join to SAFT_OWNERS_CONTACTS) | key |
| OtherTitles | VARCHAR | Additional titles | attribute |
| Country / SourceCountry | VARCHAR | country | RO,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: RegistrationNumber + (FirstName,LastName) link to contacts. No measures.
SAFT_OWNERS_TAX_REGISTRATIONS
Grain: one row per owner tax registration.
Purpose: tax registrations of stock-location owners.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| RegistrationNumber | VARCHAR | FK → SAFT_OWNERS | key |
| TaxRegistrationNumber | VARCHAR | Tax reg. no. under a tax type (e.g. VAT no.) | attribute |
| TaxType | VARCHAR | Tax type | VAT,TVA,WHT,TAX-IMP,150,… |
| TaxNumber | VARCHAR | Tax reg. number under TaxAuthority | attribute |
| TaxAuthority | VARCHAR | Issuing authority | ANAF |
| TaxVerificationDate | DATE | Last verification date | attribute |
| Country / SourceCountry | VARCHAR | country | RO,… |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: RegistrationNumber (FK). No measures.
SAFT_PAYMENTS
Grain: one row per payment document (receipt or payment).
Purpose: payments to suppliers (Outbound) and receipts from customers (Inbound).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| PaymentReference | VARCHAR(35) | PK; join key to payment child tables | "BE2024/5121CITI/EXT CITI 97", "SP2024/000001468" |
| TransactionId | VARCHAR(70) | FK → SAFT_TRANSACTIONS | "2024/BE/000001442" |
| TransactionDate | DATE | GL posting date | 2024-06-03 |
| Description | VARCHAR | Header description | attribute |
| PaymentMethod | VARCHAR(18) | Payment method; source-ERP-defined | "99","02" |
| PaymentMechanism | VARCHAR(9) | Settlement mechanism (authority taxonomy) | 1,10,20,30,42,48,49,97,ZZZ |
| BatchId / SystemId / SourceId | VARCHAR | ERP identifiers | attribute |
| NetTotal | NUMBER(18,2) | Net total excl. tax | measure |
| GrossTotal | NUMBER(18,2) | Gross total incl. tax | 3.58 … 3,949,005.09 |
| SettlementDate | DATE | Settlement effective date | measure/attr |
| SettlementDiscount | NUMBER | Early-payment discount | measure |
| SettlementAmount | NUMBER | Settlement amount, default currency | measure |
| SettlementCurrencyCode | VARCHAR | ISO FX code | RON,EUR,… |
| SettlementCurrencyAmount | NUMBER | Settlement in foreign currency | measure |
| SettlementExchangeRate | NUMBER | FX rate | measure |
| Period / PeriodYear / PeriodMonth | NUMBER | month 1-12 / year / month | (Period ) |
| Country / SourceCountry | VARCHAR(300) | country | RO / NULL |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: PaymentReference (PK), TransactionId (FK). Measures: NetTotal, GrossTotal, Settlement*.
The published description mentions DIRECTION/COUNTERPARTID, but those columns are not exposed by this model (they apply to the broader payments family).
SAFT_PAYMENTS_LINES
Grain: one row per payment line (per invoice settled / allocation).
Purpose: detail lines of payment documents.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| PaymentReference | VARCHAR | FK → SAFT_PAYMENTS | key |
| TransactionId | VARCHAR | FK → SAFT_TRANSACTIONS | key |
| TransactionDate | DATE | GL posting date | |
| LineNumber | NUMBER | 1-based line on source doc | key |
| SequentialLineNumber | NUMBER | Stable ingestion sequence | key |
| SourceDocumentId | VARCHAR | Ref to source doc | attribute |
| AccountId | VARCHAR | FK → GL accounts | key |
| CustomerId / SupplierId | VARCHAR | FK → counterpart (Out/Inbound); legacy | key |
| Description | VARCHAR | Line description | attribute |
| TaxPointDate | DATE | VAT chargeability date | attribute |
| DebitCreditIndicator | VARCHAR | D or C | D,C |
| Amount | NUMBER | Amount, default currency | measure |
| CurrencyCode / CurrencyAmount / ExchangeRate | VARCHAR/NUMBER | FX triplet | RON,EUR,… |
| Period / PeriodYear / PeriodMonth | NUMBER | month/year/month | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: PaymentReference+LineNumber, TransactionId, AccountId, CustomerId/SupplierId. Measures: Amount + FX.
SAFT_PAYMENTS_LINES_ANALYSIS
Grain: one row per analytical allocation on a payment line.
Purpose: managerial-accounting splits of a payment line.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| PaymentReference | VARCHAR | FK → SAFT_PAYMENTS | key |
| LineNumber / SequentialLineNumber | NUMBER | payment line ref | key |
| TransactionDate | DATE | GL posting date | |
| AccountId | VARCHAR | FK → GL accounts | key |
| CustomerId / SupplierId | VARCHAR | FK → counterpart; legacy | key |
| AnalysisType / AnalysisId | VARCHAR | analytical dimension + value; → SAFT_ANALYSIS_TYPES | key |
| Amount | NUMBER | Allocated amount, default currency | measure |
| CurrencyCode / CurrencyAmount / ExchangeRate | FX triplet | RON,EUR,… | |
| Period / PeriodYear / PeriodMonth | NUMBER | month/year/month | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: PaymentReference+LineNumber; (AnalysisType,AnalysisId). Measures: Amount + FX.
SAFT_PAYMENTS_LINES_TAX_INFORMATION
Grain: one row per tax entry on a payment line.
Purpose: per-line tax on payments (typically WHT to non-residents).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| PaymentReference | VARCHAR | FK → SAFT_PAYMENTS | key |
| LineNumber / SequentialLineNumber | NUMBER | payment line ref | key |
| TransactionDate | DATE | GL posting date | |
| AccountId / CustomerId / SupplierId | VARCHAR | FK refs | key |
| TaxType / TaxCode | VARCHAR | → SAFT_TAX_CODES(_DETAILS) | VAT,WHT,…; L1,A1,150010,… |
| TaxPercentage | NUMBER | rate % | measure |
| TaxBase | NUMBER | taxable base | measure |
| TaxBaseDescription | VARCHAR | base qualifier | attribute |
| Amount | NUMBER | tax amount, default currency | measure |
| CurrencyCode / CurrencyAmount / ExchangeRate | FX triplet | RON,EUR,… | |
| TaxExemptionReason | VARCHAR | exemption reason | attribute |
| TaxDeclarationPeriod | VARCHAR | declaration period YYYY-MM | attribute |
| Period / PeriodYear / PeriodMonth | NUMBER | month/year/month | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: PaymentReference+LineNumber; (TaxType,TaxCode). Measures: TaxPercentage, TaxBase, Amount + FX.
SAFT_PAYMENTS_TAX_INFORMATION_TOTALS
Grain: one row per (payment document, tax code) header-level tax total.
Purpose: payment-doc tax totals per code; reconciliation of line tax to doc total.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| PaymentReference | VARCHAR | FK → SAFT_PAYMENTS | key |
| TransactionDate | DATE | GL posting date | |
| TaxType / TaxCode | VARCHAR | → SAFT_TAX_CODES | VAT,WHT,…; codes |
| TaxPercentage / TaxBase / Amount | NUMBER | rate/base/tax amount | measure |
| TaxBaseDescription | VARCHAR | base qualifier | attribute |
| CurrencyCode / CurrencyAmount / ExchangeRate | FX triplet | RON,EUR,… | |
| TaxExemptionReason / TaxDeclarationPeriod | VARCHAR | exemption / declaration period | attribute |
| Period / PeriodYear / PeriodMonth | NUMBER | month/year/month | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: PaymentReference; (TaxType,TaxCode). Grain gotcha: header-level totals, NOT per line.
SAFT_PHYSICAL_STOCKS
Grain: one row per stock item (per warehouse/location).
Purpose: physical inventory master + on-hand balances for on-demand stocks reporting.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| WarehouseId | VARCHAR | Warehouse id | key |
| LocationId | VARCHAR | Storage location id | key |
| ProductCode | VARCHAR | FK → SAFT_PRODUCTS | key |
| StockAccountNo | VARCHAR | Inventory GL account | attribute |
| ProductType | VARCHAR | Stock item type; source-ERP-defined | attribute |
| ProductStatus | VARCHAR | Status at snapshot; source-ERP-defined | attribute |
| StockAccountCommodityCode | VARCHAR | Commodity code (NC8/TARIC/HS) | attribute |
| OwnerId | VARCHAR | FK → SAFT_OWNERS | key |
| UomPhysicalStock | VARCHAR | UOM for physical stock → SAFT_UOM_TABLES | attribute |
| UomToUomBaseConversionFactor | NUMBER | conversion to base UOM | measure |
| UnitPrice | NUMBER | Unit price, default currency | measure |
| OpeningStockQuantity / ClosingStockQuantity | NUMBER | opening/closing qty | measure |
| OpeningStockValue / ClosingStockValue | NUMBER | opening/closing value | measure |
| SelectionStartDate / SelectionEndDate | DATE | SAF-T file period bounds | attribute |
| PeriodStart / PeriodEnd / PeriodStartYear / PeriodEndYear | NUMBER | period bounds | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: (WarehouseId,LocationId,ProductCode), OwnerId (FK). Measures: quantities, values, UnitPrice, conversion factor.
SAFT_PHYSICAL_STOCKS_CHARACTERISTICS
Grain: one row per characteristic of a physical stock item.
Purpose: stock-item attributes (expiry, hazard, batch/lot).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| WarehouseId | VARCHAR | FK → SAFT_PHYSICAL_STOCKS | key |
| ProductCode | VARCHAR | FK → SAFT_PRODUCTS / SAFT_PHYSICAL_STOCKS | key |
| StockCharacteristic | VARCHAR | characteristic code | 0, blue_35, yellow_124 |
| StockCharacteristicValue | VARCHAR | characteristic value | 0, blue_35, yellow_124 |
| SelectionStartDate / SelectionEndDate | DATE | period bounds | |
| PeriodStart / PeriodEnd / PeriodStartYear / PeriodEndYear | NUMBER | period bounds | |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: (WarehouseId,ProductCode). No measures.
StockCharacteristic and StockCharacteristicValue mirror each other (for real codes).
SAFT_PRODUCTS
Grain: one row per product (SKU).
Purpose: product master referenced by lines/stock.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| ProductCode | VARCHAR(70) | PK; join to lines/stock/taxes | 127108090, 12710923L |
| Description | VARCHAR(256) | Product description | "BK 9/2.2 SCON PE T2 0067 1" |
| ProductGroup | VARCHAR(70) | Group/category | |
| ProductType | VARCHAR(1) | Type; PT branch only (NULL for RO) | |
| GoodsServicesId | VARCHAR(9) | Goods/services indicator; RO branch only | doc says G/S but shows "01" — |
| ProductCommodityCode | VARCHAR(35) | NC8/TARIC/HS; RO branch only | 39172900, 39269097 |
| ProductNumberCode | VARCHAR | EAN/UPC / alt code | attribute |
| ValuationMethod | VARCHAR(9) | FIFO/LIFO/avg; RO branch only | FIFO |
| UomBase | VARCHAR(9) | Base UOM → SAFT_UOM_TABLES; RO only | MTR |
| UomStandard | VARCHAR | Standard UOM; RO only | attribute |
| UomToUomBaseConversionFactor | NUMBER | conversion; RO only | measure |
| Country | VARCHAR(300) | ISO-2; RO branch only (NULL for PT) | RO |
| SourceCountry | VARCHAR(300) | source-country | |
| SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: ProductCode (PK). Measures: UomToUomBaseConversionFactor.
Many columns are NULL for the PT branch of the UNION, including GoodsServicesId, ProductCommodityCode, ValuationMethod, the Uom fields, and Country.
SAFT_PRODUCTS_TAXES
Grain: one row per (product, tax code).
Purpose: default tax codes per product.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| ProductCode | VARCHAR | FK → SAFT_PRODUCTS | key |
| TaxType / TaxCode | VARCHAR | → SAFT_TAX_CODES | VAT,WHT,…; L1,A1,150010,… |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: ProductCode; (TaxType,TaxCode). No measures.
SAFT_STOCK_MOVEMENTS
Grain: one row per stock-movement document header.
Purpose: headers of delivery notes/transfers/receipts.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| MovementReference | VARCHAR(35) | PK; join key from lines | "0825854383_1213_5000000021_2024" |
| MovementDate | DATE | Date of movement | 2022-02-01 |
| MovementPostingDate | DATE | GL posting date | 2022-02-01 |
| MovementPostingTime | (time) | posting time component | attribute |
| TaxPointDate | DATE | VAT chargeability date | attribute |
| MovementType | VARCHAR(9) | FK → SAFT_MOVEMENT_TYPES | 10,20,70,80,110,120 |
| SourceId / SystemId | VARCHAR | ERP identifiers | attribute |
| DocumentType | VARCHAR(18) | SAF-T document type | Invoice, AdjustmentNote, ProductionNote, ConsumptionNote |
| DocumentNumber | VARCHAR(35) | Source doc number | INV001, ADJ001, PROD001, CONS001 |
| DocumentLine | VARCHAR | Referenced doc line | attribute |
| ReportingDate | DATE | reporting date | attribute |
| SelectionStartDate / SelectionEndDate | DATE | file period bounds | attribute |
| PeriodStart / PeriodEnd / PeriodStartYear / PeriodEndYear | NUMBER | period bounds | |
| Month | NUMBER | reporting month 1-12 | 2 |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage | RO |
Keys: MovementReference (PK), MovementType (FK). No monetary measures at header.
SAFT_STOCK_MOVEMENTS_LINES
Grain: one row per item moved on a stock-movement document.
Purpose: stock-movement detail lines with product/qty and inlined ship-from/ship-to addresses.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| MovementReference | VARCHAR | FK → SAFT_STOCK_MOVEMENTS | key |
| MovementDate | DATE | movement date | |
| MovementType | VARCHAR | FK → SAFT_MOVEMENT_TYPES | 10-80 |
| LineNumber | NUMBER | 1-based line | key |
| AccountId | VARCHAR | FK → GL accounts | key |
| TransactionId | VARCHAR | FK → SAFT_TRANSACTIONS | key |
| CustomerId / SupplierId | VARCHAR | FK → counterpart; legacy | key |
| ProductCode | VARCHAR | FK → SAFT_PRODUCTS | key |
| StockAccountNo | VARCHAR | inventory GL account | attribute |
| Quantity | NUMBER | qty in UnitOfMeasure | measure |
| UnitOfMeasure | VARCHAR | UOM → SAFT_UOM_TABLES | attribute |
| UomToUomBaseConversionFactor | NUMBER | conversion to base UOM | measure |
| BookValue | NUMBER | book value, default currency | measure |
| MovementSubType | VARCHAR | finer classification | 10-180 |
| MovementComments | VARCHAR | free text | attribute |
| ShipFrom* (DeliveryId, DeliveryDate, WarehouseId, LocationId, Ucr, StreetName, Number, AdditionalAddressDetail, Building, City, PostalCode, Region, Country, AddressType) | VARCHAR/DATE | inlined dispatch address | Region RO-AB…RO-B; AddressType StreetAddress/…/ShipFromAddress |
| ShipTo* (same 14 fields) | VARCHAR/DATE | inlined delivery address | as above |
| Month | NUMBER | reporting month | 1-12 |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: MovementReference+LineNumber, ProductCode, AccountId, TransactionId. Measures: Quantity, BookValue, conversion factor. Note: 28 inlined ShipFrom*/ShipTo* address columns (not a separate address table).
This model inlines 28 ShipFrom/ShipTo* address columns directly on each line, rather than storing them in a separate address table.
SAFT_STOCK_MOVEMENTS_LINES_TAX_INFORMATION
Grain: one row per tax entry on a stock-movement line.
Purpose: per-line tax on stock movements.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| MovementReference | VARCHAR | FK → SAFT_STOCK_MOVEMENTS | key |
| MovementDate | DATE | movement date | |
| MovementType | VARCHAR | FK → SAFT_MOVEMENT_TYPES | 10-180 |
| LineNumber | NUMBER | line ref | key |
| TaxType / TaxCode | VARCHAR | → SAFT_TAX_CODES | VAT,WHT,…; codes |
| TaxPercentage / TaxBase / TaxAmount | NUMBER | rate/base/tax amount | measure |
| TaxBaseDescription | VARCHAR | base qualifier | attribute |
| TaxCurrencyCode / TaxCurrencyAmount / TaxExchangeRate | tax FX triplet | RON,EUR,… | |
| TaxExemptionReason / TaxDeclarationPeriod | VARCHAR | exemption / declaration period | attribute |
| Month | NUMBER | reporting month | 1-12 |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: MovementReference+LineNumber; (TaxType,TaxCode). Measures: TaxPercentage, TaxBase, TaxAmount + FX.
SAFT_TAXONOMIES
Grain: one row per (account, taxonomy mapping).
Purpose: maps GL accounts to reporting taxonomies.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| TaxonomyCode | VARCHAR | taxonomy element code | attribute |
| TaxonomyClusterId | VARCHAR | taxonomy cluster/group id | attribute |
| TaxonomyClusterContextId | VARCHAR | context within cluster | attribute |
| AccountId | VARCHAR | FK → SAFT_GENERAL_LEDGER_ACCOUNTS | key |
| TaxonomyReference | VARCHAR | classifying taxonomy reference | attribute |
| Country / SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: AccountId (FK). No measures. Meaning of TaxonomyCode/ClusterId specifics (country-taxonomy dependent).
SAFT_TAX_CODES
Grain: one row per tax code (parent).
Purpose: reference list of tax codes; parent to details and base-rates.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| TaxType | VARCHAR(9) | Tax type; join with TaxCode to the tax-code details. | e.g. VAT, WHT, TAX-IMP, or numeric codes such as 000, 300, 633 |
| Description | VARCHAR(256) | Tax code description | "UDT_TXT_NON-TAX","UDT_TXT_WHT","Cod special" |
| SourceCountry | VARCHAR(300) | source-country | RO |
| OrganizationId / CompanyId | VARCHAR | tenant | UUIDs |
| DataSource | VARCHAR(300) | connector | SAFT |
| FileImportId | VARCHAR | ingestion batch |
Keys: TaxType (+TaxCode in child tables). No measures.
This parent variant only exposes TaxType, not TaxCode - TaxCode lives in _DETAILS/_BASE_RATES. Live TaxType values are numeric ERP codes, not the documented labels.
SAFT_TAX_CODES_BASE_RATES
Grain: one row per (tax code, base-rate variation).
Purpose: base-rate factors for partial-base tax scenarios.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| TaxType / TaxCode | VARCHAR | → SAFT_TAX_CODES | VAT,WHT,…; codes |
| TaxPercentage | NUMBER | rate % | measure |
| BaseRate | NUMBER | base factor 0.0000-1.0000 (1.0=full base taxable) | measure |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: (TaxType,TaxCode). Measures: TaxPercentage, BaseRate.
SAFT_TAX_CODES_DETAILS
Grain: one row per tax-code rate version (effective window / region).
Purpose: detailed tax-code definitions with rates and validity.
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| TaxType / TaxCode | VARCHAR | Tax type and code; join to SAFT_TAX_CODES. | e.g. VAT, TVA, WHT, TAX-IMP |
| Description | VARCHAR | rate-version description | attribute |
| EffectiveDate | DATE | effective from | attribute |
| ExpirationDate | DATE | expires (null if current) | attribute |
| TaxPercentage | NUMBER | rate % | measure |
| FlatTaxRateAmount | NUMBER | fixed tax amount (default currency) | measure |
| FlatTaxRateCurrencyCode / FlatTaxRateCurrencyAmount / FlatTaxRateExchangeRate | flat-rate FX triplet | RON,EUR,… | |
| Country | VARCHAR | ISO-2 country of the tax code | RO,PT,… |
| Region | VARCHAR | ISO 3166-2 subdivision (null=country-wide) | RO-AB…RO-B |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: (TaxType,TaxCode) + EffectiveDate/Region for versioning. Measures: TaxPercentage, FlatTaxRate*.
SAFT_UOM_TABLES
Grain: one row per unit of measure.
Purpose: reference list of UOMs (with conversion to a base unit).
| Field | Type | Description | Example values / notes |
|---|---|---|---|
| UnitOfMeasure | VARCHAR | PK; join from products/stock/lines (UOMBASE/UNITOFMEASURE) | key |
| Description | VARCHAR | UOM description | attribute |
| SourceCountry / SourceCompanyId / OrganizationId / CompanyId / FileImportId / DataSource | scoping/lineage |
Keys: UnitOfMeasure (PK). No measures.
Although the published description mentions conversion factors, this model does not expose a conversion-factor column. Conversion values live on product and line rows instead.
