worker-automate-hub 0.4.417__py3-none-any.whl → 0.4.419__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.
@@ -69,20 +69,6 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
69
69
  # Abre um novo emsys
70
70
  await kill_process("EMSys")
71
71
 
72
- #Verifica se a nota ja foi lançada
73
- console.print("\nVerifica se a nota ja foi lançada...")
74
- nf_chave_acesso = int(nota.get("nfe"))
75
- status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
76
- if status_nf_emsys.get("status") == "Lançada":
77
- console.print("\nNota ja lançada, processo finalizado...", style="bold green")
78
- return RpaRetornoProcessoDTO(
79
- sucesso=False,
80
- retorno="Nota já lançada",
81
- status=RpaHistoricoStatusEnum.Descartado,
82
- )
83
- else:
84
- console.print("\nNota não lançada, iniciando o processo...")
85
-
86
72
  app = Application(backend="win32").start("C:\\Rezende\\EMSys3\\EMSys3.exe")
87
73
  warnings.filterwarnings(
88
74
  "ignore",
@@ -359,6 +345,7 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
359
345
 
360
346
  await worker_sleep(10)
361
347
  await emsys.percorrer_grid()
348
+ pyautogui.click(585, 328)
362
349
  await emsys.select_tipo_cobranca()
363
350
  await emsys.inserir_vencimento_e_valor(
364
351
  nota.get("nomeFornecedor"),
@@ -536,4 +523,4 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
536
523
  sucesso=False,
537
524
  retorno=observacao,
538
525
  status=RpaHistoricoStatusEnum.Falha,
539
- )
526
+ )
@@ -463,6 +463,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
463
463
 
464
464
  max_attempts = 3
465
465
  attempts = 0
466
+ captured_text = None
466
467
  resultado = None
467
468
  while attempts < max_attempts:
468
469
  main_window.set_focus()
@@ -493,9 +494,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
493
494
  console.print(f"Realizando OCR...\n")
494
495
  await worker_sleep(1)
495
496
  captured_text = pytesseract.image_to_string(Image.open(path_to_png))
496
- console.print(
497
- f"Texto Full capturado {captured_text}...\n"
498
- )
497
+ console.print(f"Texto Full capturado {captured_text}...\n")
499
498
  os.remove(path_to_png)
500
499
 
501
500
  pattern_qtd_restante = r"Quantidade restante:\s([\d,]+)"
@@ -503,6 +502,24 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
503
502
  if resultado:
504
503
  break
505
504
  else:
505
+ await worker_sleep(2)
506
+ console.print(f"Não conseguiu encontrar a quantidade restante, tentando cortar a imagem...\n")
507
+ width, height = image.size
508
+ box = (0, height - 100, width, height)
509
+ cropped_image = image.crop(box)
510
+
511
+ cropped_image = cropped_image.convert("L")
512
+ cropped_image = cropped_image.filter(ImageFilter.SHARPEN)
513
+ enhancer = ImageEnhance.Contrast(cropped_image)
514
+ cropped_image = enhancer.enhance(2.0)
515
+
516
+ captured_text = pytesseract.image_to_string(cropped_image)
517
+ console.print(f"Texto Full capturado {captured_text}...\n")
518
+
519
+ resultado = re.search(pattern_qtd_restante, captured_text)
520
+ if resultado:
521
+ break
522
+
506
523
  await worker_sleep(2)
507
524
  attempts += 1
508
525
 
@@ -521,13 +538,13 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
521
538
  else:
522
539
  return RpaRetornoProcessoDTO(
523
540
  sucesso=False,
524
- retorno=f"Não foi possivel obter o resultado da quantidade restante, texto extraido: {resultado}",
541
+ retorno=f"Não foi possivel obter o resultado da quantidade restante, texto extraido: {captured_text}",
525
542
  status=RpaHistoricoStatusEnum.Falha,
526
543
  )
527
544
  except Exception as e:
528
545
  return RpaRetornoProcessoDTO(
529
546
  sucesso=False,
530
- retorno=f"Erro {e}, Não foi possivel obter o resultado da quantidade restante, texto extraido: {resultado}",
547
+ retorno=f"Erro {e}, Não foi possivel obter o resultado da quantidade restante",
531
548
  status=RpaHistoricoStatusEnum.Falha,
532
549
  )
533
550
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: worker-automate-hub
3
- Version: 0.4.417
3
+ Version: 0.4.419
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
@@ -38,7 +38,7 @@ worker_automate_hub/tasks/jobs/ecac_estadual_sc.py,sha256=ZTjc4rS8J7VfWHPFLkJBcS
38
38
  worker_automate_hub/tasks/jobs/ecac_estadual_sp.py,sha256=iS6za_nGCzBRVCXYYuUTIyMWJznHp8l6BPahqwzc_5c,29102
39
39
  worker_automate_hub/tasks/jobs/ecac_federal.py,sha256=ORQbA4DCfyHJqjfvOCenc97QHvBCBlA3oMSzl59K6vg,55316
40
40
  worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256=5Rqz_kf-399nEA3s1_69MGOAn6Mk0GbdAP_0EFzAcYw,16570
41
- worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=t13fW63d52OwIUHaJrHY3qxIkd1LjHE_bHkSWqVhy3I,21129
41
+ worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=qt844lVCy4ljxGbnG3fTP5fbIY7g1qC57jwhQqdlFUM,20499
42
42
  worker_automate_hub/tasks/jobs/entrada_de_notas_207.py,sha256=TfvGmH1__OGRx5oYordEJt-gpcETKA9OFhwHQD3yqs4,24928
43
43
  worker_automate_hub/tasks/jobs/entrada_de_notas_32.py,sha256=0cneKY6bQU5neo3TKlGynney_CoOB_J_dctFMYf26WM,32388
44
44
  worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=ktXc_kdMhlz9cbb7XjfMJhME29mgMFd_FnatxSZZU_s,31457
@@ -48,7 +48,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=5WkmAOp18NlPfx0Cn28
48
48
  worker_automate_hub/tasks/jobs/entrada_de_notas_500.py,sha256=MYPaYAP2iwdBYDZUf39f7yGibTME9uObEash_QTCmFA,32231
49
49
  worker_automate_hub/tasks/jobs/entrada_de_notas_505.py,sha256=jIml8gjXPdI6_x7S9VVV8IrKZRF7_PTNOMnhNmYMDTU,14490
50
50
  worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py,sha256=8XP9G3n0PUeshbRWkWKOMnyUGRWspIolPZVqQTR3SMI,14184
51
- worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=DBzP8O-m7OvuBOmWGfmC7JwCQ29IkKFAWD6JnJI7BLE,48452
51
+ worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=DMKw8Px8NtrNNAmBTAJ32sQ7fCZdF5zJno-X39c7Ubg,49548
52
52
  worker_automate_hub/tasks/jobs/exemplo_processo.py,sha256=3-zxbb-9YHPmSA_K1Qgxp_FwSqg2QDjGBRCLxDZ8QoQ,3451
53
53
  worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=iXIKBMNFPj3L6G5Iq5nyDKiZT3NAP5sIhRSzYdURpNw,9571
54
54
  worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=QBGm6eS5JghgNWNqZlk1g2a2iV8LnBLiOTBBL3Giet0,4181
@@ -67,7 +67,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
67
67
  worker_automate_hub/utils/util.py,sha256=YQkdPMCgrwuCJG_069p1cIG7xTg8VgvSHlGnIQrlyHo,119625
68
68
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=yQFyDzvXPSO-UYV1m38WLJ3AWQgZYcyUkHZdCKE1jG4,28360
69
69
  worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
70
- worker_automate_hub-0.4.417.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
- worker_automate_hub-0.4.417.dist-info/METADATA,sha256=LHx1gr8Grvvbo4E1tstlbhrnbCh56AgV68a6onv6JPA,2895
72
- worker_automate_hub-0.4.417.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
- worker_automate_hub-0.4.417.dist-info/RECORD,,
70
+ worker_automate_hub-0.4.419.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
71
+ worker_automate_hub-0.4.419.dist-info/METADATA,sha256=aq9S7CUDbFqADQTf11Ns2hhEbJDq7zEOsREPjAvmuLM,2895
72
+ worker_automate_hub-0.4.419.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
73
+ worker_automate_hub-0.4.419.dist-info/RECORD,,