worker-automate-hub 0.4.432__tar.gz → 0.4.435__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/PKG-INFO +1 -1
  2. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/pyproject.toml +1 -1
  3. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/conexao_rdp.py +5 -5
  4. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +11 -29
  5. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +33 -4
  6. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/README.md +0 -0
  7. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/__init__.py +0 -0
  8. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/__init__.py +0 -0
  9. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/ahead_service.py +0 -0
  10. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/client.py +0 -0
  11. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/helpers/__init__.py +0 -0
  12. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
  13. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/api/rpa_historico_service.py +0 -0
  14. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/cli.py +0 -0
  15. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/config/__init__.py +0 -0
  16. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/config/settings.py +0 -0
  17. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/config.py +0 -0
  18. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/core/so_manipulation.py +0 -0
  19. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/__init__.py +0 -0
  20. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/deprecation.py +0 -0
  21. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/rate_limit.py +0 -0
  22. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/repeat.py +0 -0
  23. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/retry.py +0 -0
  24. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/singleton.py +0 -0
  25. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/decorators/timeit.py +0 -0
  26. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/__init__.py +0 -0
  27. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dao/__init__.py +0 -0
  28. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
  29. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
  30. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
  31. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dto/__init__.py +0 -0
  32. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
  33. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
  34. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
  35. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
  36. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/__init__.py +0 -0
  37. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
  38. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
  39. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
  40. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
  41. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
  42. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
  43. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
  44. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
  45. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
  46. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
  47. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
  48. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
  49. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
  50. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
  51. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
  52. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
  53. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
  54. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
  55. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
  56. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
  57. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
  58. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
  59. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
  60. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/playground.py +0 -0
  61. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
  62. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
  63. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/task_definitions.py +0 -0
  64. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/tasks/task_executor.py +0 -0
  65. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/__init__.py +0 -0
  66. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/env.py +0 -0
  67. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
  68. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/logger.py +0 -0
  69. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/toast.py +0 -0
  70. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/updater.py +0 -0
  71. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/util.py +0 -0
  72. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
  73. {worker_automate_hub-0.4.432 → worker_automate_hub-0.4.435}/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.432
3
+ Version: 0.4.435
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.432"
3
+ version = "0.4.435"
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"
@@ -62,9 +62,9 @@ class RDPConnection:
62
62
  janelas_rdp = [
63
63
  win
64
64
  for win in gw.getAllTitles()
65
- if "Conexão de Área de Trabalho Remota" in win
65
+ if "Ligação ao Ambiente de Trabalho Remoto" in win
66
66
  or "Remote Desktop Connection" in win
67
- or "Ligação ao ambiente de trabalho remoto" in win
67
+ or "Conexão de Área de Trabalho Remota" in win
68
68
  ]
69
69
 
70
70
  for titulo in janelas_rdp:
@@ -103,11 +103,11 @@ class RDPConnection:
103
103
  subprocess.Popen(["mstsc", f"/v:{self.ip}"], close_fds=True, start_new_session=True)
104
104
  await worker_sleep(10) # Tempo aumentado para garantir abertura
105
105
 
106
- console.print("Procurando janela 'Conexão de Área de Trabalho Remota'")
106
+ console.print("Procurando janela 'Ligação ao ambiente de trabalho remoto'")
107
107
  try:
108
- windows = gw.getWindowsWithTitle("Conexão de Área de Trabalho Remota")
109
- except:
110
108
  windows = gw.getWindowsWithTitle("Ligação ao ambiente de trabalho remoto")
109
+ except:
110
+ windows = gw.getWindowsWithTitle("Conexão de Área de Trabalho Remota")
111
111
 
112
112
  if not windows:
113
113
  logger.warning("Tentando encontrar janela com título em inglês 'Remote Desktop Connection'")
@@ -40,6 +40,7 @@ from worker_automate_hub.utils.util import (
40
40
  verify_nf_incuded,
41
41
  warnings_after_xml_imported,
42
42
  worker_sleep,
43
+ select_documento_type
43
44
  )
44
45
  from worker_automate_hub.utils.utils_nfe_entrada import EMSys
45
46
 
@@ -98,36 +99,17 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
98
99
 
99
100
  # Procura campo documento
100
101
  console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
101
- app = Application().connect(title="Nota Fiscal de Entrada")
102
- main_window = app["Nota Fiscal de Entrada"]
103
-
104
- console.print(
105
- "Controles encontrados na janela 'Nota Fiscal de Entrada, navegando entre eles...\n"
106
- )
107
- panel_TNotebook = main_window.child_window(
108
- class_name="TNotebook", found_index=0
109
- )
110
- panel_TPage = panel_TNotebook.child_window(class_name="TPage", found_index=0)
111
- panel_TPageControl = panel_TPage.child_window(
112
- class_name="TPageControl", found_index=0
113
- )
114
- panel_TTabSheet = panel_TPageControl.child_window(
115
- class_name="TTabSheet", found_index=0
116
- )
117
- combo_box_tipo_documento = panel_TTabSheet.child_window(
118
- class_name="TDBIComboBox", found_index=1
119
- )
120
- combo_box_tipo_documento.click()
121
- console.print(
122
- "Clique select box, Tipo de documento realizado com sucesso, selecionando o tipo de documento...\n"
123
- )
124
-
125
- await worker_sleep(4)
126
-
127
- set_combobox("||List", "NOTA FISCAL DE ENTRADA ELETRONICA - DANFE")
128
- console.print(
129
- "Tipo de documento 'NOTA FISCAL DE ENTRADA ELETRONICA - DANFE', selecionado com sucesso...\n"
102
+ document_type = await select_documento_type(
103
+ "NOTA FISCAL DE ENTRADA ELETRONICA - DANFE"
130
104
  )
105
+ if document_type.sucesso == True:
106
+ console.log(document_type.retorno, style="bold green")
107
+ else:
108
+ return RpaRetornoProcessoDTO(
109
+ sucesso=False,
110
+ retorno=document_type.retorno,
111
+ status=RpaHistoricoStatusEnum.Falha,
112
+ )
131
113
 
132
114
  await worker_sleep(4)
133
115
 
@@ -169,8 +169,17 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
169
169
  combo_box_natureza_operacao.click()
170
170
 
171
171
  await worker_sleep(3)
172
- set_combobox("||List", "1652-COMPRA DE MERCADORIAS- 1.652")
173
- await worker_sleep(3)
172
+ try:
173
+ set_combobox("||List", "1652-COMPRA DE MERCADORIAS- 1.652")
174
+ except:
175
+ console.log("Não foi possivel selecionar o tipo de documento via set combobox, realizando a alteração utilizando pyautogui write")
176
+ pyautogui.write("1102")
177
+ await worker_sleep(2)
178
+ pyautogui.hotkey("enter")
179
+ await worker_sleep(2)
180
+ pyautogui.write("1652-COMPRA DE MERCADORIAS- 1.652")
181
+ await worker_sleep(2)
182
+
174
183
  elif cfop == 6655:
175
184
  combo_box_natureza_operacao = main_window.child_window(
176
185
  class_name="TDBIComboBox", found_index=0
@@ -178,8 +187,16 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
178
187
  combo_box_natureza_operacao.click()
179
188
 
180
189
  await worker_sleep(3)
181
- set_combobox("||List", "2652-COMPRA DE MERCADORIAS- 2.652")
182
- await worker_sleep(3)
190
+ try:
191
+ set_combobox("||List", "2652-COMPRA DE MERCADORIAS- 2.652")
192
+ except:
193
+ console.log("Não foi possivel selecionar o tipo de documento via set combobox, realizando a alteração utilizando pyautogui write")
194
+ pyautogui.write("1102")
195
+ await worker_sleep(2)
196
+ pyautogui.hotkey("enter")
197
+ await worker_sleep(2)
198
+ pyautogui.write("2652-COMPRA DE MERCADORIAS- 2.652")
199
+ await worker_sleep(2)
183
200
  else:
184
201
  console.print(
185
202
  "Erro mapeado, CFOP diferente de 5655 ou 6655, necessario ação manual ou ajuste no robo...\n"
@@ -189,6 +206,18 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
189
206
  retorno="Erro mapeado, CFOP diferente de 5655 ou 6655, necessario ação manual ou ajuste no robo",
190
207
  status=RpaHistoricoStatusEnum.Falha,
191
208
  )
209
+
210
+
211
+ combo_box_natureza_operacao = main_window.child_window(class_name="TDBIComboBox", found_index=0)
212
+ if "2652-COMPRA DE MERCADORIAS- 2.652" in combo_box_natureza_operacao.window_text() or "1652-COMPRA DE MERCADORIAS- 1.652" in combo_box_natureza_operacao.window_text():
213
+ console.log("CFOP informado com sucesso")
214
+ else:
215
+ return RpaRetornoProcessoDTO(
216
+ sucesso=False,
217
+ retorno="Não foi possivel selecionar o CFOP",
218
+ status=RpaHistoricoStatusEnum.Falha,
219
+ )
220
+
192
221
 
193
222
  # INTERAGINDO COM O CAMPO ALMOXARIFADO
194
223
  filialEmpresaOrigem = nota.get("filialEmpresaOrigem")