openfatture

OpenFatture 2.2.0

Highlights

Upgrade notes

PDF Template Default Changed

Before (2.1.0) After (2.2.0)
Default template: minimalist Default template: professional
Basic layout stub Client-grade layout with IBAN block, logo support, enhanced header

To continue using the minimalist template, specify --template minimalist when generating PDFs or set pdf.default_template = "minimalist" in your configuration.

New CLI Commands

cliente and fattura command groups are now part of the public CLI surface. These are simple wrappers around application-layer APIs for common read/write operations. Complex domain workflows should continue to use the assistant.

# List clients
openfatture cliente list

# Create new invoice
openfatture fattura create

# Generate PDF with specific template
openfatture fattura generate-pdf <id> --template professional

Database Schema Changes

If you use natura codes or DatiCassaPrevidenziale, run the migration:

alembic upgrade head

Existing invoices without natura will continue to work correctly (natura is optional and only required for zero-VAT cases).

Lightning Module Removed

The experimental lightning extra and openfatture.lightning package have been removed. If your configuration references lightning_allow_mock or other Lightning-specific settings, remove those entries. Historical documentation is archived under docs/history/lightning/.

No Live SDI Transmission

This release includes XML generation improvements and SDI readiness documentation (docs/SDI_TRANSPORT_READINESS.md), but does NOT implement live SDI transmission, PEC sending, or digital signature features. These remain future work requiring legal authorization and qualified certificates.

Verification

PDF Layout

Test the professional template and text wrapping:

# Generate PDF with professional template (default)
openfatture fattura generate-pdf <invoice-id> --output invoice.pdf

# Test with minimalist template
openfatture fattura generate-pdf <invoice-id> --output invoice.pdf --template minimalist

Long line descriptions should wrap properly across multiple lines in table cells. Multi-page invoices should render without dropping content.

CLI Commands

# List clients
openfatture cliente list

# Show client details
openfatture cliente show <id>

# List invoices
openfatture fattura list

# Show invoice with line items
openfatture fattura show <id>

XML Validation

# Generate FatturaPA XML
openfatture fattura generate-xml <invoice-id> --output test.xml

# Validate against XSD (requires schema download)
python -c 'from openfatture.sdi.validator.xsd_validator import download_xsd_schema; download_xsd_schema(auto_download=True)'
python -m pytest tests/unit/test_xml_xsd_validation.py -xvs

Test Suite

# Run full test suite
python3 -m pytest -q

# Run with coverage
python3 -m pytest --cov=openfatture --cov-report=term-missing

# Run specific test modules
python3 -m pytest tests/pdf/test_pdf_generator.py -xvs
python3 -m pytest tests/unit/test_xml_builder.py -xvs