remove lexoffice name in project
This commit is contained in:
+7
-7
@@ -16,7 +16,7 @@ from app.mail_processor import _connect_smtp, _build_forward_email
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SEPARATOR_QR_CONTENT = "LEXOFFICE-TRENNUNG"
|
||||
SEPARATOR_QR_CONTENT = "BELEGIMPORT-TRENNUNG"
|
||||
UPLOAD_DIR = Path(os.environ.get("UPLOAD_DIR", "/data/uploads"))
|
||||
|
||||
|
||||
@@ -85,11 +85,11 @@ def split_pdf(pdf_path: str, separator_pages: list[int]) -> list[bytes]:
|
||||
|
||||
|
||||
async def process_scanned_pdf(pdf_path: str, progress_callback=None) -> dict:
|
||||
"""Full pipeline: detect separators, split, send each document to LexOffice."""
|
||||
"""Full pipeline: detect separators, split, send each document via email."""
|
||||
settings = await get_settings()
|
||||
|
||||
if not settings.get("smtp_server") or not settings.get("lexoffice_email"):
|
||||
return {"error": "SMTP oder LexOffice-Email nicht konfiguriert", "total_pages": 0, "documents": 0, "sent": 0, "errors": 1}
|
||||
if not settings.get("smtp_server") or not settings.get("import_email"):
|
||||
return {"error": "SMTP oder Import-Email nicht konfiguriert", "total_pages": 0, "documents": 0, "sent": 0, "errors": 1}
|
||||
|
||||
# Step 1: Detect separator pages (CPU-bound, run in thread)
|
||||
if progress_callback:
|
||||
@@ -116,7 +116,7 @@ async def process_scanned_pdf(pdf_path: str, progress_callback=None) -> dict:
|
||||
if not documents:
|
||||
return {"error": "Keine Dokumente nach dem Splitting gefunden", "total_pages": total_pages, "documents": 0, "sent": 0, "errors": 1}
|
||||
|
||||
# Step 3: Send each document to LexOffice
|
||||
# Step 3: Send each document via email
|
||||
if progress_callback:
|
||||
progress_callback("status", 0, 0, f"{len(documents)} Dokument(e) erkannt, starte Versand...")
|
||||
|
||||
@@ -135,7 +135,7 @@ async def process_scanned_pdf(pdf_path: str, progress_callback=None) -> dict:
|
||||
filename = f"Scan_Dokument_{i + 1}.pdf"
|
||||
msg = _build_forward_email(
|
||||
from_addr=settings["smtp_username"],
|
||||
to_addr=settings["lexoffice_email"],
|
||||
to_addr=settings["import_email"],
|
||||
original_subject=f"Scan-Upload Dokument {i + 1}/{len(documents)}",
|
||||
original_from="Scan-Upload",
|
||||
attachments=[(filename, doc_bytes)],
|
||||
@@ -217,7 +217,7 @@ def generate_separator_pdf() -> bytes:
|
||||
|
||||
# Title text
|
||||
_centered_textbox(page, 120, "TRENNSEITE", 36, (0, 0, 0))
|
||||
_centered_textbox(page, 170, "LexOffice Belegimport", 16, (0.4, 0.4, 0.4))
|
||||
_centered_textbox(page, 170, "Belegimport", 16, (0.4, 0.4, 0.4))
|
||||
|
||||
# Insert QR code image centered
|
||||
qr_bytes = io.BytesIO()
|
||||
|
||||
Reference in New Issue
Block a user