worker-automate-hub 0.5.88__tar.gz → 0.5.90__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/PKG-INFO +1 -1
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/pyproject.toml +1 -1
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py +170 -168
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/util.py +8 -10
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/README.md +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/datalake_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/rdp_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/rpa_fila_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/webhook_service.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_fila.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_robo.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/worker.py +0 -0
@@ -795,215 +795,217 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
795
795
|
await worker_sleep(1)
|
796
796
|
pyautogui.press('enter')
|
797
797
|
|
798
|
-
numero_nota_fiscal = "1777083"
|
799
798
|
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
799
|
+
#STEP 3
|
800
|
+
type_text_into_field("Gerenciador de Notas Fiscais", app["TFrmMenuPrincipal"]["Edit"], True, "50")
|
801
|
+
pyautogui.press("enter")
|
802
|
+
await worker_sleep(2)
|
803
|
+
pyautogui.press("enter")
|
804
|
+
await worker_sleep(5)
|
805
|
+
console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso",style="bold green")
|
806
|
+
pesquisar_venda_devolucao = await is_window_open_by_class("TFrmGerenciadorNFe2", "TFrmGerenciadorNFe2")
|
807
|
+
if pesquisar_venda_devolucao["IsOpened"] == True:
|
808
|
+
console.print(f"\n'Gerenciador de Notas Fiscais'aberta com sucesso",style="bold green")
|
809
|
+
selecionar_itens_gerenciador_nfe = await gerenciador_nf_header(data_hoje, cod_cliente_incorreto)
|
810
|
+
if selecionar_itens_gerenciador_nfe.sucesso:
|
811
|
+
console.print("PROCESSO EXECUTADO COM SUCESSO, SEGUINDO COM O PROCESSO PARA TRANSMITIR A NF-E...\n")
|
812
|
+
app = Application().connect(class_name="TFrmGerenciadorNFe2", timeout=10)
|
813
|
+
main_window = app["TFrmGerenciadorNFe2"]
|
814
|
+
main_window.set_focus()
|
816
815
|
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
816
|
+
console.print("Obtendo informacao da tela para o botao Transfimitir\n")
|
817
|
+
tpanel_footer = main_window.child_window(class_name="TPanel", found_index=1)
|
818
|
+
btn_transmitir = tpanel_footer.child_window(class_name="TBitBtn", found_index=5)
|
819
|
+
btn_transmitir.click()
|
820
|
+
console.print("Transmitir clicado com sucesso...\n")
|
821
|
+
await worker_sleep(3)
|
823
822
|
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
823
|
+
max_attempts = 10
|
824
|
+
i = 0
|
825
|
+
console.print("Aguardando pop de operacação concluida \n")
|
826
|
+
while i < max_attempts:
|
827
|
+
try:
|
828
|
+
app = Application().connect(class_name="TFrmProcessamentoNFe2", timeout=10)
|
829
|
+
main_window = app["TFrmProcessamentoNFe2"]
|
830
|
+
|
831
|
+
await worker_sleep(5)
|
832
|
+
information_pop_up = await is_window_open_by_class("TMessageForm", "TMessageForm")
|
833
|
+
if information_pop_up["IsOpened"] == True:
|
834
|
+
msg_pop_up = await ocr_by_class(numero_nota_fiscal, "TMessageForm", "TMessageForm")
|
835
|
+
if msg_pop_up.sucesso:
|
836
|
+
if 'concl' in msg_pop_up.lower():
|
837
|
+
try:
|
838
|
+
information_operacao_concluida = main_window.child_window(class_name="TMessageForm")
|
839
|
+
btn_ok = information_operacao_concluida.child_window(class_name="TButton")
|
840
|
+
btn_ok.click()
|
841
|
+
await worker_sleep(4)
|
842
|
+
except:
|
843
|
+
pyautogui.press('enter')
|
844
|
+
await worker_sleep(4)
|
845
|
+
break
|
846
|
+
else:
|
847
|
+
retorno = f"Pop up nao mapeado para seguimento do robo {msg_pop_up} \nEtapas Executadas:\n{steps}"
|
848
|
+
return RpaRetornoProcessoDTO(
|
849
|
+
sucesso=False,
|
850
|
+
retorno=retorno,
|
851
|
+
status=RpaHistoricoStatusEnum.Falha,
|
852
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
853
|
+
)
|
847
854
|
else:
|
848
|
-
retorno = f"
|
855
|
+
retorno = f"Não foi possivel realizar a confirmação do msg do OCR \nEtapas Executadas:\n{steps}"
|
849
856
|
return RpaRetornoProcessoDTO(
|
850
857
|
sucesso=False,
|
851
858
|
retorno=retorno,
|
852
859
|
status=RpaHistoricoStatusEnum.Falha,
|
853
860
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
854
861
|
)
|
855
|
-
|
856
|
-
|
857
|
-
return RpaRetornoProcessoDTO(
|
858
|
-
sucesso=False,
|
859
|
-
retorno=retorno,
|
860
|
-
status=RpaHistoricoStatusEnum.Falha,
|
861
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
862
|
-
)
|
863
|
-
except Exception as e:
|
864
|
-
pass
|
862
|
+
except Exception as e:
|
863
|
+
pass
|
865
864
|
|
866
865
|
|
867
|
-
|
868
|
-
|
869
|
-
|
866
|
+
i += 1
|
867
|
+
await worker_sleep(10)
|
868
|
+
|
870
869
|
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
870
|
+
if i == max_attempts:
|
871
|
+
console.print("Número máximo de tentativas atingido. Encerrando...")
|
872
|
+
retorno = f"Tempo esgotado e numero de tentativas atingido, não foi possivel obter o retorno de conclusão para transmissão na tela de Gerenciador NF-e \nEtapas Executadas:\n{steps}"
|
873
|
+
return RpaRetornoProcessoDTO(
|
874
|
+
sucesso=False,
|
875
|
+
retorno=retorno,
|
876
|
+
status=RpaHistoricoStatusEnum.Falha,
|
877
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
878
|
+
)
|
879
|
+
|
881
880
|
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
881
|
+
console.print("Verificando se a nota foi transmitida com sucesso")
|
882
|
+
app = Application().connect(class_name="TFrmProcessamentoNFe2", timeout=15)
|
883
|
+
main_window = app["TFrmProcessamentoNFe2"]
|
884
|
+
main_window.set_focus()
|
886
885
|
|
887
|
-
|
888
|
-
center_x = (rect.left + rect.right) // 2
|
889
|
-
center_y = (rect.top + rect.bottom) // 2
|
886
|
+
tpanel_footer = main_window.child_window(class_name="TGroupBox", found_index=0)
|
890
887
|
|
891
|
-
|
892
|
-
|
888
|
+
rect = tpanel_footer.rectangle()
|
889
|
+
center_x = (rect.left + rect.right) // 2
|
890
|
+
center_y = (rect.top + rect.bottom) // 2
|
893
891
|
|
894
|
-
|
895
|
-
|
896
|
-
await worker_sleep(1)
|
897
|
-
with pyautogui.hold('ctrl'):
|
898
|
-
pyautogui.press('c')
|
892
|
+
pyautogui.moveTo(center_x, center_y)
|
893
|
+
double_click(coords=(center_x, center_y))
|
899
894
|
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
895
|
+
with pyautogui.hold('ctrl'):
|
896
|
+
pyautogui.press('c')
|
897
|
+
await worker_sleep(1)
|
898
|
+
with pyautogui.hold('ctrl'):
|
899
|
+
pyautogui.press('c')
|
904
900
|
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
get_error_msg = await get_text_display_window(pop_up_status)
|
910
|
-
console.print(f"Msg Rejeição: {get_error_msg}")
|
911
|
-
retorno = f"Erro ao transmitir, mensagem de rejeição {get_error_msg} \nEtapas Executadas:\n{steps}"
|
912
|
-
return RpaRetornoProcessoDTO(
|
913
|
-
sucesso=False,
|
914
|
-
retorno=result,
|
915
|
-
status=RpaHistoricoStatusEnum.Falha,
|
916
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
917
|
-
)
|
901
|
+
win32clipboard.OpenClipboard()
|
902
|
+
pop_up_status = win32clipboard.GetClipboardData().strip()
|
903
|
+
win32clipboard.CloseClipboard()
|
904
|
+
console.print(f"Status copiado: {pop_up_status}")
|
918
905
|
|
906
|
+
if "autorizado o uso da nf-e" in pop_up_status.lower():
|
907
|
+
console.print("Sucesso ao transmitir...\n")
|
908
|
+
main_window.close()
|
909
|
+
else:
|
910
|
+
get_error_msg = await get_text_display_window(pop_up_status)
|
911
|
+
console.print(f"Mensagem Rejeição: {get_error_msg}")
|
912
|
+
retorno = f"Erro ao transmitir, mensagem de rejeição {get_error_msg} \nEtapas Executadas:\n{steps}"
|
913
|
+
return RpaRetornoProcessoDTO(
|
914
|
+
sucesso=False,
|
915
|
+
retorno=result,
|
916
|
+
status=RpaHistoricoStatusEnum.Falha,
|
917
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
918
|
+
)
|
919
919
|
|
920
|
-
#PROCESSO DE IMPRESSÃO
|
921
|
-
console.print("Conectando a janela para seguir com o processo de impressão...\n")
|
922
|
-
app = Application().connect(class_name="TFrmGerenciadorNFe2", timeout=60)
|
923
|
-
main_window = app["TFrmGerenciadorNFe2"]
|
924
|
-
main_window.set_focus()
|
925
|
-
console.print("Obtendo informações do btn para imprimir...\n")
|
926
|
-
tpanel_footer = main_window.child_window(class_name="TPanel", found_index=1)
|
927
|
-
btn_imprimir_danfe = tpanel_footer.child_window(class_name="TBitBtn", found_index=0)
|
928
|
-
btn_imprimir_danfe.click()
|
929
|
-
await worker_sleep(5)
|
930
920
|
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
921
|
+
#PROCESSO DE IMPRESSÃO
|
922
|
+
console.print("Conectando a janela para seguir com o processo de impressão...\n")
|
923
|
+
app = Application().connect(class_name="TFrmGerenciadorNFe2", timeout=60)
|
924
|
+
main_window = app["TFrmGerenciadorNFe2"]
|
925
|
+
main_window.set_focus()
|
926
|
+
console.print("Obtendo informações do btn para imprimir...\n")
|
927
|
+
tpanel_footer = main_window.child_window(class_name="TPanel", found_index=1)
|
928
|
+
btn_imprimir_danfe = tpanel_footer.child_window(class_name="TBitBtn", found_index=0)
|
929
|
+
btn_imprimir_danfe.click()
|
930
|
+
await worker_sleep(5)
|
939
931
|
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
932
|
+
console.print("Obtendo informações do btn selecionar PDF...\n")
|
933
|
+
app = Application().connect(class_name="TFrmConfigurarTemplateDANF2", timeout=60)
|
934
|
+
main_window = app["TFrmGerenciadorNFe2"]
|
935
|
+
main_window.set_focus()
|
936
|
+
console.print("Selecionando PDF...\n")
|
937
|
+
btn_selecionar_pdf = main_window.child_window(class_name="TRadioButton", found_index=1)
|
938
|
+
btn_selecionar_pdf.click()
|
939
|
+
await worker_sleep(2)
|
946
940
|
|
941
|
+
console.print("BTN Gerar ...\n")
|
942
|
+
btn_gerar = main_window.child_window(class_name="TBitBtn", found_index=1)
|
943
|
+
btn_gerar.click()
|
944
|
+
console.print("BTN Gerar - Clicado com sucesso...\n")
|
945
|
+
await worker_sleep(2)
|
946
|
+
steps += 'ETAPA 03 - PROCESSO DE TRANSMITIR NF-e EXECUTADO COM SUCESSO '
|
947
947
|
|
948
|
-
app = Application().connect(title="Salvar par arquivo")
|
949
|
-
main_window = app["Salvar"]
|
950
|
-
console.print("Tela 'Salvar' encontrada!")
|
951
948
|
|
952
|
-
|
953
|
-
|
954
|
-
|
949
|
+
app = Application().connect(title="Salvar par arquivo")
|
950
|
+
main_window = app["Salvar"]
|
951
|
+
console.print("Tela 'Salvar' encontrada!")
|
955
952
|
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
main_window.type_keys("%l")
|
960
|
-
console.print("Arquivo salvo com sucesso...\n")
|
961
|
-
await worker_sleep(6)
|
953
|
+
console.print("Interagindo com a tela 'Salvar'...\n")
|
954
|
+
username = getpass.getuser()
|
955
|
+
path_to_txt = f"C:\\Users\\{username}\\Downloads\\DEVOLUÇÃO PRAZO A FATURAR {numero_cupom_fiscal}"
|
962
956
|
|
963
|
-
|
964
|
-
|
957
|
+
main_window.type_keys("%n")
|
958
|
+
pyautogui.write(path_to_txt)
|
959
|
+
await worker_sleep(1)
|
960
|
+
main_window.type_keys("%l")
|
961
|
+
console.print("Arquivo salvo com sucesso...\n")
|
962
|
+
await worker_sleep(6)
|
965
963
|
|
966
|
-
|
967
|
-
|
968
|
-
try:
|
969
|
-
await send_file(historico_id, desArquivo, "pdf", file_bytes, file_extension="pdf")
|
970
|
-
os.remove(path_to_txt)
|
971
|
-
except Exception as e:
|
972
|
-
result = f"Arquivo DEVOLUÇÃO PRAZO A FATURAR gerado com sucesso, porém gerou erro ao realizar o envio para o backoffice {e} - Arquivo ainda salvo na dispositivo utilizado no diretório {path_to_txt}! \nEtapas Executadas:\n{steps}"
|
973
|
-
console.print(result, style="bold red")
|
974
|
-
return RpaRetornoProcessoDTO(
|
975
|
-
sucesso=False,
|
976
|
-
retorno=result,
|
977
|
-
status=RpaHistoricoStatusEnum.Falha,
|
978
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
979
|
-
)
|
964
|
+
with open(path_to_txt, 'rb') as file:
|
965
|
+
file_bytes = io.BytesIO(file.read())
|
980
966
|
|
981
|
-
|
982
|
-
|
983
|
-
|
967
|
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
968
|
+
desArquivo = f"DEVOLUÇÃO PRAZO A FATURAR {numero_cupom_fiscal}.pdf"
|
969
|
+
try:
|
970
|
+
await send_file(historico_id, desArquivo, "pdf", file_bytes, file_extension="pdf")
|
971
|
+
os.remove(path_to_txt)
|
972
|
+
except Exception as e:
|
973
|
+
result = f"Arquivo DEVOLUÇÃO PRAZO A FATURAR gerado com sucesso, porém gerou erro ao realizar o envio para o backoffice {e} - Arquivo ainda salvo na dispositivo utilizado no diretório {path_to_txt}! \nEtapas Executadas:\n{steps}"
|
974
|
+
console.print(result, style="bold red")
|
975
|
+
return RpaRetornoProcessoDTO(
|
976
|
+
sucesso=False,
|
977
|
+
retorno=result,
|
978
|
+
status=RpaHistoricoStatusEnum.Falha,
|
979
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
980
|
+
)
|
981
|
+
|
982
|
+
app = Application().connect(class_name="TFrmConfigurarTemplateDANF2", timeout=60)
|
983
|
+
main_window = app["TFrmGerenciadorNFe2"]
|
984
|
+
main_window.close()
|
984
985
|
|
985
|
-
|
986
|
-
|
987
|
-
|
986
|
+
app = Application().connect(class_name="TFrmGerenciadorNFe2", timeout=60)
|
987
|
+
main_window = app["TFrmGerenciadorNFe2"]
|
988
|
+
main_window.close()
|
988
989
|
|
989
990
|
|
991
|
+
else:
|
992
|
+
retorno = f"{selecionar_itens_gerenciador_nfe} \nEtapas Executadas:\n{steps}"
|
993
|
+
return RpaRetornoProcessoDTO(
|
994
|
+
sucesso=False,
|
995
|
+
retorno=retorno,
|
996
|
+
status=RpaHistoricoStatusEnum.Falha,
|
997
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
998
|
+
)
|
990
999
|
else:
|
991
|
-
retorno = f"
|
1000
|
+
retorno = f"Não foi possivel abrir a tela de Gerenciador de Notas Fiscais \nEtapas Executadas:\n{steps}"
|
992
1001
|
return RpaRetornoProcessoDTO(
|
993
1002
|
sucesso=False,
|
994
1003
|
retorno=retorno,
|
995
1004
|
status=RpaHistoricoStatusEnum.Falha,
|
996
1005
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
997
1006
|
)
|
998
|
-
else:
|
999
|
-
retorno = f"Não foi possivel abrir a tela de Gerenciador de Notas Fiscais \nEtapas Executadas:\n{steps}"
|
1000
|
-
return RpaRetornoProcessoDTO(
|
1001
|
-
sucesso=False,
|
1002
|
-
retorno=retorno,
|
1003
|
-
status=RpaHistoricoStatusEnum.Falha,
|
1004
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
1005
|
-
)
|
1006
1007
|
|
1008
|
+
numero_nota_fiscal = "1777083"
|
1007
1009
|
|
1008
1010
|
#STEP 4
|
1009
1011
|
#PRE VENDA
|
@@ -3478,6 +3478,7 @@ async def ocr_by_class(numero_nota: str, windows_class: str, app_class: str)-> R
|
|
3478
3478
|
console.print(f"Imagem preparada com sucesso...\n")
|
3479
3479
|
console.print(f"Realizando OCR...\n")
|
3480
3480
|
captured_text = pytesseract.image_to_string(Image.open(path_to_png))
|
3481
|
+
os.remove(path_to_png)
|
3481
3482
|
console.print(f"Texto Full capturado {captured_text}...\n")
|
3482
3483
|
return RpaRetornoProcessoDTO(
|
3483
3484
|
sucesso=True,
|
@@ -3491,11 +3492,6 @@ async def ocr_by_class(numero_nota: str, windows_class: str, app_class: str)-> R
|
|
3491
3492
|
status=RpaHistoricoStatusEnum.Falha,
|
3492
3493
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
3493
3494
|
)
|
3494
|
-
finally:
|
3495
|
-
try:
|
3496
|
-
os.remove(path_to_png)
|
3497
|
-
except:
|
3498
|
-
pass
|
3499
3495
|
|
3500
3496
|
|
3501
3497
|
async def nf_busca_nf_saida(num_nota_fiscal: str) -> RpaRetornoProcessoDTO:
|
@@ -3806,11 +3802,12 @@ async def gerenciador_nf_header(periodo: str, cod_cliente: str) -> RpaRetornoPro
|
|
3806
3802
|
|
3807
3803
|
console.print("Verificando a situação...\n")
|
3808
3804
|
situacao_text = situacao_select.window_text()
|
3809
|
-
if "
|
3805
|
+
if "XPTO" in situacao_text.lower():
|
3810
3806
|
console.print("Situação corretamente selecionada...\n")
|
3811
3807
|
else:
|
3812
3808
|
situacao_select.click()
|
3813
|
-
set_combobox("||List", "
|
3809
|
+
set_combobox("||List", "Todas")
|
3810
|
+
#set_combobox("||List", "Não Transmitida")
|
3814
3811
|
|
3815
3812
|
console.print("Inserindo o codigo do cliente...\n")
|
3816
3813
|
field_cod_cliente.click()
|
@@ -3898,16 +3895,17 @@ async def cadastro_pre_venda_header(nop: str, cod_cliente: str, cod_pagamento: s
|
|
3898
3895
|
await worker_sleep(1)
|
3899
3896
|
|
3900
3897
|
console.print("Inserindo codigo do cliente...\n")
|
3901
|
-
field_cod_cliente = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=
|
3898
|
+
field_cod_cliente = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=1)
|
3902
3899
|
field_cod_cliente.click()
|
3903
3900
|
pyautogui.press('del')
|
3904
3901
|
pyautogui.press('backspace')
|
3905
3902
|
field_cod_cliente.set_edit_text(cod_cliente)
|
3906
3903
|
pyautogui.press('tab')
|
3904
|
+
await worker_sleep(3)
|
3907
3905
|
|
3908
3906
|
console.print("Obtendo cidade do cliente")
|
3909
3907
|
field_cidade_cliente = panel_TGroup_Box.child_window(class_name="TDBIEditDescription", found_index=0)
|
3910
|
-
field_cidade_cliente.window_text()
|
3908
|
+
cidade_cliente = field_cidade_cliente.window_text()
|
3911
3909
|
|
3912
3910
|
|
3913
3911
|
console.print("Inserindo NOP...\n")
|
@@ -3920,7 +3918,7 @@ async def cadastro_pre_venda_header(nop: str, cod_cliente: str, cod_pagamento: s
|
|
3920
3918
|
|
3921
3919
|
return RpaRetornoProcessoDTO(
|
3922
3920
|
sucesso=True,
|
3923
|
-
retorno=
|
3921
|
+
retorno=cidade_cliente,
|
3924
3922
|
status=RpaHistoricoStatusEnum.Sucesso,
|
3925
3923
|
)
|
3926
3924
|
except Exception as e:
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/rdp_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/api/webhook_service.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/config/settings.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/__init__.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_fila.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dao/rpa_robo.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/models/dto/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/jobs/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/tasks/task_executor.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.5.88 → worker_automate_hub-0.5.90}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
File without changes
|
File without changes
|