Browse Source

fixed problem whern multiple unpaid invoice is pending

ash 1 year ago
parent
commit
117c201c6d
2 changed files with 3 additions and 1 deletions
  1. 3 1
      main.py
  2. BIN
      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()

BIN
msedgedriver.exe