worker-automate-hub 0.4.443__tar.gz → 0.4.445__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/PKG-INFO +1 -1
  2. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/pyproject.toml +1 -1
  3. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +30 -1
  4. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +54 -52
  5. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/utils_nfe_entrada.py +17 -4
  6. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/README.md +0 -0
  7. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/__init__.py +0 -0
  8. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/__init__.py +0 -0
  9. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/ahead_service.py +0 -0
  10. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/client.py +0 -0
  11. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/helpers/__init__.py +0 -0
  12. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
  13. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/rpa_fila_service.py +0 -0
  14. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/api/rpa_historico_service.py +0 -0
  15. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/cli.py +0 -0
  16. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/config/__init__.py +0 -0
  17. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/config/settings.py +0 -0
  18. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/config.py +0 -0
  19. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/core/so_manipulation.py +0 -0
  20. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/__init__.py +0 -0
  21. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/deprecation.py +0 -0
  22. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/rate_limit.py +0 -0
  23. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/repeat.py +0 -0
  24. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/retry.py +0 -0
  25. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/singleton.py +0 -0
  26. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/decorators/timeit.py +0 -0
  27. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/__init__.py +0 -0
  28. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dao/__init__.py +0 -0
  29. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
  30. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
  31. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
  32. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dto/__init__.py +0 -0
  33. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
  34. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
  35. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
  36. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
  37. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/__init__.py +0 -0
  38. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
  39. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
  40. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
  41. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
  42. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
  43. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
  44. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
  45. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
  46. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
  47. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
  48. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
  49. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
  50. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
  51. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
  52. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
  53. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
  54. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
  55. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
  56. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
  57. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
  58. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
  59. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
  60. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
  61. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
  62. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/playground.py +0 -0
  63. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
  64. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
  65. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/task_definitions.py +0 -0
  66. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/tasks/task_executor.py +0 -0
  67. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/__init__.py +0 -0
  68. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/env.py +0 -0
  69. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
  70. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/logger.py +0 -0
  71. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/toast.py +0 -0
  72. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/updater.py +0 -0
  73. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/utils/util.py +0 -0
  74. {worker_automate_hub-0.4.443 → worker_automate_hub-0.4.445}/worker_automate_hub/worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: worker-automate-hub
3
- Version: 0.4.443
3
+ Version: 0.4.445
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "worker-automate-hub"
3
- version = "0.4.443"
3
+ version = "0.4.445"
4
4
  description = "Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta."
5
5
  authors = ["Joel Paim"]
6
6
  readme = "README.md"
@@ -274,7 +274,36 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
274
274
  await emsys.verify_warning_and_error("Information", "&No")
275
275
 
276
276
  await worker_sleep(10)
277
- await emsys.select_tipo_cobranca()
277
+ console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
278
+ app = Application().connect(class_name="TFrmNotaFiscalEntrada")
279
+ main_window = app["TFrmNotaFiscalEntrada"]
280
+
281
+ main_window.set_focus()
282
+ console.print("Acessando a aba de Pagamentos... \n")
283
+ panel_TPage = main_window.child_window(class_name="TPage", title="Formulario")
284
+ panel_TTabSheet = panel_TPage.child_window(class_name="TcxCustomInnerTreeView")
285
+ panel_TTabSheet.wait("visible")
286
+ panel_TTabSheet.click()
287
+ send_keys("{DOWN " + ("7") + "}")
288
+
289
+ panel_TPage = main_window.child_window(class_name="TPage", title="Formulario")
290
+ panel_TTabSheet = panel_TPage.child_window(class_name="TPageControl")
291
+
292
+ panel_TabPagamento = panel_TTabSheet.child_window(class_name="TTabSheet")
293
+
294
+ panel_TabPagamentoCaixa = panel_TTabSheet.child_window(title="Pagamento Pelo Caixa")
295
+
296
+ tipo_cobranca = panel_TabPagamentoCaixa.child_window(
297
+ class_name="TDBIComboBox", found_index=0
298
+ )
299
+
300
+ console.print(f"Selecionando a Especie de Caixa... \n")
301
+ tipo_cobranca.click()
302
+ try:
303
+ set_combobox("||List", "BANCO DO BRASIL BOLETO")
304
+ except:
305
+ set_combobox("||List", "BOLETO")
306
+
278
307
  await emsys.inserir_vencimento_e_valor(
279
308
  nota.get("nomeFornecedor"),
280
309
  nota.get("dataEmissao"),
@@ -414,7 +414,7 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
414
414
  max_attempts = 60
415
415
  i = 0
416
416
 
417
- while i < max_attempts:
417
+ while i < max_attempts and retorno is not True:
418
418
  information_pop_up = await is_window_open("Information")
419
419
  if information_pop_up["IsOpened"] == True:
420
420
  break
@@ -424,60 +424,62 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
424
424
  i += 1
425
425
 
426
426
  information_pop_up = await is_window_open("Information")
427
- if information_pop_up["IsOpened"] == True:
428
- app = Application().connect(class_name="TFrmNotaFiscalEntrada")
429
- main_window = app["Information"]
430
-
431
- main_window.set_focus()
432
-
433
- console.print(f"Obtendo texto do Information...\n")
434
- console.print(f"Tirando print da janela do Information para realização do OCR...\n")
435
-
436
- window_rect = main_window.rectangle()
437
- screenshot = pyautogui.screenshot(
438
- region=(
439
- window_rect.left,
440
- window_rect.top,
441
- window_rect.width(),
442
- window_rect.height(),
427
+
428
+ if not retorno:
429
+ if information_pop_up["IsOpened"] == True:
430
+ app = Application().connect(class_name="TFrmNotaFiscalEntrada")
431
+ main_window = app["Information"]
432
+
433
+ main_window.set_focus()
434
+
435
+ console.print(f"Obtendo texto do Information...\n")
436
+ console.print(f"Tirando print da janela do Information para realização do OCR...\n")
437
+
438
+ window_rect = main_window.rectangle()
439
+ screenshot = pyautogui.screenshot(
440
+ region=(
441
+ window_rect.left,
442
+ window_rect.top,
443
+ window_rect.width(),
444
+ window_rect.height(),
445
+ )
443
446
  )
444
- )
445
- username = getpass.getuser()
446
- path_to_png = f"C:\\Users\\{username}\\Downloads\\information_popup_{nota.get("nfe")}.png"
447
- screenshot.save(path_to_png)
448
- console.print(f"Print salvo em {path_to_png}...\n")
447
+ username = getpass.getuser()
448
+ path_to_png = f"C:\\Users\\{username}\\Downloads\\information_popup_{nota.get("nfe")}.png"
449
+ screenshot.save(path_to_png)
450
+ console.print(f"Print salvo em {path_to_png}...\n")
449
451
 
450
- console.print(
451
- f"Preparando a imagem para maior resolução e assertividade no OCR...\n"
452
- )
453
- image = Image.open(path_to_png)
454
- image = image.convert("L")
455
- enhancer = ImageEnhance.Contrast(image)
456
- image = enhancer.enhance(2.0)
457
- image.save(path_to_png)
458
- console.print(f"Imagem preparada com sucesso...\n")
459
- console.print(f"Realizando OCR...\n")
460
- captured_text = pytesseract.image_to_string(Image.open(path_to_png))
461
- console.print(
462
- f"Texto Full capturado {captured_text}...\n"
463
- )
464
- os.remove(path_to_png)
465
- if 'nota fiscal inc' in captured_text.lower():
466
- console.print(f"Tentando clicar no Botão OK...\n")
467
- btn_ok = main_window.child_window(class_name="TButton")
468
-
469
- if btn_ok.exists():
470
- btn_ok.click()
471
- retorno = True
472
- else:
473
- return RpaRetornoProcessoDTO(
474
- sucesso=False,
475
- retorno=f"Pop_up Informantion não mapeado para andamento do robô, mensagem {captured_text}",
476
- status=RpaHistoricoStatusEnum.Falha,
452
+ console.print(
453
+ f"Preparando a imagem para maior resolução e assertividade no OCR...\n"
477
454
  )
478
- else:
479
- console.print(f"Aba Information não encontrada")
480
- retorno = await verify_nf_incuded()
455
+ image = Image.open(path_to_png)
456
+ image = image.convert("L")
457
+ enhancer = ImageEnhance.Contrast(image)
458
+ image = enhancer.enhance(2.0)
459
+ image.save(path_to_png)
460
+ console.print(f"Imagem preparada com sucesso...\n")
461
+ console.print(f"Realizando OCR...\n")
462
+ captured_text = pytesseract.image_to_string(Image.open(path_to_png))
463
+ console.print(
464
+ f"Texto Full capturado {captured_text}...\n"
465
+ )
466
+ os.remove(path_to_png)
467
+ if 'nota fiscal inc' in captured_text.lower():
468
+ console.print(f"Tentando clicar no Botão OK...\n")
469
+ btn_ok = main_window.child_window(class_name="TButton")
470
+
471
+ if btn_ok.exists():
472
+ btn_ok.click()
473
+ retorno = True
474
+ else:
475
+ return RpaRetornoProcessoDTO(
476
+ sucesso=False,
477
+ retorno=f"Pop_up Informantion não mapeado para andamento do robô, mensagem {captured_text}",
478
+ status=RpaHistoricoStatusEnum.Falha,
479
+ )
480
+ else:
481
+ console.print(f"Aba Information não encontrada")
482
+ retorno = await verify_nf_incuded()
481
483
 
482
484
  except Exception as e:
483
485
  console.print(f"Erro ao conectar à janela Information: {e}\n")
@@ -198,8 +198,7 @@ class EMSys:
198
198
  await worker_sleep(1)
199
199
  pyautogui.click(1180, 776)
200
200
  await worker_sleep(1)
201
- pyautogui.click(619, 377)
202
- await worker_sleep(1)
201
+ await self.click_itens_da_nota()
203
202
 
204
203
  # Fecha a janela de alteração de item
205
204
  # try:
@@ -207,7 +206,7 @@ class EMSys:
207
206
  # console.print("Apertando [ESC]", style="bold blue")
208
207
  # except Exception as e:
209
208
  # console.print(f"Erro ao cancelar edição de item: {e}", style="bold red")
210
- await worker_sleep(3)
209
+ # await worker_sleep(3)
211
210
 
212
211
  index_item_atual += 1
213
212
  console.print(f"Item aual no final da execução: {index_item_atual}")
@@ -226,7 +225,21 @@ class EMSys:
226
225
  await worker_sleep(2)
227
226
 
228
227
  async def select_tipo_cobranca(self):
229
- pyautogui.click(632, 384)
228
+ # await worker_sleep(3)
229
+ # pyautogui.click(632, 384)
230
+
231
+ console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
232
+ app = Application().connect(class_name="TFrmNotaFiscalEntrada")
233
+ main_window = app["TFrmNotaFiscalEntrada"]
234
+
235
+ main_window.set_focus()
236
+ console.print("Acessando a aba de Pagamentos... \n")
237
+ panel_TPage = main_window.child_window(class_name="TPage", title="Formulario")
238
+ panel_TTabSheet = panel_TPage.child_window(class_name="TcxCustomInnerTreeView")
239
+ panel_TTabSheet.wait("visible")
240
+ panel_TTabSheet.click()
241
+ send_keys("{DOWN " + ("2") + "}")
242
+
230
243
  await worker_sleep(2)
231
244
  pyautogui.click(893, 549)
232
245
  await worker_sleep(5)