Parcourir la source

Fehler bei xlsx-Exporten

gc-server3 il y a 3 mois
Parent
commit
4c328099b6
1 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 7 3
      cognos11/c11_export.py

+ 7 - 3
cognos11/c11_export.py

@@ -153,6 +153,7 @@ class c11_export:
     def filter_request_plan(self, req_plan: list[list[ReportRequest]], mail_csv: str):
         if not Path(mail_csv).exists() or not Path(mail_csv).is_file():
             return req_plan
+        print("Filtern auf Empfaenger: " + mail_csv)
         required_files = []
         required_full_export = []
         with open(Path(mail_csv), "r", encoding="latin-1") as rfh:
@@ -163,7 +164,7 @@ class c11_export:
                 if "@" not in mailto:
                     continue
                 required_files.append(str(Path(self.cfg.cognos11.reportoutput_dir + "/" + filename).resolve()))
-                if "_Schichten." in filename:
+                if "_Schichten." in filename and "erstellte_Schichten" not in filename:
                     filename2 = filename.replace("__Summe_und_Schichten", "__Summe").replace(
                         "__nur_Schichten", "__Summe"
                     )
@@ -207,15 +208,18 @@ class c11_export:
     def get_merge_group(self, req_plan: list[list[ReportRequest]]):
         res = {}
         for req_group in req_plan:
-            if len(req_group) <= 1:
-                continue
             files = [r.filename for r in req_group if r.report_format == "PDF"]
+            if len(files) <= 1:
+                continue
             filename = files[0].replace("_Summe", "_Summe_und_Schichten")
             res[filename] = files
 
             files2 = [r for r in files if "_Summe" not in r]
             filename2 = filename.replace("_Summe_und_Schichten", "_nur_Schichten")
             res[filename2] = files2
+
+            filename3 = filename.replace("_Summe_und_Schichten", "_nur_erstellte_Schichten")
+            res[filename3] = files2
         return res
 
     def export_errors(self):