Metadata-Version: 2.4
Name: django-xrechnung
Version: 0.1.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 :: OS Independent
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: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pypdf>=5; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: django-stubs>=4.2.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: pydocstyle>=6.3.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-cov>=4.0.0; extra == "test"
Requires-Dist: pypdf>=5; extra == "test"
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/)
[![Python versions](https://img.shields.io/pypi/pyversions/django-xrechnung)](https://pypi.org/project/django-xrechnung/)
[![Django versions](https://img.shields.io/pypi/frameworkversions/django/django-xrechnung)](https://pypi.org/project/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, 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.
- **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.

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 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.

Discounts, charges, attachments, additional countries, and transmission
integrations are not yet supported. Settlement tracking and cumulative credit
limits remain outside the app. PDFs are separate printable documents; PDF/A and
ZUGFeRD/Factur-X output are not supported.

## 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).
- [Develop and test](docs/how-to/develop.rst) or
  [build the Sphinx documentation](docs/how-to/documentation.rst).

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.
