worker-automate-hub 0.5.807__py3-none-any.whl → 0.5.809__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 +63 -112
- worker_automate_hub/tasks/jobs/integracao_contabil_generica.py +81 -57
- worker_automate_hub/utils/util.py +21 -3
- {worker_automate_hub-0.5.807.dist-info → worker_automate_hub-0.5.809.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.807.dist-info → worker_automate_hub-0.5.809.dist-info}/RECORD +7 -7
- {worker_automate_hub-0.5.807.dist-info → worker_automate_hub-0.5.809.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.807.dist-info → worker_automate_hub-0.5.809.dist-info}/entry_points.txt +0 -0
@@ -67,17 +67,6 @@ async def wait_aguarde_window_closed(app, timeout=60):
|
|
67
67
|
console.log("Timeout esperando a janela Aguarde...")
|
68
68
|
|
69
69
|
|
70
|
-
def click_desconfirmar():
|
71
|
-
cords = (675, 748)
|
72
|
-
pyautogui.click(x=cords[0], y=cords[1])
|
73
|
-
|
74
|
-
|
75
|
-
def ctrl_c():
|
76
|
-
pyautogui.press("tab", presses=12) # verificar
|
77
|
-
pyautogui.hotkey("ctrl", "c")
|
78
|
-
return pyperclip.paste()
|
79
|
-
|
80
|
-
|
81
70
|
async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
82
71
|
try:
|
83
72
|
config = await get_config_by_name("login_emsys_fiscal")
|
@@ -365,10 +354,10 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
365
354
|
info_window.child_window(
|
366
355
|
class_name="Button", found_index=0
|
367
356
|
).click_input()
|
368
|
-
except
|
369
|
-
|
370
|
-
except
|
371
|
-
|
357
|
+
except:
|
358
|
+
pass
|
359
|
+
except:
|
360
|
+
pass
|
372
361
|
|
373
362
|
# Verifica se a janela TMsgBox de aviso está aberta
|
374
363
|
try:
|
@@ -378,25 +367,49 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
378
367
|
box.set_focus()
|
379
368
|
box.child_window(class_name="TBitBtn", found_index=0).click_input()
|
380
369
|
print("Clicou no botão 'TBitBtn'.")
|
381
|
-
except
|
370
|
+
except:
|
382
371
|
pass
|
383
|
-
except Exception as e:
|
384
|
-
print(f"[Erro ao procurar/clicar na TMessageForm]: {e}")
|
385
372
|
|
386
373
|
# 2. Verifica e trata janela de confirmação TMessageForm
|
387
374
|
try:
|
388
|
-
|
389
|
-
|
390
|
-
)
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
375
|
+
# img_dialog = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\notas_rejeitadas.png"
|
376
|
+
img_dialog = "assets\\abertura_livros\\notas_rejeitadas.png"
|
377
|
+
if os.path.exists(img_dialog):
|
378
|
+
caixa = pyautogui.locateOnScreen(img_dialog, confidence=0.86, grayscale=True)
|
379
|
+
if caixa:
|
380
|
+
print("Janela 'notas rejeitadas' detectada por imagem.")
|
381
|
+
region = (caixa.left, caixa.top, caixa.width, caixa.height)
|
382
|
+
|
383
|
+
app_msg = Application().connect(
|
384
|
+
class_name="TMessageForm", timeout=2
|
385
|
+
)
|
386
|
+
form = app_msg["TMessageForm"]
|
387
|
+
console.print("Janela de confirmação 'TMessageForm' encontrada.")
|
388
|
+
form.set_focus()
|
389
|
+
form.child_window(class_name="TButton", found_index=1).click_input()
|
390
|
+
print("Clicou no botão de confirmação.")
|
391
|
+
|
392
|
+
await worker_sleep(5)
|
393
|
+
|
394
|
+
# img_dialog = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\gerar_rel_notas_rejeitadas.png"
|
395
|
+
img_dialog = "assets\\abertura_livros\\gerar_rel_notas_rejeitadas.png"
|
396
|
+
if os.path.exists(img_dialog):
|
397
|
+
caixa = pyautogui.locateOnScreen(img_dialog, confidence=0.86, grayscale=True)
|
398
|
+
if caixa:
|
399
|
+
print("Janela 'notas rejeitadas' detectada por imagem.")
|
400
|
+
region = (caixa.left, caixa.top, caixa.width, caixa.height)
|
401
|
+
|
402
|
+
app_msg = Application().connect(
|
403
|
+
class_name="TMessageForm", timeout=2
|
404
|
+
)
|
405
|
+
form = app_msg["TMessageForm"]
|
406
|
+
console.print("Janela de confirmação 'TMessageForm' encontrada.")
|
407
|
+
form.set_focus()
|
408
|
+
form.child_window(class_name="TButton", found_index=0).click_input()
|
409
|
+
print("Clicou no botão de confirmação.")
|
410
|
+
except:
|
397
411
|
pass
|
398
|
-
|
399
|
-
print(f"[Erro ao procurar/clicar na TMessageForm]: {e}")
|
412
|
+
|
400
413
|
|
401
414
|
# 3. Verifica se a janela do relatório está aberta
|
402
415
|
try:
|
@@ -406,10 +419,9 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
406
419
|
janela = app_report["TFrmPreviewRelatorio"]
|
407
420
|
print("Janela 'TFrmPreviewRelatorio' encontrada.")
|
408
421
|
janela_aberta = True
|
409
|
-
except
|
422
|
+
except:
|
410
423
|
pass
|
411
|
-
|
412
|
-
print(f"[Erro ao procurar TFrmPreviewRelatorio]: {e}")
|
424
|
+
|
413
425
|
|
414
426
|
# Se encontrou a janela de relatório, sai
|
415
427
|
if janela_aberta:
|
@@ -444,9 +456,27 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
444
456
|
main_window = app["TFrmPreviewRelatorio"]
|
445
457
|
main_window.set_focus()
|
446
458
|
|
459
|
+
# Verificando se a foi confirmado os livres
|
460
|
+
console.print("Verificando se os livros foram confirmados")
|
461
|
+
|
462
|
+
# imagem = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\assets\abertura_livros\confirmado_livros.png"
|
463
|
+
imagem = "assets\\abertura_livros\\confirmado_livros.png"
|
464
|
+
if os.path.exists(imagem):
|
465
|
+
caixa = pyautogui.locateOnScreen(imagem, confidence=0.9, grayscale=True)
|
466
|
+
else:
|
467
|
+
console.print("Imagem confirmada não encontrada")
|
468
|
+
return RpaRetornoProcessoDTO(
|
469
|
+
sucesso=False,
|
470
|
+
retorno=f"Erro na Abertura de Livro Fiscal: Imagem confirmada não encontrada",
|
471
|
+
status=RpaHistoricoStatusEnum.Falha,
|
472
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
473
|
+
)
|
474
|
+
|
447
475
|
# Clicar em fechar
|
448
476
|
main_window.close()
|
449
477
|
|
478
|
+
console.print("Livros confirmados")
|
479
|
+
|
450
480
|
await worker_sleep(5)
|
451
481
|
|
452
482
|
# Conecta na janela principal
|
@@ -577,86 +607,6 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
577
607
|
|
578
608
|
await worker_sleep(2)
|
579
609
|
|
580
|
-
# flag para controlar se é a primeira vez
|
581
|
-
primeira_confirmacao = True
|
582
|
-
|
583
|
-
while True:
|
584
|
-
janela_aberta = False
|
585
|
-
|
586
|
-
# 1. Verifica se a imagem apareceu e clica em 'Sim' na janela "Informação"
|
587
|
-
try:
|
588
|
-
if pyautogui.locateOnScreen(imagem, confidence=0.9):
|
589
|
-
print("Imagem 'livros_incluidos' apareceu na tela.")
|
590
|
-
try:
|
591
|
-
app_info = Application().connect(title="Informação", timeout=5)
|
592
|
-
info_window = app_info["Informação"]
|
593
|
-
info_window.set_focus()
|
594
|
-
console.print("Clicando em 'Sim' na janela Informação...")
|
595
|
-
info_window.child_window(class_name="Button", found_index=0).click_input()
|
596
|
-
except Exception as e:
|
597
|
-
print(f"Erro ao clicar em 'Sim' na janela Informação: {e}")
|
598
|
-
except Exception as e:
|
599
|
-
print(f"[Erro ao procurar imagem]: {e}")
|
600
|
-
|
601
|
-
# Verifica se a janela TMsgBox de aviso está aberta
|
602
|
-
try:
|
603
|
-
app_msgbox = Application().connect(class_name="TMsgBox", timeout=10)
|
604
|
-
box = app_msgbox["TMsgBox"]
|
605
|
-
print("Janela 'TMsgBox' encontrada.")
|
606
|
-
box.set_focus()
|
607
|
-
box.child_window(class_name="TBitBtn", found_index=0).click_input()
|
608
|
-
print("Clicou no botão 'TBitBtn'.")
|
609
|
-
except ElementNotFoundError:
|
610
|
-
pass
|
611
|
-
except Exception as e:
|
612
|
-
print(f"[Erro ao procurar/clicar na TMsgBox]: {e}")
|
613
|
-
|
614
|
-
# 2. Verifica e trata janela de confirmação TMessageForm
|
615
|
-
try:
|
616
|
-
app_msg = Application().connect(class_name="TMessageForm", timeout=2)
|
617
|
-
form = app_msg["TMessageForm"]
|
618
|
-
console.print("Janela de confirmação 'TMessageForm' encontrada.")
|
619
|
-
form.set_focus()
|
620
|
-
|
621
|
-
idx = 1 if primeira_confirmacao else 0
|
622
|
-
try:
|
623
|
-
form.child_window(class_name="TButton", found_index=idx).click_input()
|
624
|
-
print(f"Clicou no botão de confirmação (found_index={idx}).")
|
625
|
-
primeira_confirmacao = False # nas próximas vezes será 0
|
626
|
-
except Exception as e:
|
627
|
-
print(f"[Falha ao clicar no botão found_index={idx}]: {e}")
|
628
|
-
|
629
|
-
except ElementNotFoundError:
|
630
|
-
pass
|
631
|
-
except Exception as e:
|
632
|
-
print(f"[Erro ao procurar/clicar na TMessageForm]: {e}")
|
633
|
-
|
634
|
-
await worker_sleep(5)
|
635
|
-
|
636
|
-
# 3. Verifica se a janela do relatório está aberta
|
637
|
-
try:
|
638
|
-
app_report = Application().connect(class_name="TFrmPreviewRelatorio", timeout=2)
|
639
|
-
janela = app_report["TFrmPreviewRelatorio"]
|
640
|
-
print("Janela 'TFrmPreviewRelatorio' encontrada.")
|
641
|
-
janela_aberta = True
|
642
|
-
except ElementNotFoundError:
|
643
|
-
pass
|
644
|
-
except Exception as e:
|
645
|
-
print(f"[Erro ao procurar TFrmPreviewRelatorio]: {e}")
|
646
|
-
|
647
|
-
# Se encontrou a janela de relatório, sai
|
648
|
-
if janela_aberta:
|
649
|
-
print("Relatório carregado. Saindo do loop.")
|
650
|
-
break
|
651
|
-
|
652
|
-
# Verifica tempo limite
|
653
|
-
if time.time() - inicio > tempo_limite:
|
654
|
-
print("Tempo esgotado. Relatório não carregado.")
|
655
|
-
break
|
656
|
-
|
657
|
-
print("Aguardando janela de relatório... (verificando novas confirmações se houver)")
|
658
|
-
time.sleep(intervalo)
|
659
|
-
|
660
610
|
|
661
611
|
# === 5) Se não houve 'Aviso' com erro mapeado, considera sucesso ===
|
662
612
|
console.print("Nenhum erro confirmado. Fluxo OK.")
|
@@ -682,3 +632,4 @@ async def abertura_livros_fiscais(task: RpaProcessoEntradaDTO) -> RpaRetornoProc
|
|
682
632
|
status=RpaHistoricoStatusEnum.Falha,
|
683
633
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
684
634
|
)
|
635
|
+
|
@@ -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 = f"
|
205
|
+
caminho_imagem = os.path.join(ASSETS_PATH_BASE, "integracao_contabil", f"{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 = os.path.join(ASSETS_PATH_BASE, "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 = os.path.join(ASSETS_PATH_BASE, "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
|
-
print("Diferença:", diferenca)
|
403
|
-
print("Total Débito:", total_debito)
|
404
|
-
print("Total Crédito:", total_credito)
|
402
|
+
console.print("Diferença:", diferenca)
|
403
|
+
console.print("Total Débito:", total_debito)
|
404
|
+
console.print("Total Crédito:", total_credito)
|
405
405
|
|
406
406
|
if diferenca > "0,00":
|
407
407
|
clicou = True
|
@@ -433,19 +433,16 @@ async def integracao_contabil_generica(
|
|
433
433
|
|
434
434
|
await worker_sleep(5)
|
435
435
|
|
436
|
-
|
436
|
+
# --- AJUSTE: retorno de SUCESSO quando detectar integracao_sucesso.png
|
437
|
+
assets_int_cont = os.path.join(ASSETS_PATH_BASE, "integracao_contabil")
|
437
438
|
err_dict = {
|
438
|
-
assets_int_cont
|
439
|
-
|
440
|
-
assets_int_cont
|
441
|
-
|
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.",
|
439
|
+
os.path.join(assets_int_cont, "erro_duplicidade.png"): "Integração não realizada. Erro de Duplicidade localizado enquanto finalizava a integração, contate o suporte do Emsys.",
|
440
|
+
os.path.join(assets_int_cont, "conta_indefinida_error.png"): "Integração não realizada. Conta contábil indefinida no sistema.",
|
441
|
+
os.path.join(assets_int_cont, "lote_sem_complemento_error.png"): "Integração não realizada. Lote encontrado sem complemento obrigatório.",
|
442
|
+
os.path.join(assets_int_cont, "diferenca_cred_deb.png"): "Integração não realizada. Existem diferença em lotes consistentes, por favor verificar.",
|
443
|
+
os.path.join(assets_int_cont, "integracao_sucesso.png"): "Integração Finalizada com Sucesso.",
|
448
444
|
}
|
445
|
+
|
449
446
|
# Aguardar finalizar
|
450
447
|
while True:
|
451
448
|
try:
|
@@ -454,23 +451,56 @@ async def integracao_contabil_generica(
|
|
454
451
|
)
|
455
452
|
msg_box = app["TMsgBox"]
|
456
453
|
|
457
|
-
#
|
454
|
+
# Verifica por imagens de SUCESSO/ERRO
|
458
455
|
for img_path, mensagem in err_dict.items():
|
459
456
|
try:
|
460
|
-
|
461
|
-
except:
|
462
|
-
|
457
|
+
found = pyautogui.locateOnScreen(img_path, confidence=0.90)
|
458
|
+
except Exception:
|
459
|
+
found = None
|
463
460
|
|
464
|
-
if
|
465
|
-
|
461
|
+
if found:
|
462
|
+
# Caso SUCESSO
|
463
|
+
if img_path.endswith("integracao_sucesso.png"):
|
466
464
|
console.print(f"[green]{mensagem}[/green]")
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
465
|
+
# fecha a TMsgBox se estiver aberta (best-effort)
|
466
|
+
try:
|
467
|
+
msg_box.child_window(class_name="TBitBtn", found_index=0).click_input()
|
468
|
+
except:
|
469
|
+
pass
|
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
|
472
499
|
console.print(f"[red]Erro encontrado:[/red] {mensagem}")
|
473
|
-
|
500
|
+
try:
|
501
|
+
msg_box.child_window(class_name="TBitBtn", found_index=0).click_input()
|
502
|
+
except:
|
503
|
+
pass
|
474
504
|
return RpaRetornoProcessoDTO(
|
475
505
|
sucesso=False,
|
476
506
|
retorno=mensagem,
|
@@ -480,19 +510,16 @@ async def integracao_contabil_generica(
|
|
480
510
|
|
481
511
|
await worker_sleep(1)
|
482
512
|
|
513
|
+
# Se nenhuma imagem foi encontrada, tenta só fechar a TMsgBox (se existir) e sai
|
483
514
|
try:
|
484
515
|
app = Application(backend="win32").connect(
|
485
516
|
class_name="TMsgBox", found_index=0
|
486
517
|
)
|
487
518
|
main_window = app["TMsgBox"]
|
488
|
-
main_window.child_window(
|
489
|
-
class_name="TBitBtn", found_index=0
|
490
|
-
).click_input()
|
519
|
+
main_window.child_window(class_name="TBitBtn", found_index=0).click_input()
|
491
520
|
break
|
492
521
|
except ElementNotFoundError:
|
493
|
-
console.print(
|
494
|
-
"[yellow]Janela TMsgBox ainda não visível.[/yellow]"
|
495
|
-
)
|
522
|
+
console.print("[yellow]Janela TMsgBox ainda não visível.[/yellow]")
|
496
523
|
break
|
497
524
|
|
498
525
|
except ElementNotFoundError:
|
@@ -503,6 +530,23 @@ async def integracao_contabil_generica(
|
|
503
530
|
|
504
531
|
await worker_sleep(1)
|
505
532
|
|
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
|
+
|
506
550
|
try:
|
507
551
|
app = Application(backend="win32").connect(
|
508
552
|
class_name="TMsgBox", found_index=0
|
@@ -516,28 +560,7 @@ async def integracao_contabil_generica(
|
|
516
560
|
except ElementNotFoundError:
|
517
561
|
console.print("[yellow]Janela TMsgBox ainda não visível.[/yellow]")
|
518
562
|
|
519
|
-
|
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
|
-
)
|
563
|
+
|
541
564
|
except Exception as erro:
|
542
565
|
return RpaRetornoProcessoDTO(
|
543
566
|
sucesso=False,
|
@@ -553,3 +576,4 @@ async def integracao_contabil_generica(
|
|
553
576
|
status=RpaHistoricoStatusEnum.Falha,
|
554
577
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
555
578
|
)
|
579
|
+
|
@@ -339,9 +339,27 @@ async def login_emsys_fiscal(
|
|
339
339
|
message="32-bit application should be automated using 32-bit Python",
|
340
340
|
)
|
341
341
|
await worker_sleep(2)
|
342
|
-
filial_cod =
|
343
|
-
|
344
|
-
|
342
|
+
filial_cod = (
|
343
|
+
task.configEntrada.get("empresa")
|
344
|
+
or task.configEntrada.get("filialEmpresaOrigem")
|
345
|
+
or task.configEntrada.get("descricaoFilial")
|
346
|
+
)
|
347
|
+
|
348
|
+
# Extrai apenas os dígitos iniciais da string
|
349
|
+
num = None
|
350
|
+
if filial_cod is not None:
|
351
|
+
s = str(filial_cod).strip()
|
352
|
+
m = re.match(r'^(\d+)', s) # pega o número do INÍCIO
|
353
|
+
if not m:
|
354
|
+
m = re.search(r'\d+', s) # fallback: primeiro número que aparecer
|
355
|
+
if m:
|
356
|
+
num = m.group(1)
|
357
|
+
|
358
|
+
if num is None:
|
359
|
+
raise ValueError(f"Não foi possível extrair número de: {filial_cod!r}")
|
360
|
+
|
361
|
+
filial_cod = num
|
362
|
+
|
345
363
|
console.print(f"Empresa a ser processada: {filial_cod}")
|
346
364
|
|
347
365
|
try:
|
@@ -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=HYIp3eYyMc2JsMw9VGlgjxSeuQB3400_LLTyxJi9VYE,25203
|
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
|
@@ -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=aAMdB8a-BjHf5zoCvbiec8-CAs3ZR7ChBT8kPIEQQk0,24122
|
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
|
@@ -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=HXXGEEeGQd-gD_u8W0_aPYVDiMB9bKF-rJBl-m6RiRM,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.809.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
107
|
+
worker_automate_hub-0.5.809.dist-info/METADATA,sha256=bLZrGpEhfMwwktgBq0MdJIyvf3mbeZ9C9dwK2oxDk_8,3100
|
108
|
+
worker_automate_hub-0.5.809.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
109
|
+
worker_automate_hub-0.5.809.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.807.dist-info → worker_automate_hub-0.5.809.dist-info}/entry_points.txt
RENAMED
File without changes
|