worker-automate-hub 0.5.813__py3-none-any.whl → 0.5.814__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/abertura_livros_fiscais.py +40 -23
- worker_automate_hub/tasks/jobs/sped_fiscal.py +8 -8
- worker_automate_hub/utils/util.py +1 -1
- {worker_automate_hub-0.5.813.dist-info → worker_automate_hub-0.5.814.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.813.dist-info → worker_automate_hub-0.5.814.dist-info}/RECORD +7 -7
- {worker_automate_hub-0.5.813.dist-info → worker_automate_hub-0.5.814.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.813.dist-info → worker_automate_hub-0.5.814.dist-info}/entry_points.txt +0 -0
@@ -81,11 +81,11 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
81
81
|
message="32-bit application should be automated using 32-bit Python",
|
82
82
|
)
|
83
83
|
|
84
|
-
await worker_sleep(
|
84
|
+
await worker_sleep(8)
|
85
85
|
|
86
86
|
try:
|
87
87
|
app = Application(backend="win32").connect(
|
88
|
-
class_name="TFrmLoginModulo", timeout=
|
88
|
+
class_name="TFrmLoginModulo", timeout=120
|
89
89
|
)
|
90
90
|
except:
|
91
91
|
return RpaRetornoProcessoDTO(
|
@@ -331,8 +331,8 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
331
331
|
console.print("Aguardar o término de carregar")
|
332
332
|
# imagem = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\livros_incluidos.png"
|
333
333
|
imagem = "assets\\abertura_livros\\livros_incluidos.png"
|
334
|
-
|
335
|
-
tempo_limite = 6600
|
334
|
+
|
335
|
+
tempo_limite = 6600 # 1h
|
336
336
|
intervalo = 2 # segundos entre as verificações
|
337
337
|
|
338
338
|
inicio = time.time()
|
@@ -375,7 +375,9 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
375
375
|
# img_dialog = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\notas_rejeitadas.png"
|
376
376
|
img_dialog = "assets\\abertura_livros\\notas_rejeitadas.png"
|
377
377
|
if os.path.exists(img_dialog):
|
378
|
-
caixa = pyautogui.locateOnScreen(
|
378
|
+
caixa = pyautogui.locateOnScreen(
|
379
|
+
img_dialog, confidence=0.9, grayscale=True
|
380
|
+
)
|
379
381
|
if caixa:
|
380
382
|
print("Janela 'notas rejeitadas' detectada por imagem.")
|
381
383
|
region = (caixa.left, caixa.top, caixa.width, caixa.height)
|
@@ -384,9 +386,13 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
384
386
|
class_name="TMessageForm", timeout=2
|
385
387
|
)
|
386
388
|
form = app_msg["TMessageForm"]
|
387
|
-
console.print(
|
389
|
+
console.print(
|
390
|
+
"Janela de confirmação 'TMessageForm' encontrada."
|
391
|
+
)
|
388
392
|
form.set_focus()
|
389
|
-
form.child_window(
|
393
|
+
form.child_window(
|
394
|
+
class_name="TButton", found_index=1
|
395
|
+
).click_input()
|
390
396
|
print("Clicou no botão de sim.")
|
391
397
|
|
392
398
|
await worker_sleep(5)
|
@@ -394,18 +400,31 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
394
400
|
# img_dialog = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\gerar_rel_notas_rejeitadas.png"
|
395
401
|
img_dialog = "assets\\abertura_livros\\gerar_rel_notas_rejeitadas.png"
|
396
402
|
if os.path.exists(img_dialog):
|
397
|
-
caixa = pyautogui.locateOnScreen(
|
403
|
+
caixa = pyautogui.locateOnScreen(
|
404
|
+
img_dialog, confidence=0.9, grayscale=True
|
405
|
+
)
|
398
406
|
if caixa:
|
399
|
-
print(
|
400
|
-
|
407
|
+
print(
|
408
|
+
"Janela 'notas relatorios rejeitadas' detectada por imagem."
|
409
|
+
)
|
410
|
+
region = (
|
411
|
+
caixa.left,
|
412
|
+
caixa.top,
|
413
|
+
caixa.width,
|
414
|
+
caixa.height,
|
415
|
+
)
|
401
416
|
|
402
417
|
app_msg = Application().connect(
|
403
418
|
class_name="TMessageForm", timeout=2
|
404
419
|
)
|
405
420
|
form = app_msg["TMessageForm"]
|
406
|
-
console.print(
|
421
|
+
console.print(
|
422
|
+
"Janela de confirmação 'TMessageForm' encontrada."
|
423
|
+
)
|
407
424
|
form.set_focus()
|
408
|
-
form.child_window(
|
425
|
+
form.child_window(
|
426
|
+
class_name="TButton", found_index=0
|
427
|
+
).click_input()
|
409
428
|
print("Clicou no botão de não.")
|
410
429
|
except:
|
411
430
|
pass
|
@@ -421,7 +440,6 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
421
440
|
except:
|
422
441
|
pass
|
423
442
|
|
424
|
-
|
425
443
|
# Se encontrou a janela de relatório, sai
|
426
444
|
if janela_aberta:
|
427
445
|
print("Relatório carregado. Saindo do loop.")
|
@@ -457,19 +475,19 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
457
475
|
|
458
476
|
# Verificando se a foi confirmado os livres
|
459
477
|
console.print("Verificando se os livros foram confirmados")
|
460
|
-
|
478
|
+
|
461
479
|
# imagem = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\confirmado_livros.png"
|
462
480
|
imagem = "assets\\abertura_livros\\confirmado_livros.png"
|
463
481
|
if os.path.exists(imagem):
|
464
|
-
caixa = pyautogui.locateOnScreen(imagem, confidence=0.9, grayscale=True)
|
482
|
+
caixa = pyautogui.locateOnScreen(imagem, confidence=0.9, grayscale=True)
|
465
483
|
else:
|
466
484
|
console.print("Imagem confirmada não encontrada")
|
467
485
|
return RpaRetornoProcessoDTO(
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
486
|
+
sucesso=False,
|
487
|
+
retorno=f"Erro na Abertura de Livro Fiscal: Imagem confirmada não encontrada",
|
488
|
+
status=RpaHistoricoStatusEnum.Falha,
|
489
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
490
|
+
)
|
473
491
|
|
474
492
|
# Clicar em fechar
|
475
493
|
main_window.close()
|
@@ -581,9 +599,9 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
581
599
|
class_name="TDBIEditDate", found_index=0
|
582
600
|
)
|
583
601
|
data_input.click_input()
|
584
|
-
|
602
|
+
|
585
603
|
await worker_sleep(5)
|
586
|
-
|
604
|
+
|
587
605
|
data_input.set_edit_text("") # Limpa o campo
|
588
606
|
|
589
607
|
# Define a competência
|
@@ -606,7 +624,6 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
606
624
|
|
607
625
|
await worker_sleep(2)
|
608
626
|
|
609
|
-
|
610
627
|
# === 5) Se não houve 'Aviso' com erro mapeado, considera sucesso ===
|
611
628
|
console.print("Nenhum erro confirmado. Fluxo OK.")
|
612
629
|
try:
|
@@ -108,11 +108,11 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
108
108
|
message="32-bit application should be automated using 32-bit Python",
|
109
109
|
)
|
110
110
|
|
111
|
-
await worker_sleep(
|
111
|
+
await worker_sleep(8)
|
112
112
|
|
113
113
|
try:
|
114
114
|
app = Application(backend="win32").connect(
|
115
|
-
class_name="TFrmLoginModulo", timeout=
|
115
|
+
class_name="TFrmLoginModulo", timeout=120
|
116
116
|
)
|
117
117
|
except:
|
118
118
|
return RpaRetornoProcessoDTO(
|
@@ -131,12 +131,12 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
131
131
|
await worker_sleep(10)
|
132
132
|
console.print(f"Verificando a presença de Confirm...")
|
133
133
|
confirm_pop_up = await is_window_open("Confirm")
|
134
|
-
if confirm_pop_up["IsOpened"] == True:
|
134
|
+
if confirm_pop_up["IsOpened"] == True:
|
135
135
|
app = Application().connect(class_name="TMessageForm")
|
136
136
|
main_window = app["TMessageForm"]
|
137
137
|
main_window.set_focus()
|
138
138
|
main_window.child_window(title="&No").click()
|
139
|
-
pyautogui.click(120,173)
|
139
|
+
pyautogui.click(120, 173)
|
140
140
|
pyautogui.press("enter")
|
141
141
|
await worker_sleep(2)
|
142
142
|
pyautogui.press("enter")
|
@@ -298,7 +298,7 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
298
298
|
)
|
299
299
|
periodo_btn_buscar.click()
|
300
300
|
await worker_sleep(2)
|
301
|
-
#As vezes o click de cima não funciona
|
301
|
+
# As vezes o click de cima não funciona
|
302
302
|
pyautogui.click(915, 664)
|
303
303
|
await worker_sleep(2)
|
304
304
|
periodo_btn_buscar = main_window.child_window(
|
@@ -307,7 +307,7 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
307
307
|
rect = periodo_btn_buscar.rectangle()
|
308
308
|
center_x = (rect.left + rect.right) // 2
|
309
309
|
center_y = (rect.top + rect.bottom) // 2
|
310
|
-
double_click(coords=(center_x, center_y))
|
310
|
+
double_click(coords=(center_x, center_y))
|
311
311
|
elif gerar_inventario:
|
312
312
|
mes_atual = datetime.now().month
|
313
313
|
if mes_atual == 1:
|
@@ -336,7 +336,7 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
336
336
|
)
|
337
337
|
periodo_btn_buscar.click()
|
338
338
|
await worker_sleep(2)
|
339
|
-
#As vezes o click de cima não funciona
|
339
|
+
# As vezes o click de cima não funciona
|
340
340
|
pyautogui.click(915, 664)
|
341
341
|
await worker_sleep(2)
|
342
342
|
try:
|
@@ -707,4 +707,4 @@ async def sped_fiscal(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
707
707
|
retorno=observacao,
|
708
708
|
status=RpaHistoricoStatusEnum.Falha,
|
709
709
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
710
|
-
)
|
710
|
+
)
|
@@ -36,7 +36,7 @@ worker_automate_hub/models/dto/rpa_sap_dto.py,sha256=eovdvKCtVIhRct3PL98KjsdlngL
|
|
36
36
|
worker_automate_hub/models/dto/rpa_sistema_dto.py,sha256=sLkmJei8x6sl-1-IXUKDmYQuKx0sotYQREPyhQqPmRg,161
|
37
37
|
worker_automate_hub/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
worker_automate_hub/tasks/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
|
-
worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py,sha256=
|
39
|
+
worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py,sha256=Xn6RfouH3H2yhhxynp80MClcfVGV9c0CwmbOErPo5w4,25857
|
40
40
|
worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ0DLLOVJOfNTq_z9krx_t25Q,29476
|
41
41
|
worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=S6QC4xhuo0pB5FjaUJZNMm1LIgEjpjifReCTBDqxH-U,11719
|
42
42
|
worker_automate_hub/tasks/jobs/cte_manual.py,sha256=JucHpRMjMiy-QEJ0wtFnytLpN53tKXgCDI05nGLGclU,603
|
@@ -90,7 +90,7 @@ worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py,sha256=_6CFh79ea
|
|
90
90
|
worker_automate_hub/tasks/jobs/notas_faturamento_sap.py,sha256=p6tVE027FHHXBxt2sIDxqLInpf_0wS-8TcACnS34p7w,13961
|
91
91
|
worker_automate_hub/tasks/jobs/opex_capex.py,sha256=KnZymjtYtRO0EmNAk12xA9Hx9XlShxT5voFFJ6MPeZc,36879
|
92
92
|
worker_automate_hub/tasks/jobs/playground.py,sha256=7vWDg9DwToHwGJ6_XOa8TQ6LmfRV5Qz2TaOV3q3P9sA,1918
|
93
|
-
worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=
|
93
|
+
worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=rinyHCF7QYHUc6oWACJgnQiAv0S-_Fel9Z0bImiHUoM,31064
|
94
94
|
worker_automate_hub/tasks/jobs/transferencias.py,sha256=5TIktufkvUPnVTR2gf7GFQJ5KQP6PWnmoWiE08WiVDQ,46191
|
95
95
|
worker_automate_hub/tasks/task_definitions.py,sha256=AKzuSb5CiNu97-9V_Ykb2jmXXNenOLiTFeBT3Pw9chI,12815
|
96
96
|
worker_automate_hub/tasks/task_executor.py,sha256=F5ngJLGz7vbUrX-batUlt3FFwiCE8denFmtTTLaE77I,6044
|
@@ -100,10 +100,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
|
|
100
100
|
worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
|
101
101
|
worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
|
102
102
|
worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
|
103
|
-
worker_automate_hub/utils/util.py,sha256=
|
103
|
+
worker_automate_hub/utils/util.py,sha256=p15z2pqyV-fPD8lL6ulurecsWQw9XpKPFf_xEr4U5lM,210781
|
104
104
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=F7jk95LpDwl5WfaQXahCA5yDdnySnWdctDqczHXwGqE,38195
|
105
105
|
worker_automate_hub/worker.py,sha256=zEnYUrm5kY2cHbbee15QJkwkx4euD2SB2zRvUIbjS90,6850
|
106
|
-
worker_automate_hub-0.5.
|
107
|
-
worker_automate_hub-0.5.
|
108
|
-
worker_automate_hub-0.5.
|
109
|
-
worker_automate_hub-0.5.
|
106
|
+
worker_automate_hub-0.5.814.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
107
|
+
worker_automate_hub-0.5.814.dist-info/METADATA,sha256=x7HU_b8IB-dVLBfD1FLkFMG3MziCynSCa_5I7KjZHbI,3100
|
108
|
+
worker_automate_hub-0.5.814.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
109
|
+
worker_automate_hub-0.5.814.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.813.dist-info → worker_automate_hub-0.5.814.dist-info}/entry_points.txt
RENAMED
File without changes
|