How cialinux/dolibarr-saft works
This Dolibarr module is an ERP/UI connector to the commercial SAF-T Validator API. Users can upload SAF-T files for validation and invoice preview, then select invoices for import; separate screens support issuing invoices and monthly SAF-T export. Import creates or reuses customers and drafts invoices in Dolibarr. The graph preserves those documented capabilities and the module’s menu/configuration layer. Source excerpts show API-session calls, import delegation and endpoint calls; some export and issue details are documented rather than fully sampled.
Main entry points: saft.lib.php API client helpers · saftindex.php Validate and preview · modSaft.class.php SAF-T module · index.php Invoice import
Components 12
Dolibarr Integration
- SAF-T module
core/modules/modSaft.class.php - API client helpers
lib/saft.lib.php
Validation and Import
- Validate and preview
saftindex.php - Invoice import
import/index.php - Invoice preview
tpl/invoice_from_xml.tpl.php - Customer and draft creation
class/SaftImport.class.php
Invoice Operations
- Issue invoice
issue.php - Monthly SAF-T export
export.php
Module Administration
- API settings
admin/setup.php
Other components
- ERP user
- Dolibarr ERP
- SAF-T Validator API
Connections 20
- ERP user → Validate and preview: uploads file
saftindex.php - Validate and preview → API client helpers: creates session
saftindex.php - API client helpers → SAF-T Validator API: sends SAF-T
lib/saft.lib.php - Validate and preview → API client helpers: fetches preview
saftindex.php - Validate and preview → Invoice preview: renders preview
saftindex.php - ERP user → Invoice import: selects invoices
import/index.php - Invoice import → API client helpers: creates session
import/index.php - Invoice import → Customer and draft creation: creates drafts
import/index.php - Customer and draft creation → Dolibarr ERP: reads and writes
class/SaftImport.class.php - ERP user → Issue invoice: requests issuance
issue.php - Issue invoice → API client helpers: requests invoice
issue.php - API client helpers → SAF-T Validator API: calls service
- ERP user → Monthly SAF-T export: requests export
export.php - Monthly SAF-T export → API client helpers: generates or downloads
export.php - API client helpers → SAF-T Validator API: calls service
- ERP user → API settings: configures API
admin/setup.php - SAF-T module → Validate and preview: registers menu
core/modules/modSaft.class.php - SAF-T module → Invoice import: registers menu
core/modules/modSaft.class.php - SAF-T module → Issue invoice: registers menu
core/modules/modSaft.class.php - SAF-T module → Monthly SAF-T export: registers menu
core/modules/modSaft.class.php