Metadata-Version: 2.4
Name: django-xrechnung
Version: 0.2.0
Summary: A Django app for handling XRechnung (German electronic invoicing standard)
Author-email: Fabian Braun <fsbraun@gmx.de>
Maintainer-email: Fabian Braun <fsbraun@gmx.de>
License: BSD-3-Clause
Project-URL: Homepage, https://codeberg.org/fsbraun/django-xrechnung
Project-URL: Repository, https://codeberg.org/fsbraun/django-xrechnung
Project-URL: Issues, https://codeberg.org/fsbraun/django-xrechnung/issues
Keywords: django,xrechnung,invoice,german,electronic,billing
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Office/Business :: Financial :: Accounting
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django<6.2,>=5.2
Requires-Dist: lxml<7,>=5.3
Requires-Dist: weasyprint<71,>=70
Requires-Dist: tomli>=2; python_version < "3.11"
Provides-Extra: cii
Requires-Dist: drafthorse==2025.2.0; extra == "cii"
Requires-Dist: factur-x==6.8; extra == "cii"
Provides-Extra: hybrid
Requires-Dist: drafthorse==2025.2.0; extra == "hybrid"
Requires-Dist: pypdf==6.18.0; extra == "hybrid"
Requires-Dist: factur-x==6.8; extra == "hybrid"
Provides-Extra: inbound
Requires-Dist: drafthorse==2025.2.0; extra == "inbound"
Requires-Dist: pypdf==6.18.0; extra == "inbound"
Requires-Dist: factur-x==6.8; extra == "inbound"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.6; extra == "dev"
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
Requires-Dist: coverage[toml]>=7.10.6; extra == "dev"
Requires-Dist: django-filer>=3.0; extra == "dev"
Requires-Dist: pypdf==6.18.0; extra == "dev"
Requires-Dist: factur-x==6.8; extra == "dev"
Requires-Dist: drafthorse==2025.2.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-django>=4.5.0; extra == "test"
Requires-Dist: pytest-xdist>=3.6; extra == "test"
Requires-Dist: pytest-cov>=7.0.0; extra == "test"
Requires-Dist: coverage[toml]>=7.10.6; extra == "test"
Requires-Dist: django-filer>=3.0; extra == "test"
Requires-Dist: pypdf==6.18.0; extra == "test"
Requires-Dist: factur-x==6.8; extra == "test"
Requires-Dist: drafthorse==2025.2.0; extra == "test"
Provides-Extra: filer
Requires-Dist: django-filer>=3.0; extra == "filer"
Provides-Extra: postgres
Requires-Dist: psycopg[binary]>=3.2; extra == "postgres"
Dynamic: license-file

# django-xrechnung

[![PyPI version](https://badge.fury.io/py/django-xrechnung.svg)](https://pypi.org/project/django-xrechnung/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-xrechnung)](https://pypi.org/project/django-xrechnung/)
[![PyPI - Django Versions from Framework Classifiers](https://img.shields.io/pypi/frameworkversions/django/django-xrechnung)](https://www.djangoproject.com/)
[![PyPI - License](https://img.shields.io/pypi/l/django-xrechnung)](LICENSE)
[![Latest on Django Packages](https://img.shields.io/badge/Django%20Packages-django--xrechnung-8c3c26)](https://djangopackages.org/packages/p/django-xrechnung/)

**Create validated XRechnung XML and printable PDF invoices in Django.**

Bring invoicing into your existing Django project: prepare drafts in admin or
Python, review calculated totals, then finalize and download both documents.
The app runs the official KoSIT validator locally and renders PDFs with WeasyPrint.
XML, PDF, and the validation report are stored together when finalization succeeds.

## What it does

- **Invoices, credit notes, and corrections:** generate XRechnung 3.0.2 documents
  in UBL 2.1 or CII, including credit notes and corrected invoices linked to their originals.
- **Flexible VAT:** combine German 7% and 19% VAT, exempt lines, and reverse charge
  with separate tax breakdowns, exemption reasons, and consistent decimal rounding.
- **Printable PDFs:** produce German invoice layouts with customizable templates,
  wrapping descriptions, repeated table headers, and page numbers.
- **Factur-X output:** generate PDF/A-3b invoices with embedded CII using WeasyPrint,
  validated by veraPDF and the pinned XML rules before issuance.
- **Less repeated data entry:** reuse seller, contact, and payment defaults for
  new drafts without changing existing invoices.
- **Controlled issuance:** enforce ownership and Django permissions, validate
  before issuing, and preserve finalized documents against edits through the app.
- **Django integration:** use the supplied admin, review pages, JSON read endpoints,
  document downloads, and Python services in your own workflows.
- **Incoming invoice review:** receive immutable originals through Python, a
  management command, or admin upload;
  deduplicate within owned inboxes, retain validation evidence, and retry failures.
  Validate UBL/CII XRechnung and Factur-X XML, including XML extracted from PDFs
  with the optional `inbound` extra. Review parsed parties, lines and totals,
  reconciliation mismatches, and unsupported fields without changing originals.

Invoice validation and PDF rendering run on your application host. Invoice data
is not uploaded to an external validation service.

## Project status

**Alpha, under active development.** The draft-to-document workflow is implemented,
including credit notes and corrections. Automated tests exercise real KoSIT
acceptance and rejection, PDF output, permissions, calculations, migrations, and
installation from a built wheel.

The current outgoing invoice scope covers German sellers and buyers, EUR, standard
VAT, exemptions and reverse charge, email electronic addresses, and SEPA transfers
to German IBANs. See the
[supported invoice scenarios](docs/reference/supported-invoices.rst) for exact limits.

Creating invoices with discounts, charges, attachments, or additional countries,
and transmission integrations, are not yet supported. Settlement tracking and cumulative credit
limits remain outside the app. PDFs can be separate printable documents or
Factur-X EN 16931 hybrids with embedded CII and mandatory runtime PDF/A-3b checks.

## Get started

Install from [Codeberg](https://codeberg.org/fsbraun/django-xrechnung) with Git
available in your environment:

```bash
python -m pip install git+https://codeberg.org/fsbraun/django-xrechnung.git
```

Follow the **[first-invoice tutorial](docs/tutorials/first-invoice.rst)** to install
into a Django project and generate your first XML and PDF. The
[installation guide](docs/how-to/install.rst) covers Java and WeasyPrint's
system dependencies.

## Documentation

The [documentation](docs/index.rst) is organized around tutorials, how-to guides,
reference, and explanation:

- [Configure seller defaults](docs/how-to/seller-defaults.rst),
  [manage permissions](docs/how-to/permissions.rst), and
  [customize PDFs](docs/how-to/customize-pdf.rst).
- [Use VAT exemptions and reverse charge](docs/how-to/vat-categories.rst).
- [Create credit notes and corrected invoices](docs/how-to/adjustments.rst).
- Look up [configuration](docs/reference/configuration.rst),
  [Python services](docs/reference/python-api.rst), and
  [HTTP endpoints](docs/reference/http-api.rst).
- Understand [finalization](docs/explanation/lifecycle.rst) and
  [VAT calculations](docs/explanation/calculations.rst).
- [Choose CII or Factur-X PDF output](docs/how-to/output-formats.rst).
- [Receive and review documents](docs/how-to/receive-documents.rst).

For repository development, see [contributing](CONTRIBUTING.md).

See the [runnable example](example/README.md), [changelog](CHANGELOG.md), and
[compatibility and release policy](docs/reference/releases.rst).

## License

[BSD 3-Clause](LICENSE). KoSIT, WeasyPrint, and system fonts retain their upstream
licenses.
