worker-automate-hub 0.4.402__py3-none-any.whl → 0.4.404__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_39.py +105 -9
- worker_automate_hub/tasks/jobs/transferencias.py +60 -18
- {worker_automate_hub-0.4.402.dist-info → worker_automate_hub-0.4.404.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.4.402.dist-info → worker_automate_hub-0.4.404.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.4.402.dist-info → worker_automate_hub-0.4.404.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.4.402.dist-info → worker_automate_hub-0.4.404.dist-info}/entry_points.txt +0 -0
@@ -1,9 +1,11 @@
|
|
1
1
|
import asyncio
|
2
|
+
import datetime
|
2
3
|
import getpass
|
3
4
|
import os
|
4
5
|
import warnings
|
5
6
|
|
6
7
|
import pyautogui
|
8
|
+
import pyperclip
|
7
9
|
from pywinauto.keyboard import send_keys
|
8
10
|
from PIL import Image, ImageEnhance
|
9
11
|
import pytesseract
|
@@ -135,19 +137,23 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
135
137
|
class_name="TDBIComboBox", found_index=1
|
136
138
|
)
|
137
139
|
|
140
|
+
combo_box_tipo_documento.set_focus()
|
138
141
|
combo_box_tipo_documento.click()
|
142
|
+
|
139
143
|
console.print(
|
140
144
|
"Clique select box, Tipo de documento realizado com sucesso, selecionando o tipo de documento...\n"
|
141
145
|
)
|
142
146
|
|
143
147
|
await worker_sleep(4)
|
144
148
|
|
145
|
-
|
149
|
+
pyautogui.write("NFe - NOTA FISCAL ELETRONICA PROPRIA - DANFE SERIE 077")
|
146
150
|
console.print(
|
147
151
|
"Tipo de documento 'NFe - NOTA FISCAL ELETRONICA PROPRIA - DANFE SERIE 077', selecionado com sucesso...\n"
|
148
152
|
)
|
149
153
|
|
150
|
-
|
154
|
+
pyautogui.hotkey("enter")
|
155
|
+
|
156
|
+
await worker_sleep(10)
|
151
157
|
|
152
158
|
# Clica em 'Importar-Nfe'
|
153
159
|
imported_nfe = await import_nfe()
|
@@ -169,7 +175,7 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
169
175
|
await worker_sleep(3)
|
170
176
|
|
171
177
|
try:
|
172
|
-
|
178
|
+
|
173
179
|
#INTERAGINDO COM A TELA DE NOTAS DE OUTRAS EMPRESAS
|
174
180
|
app = Application().connect(class_name="TFrmImportarNotaOutraEmpresa")
|
175
181
|
main_window = app["TFrmImportarNotaOutraEmpresa"]
|
@@ -401,8 +407,48 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
401
407
|
retorno=f"Erro ao importar nota fiscal.",
|
402
408
|
status=RpaHistoricoStatusEnum.Descartado,
|
403
409
|
)
|
404
|
-
|
410
|
+
|
405
411
|
await worker_sleep(40)
|
412
|
+
|
413
|
+
try:
|
414
|
+
app = Application().connect(title="Confirm")
|
415
|
+
except:
|
416
|
+
app = None
|
417
|
+
console.print("Tela de itens não localizados",style="bold yellow")
|
418
|
+
if app is not None:
|
419
|
+
try:
|
420
|
+
window_itens = app["Confirm"]
|
421
|
+
button_yes = window_itens.child_window(title="&Yes")
|
422
|
+
#Clicar em YES (ou sim)
|
423
|
+
button_yes.click()
|
424
|
+
#Aguarda Tela carregar
|
425
|
+
await worker_sleep(5)
|
426
|
+
#Conecta com tela de itens
|
427
|
+
app = Application().connect(title="Incluir Item Fornecedor")
|
428
|
+
window_incluir_itens = app["Incluir Item Fornecedor"]
|
429
|
+
#Garante que a tela esta em foco
|
430
|
+
window_incluir_itens.set_focus()
|
431
|
+
trys = 10
|
432
|
+
await worker_sleep(1)
|
433
|
+
error_itens = []
|
434
|
+
for i in range(trys):
|
435
|
+
pyautogui.hotkey('ctrl', 'c')
|
436
|
+
text_incluir_item_fornecedor = pyperclip.paste()
|
437
|
+
error_itens.append(text_incluir_item_fornecedor)
|
438
|
+
pyautogui.press('down', presses=1)
|
439
|
+
await worker_sleep(1)
|
440
|
+
|
441
|
+
return RpaRetornoProcessoDTO(
|
442
|
+
sucesso=False,
|
443
|
+
retorno=f"Itens nao localizados - \n{text_incluir_item_fornecedor}",
|
444
|
+
status=RpaHistoricoStatusEnum.Falha,
|
445
|
+
)
|
446
|
+
except Exception as e:
|
447
|
+
return RpaRetornoProcessoDTO(
|
448
|
+
sucesso=False,
|
449
|
+
retorno=f"Erro tratar tela 'Incluir item fornecedor', erro: {e}",
|
450
|
+
status=RpaHistoricoStatusEnum.Falha,
|
451
|
+
)
|
406
452
|
|
407
453
|
await emsys.verify_warning_and_error("Information", "&No")
|
408
454
|
|
@@ -428,9 +474,8 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
428
474
|
pyautogui.write(nota["valorNota"])
|
429
475
|
|
430
476
|
await emsys.incluir_registro()
|
431
|
-
await worker_sleep(
|
432
|
-
|
433
|
-
await worker_sleep(5)
|
477
|
+
await worker_sleep(40)
|
478
|
+
#TODO tratar tela de CFOP da capa
|
434
479
|
console.print(
|
435
480
|
"Verificando a existencia de POP-UP de Itens que Ultrapassam a Variação Máxima de Custo ...\n"
|
436
481
|
)
|
@@ -454,7 +499,10 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
454
499
|
main_window = app["TFrmTelaSelecao"]
|
455
500
|
send_keys("%o")
|
456
501
|
|
457
|
-
await worker_sleep(
|
502
|
+
await worker_sleep(3)
|
503
|
+
|
504
|
+
await emsys.verify_warning_and_error("Aviso", "OK")
|
505
|
+
|
458
506
|
console.print(
|
459
507
|
"Verificando a existencia de Warning informando que a Soma dos pagamentos não bate com o valor da nota. ...\n"
|
460
508
|
)
|
@@ -575,7 +623,50 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
575
623
|
retorno=f"Warning não mapeado para seguimento do robo, mensagem: {captured_text}",
|
576
624
|
status=RpaHistoricoStatusEnum.Falha,
|
577
625
|
)
|
626
|
+
|
627
|
+
await emsys.verify_warning_and_error("Aviso", "OK")
|
628
|
+
|
629
|
+
await worker_sleep(3)
|
630
|
+
|
631
|
+
#Alterar NOP
|
632
|
+
try:
|
633
|
+
for attempt in range(2):
|
634
|
+
console.print("Alterando a NOP...\n")
|
635
|
+
pyautogui.click(618, 330)
|
636
|
+
await worker_sleep(2)
|
637
|
+
nop_value = "1152 - ENTRADAS P/ TRANSFERENCIAS DE MERCADORIA- 1.152"
|
638
|
+
console.print(f"Inserindo a informação da NOP: {nop_value} ...\n")
|
639
|
+
await worker_sleep(5)
|
640
|
+
set_combobox("||List", nop_value)
|
641
|
+
await worker_sleep(2)
|
642
|
+
pyautogui.hotkey("enter")
|
643
|
+
await worker_sleep(8)
|
644
|
+
console.print("Teste")
|
645
|
+
await emsys.verify_warning_and_error("Aviso", "OK")
|
646
|
+
await emsys.incluir_registro()
|
647
|
+
retorno = await verify_nf_incuded()
|
648
|
+
await worker_sleep(40)
|
649
|
+
if retorno:
|
650
|
+
break
|
578
651
|
|
652
|
+
console.print("\nVerifica se a nota ja foi lançada...")
|
653
|
+
nf_chave_acesso = int(nota.get("nfe"))
|
654
|
+
status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
|
655
|
+
if status_nf_emsys.get("status") != "Lançada":
|
656
|
+
|
657
|
+
return RpaRetornoProcessoDTO(
|
658
|
+
sucesso=False,
|
659
|
+
retorno=f"Erro na validação de CFOP, foi encontrado mais de uma opção com a mesma informação",
|
660
|
+
status=RpaHistoricoStatusEnum.Falha,
|
661
|
+
)
|
662
|
+
|
663
|
+
except:
|
664
|
+
return RpaRetornoProcessoDTO(
|
665
|
+
sucesso=False,
|
666
|
+
retorno=f"Erro ao alterar o NOP",
|
667
|
+
status=RpaHistoricoStatusEnum.Falha,
|
668
|
+
)
|
669
|
+
|
579
670
|
await worker_sleep(3)
|
580
671
|
retorno = False
|
581
672
|
try:
|
@@ -588,10 +679,11 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
588
679
|
break
|
589
680
|
else:
|
590
681
|
console.print(f"Aguardando confirmação de nota incluida...\n")
|
591
|
-
await worker_sleep(
|
682
|
+
await worker_sleep(4)
|
592
683
|
i += 1
|
593
684
|
|
594
685
|
information_pop_up = await is_window_open("Information")
|
686
|
+
|
595
687
|
if information_pop_up["IsOpened"] == True:
|
596
688
|
app = Application().connect(class_name="TFrmNotaFiscalEntrada")
|
597
689
|
main_window = app["Information"]
|
@@ -645,6 +737,7 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
645
737
|
)
|
646
738
|
else:
|
647
739
|
console.print(f"Aba Information não encontrada")
|
740
|
+
print("romero brito?")
|
648
741
|
retorno = await verify_nf_incuded()
|
649
742
|
|
650
743
|
except Exception as e:
|
@@ -655,6 +748,9 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
655
748
|
status=RpaHistoricoStatusEnum.Falha,
|
656
749
|
)
|
657
750
|
|
751
|
+
await emsys.verify_warning_and_error("Aviso", "OK")
|
752
|
+
await emsys.verify_warning_and_error("Aviso", "&OK")
|
753
|
+
|
658
754
|
if retorno:
|
659
755
|
console.print("\nNota lançada com sucesso...", style="bold green")
|
660
756
|
await worker_sleep(6)
|
@@ -613,10 +613,10 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
613
613
|
app = Application().connect(title="Informação")
|
614
614
|
dialog = app.window(title="Informação")
|
615
615
|
|
616
|
-
|
617
|
-
if
|
616
|
+
btn_yes = dialog.child_window(title="OK", class_name="Button")
|
617
|
+
if btn_yes.exists():
|
618
618
|
try:
|
619
|
-
|
619
|
+
btn_yes.click()
|
620
620
|
await worker_sleep(3)
|
621
621
|
console.print(
|
622
622
|
"O botão OK de pré-venda incluída foi clicado com sucesso.",
|
@@ -632,7 +632,6 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
632
632
|
retorno=f"Falha ao clicar no botão OK de pré-venda incluída: {e}",
|
633
633
|
status=RpaHistoricoStatusEnum.Falha,
|
634
634
|
)
|
635
|
-
|
636
635
|
else:
|
637
636
|
|
638
637
|
console.print(
|
@@ -656,22 +655,66 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
656
655
|
|
657
656
|
await worker_sleep(3)
|
658
657
|
|
659
|
-
screenshot_path = take_screenshot()
|
658
|
+
# screenshot_path = take_screenshot()
|
660
659
|
# Message 'Deseja pesquisar pré-venda?'
|
661
660
|
console.print(
|
662
661
|
"Verificando a existencia da mensagem: 'Deseja pesquisar pré-venda?'...\n"
|
663
662
|
)
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
663
|
+
try:
|
664
|
+
app = Application().connect(title="Confirm")
|
665
|
+
dialog_prevenda = app.window(title="Confirm")
|
666
|
+
|
667
|
+
btn_yes = dialog_prevenda.child_window(title="&Yes", class_name="TButton")
|
668
|
+
if btn_yes.exists():
|
669
|
+
try:
|
670
|
+
btn_yes.click()
|
671
|
+
await worker_sleep(3)
|
672
|
+
console.print(
|
673
|
+
"O botão YES de pesquisa pré-venda incluída foi clicado com sucesso.",
|
674
|
+
style="green",
|
675
|
+
)
|
676
|
+
except Exception as e:
|
677
|
+
console.print(
|
678
|
+
f"Falha ao clicar no botão YES de pesquisa pré-venda incluída: {e}",
|
679
|
+
style="red",
|
680
|
+
)
|
681
|
+
return RpaRetornoProcessoDTO(
|
682
|
+
sucesso=False,
|
683
|
+
retorno=f"Falha ao clicar no botão YES de pesquisa pré-venda incluída: {e}",
|
684
|
+
status=RpaHistoricoStatusEnum.Falha,
|
685
|
+
)
|
669
686
|
else:
|
670
|
-
|
671
|
-
console.
|
672
|
-
|
673
|
-
|
674
|
-
|
687
|
+
|
688
|
+
console.print(
|
689
|
+
"O Botão OK de pré-venda incluída não foi encontrado.", style="red"
|
690
|
+
)
|
691
|
+
return RpaRetornoProcessoDTO(
|
692
|
+
sucesso=False,
|
693
|
+
retorno="O Botão YES de pesquisa pré-venda incluída não foi encontrado.",
|
694
|
+
status=RpaHistoricoStatusEnum.Falha,
|
695
|
+
)
|
696
|
+
|
697
|
+
except Exception as e:
|
698
|
+
console.print(
|
699
|
+
f"O Botão YES de pesquisa pré-venda incluída não foi encontrado: {e}", style="red"
|
700
|
+
)
|
701
|
+
return RpaRetornoProcessoDTO(
|
702
|
+
sucesso=False,
|
703
|
+
retorno=f"O Botão YES de pesquisa pré-venda incluída não foi encontrado: {e}",
|
704
|
+
status=RpaHistoricoStatusEnum.Falha,
|
705
|
+
)
|
706
|
+
|
707
|
+
# message_prevenda = take_target_position(screenshot_path, "Deseja")
|
708
|
+
# if message_prevenda is not None:
|
709
|
+
# button_yes = find_target_position(screenshot_path, "Yes", attempts=5)
|
710
|
+
# if button_yes is not None:
|
711
|
+
# pyautogui.click(button_yes)
|
712
|
+
# else:
|
713
|
+
# pyautogui.click(914,560)
|
714
|
+
# console.log('Clicou em "Yes" para confirmar pré-venda', style="bold green")
|
715
|
+
# else:
|
716
|
+
# log_msg = f"Mensagem 'Deseja pesquisar pré-venda?' não encontrada."
|
717
|
+
# console.print(log_msg, style="bold yellow")
|
675
718
|
await worker_sleep(5)
|
676
719
|
|
677
720
|
# screenshot_path = take_screenshot()
|
@@ -767,7 +810,7 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
767
810
|
pyautogui.click(pre_venda_sucesso)
|
768
811
|
console.log('Clicou em "OK" na mensagem de sucesso', style="bold green")
|
769
812
|
|
770
|
-
await worker_sleep(
|
813
|
+
await worker_sleep(10)
|
771
814
|
|
772
815
|
# Faturando Pre-venda
|
773
816
|
retorno = await faturar_pre_venda(task)
|
@@ -856,5 +899,4 @@ async def transferencias(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
856
899
|
sucesso=False,
|
857
900
|
retorno=log_msg,
|
858
901
|
status=RpaHistoricoStatusEnum.Falha,
|
859
|
-
)
|
860
|
-
|
902
|
+
)
|
@@ -44,7 +44,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_32.py,sha256=0cneKY6bQU5neo3TKlG
|
|
44
44
|
worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=cR1a7Q61adYuCMCRxH71mxVnORvkeBbKZ8_dsnUNQ-g,31456
|
45
45
|
worker_automate_hub/tasks/jobs/entrada_de_notas_34.py,sha256=iaSmtWTWlazHDtGp22yTV5J5rHDhUCbEaCAnpU7UWyM,31808
|
46
46
|
worker_automate_hub/tasks/jobs/entrada_de_notas_36.py,sha256=vFkDcgJ9uxrMMLYdeONCMxh6_evnhgF1Sun5HEHAWa4,22716
|
47
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=
|
47
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=YMXbcQ-IXimJzH8npsGO3525aBrjSSsiiD-TlLdlURo,32664
|
48
48
|
worker_automate_hub/tasks/jobs/entrada_de_notas_500.py,sha256=ryl5AZ2617aROSVcS-N5wQIBlFQ1Bp0khUH9fP4DOzU,26542
|
49
49
|
worker_automate_hub/tasks/jobs/entrada_de_notas_505.py,sha256=jIml8gjXPdI6_x7S9VVV8IrKZRF7_PTNOMnhNmYMDTU,14490
|
50
50
|
worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py,sha256=8XP9G3n0PUeshbRWkWKOMnyUGRWspIolPZVqQTR3SMI,14184
|
@@ -55,7 +55,7 @@ worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=QBGm6eS5J
|
|
55
55
|
worker_automate_hub/tasks/jobs/login_emsys.py,sha256=IoGCIvO4UwmuxOZEn3cvYJlKyhsWvtHvbFk8vwjTroQ,5620
|
56
56
|
worker_automate_hub/tasks/jobs/playground.py,sha256=bdnXv3C7WLQUxt4edGZDfAbRJJ2-q4zuIQaK3GLnaUc,1765
|
57
57
|
worker_automate_hub/tasks/jobs/sped_fiscal.py,sha256=KquAdk26kvIKqT5hkHvzKMpa1UzJphx6s7qDv9pVuH4,26243
|
58
|
-
worker_automate_hub/tasks/jobs/transferencias.py,sha256=
|
58
|
+
worker_automate_hub/tasks/jobs/transferencias.py,sha256=GM8OjjIgxu9biXYyQVnW3c-af06tdIPqy3s9QH9UXSs,38023
|
59
59
|
worker_automate_hub/tasks/task_definitions.py,sha256=2Jp1H4_qJZqqGyaP6MA87KLt4QNrtWBYWbXu-2gymFo,4459
|
60
60
|
worker_automate_hub/tasks/task_executor.py,sha256=eXFgWbcM8aMPwENvNix8KyFv7BqvIwhXUDkBSI1ul7M,8873
|
61
61
|
worker_automate_hub/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -67,7 +67,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
67
67
|
worker_automate_hub/utils/util.py,sha256=YCbgMMBwhp9LD6NUmE5S2K6S12TNEpGJm25FqfsIKPE,119544
|
68
68
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=yQFyDzvXPSO-UYV1m38WLJ3AWQgZYcyUkHZdCKE1jG4,28360
|
69
69
|
worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
|
70
|
-
worker_automate_hub-0.4.
|
71
|
-
worker_automate_hub-0.4.
|
72
|
-
worker_automate_hub-0.4.
|
73
|
-
worker_automate_hub-0.4.
|
70
|
+
worker_automate_hub-0.4.404.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
71
|
+
worker_automate_hub-0.4.404.dist-info/METADATA,sha256=JCgJOuaKdUaHqNe89o2mchau7CnsD5_rIpEqtLIxgU4,2895
|
72
|
+
worker_automate_hub-0.4.404.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
73
|
+
worker_automate_hub-0.4.404.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.4.402.dist-info → worker_automate_hub-0.4.404.dist-info}/entry_points.txt
RENAMED
File without changes
|