|
|
@@ -95,7 +95,7 @@ def search_files(
|
|
|
json.dump(res, fwh, indent=2)
|
|
|
|
|
|
|
|
|
-def get_invoice_pdf_by_document_no(client_db: str, document_no: str) -> str:
|
|
|
+def get_invoice_pdf_by_document_no(client_db: str, document_no: str) -> bytes:
|
|
|
search_condition = {}
|
|
|
search_condition["BELEGNUMMER"] = document_no
|
|
|
|
|
|
@@ -103,7 +103,9 @@ def get_invoice_pdf_by_document_no(client_db: str, document_no: str) -> str:
|
|
|
dlg = fc.search_dialog()
|
|
|
|
|
|
for doc in dlg.search(search_condition):
|
|
|
- return os.getenv("DW_URL").strip("/") + doc.document.endpoints["content"]
|
|
|
+ # return os.getenv("DW_URL").strip("/") + doc.document.endpoints["content"]
|
|
|
+ data, content_type, filename = doc.download(keep_annotations=True)
|
|
|
+ return data
|
|
|
raise ValueError(f"Document with document_no {document_no} not found in client_db {client_db}")
|
|
|
|
|
|
|