worker-automate-hub 0.5.57__py3-none-any.whl → 0.5.59__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.
@@ -133,124 +133,127 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
133
133
  console.print(f"\nError Message: {return_login.retorno}", style="bold red")
134
134
  return return_login
135
135
 
136
- #VALIDAR SE CLIENTE É FIDIC
137
- console.print("Validando se o Cliente é FIDC...\n")
138
- if nota.get("clienteFIDC").lower() == 'não':
139
- #HABILITAR CLIENTE E FORNECEDOR PARA COD INCORRETO
140
- console.print("Seguindo com o processo de habilitar Cliente e Fornecedor para andamento do processo.. \n")
141
- type_text_into_field("Pessoas", app["TFrmMenuPrincipal"]["Edit"], True, "50")
142
- pyautogui.press("enter")
143
- send_keys("{DOWN " + ("2") + "}")
144
- pyautogui.press("enter")
145
-
146
- await worker_sleep(2)
147
- console.print("Verificando se o cliente esta ativo como Cliente e como Fornecedor... \n")
148
- ativar_cliente_fornecedor = await pessoas_ativa_cliente_fornecedor(cod_cliente_incorreto, True, True)
149
- if ativar_cliente_fornecedor.sucesso == True:
150
- steps += 'ETAPA 00 - CLIENTE E FORNECEDOR - ATIVADOS COM SUCESSO'
151
- console.log(ativar_cliente_fornecedor.retorno, style="bold green")
152
- else:
153
- return RpaRetornoProcessoDTO(
154
- sucesso=False,
155
- retorno=ativar_cliente_fornecedor.retorno,
156
- status=RpaHistoricoStatusEnum.Falha,
157
- tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
158
- )
159
-
160
- #REALIZAR PROCESSO DE NOTA FISCAL DE SAIDA
161
- type_text_into_field("Nota Fiscal de Saida", app["TFrmMenuPrincipal"]["Edit"], True, "50")
162
- pyautogui.press("enter")
163
- await worker_sleep(2)
164
- pyautogui.press('down')
165
- pyautogui.press("enter")
166
- console.print(f"\nPesquisa: 'Nota Fiscal de Saída' realizada com sucesso",style="bold green")
167
- await worker_sleep(6)
168
-
169
- busca_nf_saida = await nf_busca_nf_saida(numero_cupom_fiscal)
170
- if busca_nf_saida.sucesso == True:
171
- console.log(busca_nf_saida.retorno, style="bold green")
172
- else:
173
- retorno = f"{busca_nf_saida.retorno} \nEtapas Executadas:\n{steps}"
174
- return RpaRetornoProcessoDTO(
175
- sucesso=False,
176
- retorno=retorno,
177
- status=RpaHistoricoStatusEnum.Falha,
178
- tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
179
- )
180
-
181
-
182
- #VERIFICANDO A EXISTENCIA DE WARNINGS
183
- console.print("Verificando a existência de Warning... \n")
184
- warning_pop_up = await is_window_open("Warning")
185
- if warning_pop_up["IsOpened"] == True:
186
- console.print("possui Pop-up de Warning, analisando... \n")
187
- ocr_pop_warning = await ocr_warnings(numero_cupom_fiscal)
188
- if ocr_pop_warning.sucesso == True:
189
- retorno = f"POP UP Warning não mapeado para seguimento do processo, mensagem: {ocr_pop_warning.retorno} \nEtapas Executadas:\n{steps}"
136
+ #VALIDAR SE CLIENTE É FIDIC
137
+ #REGRA PARA INICIAR ONDE PAROU, TEMPORARIO
138
+ init = 1
139
+ if init == 2:
140
+ console.print("Validando se o Cliente é FIDC...\n")
141
+ if nota.get("clienteFIDC").lower() == 'não':
142
+ #HABILITAR CLIENTE E FORNECEDOR PARA COD INCORRETO
143
+ console.print("Seguindo com o processo de habilitar Cliente e Fornecedor para andamento do processo.. \n")
144
+ type_text_into_field("Pessoas", app["TFrmMenuPrincipal"]["Edit"], True, "50")
145
+ pyautogui.press("enter")
146
+ send_keys("{DOWN " + ("2") + "}")
147
+ pyautogui.press("enter")
148
+
149
+ await worker_sleep(2)
150
+ console.print("Verificando se o cliente esta ativo como Cliente e como Fornecedor... \n")
151
+ ativar_cliente_fornecedor = await pessoas_ativa_cliente_fornecedor(cod_cliente_incorreto, True, True)
152
+ if ativar_cliente_fornecedor.sucesso == True:
153
+ steps += 'ETAPA 00 - CLIENTE E FORNECEDOR - ATIVADOS COM SUCESSO'
154
+ console.log(ativar_cliente_fornecedor.retorno, style="bold green")
155
+ else:
190
156
  return RpaRetornoProcessoDTO(
191
157
  sucesso=False,
192
- retorno=retorno,
193
- status=RpaHistoricoStatusEnum.Falha,
194
- tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
158
+ retorno=ativar_cliente_fornecedor.retorno,
159
+ status=RpaHistoricoStatusEnum.Falha,
160
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
195
161
  )
162
+
163
+ #REALIZAR PROCESSO DE NOTA FISCAL DE SAIDA
164
+ type_text_into_field("Nota Fiscal de Saida", app["TFrmMenuPrincipal"]["Edit"], True, "50")
165
+ pyautogui.press("enter")
166
+ await worker_sleep(2)
167
+ pyautogui.press('down')
168
+ pyautogui.press("enter")
169
+ console.print(f"\nPesquisa: 'Nota Fiscal de Saída' realizada com sucesso",style="bold green")
170
+ await worker_sleep(6)
171
+
172
+ busca_nf_saida = await nf_busca_nf_saida(numero_cupom_fiscal)
173
+ if busca_nf_saida.sucesso == True:
174
+ console.log(busca_nf_saida.retorno, style="bold green")
196
175
  else:
197
- retorno = f"{ocr_pop_warning.retorno} \nEtapas Executadas:\n{steps}"
176
+ retorno = f"{busca_nf_saida.retorno} \nEtapas Executadas:\n{steps}"
198
177
  return RpaRetornoProcessoDTO(
199
178
  sucesso=False,
200
179
  retorno=retorno,
201
- status=RpaHistoricoStatusEnum.Falha,
180
+ status=RpaHistoricoStatusEnum.Falha,
202
181
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
203
182
  )
204
- else:
205
- console.print("Não possui pop de Warning...\n")
206
-
207
183
 
208
- #VERIFICANDO SE O BOTÃO IR PARA A NOTA FATURA
209
- console.print("Verificando o status do Botão [Ir para Nota Fatura]...\n")
210
- try:
211
- btn_ir_para_nota = pyautogui.locateOnScreen(ASSETS_PATH + "\\notas_saida\\ir_para_nota_a_fatura_esmaecido.png", confidence=0.8)
212
- if btn_ir_para_nota:
213
- console.print("Botão 'Ir para nota de faturar' inativo, seguindo com o processo...\n")
214
- app = Application().connect(class_name="TFrmNotaFiscalSaida", timeout=60)
215
- main_window = app["TFrmNotaFiscalSaida"]
216
- main_window.set_focus()
217
- main_window.close()
184
+
185
+ #VERIFICANDO A EXISTENCIA DE WARNINGS
186
+ console.print("Verificando a existência de Warning... \n")
187
+ warning_pop_up = await is_window_open("Warning")
188
+ if warning_pop_up["IsOpened"] == True:
189
+ console.print("possui Pop-up de Warning, analisando... \n")
190
+ ocr_pop_warning = await ocr_warnings(numero_cupom_fiscal)
191
+ if ocr_pop_warning.sucesso == True:
192
+ retorno = f"POP UP Warning não mapeado para seguimento do processo, mensagem: {ocr_pop_warning.retorno} \nEtapas Executadas:\n{steps}"
193
+ return RpaRetornoProcessoDTO(
194
+ sucesso=False,
195
+ retorno=retorno,
196
+ status=RpaHistoricoStatusEnum.Falha,
197
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
198
+ )
199
+ else:
200
+ retorno = f"{ocr_pop_warning.retorno} \nEtapas Executadas:\n{steps}"
201
+ return RpaRetornoProcessoDTO(
202
+ sucesso=False,
203
+ retorno=retorno,
204
+ status=RpaHistoricoStatusEnum.Falha,
205
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
206
+ )
218
207
  else:
219
- retorno = f"Botão [Ir para nota de faturar] está ativo, impossibilitando realizar a devolução \nEtapas Executadas:\n{steps}"
208
+ console.print("Não possui pop de Warning...\n")
209
+
210
+
211
+ #VERIFICANDO SE O BOTÃO IR PARA A NOTA FATURA
212
+ console.print("Verificando o status do Botão [Ir para Nota Fatura]...\n")
213
+ try:
214
+ btn_ir_para_nota = pyautogui.locateOnScreen(ASSETS_PATH + "\\notas_saida\\ir_para_nota_a_fatura_esmaecido.png", confidence=0.8)
215
+ if btn_ir_para_nota:
216
+ console.print("Botão 'Ir para nota de faturar' inativo, seguindo com o processo...\n")
217
+ app = Application().connect(class_name="TFrmNotaFiscalSaida", timeout=60)
218
+ main_window = app["TFrmNotaFiscalSaida"]
219
+ main_window.set_focus()
220
+ main_window.close()
221
+ else:
222
+ retorno = f"Botão [Ir para nota de faturar] está ativo, impossibilitando realizar a devolução \nEtapas Executadas:\n{steps}"
223
+ return RpaRetornoProcessoDTO(
224
+ sucesso=False,
225
+ retorno=retorno,
226
+ status=RpaHistoricoStatusEnum.Falha,
227
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
228
+ )
229
+ except Exception as e:
220
230
  return RpaRetornoProcessoDTO(
221
231
  sucesso=False,
222
- retorno=retorno,
232
+ retorno=f"Não foi possivel verificar o botão [Ir para nota de faturar], erro: {e}",
223
233
  status=RpaHistoricoStatusEnum.Falha,
224
- tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
225
- )
226
- except Exception as e:
227
- return RpaRetornoProcessoDTO(
228
- sucesso=False,
229
- retorno=f"Não foi possivel verificar o botão [Ir para nota de faturar], erro: {e}",
230
- status=RpaHistoricoStatusEnum.Falha,
231
- tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
232
- )
234
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
235
+ )
233
236
 
234
- #Para liquidar o cupom
235
- type_text_into_field("Titulos a receber", app["TFrmMenuPrincipal"]["Edit"], True, "50")
236
- pyautogui.press("enter")
237
- await worker_sleep(2)
238
- pyautogui.press("enter")
237
+ #Para liquidar o cupom
238
+ type_text_into_field("Titulos a receber", app["TFrmMenuPrincipal"]["Edit"], True, "50")
239
+ pyautogui.press("enter")
240
+ await worker_sleep(2)
241
+ pyautogui.press("enter")
239
242
 
240
-
241
- liquidar_cupom = await nf_devolucao_liquidar_cupom(numero_cupom_fiscal, data_hoje)
242
- if liquidar_cupom.sucesso == True:
243
- console.log(liquidar_cupom.retorno, style="bold green")
244
- steps += 'ETAPA 01 - Processo de liquidar cupom finalizado com sucesso'
245
- else:
246
- descricao_tag = liquidar_cupom.tags[0]
247
- retorno = f"{liquidar_cupom.retorno} \nEtapas Executadas:\n{steps}"
248
- return RpaRetornoProcessoDTO(
249
- sucesso=False,
250
- retorno=retorno,
251
- status=RpaHistoricoStatusEnum.Falha,
252
- tags=[RpaTagDTO(descricao=descricao_tag.descricao)]
253
- )
243
+
244
+ liquidar_cupom = await nf_devolucao_liquidar_cupom(numero_cupom_fiscal, data_hoje)
245
+ if liquidar_cupom.sucesso == True:
246
+ console.log(liquidar_cupom.retorno, style="bold green")
247
+ steps += 'ETAPA 01 - Processo de liquidar cupom finalizado com sucesso'
248
+ else:
249
+ descricao_tag = liquidar_cupom.tags[0]
250
+ retorno = f"{liquidar_cupom.retorno} \nEtapas Executadas:\n{steps}"
251
+ return RpaRetornoProcessoDTO(
252
+ sucesso=False,
253
+ retorno=retorno,
254
+ status=RpaHistoricoStatusEnum.Falha,
255
+ tags=[RpaTagDTO(descricao=descricao_tag.descricao)]
256
+ )
254
257
 
255
258
 
256
259
  #ETAPA 14 A 18
@@ -3670,7 +3670,7 @@ async def nf_devolucao_liquidar_cupom(num_nota_fiscal: str, data_atual: str) ->
3670
3670
  status=RpaHistoricoStatusEnum.Falha,
3671
3671
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
3672
3672
  )
3673
- elif "bloquear" in msg_result.lower():
3673
+ elif "bloqueado" in msg_result.lower():
3674
3674
  app_confirm = Application().connect(class_name="TMessageForm")
3675
3675
  main_window_confirm = app_confirm["TMessageForm"]
3676
3676
 
@@ -3694,11 +3694,17 @@ async def nf_devolucao_liquidar_cupom(num_nota_fiscal: str, data_atual: str) ->
3694
3694
  status=RpaHistoricoStatusEnum.Falha,
3695
3695
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
3696
3696
  )
3697
-
3697
+ else:
3698
+ return RpaRetornoProcessoDTO(
3699
+ sucesso=False,
3700
+ retorno=f"POP de confirmação de liquidar titulo não encontrado",
3701
+ status=RpaHistoricoStatusEnum.Falha,
3702
+ tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
3703
+ )
3698
3704
  console.print('Aguardando a confirmação de Liquidação realizado com sucesso')
3699
3705
  try:
3700
- app = Application().connect(title="Informação", timeout=60)
3701
- main_window = app["Informação"]
3706
+ app = Application().connect(class_name="TMessageForm", timeout=60)
3707
+ main_window = app["TMessageForm"]
3702
3708
  main_window.set_focus()
3703
3709
  msg_pop_up = await ocr_by_class(num_nota_fiscal,"TMessageForm","TMessageForm")
3704
3710
  if msg_pop_up.sucesso == True:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.57
3
+ Version: 0.5.59
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
@@ -37,7 +37,7 @@ worker_automate_hub/tasks/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
37
37
  worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ0DLLOVJOfNTq_z9krx_t25Q,29476
38
38
  worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=lNjD-JxpPTXdvFEJAkajC_Ltyw81rIEJeu7FUfRf2qI,9586
39
39
  worker_automate_hub/tasks/jobs/descartes.py,sha256=0bMCJ0xIcK8TLSgjF6taAbGFLMU-sGDVFIhUYSRtrbg,41092
40
- worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=PErDGphh75kc5SGJKI90L26qPJKl0BAkk8eRgjwmRvA,79240
40
+ worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=S1Dx99vD0x1HYACpE_Ro7xJOjawdZ7uuf7i9XQmjffs,79780
41
41
  worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=dKkf22nH5gp3RErq5u0UzRsKyJ81fc6ZZ4vLtUuMwHA,21002
42
42
  worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=8WmKe4-MRtzHobXz2S4YBDNN8alfawkC-BBlRY-mn1g,1726
43
43
  worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM3Fje-rkyx5tjwmRy4lyL8,25300
@@ -73,10 +73,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
73
73
  worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
74
74
  worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
75
75
  worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
76
- worker_automate_hub/utils/util.py,sha256=luy9Tvbu2IUeQqiZrPlXrQaRXa6cav7FrLjhbD93dC0,160742
76
+ worker_automate_hub/utils/util.py,sha256=7tAObxRExXXB_AUwWU4rEI5w-OXw42rvj326_uUQzCk,161074
77
77
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=iYpOs7fb7C3bY61QHySr00xlDNzrrCP0zaexOpBPuaQ,31930
78
78
  worker_automate_hub/worker.py,sha256=CT-poyP1ZYvubArYsnnNd9oJ53SPaDwgr6p6keS3nI4,6248
79
- worker_automate_hub-0.5.57.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
80
- worker_automate_hub-0.5.57.dist-info/METADATA,sha256=LqZduG_PWeN-bng6NbbLLvBmlZBCmL3vEVqVEo6OfDQ,2894
81
- worker_automate_hub-0.5.57.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
82
- worker_automate_hub-0.5.57.dist-info/RECORD,,
79
+ worker_automate_hub-0.5.59.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
80
+ worker_automate_hub-0.5.59.dist-info/METADATA,sha256=stcg4mdqHzJmV-CSnqeyuL9Jtk_yyzSVyEPIhV0Yvaw,2894
81
+ worker_automate_hub-0.5.59.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
82
+ worker_automate_hub-0.5.59.dist-info/RECORD,,