worker-automate-hub 0.5.594__py3-none-any.whl → 0.5.596__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -384,17 +384,30 @@ async def integracao_contabil_generica(
384
384
  )
385
385
 
386
386
  botao_integrar.click_input()
387
-
387
+ assets_int_cont = "assets\\integracao_contabil\\"
388
+ err_dict = {
389
+ assets_int_cont + "erro_duplicidade.png": "Erro de Duplicidade localizado enquanto finalizava a integração.",
390
+ assets_int_cont + "conta_indefinida_error.png": "Conta contábil indefinida no sistema.",
391
+ assets_int_cont + "lote_sem_complemento_error.png": "Lote encontrado sem complemento obrigatório.",
392
+ }
388
393
  # Aguardar finalizar
389
394
  while True:
390
395
  try:
396
+ for img_path, mensagem in err_dict.items():
397
+ err = pyautogui.locateOnScreen(img_path, confidence=0.86)
398
+ if err:
399
+ console.print(f"[red]Erro encontrado:[/red] {mensagem}")
400
+ return RpaRetornoProcessoDTO(
401
+ sucesso=False,
402
+ retorno=mensagem,
403
+ status=RpaHistoricoStatusEnum.Falha,
404
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
405
+ )
391
406
  # Conecta à janela do tipo MsgBox
392
- time.sleep(1)
407
+ await worker_sleep(1)
393
408
  app = Application(backend="win32").connect(class_name="TMsgBox")
394
409
  msgbox = app.window(class_name="TMsgBox", title_re="Inform.*")
395
-
396
410
  msgbox.set_focus()
397
-
398
411
  # Procura pelo botão com texto '&Ok'
399
412
  botao_ok = msgbox.child_window(class_name="TBitBtn", title="&Ok")
400
413
  if botao_ok.exists() and botao_ok.is_visible():
@@ -402,24 +415,7 @@ async def integracao_contabil_generica(
402
415
  console.print("Botão '&Ok' clicado com sucesso.")
403
416
  break
404
417
  except ElementNotFoundError:
405
- console.print("Janela MsgBox não encontrada ainda. Verificando existencia de erro de duplicidade...")
406
- try:
407
- duplicidade_err_img = "assets\\integracao_contabil\\erro_duplicidade.png"
408
- duplicidade_err = pyautogui.locateOnScreen(
409
- duplicidade_err_img, confidence=0.86
410
- )
411
- console.print("Verificando imagem...")
412
- if duplicidade_err:
413
- console.print("Erro de Duplicidade localizado.")
414
- return RpaRetornoProcessoDTO(
415
- sucesso=False,
416
- retorno=f"Erro de Duplicidade localizado enquanto finalizava a integração.",
417
- status=RpaHistoricoStatusEnum.Falha,
418
- tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
419
- )
420
- console.print("Erro de Duplicidade não localizado.")
421
- except Exception as err:
422
- print(f"Sem erro de Duplicidade.\nDetalhe: {err}")
418
+ console.print("Janela MsgBox não encontrada ainda.")
423
419
  except Exception as e:
424
420
  print(f"Erro ao tentar clicar no botão: {e}")
425
421
 
@@ -3278,7 +3278,7 @@ async def check_nota_importada(xml_nota: str) -> RpaRetornoProcessoDTO:
3278
3278
  from worker_automate_hub.api.client import get_status_nf_emsys
3279
3279
 
3280
3280
  try:
3281
- max_attempts = 60
3281
+ max_attempts = 100
3282
3282
  i = 0
3283
3283
 
3284
3284
  while i < max_attempts:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.594
3
+ Version: 0.5.596
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -74,7 +74,7 @@ worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=XCbIZG1y7
74
74
  worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py,sha256=6BtgiHZ8gLiKpOHwF3Tba4oVFZDUbUUwaHw7WK_5V2I,11879
75
75
  worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py,sha256=QzK2aG5d9pmFbb8cTaNm3LWf5NMkmCvBkgo70gcLu0c,14781
76
76
  worker_automate_hub/tasks/jobs/integracao_contabil.py,sha256=psoIU0tjtTJq2W8aGXjXrfkAOYlIpUtHZyNolI7dp-0,16263
77
- worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=uyiktW67IL-r1jl_LtGk2Us0gz6rB3uW6u3MutF2NHU,18098
77
+ worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=mQo6d_X5gC5t5gnt4lyQPN7J30u8e4f81dWRjzH5Mk8,18060
78
78
  worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py,sha256=9BePVw8AP42mRKRiWqZHxIah9rGOqoBXs_Vo-OQBioM,35679
79
79
  worker_automate_hub/tasks/jobs/login_emsys.py,sha256=dO9S027qRTtjOfytF6IWO-m6hDld8kZqOVAsn91l1YA,5684
80
80
  worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py,sha256=_6CFh79eaW9KdPGR6FMV01ASPjJzNzzBK1MvC_uiSOo,5625
@@ -90,10 +90,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
90
90
  worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
91
91
  worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
92
92
  worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
93
- worker_automate_hub/utils/util.py,sha256=mFsEBbrIJBP_jyGj1bRbQjZuPH8LmXqgXQOuVZmx8aA,198280
93
+ worker_automate_hub/utils/util.py,sha256=_pgZOFWgXoov6WPbqyRTDVXJCRFfucYB3gb9swzU7bo,198281
94
94
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=wmnpuOesmPSryZszmapa37b9YNC0E2MkeDYnbwr-0rU,33315
95
95
  worker_automate_hub/worker.py,sha256=axdrr1xLTjWEyWfcyH3OCSpPTsyzck_fL_0u1DBLjvw,6525
96
- worker_automate_hub-0.5.594.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
97
- worker_automate_hub-0.5.594.dist-info/METADATA,sha256=DOf8GvqpYFXtcWw1stAe6y_MrrWT_sQipKnoXlkQ7Rg,3012
98
- worker_automate_hub-0.5.594.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
99
- worker_automate_hub-0.5.594.dist-info/RECORD,,
96
+ worker_automate_hub-0.5.596.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
97
+ worker_automate_hub-0.5.596.dist-info/METADATA,sha256=z3BxWiHHeJw3oimu337GSQNNbc7bbMiq2-Gh82ZE6ts,3012
98
+ worker_automate_hub-0.5.596.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
99
+ worker_automate_hub-0.5.596.dist-info/RECORD,,