worker-automate-hub 0.5.663__py3-none-any.whl → 0.5.664__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.

Potentially problematic release.


This version of worker-automate-hub might be problematic. Click here for more details.

@@ -122,14 +122,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
122
122
  # Fecha a instancia do emsys - caso esteja aberta
123
123
  await kill_all_emsys()
124
124
 
125
- # #Validar se é o ultimo dia
126
- # if await e_ultimo_dia_util():
127
- # return RpaRetornoProcessoDTO(
128
- # sucesso=False,
129
- # retorno="Não será possivel processar devido a regra - 'Não deve ser processado nenhuma devolução no último dia útil do mês vigente'",
130
- # status=RpaHistoricoStatusEnum.Falha,
131
- # tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
132
- # )
133
125
 
134
126
  #Realizando o login
135
127
  app = Application(backend="win32").start("C:\\Rezende\\EMSys3\\EMSys3.exe")
@@ -155,8 +147,9 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
155
147
 
156
148
  await worker_sleep(2)
157
149
  console.print("Verificando se o cliente esta ativo como Cliente e como Fornecedor... \n")
158
- ativar_cliente_fornecedor = await pessoas_ativa_cliente_fornecedor(cod_cliente_incorreto, True, True)
150
+ ativar_cliente_fornecedor, uf_cliente = await pessoas_ativa_cliente_fornecedor(cod_cliente_incorreto, True, True)
159
151
  if ativar_cliente_fornecedor.sucesso == True:
152
+ print(f"UF: {uf_cliente}")
160
153
  steps += ' ETAPA 00 - CLIENTE E FORNECEDOR - ATIVADOS COM SUCESSO'
161
154
  console.log(ativar_cliente_fornecedor.retorno, style="bold green")
162
155
  else:
@@ -167,6 +160,47 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
167
160
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
168
161
  )
169
162
 
163
+ uf_posto = False
164
+ if cod_cliente_incorreto != "140552":
165
+ uf_posto = True
166
+ # Verificar se UF são iguais
167
+ type_text_into_field("Pessoas", app["TFrmMenuPrincipal"]["Edit"], True, "50")
168
+
169
+ pyautogui.press("enter")
170
+ send_keys("{DOWN " + ("2") + "}")
171
+ pyautogui.press("enter")
172
+
173
+ await worker_sleep(5)
174
+
175
+ app = Application().connect(class_name="TFrmCadastroPessoaNew", timeout=60)
176
+ main_window = app["TFrmCadastroPessoaNew"]
177
+ main_window.set_focus()
178
+ panel_Capa = main_window.child_window(class_name="TGroupBox", found_index=1)
179
+ cod_pessoa = panel_Capa.child_window(class_name="TDBIEditNumber", found_index=1)
180
+ cod_pessoa.click()
181
+ for _ in range(3):
182
+ pyautogui.press("del")
183
+ pyautogui.press("backspace")
184
+
185
+ cod_pessoa.set_edit_text(cod_empresa)
186
+ cod_pessoa.click()
187
+ pyautogui.press("enter")
188
+
189
+ await worker_sleep(5)
190
+
191
+ try:
192
+ campo_uf_posto = main_window.child_window(class_name="TDBIEditString", found_index=9)
193
+ uf_posto = campo_uf_posto.window_text().strip()
194
+ except Exception as e:
195
+ texto_campo = ""
196
+
197
+ if uf_cliente == uf_posto:
198
+ console.print("Os estados são iguais")
199
+ else:
200
+ console.print("Os estados são diferentes")
201
+
202
+ main_window.close()
203
+
170
204
  #REALIZAR PROCESSO DE NOTA FISCAL DE SAIDA
171
205
  type_text_into_field("Nota Fiscal de Saida", app["TFrmMenuPrincipal"]["Edit"], True, "50")
172
206
  pyautogui.press("enter")
@@ -241,7 +275,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
241
275
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
242
276
  )
243
277
 
244
- #Para liquidar o cupom
278
+ # Para liquidar o cupom
245
279
  type_text_into_field("Titulos a receber", app["TFrmMenuPrincipal"]["Edit"], True, "50")
246
280
  pyautogui.press("enter")
247
281
  await worker_sleep(2)
@@ -262,7 +296,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
262
296
  tags=[RpaTagDTO(descricao=descricao_tag.descricao)]
263
297
  )
264
298
 
265
-
299
+ await worker_sleep(2)
266
300
  #ETAPA 14 A 18
267
301
  #STEP 2 - EMISSAO DA NOTA
268
302
  type_text_into_field("Nota Fiscal de Entrada", app["TFrmMenuPrincipal"]["Edit"], True, "50")
@@ -352,9 +386,20 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
352
386
  break
353
387
  else:
354
388
  for item in itens_to_select:
355
- if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
356
- nop_to_be_select = item
357
- break
389
+ if uf_posto:
390
+ if uf_posto != uf_cliente:
391
+ if '2662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
392
+ nop_to_be_select = item
393
+ break
394
+ else:
395
+ if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
396
+ nop_to_be_select = item
397
+ break
398
+ else:
399
+ if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
400
+ nop_to_be_select = item
401
+ break
402
+
358
403
 
359
404
  if nop_to_be_select != '':
360
405
  console.print(f"Nop a ser considerada: {nop_to_be_select}...\n")
@@ -415,6 +460,38 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
415
460
  await worker_sleep(1)
416
461
  pyautogui.press('tab')
417
462
  await worker_sleep(3)
463
+ main_window.set_focus()
464
+ try:
465
+ # Conecta à janela
466
+ app = Application(backend="win32").connect(class_name="TFrmPesquisarVendaDevolucao", found_index=0)
467
+ main_window = app["TFrmPesquisarVendaDevolucao"]
468
+ data_ano = datetime.now().year
469
+ data_inicial = f"01/01/{data_ano}"
470
+
471
+ # Acessa o campo desejado
472
+ data_inicial_input = main_window.child_window(class_name="TDBIEditDate", found_index=1)
473
+ data_inicial_input.click_input()
474
+ data_inicial_input.set_edit_text(data_inicial)
475
+
476
+ await worker_sleep(2)
477
+
478
+ # Data final
479
+ data_final = datetime.now().strftime("%d/%m/%Y")
480
+ print(data_final)
481
+ data_final_input = main_window.child_window(class_name="TDBIEditDate", found_index=0)
482
+ data_final_input.click_input()
483
+ data_final_input.set_edit_text(data_final)
484
+
485
+ await worker_sleep(5)
486
+
487
+ except Exception as e:
488
+ retorno = f"Não foi possivel clicar em selecionar todos os itens na tela de Pesquisar Vendas para Devolução, erro: {e} \nEtapas Executadas:\n{steps}"
489
+ return RpaRetornoProcessoDTO(
490
+ sucesso=False,
491
+ retorno=retorno,
492
+ status=RpaHistoricoStatusEnum.Falha,
493
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
494
+ )
418
495
 
419
496
  try:
420
497
  pesquisar_icon = pyautogui.locateOnScreen(ASSETS_PATH + "\\notas_saida\\icon_pesquisa_nota_saida.png", confidence=0.8)
@@ -4021,14 +4021,25 @@ async def nf_devolucao_liquidar_cupom(
4021
4021
  )
4022
4022
  n_titulo = panel_TTab_Sheet.child_window(
4023
4023
  class_name="TDBIEditString", found_index=8
4024
- )
4024
+ ).click()
4025
+
4026
+ await worker_sleep(1)
4027
+
4025
4028
  n_titulo.set_edit_text(num_nota_fiscal)
4029
+
4026
4030
  await worker_sleep(2)
4031
+
4032
+ pyautogui.press("tab")
4033
+
4027
4034
  console.print("Numero da nota fiscal inserido com sucesso...\n")
4028
-
4035
+
4036
+ main_window.set_focus()
4037
+
4038
+ await worker_sleep(2)
4039
+
4029
4040
  try:
4030
4041
  pesquisar_icon = pyautogui.locateOnScreen(
4031
- ASSETS_PATH + "\\emsys\\icon_pesquisa_nota_saida.png", confidence=0.8
4042
+ "assets\\emsys\\icon_pesquisa_nota_saida.png", confidence=0.8
4032
4043
  )
4033
4044
  pyautogui.click(pesquisar_icon)
4034
4045
  await worker_sleep(5)
@@ -4092,6 +4103,8 @@ async def nf_devolucao_liquidar_cupom(
4092
4103
  tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
4093
4104
  )
4094
4105
 
4106
+ await worker_sleep(2)
4107
+
4095
4108
  console.print("Acessando a opção de Caixa")
4096
4109
  panel_TPage = main_window.child_window(class_name="TcxTreeView")
4097
4110
  panel_TTabSheet = panel_TPage.child_window(class_name="TcxCustomInnerTreeView")
@@ -4134,7 +4147,11 @@ async def nf_devolucao_liquidar_cupom(
4134
4147
  )
4135
4148
  db_edit_code.set_edit_text("13")
4136
4149
  await worker_sleep(1)
4150
+ db_edit_code.click()
4151
+ await worker_sleep(1)
4137
4152
  pyautogui.press("tab")
4153
+ await worker_sleep(1)
4154
+
4138
4155
 
4139
4156
  # Clicar no botão Liquidar dentro de TabSheetLiquidacao
4140
4157
  liquidar_button = panel_liquidacao.child_window(
@@ -4867,7 +4884,6 @@ async def pessoas_ativa_cliente_fornecedor(
4867
4884
  ), ""
4868
4885
 
4869
4886
 
4870
-
4871
4887
  async def save_pdf_emsys(file_path):
4872
4888
  try:
4873
4889
  await worker_sleep(10)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.663
3
+ Version: 0.5.664
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
@@ -44,7 +44,7 @@ worker_automate_hub/tasks/jobs/cte_xml.py,sha256=hvKWRF46Pcl_Mp-l2FjgXaqrQ5UgKVk
44
44
  worker_automate_hub/tasks/jobs/descartes.py,sha256=E5kKef8j7e0PTm6NBeZAXkljUoAFEMjVWvHaJ8g2fv4,44451
45
45
  worker_automate_hub/tasks/jobs/devolucao_ctf.py,sha256=zQcRXZ9TxJhyL4jHjBTS-iW5BcmRoSPv9FsBLy0-eWQ,250793
46
46
  worker_automate_hub/tasks/jobs/devolucao_ctf_35.py,sha256=e9t5k2mtZcUcEGKPWysbWzsH_gqrK-6aBXjWe2jWfTg,253948
47
- worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=k79CKAU4Oi1ZSMaYMW0BHsUWgLXMMJzmzxSXdNKirJY,274457
47
+ worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=Y3xY3eE1-H_NoKoLAte_UWiWd6gfmT2M_VDwq1tf6rk,278013
48
48
  worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=dKkf22nH5gp3RErq5u0UzRsKyJ81fc6ZZ4vLtUuMwHA,21002
49
49
  worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=8WmKe4-MRtzHobXz2S4YBDNN8alfawkC-BBlRY-mn1g,1726
50
50
  worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM3Fje-rkyx5tjwmRy4lyL8,25300
@@ -95,10 +95,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
95
95
  worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
96
96
  worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
97
97
  worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
98
- worker_automate_hub/utils/util.py,sha256=GJvJdRil1DLVgZFgGg2n_WI3UKoy-xVmXF3IIefW59I,206009
98
+ worker_automate_hub/utils/util.py,sha256=kXGtm91s6XJBtD7m_KyCrOxQ7mCeIBqEOnhbfYs3Vf8,206355
99
99
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=L_z1Aps6BFWl-6_Ibm45vDid1S4kFDz5O78N2uO1Rq0,36458
100
100
  worker_automate_hub/worker.py,sha256=axdrr1xLTjWEyWfcyH3OCSpPTsyzck_fL_0u1DBLjvw,6525
101
- worker_automate_hub-0.5.663.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
102
- worker_automate_hub-0.5.663.dist-info/METADATA,sha256=CXuQG9DoPUUP37a1XmHtiFodfiqgiPFkua-qTchNYbY,3049
103
- worker_automate_hub-0.5.663.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
104
- worker_automate_hub-0.5.663.dist-info/RECORD,,
101
+ worker_automate_hub-0.5.664.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
102
+ worker_automate_hub-0.5.664.dist-info/METADATA,sha256=cWIVE9pcQDN0pDK3VJ6VAJ3454GhhIO__KGR6GRwkDM,3049
103
+ worker_automate_hub-0.5.664.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
104
+ worker_automate_hub-0.5.664.dist-info/RECORD,,