feat: create validated ZUGFeRD invoices in one console command

This commit is contained in:
admin committed 2026-10-16 09:29:08 +02:00
1 parent e0c15fc7f2
commit a643cf5227
30 files changed
+1509 -207

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
"""Bundled resources and writable, private user data locations."""
import os
from pathlib import Path
def resource_root() -> Path:
source = Path(__file__).resolve().parent.parent
return source if (source / 'templates/invoice.html.j2').is_file() else Path(__file__).resolve().parent / 'data'
def private_root(resources: Path | None = None) -> Path:
root = resources or resource_root()
default = root / 'private' if root.name != 'data' else Path.home() / '.local/share/jr-einvoice'
return Path(os.environ.get('JR_EINVOICE_HOME', str(default))).expanduser().resolve()
def presets_root(resources: Path | None = None) -> Path:
return Path(os.environ.get('JR_EINVOICE_PRESETS', str(private_root(resources) / 'presets'))).expanduser().resolve()