瀏覽代碼

fixed problem whern multiple unpaid invoice is pending

ash 1 年之前
父節點
當前提交
117c201c6d
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      main.py
  2. 二進制
      msedgedriver.exe

+ 3 - 1
main.py

@@ -441,7 +441,9 @@ for link in invoice_links :
                 date_string = format(stripe_payment_date,'{%d/%m/%Y}')
                 driver.find_element(By.ID, "re").send_keys(date_string)
                 driver.find_element(By.NAME, "comment").send_keys("Payment treated by automation - Slash-DoliStripe \n stripe invoice URL : " + link.stripe_invoice_url )
-                driver.find_element(By.CLASS_NAME,'AutoFillAmout').click()
+                #en cas de plusieur facture impayée dont celles qui n'ont rien a voir avec le contrat
+                target_invoice_line = driver.find_element(By.CLASS_NAME,'highlight') 
+                target_invoice_line.find_element(By.CLASS_NAME,'AutoFillAmout').click()
                 driver.find_element(By.NAME, "num_paiement").send_keys(link.stripe_invoice_number)
                 driver.find_element(By.XPATH,'//input[@value="Payer"]').click()
                 driver.find_element(By.XPATH,'//input[@value="Valider"]').click()

二進制
msedgedriver.exe