瀏覽代碼

extract only if not booked in fname and _ < 2

marton levente 3 月之前
父節點
當前提交
7815430f06
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      anafapi/anafoauth.py

+ 3 - 1
anafapi/anafoauth.py

@@ -362,7 +362,8 @@ class Efactoauth(Anafoauth):
             xml_files = [file for file in files_in_folder if file.lower().endswith('.xml')]
             # print(xml_files)
             # print(os.path.join(dest_f, name[0].replace('.xml', '') + '_booked.xml'))
-            if os.path.join(dest_f, name[0].replace('.xml', '') + '_booked.xml') not in xml_files:
+            if os.path.join(dest_f, name[0].replace('.xml', '') + '_booked.xml') not in xml_files \
+                    and os.path.join(dest_f, name[0]).count('_') < 2:
                 if not os.path.exists(os.path.join(dest_f, name[0].replace('.xml', '') + '_booked.xml')):
                     self.xml_inv = self._extract_zipfile(inv_zip, dest_f=dest_f)
                 # print(self.xml_inv)
@@ -538,6 +539,7 @@ class Efactoauth(Anafoauth):
         post = client.add_invoice2(code_,  # ciel.partners.PARTNERS[invoice.seller_party.name]
                                    lines=document_lines,
                                    date=invoice.issue_date.strftime('%Y-%m-%d'),
+                                   due_date=invoice.due_date.strftime('%Y-%m-%d'),
                                    warehouse_code=warehouse_code,
                                    nrdoc=num,
                                    series=series,