소스 검색

fixed problem whern multiple unpaid invoice is pending

ash 1 년 전
부모
커밋
117c201c6d
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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