worker-automate-hub 0.5.814__py3-none-any.whl → 0.5.815__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/integracao_contabil_generica.py +57 -81
- {worker_automate_hub-0.5.814.dist-info → worker_automate_hub-0.5.815.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.814.dist-info → worker_automate_hub-0.5.815.dist-info}/RECORD +5 -5
- {worker_automate_hub-0.5.814.dist-info → worker_automate_hub-0.5.815.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.814.dist-info → worker_automate_hub-0.5.815.dist-info}/entry_points.txt +0 -0
@@ -202,7 +202,7 @@ async def integracao_contabil_generica(
|
|
202
202
|
|
203
203
|
# console.print("Selecionando item do campo origem...")
|
204
204
|
uuid_processo = task.uuidProcesso
|
205
|
-
caminho_imagem =
|
205
|
+
caminho_imagem = f"assets\\integracao_contabil\\{uuid_processo}.png"
|
206
206
|
|
207
207
|
await metodo_selecao_origem_especial()
|
208
208
|
await localizar_e_clicar(caminho_imagem) # main_window.set_focus()
|
@@ -258,7 +258,7 @@ async def integracao_contabil_generica(
|
|
258
258
|
console.print("Verificar se existem lotes")
|
259
259
|
try:
|
260
260
|
# Verifica mensagem sem lote pra integrar
|
261
|
-
imagem_alvo =
|
261
|
+
imagem_alvo = "assets\\integracao_contabil\\sem_lote.png"
|
262
262
|
|
263
263
|
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
264
264
|
|
@@ -297,7 +297,7 @@ async def integracao_contabil_generica(
|
|
297
297
|
await worker_sleep(5)
|
298
298
|
|
299
299
|
try:
|
300
|
-
imagem_finalizada =
|
300
|
+
imagem_finalizada = "assets\\integracao_contabil\\pesquisa_finalizada.png"
|
301
301
|
|
302
302
|
if not os.path.exists(imagem_finalizada):
|
303
303
|
raise FileNotFoundError(
|
@@ -399,9 +399,9 @@ async def integracao_contabil_generica(
|
|
399
399
|
total_debito = numeros[1].window_text()
|
400
400
|
total_credito = numeros[2].window_text()
|
401
401
|
|
402
|
-
|
403
|
-
|
404
|
-
|
402
|
+
print("Diferença:", diferenca)
|
403
|
+
print("Total Débito:", total_debito)
|
404
|
+
print("Total Crédito:", total_credito)
|
405
405
|
|
406
406
|
if diferenca > "0,00":
|
407
407
|
clicou = True
|
@@ -433,16 +433,19 @@ async def integracao_contabil_generica(
|
|
433
433
|
|
434
434
|
await worker_sleep(5)
|
435
435
|
|
436
|
-
|
437
|
-
assets_int_cont = os.path.join(ASSETS_PATH_BASE, "integracao_contabil")
|
436
|
+
assets_int_cont = "assets\\integracao_contabil\\"
|
438
437
|
err_dict = {
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
438
|
+
assets_int_cont
|
439
|
+
+ "erro_duplicidade.png": "Integração não realizada. Erro de Duplicidade localizado enquanto finalizava a integração, contate o suporte do Emsys.",
|
440
|
+
assets_int_cont
|
441
|
+
+ "conta_indefinida_error.png": "Integração não realizada. Conta contábil indefinida no sistema.",
|
442
|
+
assets_int_cont
|
443
|
+
+ "lote_sem_complemento_error.png": "Integração não realizada. Lote encontrado sem complemento obrigatório.",
|
444
|
+
assets_int_cont
|
445
|
+
+ "diferenca_cred_deb.png": "Integração não realizada. Existem diferença em lotes consistentes, por favor verificar.",
|
446
|
+
assets_int_cont
|
447
|
+
+ "integracao_sucesso.png": "Integração Finalizada com Sucesso.",
|
444
448
|
}
|
445
|
-
|
446
449
|
# Aguardar finalizar
|
447
450
|
while True:
|
448
451
|
try:
|
@@ -451,56 +454,23 @@ async def integracao_contabil_generica(
|
|
451
454
|
)
|
452
455
|
msg_box = app["TMsgBox"]
|
453
456
|
|
454
|
-
#
|
457
|
+
# Antes de qualquer coisa, verifica por imagem de erro
|
455
458
|
for img_path, mensagem in err_dict.items():
|
456
459
|
try:
|
457
|
-
|
458
|
-
except
|
459
|
-
|
460
|
+
err = pyautogui.locateOnScreen(img_path, confidence=0.90)
|
461
|
+
except:
|
462
|
+
continue
|
460
463
|
|
461
|
-
if
|
462
|
-
|
463
|
-
if img_path.endswith("integracao_sucesso.png"):
|
464
|
+
if err:
|
465
|
+
if "integracao_sucesso.png" in img_path:
|
464
466
|
console.print(f"[green]{mensagem}[/green]")
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
# Se integrou com 'Lotes Consistentes' marcados, é FALHA
|
472
|
-
if lotesMarcados:
|
473
|
-
try:
|
474
|
-
# busca novamente o checkbox para garantir escopo
|
475
|
-
cb = dlg.child_window(title="Lotes Consistentes", class_name="TCheckBox")
|
476
|
-
if cb.exists() and cb.is_enabled() and cb.is_visible():
|
477
|
-
cb.click_input()
|
478
|
-
print("Checkbox 'Lotes Consistentes' desmarcado com sucesso.")
|
479
|
-
except Exception as e:
|
480
|
-
print(f"Não foi possível desmarcar checkbox: {e}")
|
481
|
-
|
482
|
-
time.sleep(5)
|
483
|
-
return RpaRetornoProcessoDTO(
|
484
|
-
sucesso=False,
|
485
|
-
retorno="Integração realizada, porém, existem LOTES INCONSISTENTES.",
|
486
|
-
status=RpaHistoricoStatusEnum.Falha,
|
487
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
488
|
-
)
|
489
|
-
|
490
|
-
# Se não estava marcado, aí sim é sucesso
|
491
|
-
return RpaRetornoProcessoDTO(
|
492
|
-
sucesso=True,
|
493
|
-
retorno=mensagem,
|
494
|
-
status=RpaHistoricoStatusEnum.Sucesso,
|
495
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
496
|
-
)
|
497
|
-
|
498
|
-
# Demais imagens tratadas como ERRO
|
467
|
+
msg_box.child_window(
|
468
|
+
class_name="TBitBtn", found_index=0
|
469
|
+
).click_input()
|
470
|
+
break
|
471
|
+
|
499
472
|
console.print(f"[red]Erro encontrado:[/red] {mensagem}")
|
500
|
-
|
501
|
-
msg_box.child_window(class_name="TBitBtn", found_index=0).click_input()
|
502
|
-
except:
|
503
|
-
pass
|
473
|
+
|
504
474
|
return RpaRetornoProcessoDTO(
|
505
475
|
sucesso=False,
|
506
476
|
retorno=mensagem,
|
@@ -510,16 +480,19 @@ async def integracao_contabil_generica(
|
|
510
480
|
|
511
481
|
await worker_sleep(1)
|
512
482
|
|
513
|
-
# Se nenhuma imagem foi encontrada, tenta só fechar a TMsgBox (se existir) e sai
|
514
483
|
try:
|
515
484
|
app = Application(backend="win32").connect(
|
516
485
|
class_name="TMsgBox", found_index=0
|
517
486
|
)
|
518
487
|
main_window = app["TMsgBox"]
|
519
|
-
main_window.child_window(
|
488
|
+
main_window.child_window(
|
489
|
+
class_name="TBitBtn", found_index=0
|
490
|
+
).click_input()
|
520
491
|
break
|
521
492
|
except ElementNotFoundError:
|
522
|
-
console.print(
|
493
|
+
console.print(
|
494
|
+
"[yellow]Janela TMsgBox ainda não visível.[/yellow]"
|
495
|
+
)
|
523
496
|
break
|
524
497
|
|
525
498
|
except ElementNotFoundError:
|
@@ -530,23 +503,6 @@ async def integracao_contabil_generica(
|
|
530
503
|
|
531
504
|
await worker_sleep(1)
|
532
505
|
|
533
|
-
try:
|
534
|
-
app = Application(backend="win32").connect(
|
535
|
-
class_name="TMsgBox", found_index=0
|
536
|
-
)
|
537
|
-
main_window = app["TMsgBox"]
|
538
|
-
main_window.child_window(class_name="TBitBtn", found_index=0).click_input()
|
539
|
-
time.sleep(5)
|
540
|
-
break
|
541
|
-
except ElementNotFoundError:
|
542
|
-
console.print("[yellow]Janela TMsgBox ainda não visível.[/yellow]")
|
543
|
-
|
544
|
-
except Exception as e:
|
545
|
-
print(f"Erro inesperado ao verificar janela de confirmação: {e}")
|
546
|
-
break
|
547
|
-
|
548
|
-
await worker_sleep(1)
|
549
|
-
|
550
506
|
try:
|
551
507
|
app = Application(backend="win32").connect(
|
552
508
|
class_name="TMsgBox", found_index=0
|
@@ -560,7 +516,28 @@ async def integracao_contabil_generica(
|
|
560
516
|
except ElementNotFoundError:
|
561
517
|
console.print("[yellow]Janela TMsgBox ainda não visível.[/yellow]")
|
562
518
|
|
563
|
-
|
519
|
+
if lotesMarcados:
|
520
|
+
if (
|
521
|
+
checkbox.exists()
|
522
|
+
and checkbox.is_enabled()
|
523
|
+
and checkbox.is_visible()
|
524
|
+
):
|
525
|
+
checkbox.click_input()
|
526
|
+
print("Checkbox 'Lotes Consistentes' desmarcado com sucesso.")
|
527
|
+
time.sleep(5)
|
528
|
+
return RpaRetornoProcessoDTO(
|
529
|
+
sucesso=False,
|
530
|
+
retorno=f"Integração realizada, porém, existem LOTES INCONSISTENTES.",
|
531
|
+
status=RpaHistoricoStatusEnum.Falha,
|
532
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
533
|
+
)
|
534
|
+
else:
|
535
|
+
return RpaRetornoProcessoDTO(
|
536
|
+
sucesso=True,
|
537
|
+
retorno=f"Sucesso ao executar processo de integracao contabil",
|
538
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
539
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
540
|
+
)
|
564
541
|
except Exception as erro:
|
565
542
|
return RpaRetornoProcessoDTO(
|
566
543
|
sucesso=False,
|
@@ -576,4 +553,3 @@ async def integracao_contabil_generica(
|
|
576
553
|
status=RpaHistoricoStatusEnum.Falha,
|
577
554
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
578
555
|
)
|
579
|
-
|
@@ -82,7 +82,7 @@ worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py,sha256=mmBW7KetUeRjiZkjn
|
|
82
82
|
worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py,sha256=QzK2aG5d9pmFbb8cTaNm3LWf5NMkmCvBkgo70gcLu0c,14781
|
83
83
|
worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos_novo.py,sha256=4Rtm2uCfA6tZ-KW6aunKug7reTqbBX69CCBZCBnwbYc,21856
|
84
84
|
worker_automate_hub/tasks/jobs/integracao_contabil.py,sha256=psoIU0tjtTJq2W8aGXjXrfkAOYlIpUtHZyNolI7dp-0,16263
|
85
|
-
worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=
|
85
|
+
worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=cA41rQlqTkNo9XD1QM0xtSDhJQoWJenvNuA_WePW4OM,22048
|
86
86
|
worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py,sha256=0mlu-oPwRd9qCocB-6tWsEI0-wd48mkBJn5juYqOAX8,40788
|
87
87
|
worker_automate_hub/tasks/jobs/lancamento_rateio.py,sha256=0cvbpuJiHl5mca5gpZudX7uQY5Rqe5xzwt6juQcMhjo,15875
|
88
88
|
worker_automate_hub/tasks/jobs/login_emsys.py,sha256=dO9S027qRTtjOfytF6IWO-m6hDld8kZqOVAsn91l1YA,5684
|
@@ -103,7 +103,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
103
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.815.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
107
|
+
worker_automate_hub-0.5.815.dist-info/METADATA,sha256=OrtUVWxNu_6_tsaoS3JTHEkxvj0nGcMKMSl9pBWuq04,3100
|
108
|
+
worker_automate_hub-0.5.815.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
109
|
+
worker_automate_hub-0.5.815.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.814.dist-info → worker_automate_hub-0.5.815.dist-info}/entry_points.txt
RENAMED
File without changes
|