worker-automate-hub 0.5.21__py3-none-any.whl → 0.5.22__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.
- worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +34 -35
- worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +12 -4
- worker_automate_hub/utils/utils_nfe_entrada.py +32 -3
- {worker_automate_hub-0.5.21.dist-info → worker_automate_hub-0.5.22.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.21.dist-info → worker_automate_hub-0.5.22.dist-info}/RECORD +7 -7
- {worker_automate_hub-0.5.21.dist-info → worker_automate_hub-0.5.22.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.21.dist-info → worker_automate_hub-0.5.22.dist-info}/entry_points.txt +0 -0
@@ -329,47 +329,46 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
329
329
|
except:
|
330
330
|
console.print("Erros não foram encontrados após incluir o registro")
|
331
331
|
|
332
|
-
# Verifica se a info 'Nota fiscal incluida' está na tela
|
333
|
-
await worker_sleep(6)
|
334
|
-
try:
|
335
|
-
app = Application().connect(class_name="TFrmNotaFiscalEntrada")
|
336
|
-
main_window = app["Information"]
|
337
|
-
|
338
|
-
main_window.set_focus()
|
339
|
-
|
340
|
-
console.print(f"Tentando clicar no Botão OK...\n")
|
341
|
-
btn_ok = main_window.child_window(class_name="TButton")
|
342
|
-
|
343
|
-
if btn_ok.exists():
|
344
|
-
btn_ok.click()
|
345
|
-
else:
|
346
|
-
console.print(f" botão OK Não enontrado")
|
347
|
-
except Exception as e:
|
348
|
-
try:
|
349
|
-
await worker_sleep(5)
|
350
|
-
await emsys.verify_warning_and_error("Aviso", "OK")
|
351
|
-
alterar_nop = await emsys.alterar_nop(nota["cfop"])
|
352
|
-
|
353
|
-
if alterar_nop:
|
354
|
-
return alterar_nop
|
355
|
-
except Exception as error:
|
356
|
-
observacao = f"Erro Processo Entrada de Notas: {str(error)}"
|
357
|
-
logger.error(observacao)
|
358
|
-
console.print(observacao, style="bold red")
|
359
|
-
return RpaRetornoProcessoDTO(
|
360
|
-
sucesso=False,
|
361
|
-
retorno=observacao,
|
362
|
-
status=RpaHistoricoStatusEnum.Falha,
|
363
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
364
|
-
)
|
365
|
-
|
366
332
|
max_attempts = 60
|
367
333
|
i = 0
|
368
334
|
|
369
335
|
while i < max_attempts:
|
370
336
|
information_pop_up = await is_window_open("Information")
|
371
337
|
if information_pop_up["IsOpened"] == True:
|
372
|
-
|
338
|
+
# Verifica se a info 'Nota fiscal incluida' está na tela
|
339
|
+
try:
|
340
|
+
app = Application().connect(class_name="TFrmNotaFiscalEntrada")
|
341
|
+
main_window = app["Information"]
|
342
|
+
|
343
|
+
main_window.set_focus()
|
344
|
+
|
345
|
+
console.print(f"Tentando clicar no Botão OK...\n")
|
346
|
+
btn_ok = main_window.child_window(class_name="TButton")
|
347
|
+
|
348
|
+
if btn_ok.exists():
|
349
|
+
btn_ok.click()
|
350
|
+
break
|
351
|
+
else:
|
352
|
+
console.print(f" botão OK Não enontrado")
|
353
|
+
except Exception as e:
|
354
|
+
try:
|
355
|
+
await worker_sleep(5)
|
356
|
+
await emsys.verify_warning_and_error("Warning", "OK")
|
357
|
+
await emsys.verify_warning_and_error("Aviso", "OK")
|
358
|
+
alterar_nop = await emsys.alterar_nop(nota["cfop"], nota["nfe"])
|
359
|
+
|
360
|
+
if alterar_nop:
|
361
|
+
return alterar_nop
|
362
|
+
except Exception as error:
|
363
|
+
observacao = f"Erro Processo Entrada de Notas: {str(error)}"
|
364
|
+
logger.error(observacao)
|
365
|
+
console.print(observacao, style="bold red")
|
366
|
+
return RpaRetornoProcessoDTO(
|
367
|
+
sucesso=False,
|
368
|
+
retorno=observacao,
|
369
|
+
status=RpaHistoricoStatusEnum.Falha,
|
370
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
371
|
+
)
|
373
372
|
else:
|
374
373
|
console.print(f"Aguardando confirmação de nota incluida...\n")
|
375
374
|
await worker_sleep(5)
|
@@ -391,14 +391,21 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
391
391
|
|
392
392
|
except Exception as e:
|
393
393
|
try:
|
394
|
-
await
|
395
|
-
await emsys.verify_warning_and_error("Aviso", "OK")
|
396
|
-
alterar_nop_result = await emsys.alterar_nop(nota.get("cfop"))
|
397
|
-
|
394
|
+
alterar_nop_result = await emsys.alterar_nop(nota.get("cfop"), nota.get("nfe"))
|
398
395
|
if alterar_nop_result:
|
399
396
|
await worker_sleep(5)
|
400
397
|
resultado = await emsys.verify_max_variation()
|
401
398
|
return alterar_nop_result
|
399
|
+
except ValueError as ve:
|
400
|
+
observacao = f"Erro Processo Entrada de Notas: {str(ve)}"
|
401
|
+
logger.error(observacao)
|
402
|
+
console.print(observacao, style="bold red")
|
403
|
+
return RpaRetornoProcessoDTO(
|
404
|
+
sucesso=False,
|
405
|
+
retorno=observacao,
|
406
|
+
status=RpaHistoricoStatusEnum.Falha,
|
407
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
408
|
+
)
|
402
409
|
except Exception as error:
|
403
410
|
observacao = f"Erro Processo Entrada de Notas: {str(error)}"
|
404
411
|
logger.error(observacao)
|
@@ -409,6 +416,7 @@ async def entrada_de_notas_16(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
409
416
|
status=RpaHistoricoStatusEnum.Falha,
|
410
417
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
411
418
|
)
|
419
|
+
|
412
420
|
try:
|
413
421
|
|
414
422
|
await emsys.verify_warning_and_error("Warning", "OK")
|
@@ -14,6 +14,7 @@ from pywinauto_recorder.player import set_combobox
|
|
14
14
|
from rich.console import Console
|
15
15
|
from datetime import datetime, timedelta
|
16
16
|
|
17
|
+
from worker_automate_hub.api.client import get_status_nf_emsys
|
17
18
|
from worker_automate_hub.models.dao.rpa_configuracao import RpaConfiguracao
|
18
19
|
from worker_automate_hub.models.dto.rpa_historico_request_dto import (
|
19
20
|
RpaHistoricoStatusEnum,
|
@@ -28,6 +29,8 @@ from worker_automate_hub.utils.util import worker_sleep, is_window_open_by_class
|
|
28
29
|
pyautogui.PAUSE = 0.5
|
29
30
|
import pyperclip
|
30
31
|
|
32
|
+
ASSETS_PATH = "assets"
|
33
|
+
|
31
34
|
console = Console()
|
32
35
|
|
33
36
|
|
@@ -674,7 +677,7 @@ class EMSys:
|
|
674
677
|
f"Erro ao deletar o arquivo {xml_filename}: {str(e)}"
|
675
678
|
) from e
|
676
679
|
|
677
|
-
async def alterar_nop(self, cfop: str) -> RpaRetornoProcessoDTO | None:
|
680
|
+
async def alterar_nop(self, cfop: str, chave_acesso=None) -> RpaRetornoProcessoDTO | None:
|
678
681
|
await self.click_principal()
|
679
682
|
console.print("Alterando a NOP...\n")
|
680
683
|
pyautogui.click(945, 543)
|
@@ -700,6 +703,15 @@ class EMSys:
|
|
700
703
|
pyautogui.hotkey("enter")
|
701
704
|
await worker_sleep(6)
|
702
705
|
await self.incluir_registro()
|
706
|
+
await worker_sleep(15)
|
707
|
+
|
708
|
+
if chave_acesso is not None:
|
709
|
+
console.print("\nVerifica se a nota ja foi lançada...")
|
710
|
+
nf_chave_acesso = int(chave_acesso)
|
711
|
+
status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
|
712
|
+
if status_nf_emsys.get("status") != "Lançada":
|
713
|
+
raise ValueError("A nota não possui itens com o mesmo CFOP de capa. Necessário que ao menos um item possua este CFOP")
|
714
|
+
|
703
715
|
else:
|
704
716
|
pyautogui.hotkey("esc")
|
705
717
|
observacao = f"Nota bonificada do tipo ({cfop}), está retornando diferença de itens sem o mesmo CFOP de capa. Por favor verifique a nota."
|
@@ -709,11 +721,28 @@ class EMSys:
|
|
709
721
|
status=RpaHistoricoStatusEnum.Falha,
|
710
722
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
711
723
|
)
|
712
|
-
except:
|
713
|
-
console.print("
|
724
|
+
except ValueError as e:
|
725
|
+
console.print(f"Erro de validação ao alterar o NOP: {e}", style="bold red")
|
726
|
+
raise
|
727
|
+
except Exception as e:
|
728
|
+
console.print(f"Erro inesperado ao alterar o NOP: {e}", style="bold red")
|
729
|
+
raise
|
714
730
|
|
715
731
|
return RpaRetornoProcessoDTO(
|
716
732
|
sucesso=True,
|
717
733
|
retorno="Nota lançada com sucesso!",
|
718
734
|
status=RpaHistoricoStatusEnum.Sucesso,
|
719
735
|
)
|
736
|
+
|
737
|
+
async def verify_nf_incuded(self) -> bool:
|
738
|
+
try:
|
739
|
+
nota_incluida = pyautogui.locateOnScreen(
|
740
|
+
ASSETS_PATH + "\\entrada_notas\\nota_fiscal_incluida.png", confidence=0.7
|
741
|
+
)
|
742
|
+
if nota_incluida:
|
743
|
+
return True
|
744
|
+
else:
|
745
|
+
return False
|
746
|
+
except Exception as e:
|
747
|
+
console.print(f"Error: {e}")
|
748
|
+
return False
|
@@ -42,8 +42,8 @@ worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM
|
|
42
42
|
worker_automate_hub/tasks/jobs/ecac_estadual_sc.py,sha256=fZD67poalpANlbJoMgnAvO-APp84oicvXEFnbeyulEk,13851
|
43
43
|
worker_automate_hub/tasks/jobs/ecac_estadual_sp.py,sha256=AqSsn0SlK_nok4AhMCNUlApQ-LwHYNXeUwOrMLyWmNU,29418
|
44
44
|
worker_automate_hub/tasks/jobs/ecac_federal.py,sha256=VFOrbMuMHL3ac1sJ-z-N1p1WYtP-e-JJHbvUfgmfgNw,55748
|
45
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256
|
46
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=
|
45
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256=-UVE1nIWDqjK1zc6WPllhronO5ppjjav--l8WwMYfAY,15314
|
46
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=t17lwubu3HT7uOV0fdxOKvoIeOQr6ELMiJtyEw0Aac4,20652
|
47
47
|
worker_automate_hub/tasks/jobs/entrada_de_notas_207.py,sha256=JJ1jtExQRXsI2UvxklX7jJDtzim54QyGSQ5U54E7jbg,25609
|
48
48
|
worker_automate_hub/tasks/jobs/entrada_de_notas_32.py,sha256=MZpLWZEvk1voQ-jVedmzyr-NcMDtgBxGMa0FrjK8Kzg,33989
|
49
49
|
worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=30Kx_VlyXQmrjyVPdSKN_c6DZ8Ggueee9hz5GYX-1mo,32841
|
@@ -72,9 +72,9 @@ worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1
|
|
72
72
|
worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
|
73
73
|
worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
|
74
74
|
worker_automate_hub/utils/util.py,sha256=Eyy0mLLt_xd_zVXWoHAb-GK0PU1xZdWPvh-IndajxDk,128815
|
75
|
-
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=
|
75
|
+
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=3keuXhgNkEMZhLX9gGzck41SAwJqIPlwWSo_WSOs2HI,30980
|
76
76
|
worker_automate_hub/worker.py,sha256=CT-poyP1ZYvubArYsnnNd9oJ53SPaDwgr6p6keS3nI4,6248
|
77
|
-
worker_automate_hub-0.5.
|
78
|
-
worker_automate_hub-0.5.
|
79
|
-
worker_automate_hub-0.5.
|
80
|
-
worker_automate_hub-0.5.
|
77
|
+
worker_automate_hub-0.5.22.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
78
|
+
worker_automate_hub-0.5.22.dist-info/METADATA,sha256=Upv7AVy8AdSniz2ZHlGi3u_b4NJAulUE2g7UOjHw2no,2894
|
79
|
+
worker_automate_hub-0.5.22.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
80
|
+
worker_automate_hub-0.5.22.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.21.dist-info → worker_automate_hub-0.5.22.dist-info}/entry_points.txt
RENAMED
File without changes
|