Initial version of the E-Invoice solution of JR IT Services

This commit is contained in:
2026-02-16 17:02:03 +01:00
commit e0c15fc7f2
36 changed files with 1407 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from __future__ import annotations
import re
def slugify(value: str, max_len: int = 40) -> str:
v = value.strip()
v = re.sub(r"\s+", "_", v)
v = re.sub(r"[^A-Za-z0-9_\-]+", "", v)
v = v.strip("_-")
if len(v) > max_len:
v = v[:max_len].rstrip("_-")
return v or "Kunde"
def default_invoice_folder_name(invoice_number: str, customer: str | None = None) -> str:
cust = slugify(customer or "Kunde")
inv = slugify(invoice_number, max_len=32)
return f"Rechnung_{inv}_{cust}"