worker-automate-hub 0.5.673__tar.gz → 0.5.674__tar.gz
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.
Potentially problematic release.
This version of worker-automate-hub might be problematic. Click here for more details.
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/PKG-INFO +1 -1
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/pyproject.toml +1 -1
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +74 -128
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/README.md +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/datalake_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/rdp_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/rpa_fila_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/webhook_service.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/rpa_fila.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dao/rpa_robo.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/rpa_sap_dto.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/cte_manual.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/cte_xml.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/devolucao_ctf.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/devolucao_ctf_35.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_cte_1353.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_cte_333.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_503.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos_novo.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/integracao_contabil.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/integracao_contabil_generica.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/lancamento_rateio.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/notas_faturamento_sap.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/util.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/worker.py +0 -0
|
@@ -7,18 +7,19 @@ import time
|
|
|
7
7
|
import uuid
|
|
8
8
|
import asyncio
|
|
9
9
|
import pyautogui
|
|
10
|
-
from datetime import datetime
|
|
11
10
|
import pytesseract
|
|
12
11
|
import win32clipboard
|
|
12
|
+
from datetime import datetime
|
|
13
13
|
from PIL import Image, ImageEnhance
|
|
14
|
-
from pyscreeze import ImageNotFoundException
|
|
15
14
|
from pywinauto.application import Application
|
|
16
15
|
from pywinauto.keyboard import send_keys
|
|
17
16
|
from pywinauto.timings import wait_until
|
|
18
17
|
from pywinauto_recorder.player import set_combobox
|
|
19
18
|
from rich.console import Console
|
|
20
|
-
import sys
|
|
21
|
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")))
|
|
19
|
+
# import sys
|
|
20
|
+
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")))
|
|
21
|
+
|
|
22
|
+
|
|
22
23
|
from worker_automate_hub.api.ahead_service import save_xml_to_downloads
|
|
23
24
|
from worker_automate_hub.api.client import (
|
|
24
25
|
get_config_by_name,
|
|
@@ -143,7 +144,7 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
143
144
|
await worker_sleep(5)
|
|
144
145
|
|
|
145
146
|
await get_xml(nota.get("nfe"))
|
|
146
|
-
await worker_sleep(
|
|
147
|
+
await worker_sleep(3)
|
|
147
148
|
|
|
148
149
|
# VERIFICANDO A EXISTENCIA DE WARNINGS
|
|
149
150
|
warning_pop_up = await is_window_open("Warning")
|
|
@@ -200,20 +201,31 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
200
201
|
await worker_sleep(3)
|
|
201
202
|
|
|
202
203
|
if str(cfop).startswith("6"):
|
|
203
|
-
|
|
204
|
+
texto_alvo = "2556-COMPRA DE MERCADORIAS SEM ESTOQUE- 2.556"
|
|
204
205
|
elif str(cfop).startswith("5"):
|
|
205
|
-
|
|
206
|
+
texto_alvo = "1556-COMPRA DE MERCADORIAS SEM ESTOQUE- 1.556"
|
|
206
207
|
else:
|
|
207
|
-
console.print(
|
|
208
|
-
"Erro mapeado, CFOP diferente de inicio com 540 ou 510, necessario ação manual ou ajuste no robo...\n"
|
|
209
|
-
)
|
|
208
|
+
console.print("CFOP não suportada...\n")
|
|
210
209
|
return RpaRetornoProcessoDTO(
|
|
211
210
|
sucesso=False,
|
|
212
|
-
retorno=
|
|
211
|
+
retorno="CFOP não suportada.",
|
|
213
212
|
status=RpaHistoricoStatusEnum.Falha,
|
|
214
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
213
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
|
215
214
|
)
|
|
216
|
-
|
|
215
|
+
|
|
216
|
+
# Percorre com seta para baixo até encontrar o texto alvo
|
|
217
|
+
for _ in range(500): # tenta até 15 opções
|
|
218
|
+
texto_atual = combo_box_natureza_operacao.window_text().strip()
|
|
219
|
+
|
|
220
|
+
if texto_alvo.lower() in texto_atual.lower():
|
|
221
|
+
combo_box_natureza_operacao.type_keys("{ENTER}")
|
|
222
|
+
break
|
|
223
|
+
else:
|
|
224
|
+
combo_box_natureza_operacao.type_keys("{DOWN}")
|
|
225
|
+
await worker_sleep(0.5)
|
|
226
|
+
|
|
227
|
+
# Sai do campo (opcional)
|
|
228
|
+
combo_box_natureza_operacao.type_keys("{TAB}")
|
|
217
229
|
await worker_sleep(3)
|
|
218
230
|
|
|
219
231
|
# INTERAGINDO COM O CAMPO ALMOXARIFADO
|
|
@@ -307,7 +319,7 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
307
319
|
"A opção 'Manter Natureza de Operação selecionada' selecionado com sucesso... \n"
|
|
308
320
|
)
|
|
309
321
|
|
|
310
|
-
await worker_sleep(
|
|
322
|
+
await worker_sleep(2)
|
|
311
323
|
console.print("Clicando em OK... \n")
|
|
312
324
|
|
|
313
325
|
max_attempts = 3
|
|
@@ -324,89 +336,8 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
324
336
|
except:
|
|
325
337
|
console.print("Não foi possivel clicar no Botão OK... \n")
|
|
326
338
|
|
|
327
|
-
await worker_sleep(
|
|
328
|
-
|
|
329
|
-
# Aguarda a tela de aguarde
|
|
330
|
-
# imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
331
|
-
imagem_alvo =r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\aguarde.png"
|
|
332
|
-
timeout = 300 # 5 minutos
|
|
333
|
-
start_time = time.time()
|
|
334
|
-
|
|
335
|
-
try:
|
|
336
|
-
console.print("Aguardando a imagem desaparecer da tela (até 5 minutos)...")
|
|
337
|
-
|
|
338
|
-
while True:
|
|
339
|
-
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
340
|
-
|
|
341
|
-
if not localizacao:
|
|
342
|
-
console.print("Imagem não está mais na tela.")
|
|
343
|
-
break
|
|
344
|
-
|
|
345
|
-
if time.time() - start_time > timeout:
|
|
346
|
-
console.print("Tempo limite atingido. A imagem ainda está na tela.")
|
|
347
|
-
break
|
|
348
|
-
|
|
349
|
-
time.sleep(5) # Espera 5 segundos antes de verificar novamente
|
|
350
|
-
|
|
351
|
-
except:
|
|
352
|
-
pass
|
|
353
|
-
|
|
354
|
-
await worker_sleep(7)
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
try:
|
|
358
|
-
app = Application().connect(class_name="TMessageForm", timeout=10)
|
|
359
|
-
main_window = app["TMessageForm"]
|
|
360
|
-
main_window.set_focus()
|
|
361
|
-
click_yes = main_window.child_window(class_name='TButton', found_index=1).click()
|
|
362
|
-
except:
|
|
363
|
-
pass
|
|
364
|
-
|
|
365
|
-
try:
|
|
366
|
-
# Verifica erro ncm nao encontrado
|
|
367
|
-
imagem_alvo = "assets\\entrada_notas\\nao_encontrado_ncm.png"
|
|
368
|
-
imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\nao_encontrado_ncm.png"
|
|
369
|
-
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
370
|
-
|
|
371
|
-
if localizacao:
|
|
372
|
-
console.print("Não encontrado o NCM cadastrado no sistema")
|
|
373
|
-
return RpaRetornoProcessoDTO(
|
|
374
|
-
sucesso=False,
|
|
375
|
-
retorno="Não encontrado o NCM cadastrado no sistema",
|
|
376
|
-
status=RpaHistoricoStatusEnum.Falha,
|
|
377
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
378
|
-
)
|
|
379
|
-
|
|
380
|
-
except ImageNotFoundException:
|
|
381
|
-
console.print(
|
|
382
|
-
"Imagem não encontrada continuando"
|
|
383
|
-
)
|
|
384
|
-
|
|
385
|
-
# Aguarda a tela de aguarde
|
|
386
|
-
# imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
387
|
-
imagem_alvo =r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\aguarde.png"
|
|
388
|
-
timeout = 300 # 5 minutos
|
|
389
|
-
start_time = time.time()
|
|
390
|
-
|
|
391
|
-
try:
|
|
392
|
-
console.print("Aguardando a imagem desaparecer da tela (até 5 minutos)...")
|
|
393
|
-
|
|
394
|
-
while True:
|
|
395
|
-
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
396
|
-
|
|
397
|
-
if not localizacao:
|
|
398
|
-
console.print("Imagem não está mais na tela.")
|
|
399
|
-
break
|
|
400
|
-
|
|
401
|
-
if time.time() - start_time > timeout:
|
|
402
|
-
console.print("Tempo limite atingido. A imagem ainda está na tela.")
|
|
403
|
-
break
|
|
404
|
-
|
|
405
|
-
time.sleep(2) # Espera 2 segundos antes de verificar novamente
|
|
339
|
+
await worker_sleep(3)
|
|
406
340
|
|
|
407
|
-
except Exception as e:
|
|
408
|
-
console.print(f"Ocorreu um erro: {e}")
|
|
409
|
-
|
|
410
341
|
console.print(
|
|
411
342
|
"Verificando a existencia da tela Informações para importação da Nota Fiscal Eletrônica...\n"
|
|
412
343
|
)
|
|
@@ -689,22 +620,59 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
689
620
|
class_name="TDBIComboBox", found_index=0
|
|
690
621
|
)
|
|
691
622
|
tipo_cobranca.click()
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
623
|
+
|
|
624
|
+
# Selecionando tipo de boleto
|
|
625
|
+
texto_alvo = "BANCO DO BRASIL BOLETO"
|
|
626
|
+
alternativo = "BOLETO"
|
|
627
|
+
# Tenta encontrar o texto preferencial
|
|
628
|
+
encontrado = False
|
|
629
|
+
for _ in range(50): # ajustável
|
|
630
|
+
texto_atual = tipo_cobranca.window_text().strip()
|
|
631
|
+
if texto_alvo.lower() in texto_atual.lower():
|
|
632
|
+
tipo_cobranca.type_keys("{ENTER}")
|
|
633
|
+
encontrado = True
|
|
634
|
+
break
|
|
635
|
+
else:
|
|
636
|
+
tipo_cobranca.type_keys("{DOWN}")
|
|
637
|
+
await worker_sleep(0.5)
|
|
638
|
+
|
|
639
|
+
# Se não encontrou o valor desejado, tenta o alternativo
|
|
640
|
+
if not encontrado:
|
|
641
|
+
console.print(f"[yellow]'{texto_alvo}' não encontrado. Tentando '{alternativo}'...[/yellow]")
|
|
642
|
+
|
|
643
|
+
# Reposiciona no início digitando parte do alternativo
|
|
644
|
+
tipo_cobranca.type_keys(alternativo[:4], with_spaces=True)
|
|
645
|
+
await worker_sleep(1)
|
|
646
|
+
|
|
647
|
+
for _ in range(50):
|
|
648
|
+
texto_atual = tipo_cobranca.window_text().strip()
|
|
649
|
+
if alternativo.lower() in texto_atual.lower():
|
|
650
|
+
tipo_cobranca.type_keys("{ENTER}")
|
|
651
|
+
encontrado = True
|
|
652
|
+
break
|
|
653
|
+
else:
|
|
654
|
+
tipo_cobranca.type_keys("{DOWN}")
|
|
655
|
+
await worker_sleep(0.5)
|
|
656
|
+
|
|
657
|
+
# Verifica se selecionou algo corretamente
|
|
658
|
+
texto_final = tipo_cobranca.window_text().strip()
|
|
659
|
+
|
|
660
|
+
if not encontrado or all(x.lower() not in texto_final.lower() for x in [texto_alvo, alternativo]):
|
|
661
|
+
console.print(f"[red]Erro: valor da conta de recebimento não foi selecionado corretamente. Último texto: '{texto_final}'[/red]")
|
|
662
|
+
return RpaRetornoProcessoDTO(
|
|
663
|
+
sucesso=False,
|
|
664
|
+
retorno="Conta de recebimento incorreta ou não encontrada.",
|
|
665
|
+
status=RpaHistoricoStatusEnum.Falha,
|
|
666
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
|
667
|
+
)
|
|
696
668
|
|
|
697
669
|
await worker_sleep(3)
|
|
698
670
|
console.print(f"Incluindo registro...\n")
|
|
699
671
|
try:
|
|
700
|
-
|
|
701
|
-
ASSETS_PATH = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\IncluirRegistro.png"
|
|
672
|
+
ASSETS_PATH = "assets"
|
|
702
673
|
inserir_registro = pyautogui.locateOnScreen(
|
|
703
|
-
ASSETS_PATH, confidence=0.8
|
|
674
|
+
ASSETS_PATH + "\\entrada_notas\\IncluirRegistro.png", confidence=0.8
|
|
704
675
|
)
|
|
705
|
-
# inserir_registro = pyautogui.locateOnScreen(
|
|
706
|
-
# ASSETS_PATH + "\\entrada_notas\\IncluirRegistro.png", confidence=0.8
|
|
707
|
-
# )
|
|
708
676
|
pyautogui.click(inserir_registro)
|
|
709
677
|
except Exception as e:
|
|
710
678
|
console.print(
|
|
@@ -894,25 +862,3 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
894
862
|
finally:
|
|
895
863
|
# Deleta o xml
|
|
896
864
|
await delete_xml(nota.get("nfe"))
|
|
897
|
-
|
|
898
|
-
if __name__ == "__main__":
|
|
899
|
-
|
|
900
|
-
task = RpaProcessoEntradaDTO(
|
|
901
|
-
datEntradaFila= datetime.now(),
|
|
902
|
-
configEntrada= {"nfe":"43250703746938001387550040005122881902295895","cfop":"5102","itens":[{"qtd":"2.00","ocst":"000","ncmsh":"39232990","valorIpi":"0.00","valorIcms":"3.63","valorTotal":"21.34","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"21.34","codigoProduto":"030338","unidadeMedida":"UN","valorUnitario":"10.67","descricaoProduto":"Saco Plastico para Moedas Transparente 0,10m PCT 100UN"},{"qtd":"1.00","ocst":"000","ncmsh":"48211000","valorIpi":"0.00","valorIcms":"5.39","valorTotal":"31.72","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"31.72","codigoProduto":"044867","unidadeMedida":"ROL","valorUnitario":"31.72","descricaoProduto":"Etiqueta Adesiva 100X50mm Amarelo 101C RL 200UN"},{"qtd":"1.00","ocst":"000","ncmsh":"49111090","valorIpi":"0.00","valorIcms":"14.43","valorTotal":"84.90","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"84.90","codigoProduto":"041749","unidadeMedida":"PAC","valorUnitario":"84.90","descricaoProduto":"Bloco de Abastecimento 1 via 8 x 6,5cm PCT 50BL de 100fls"},{"qtd":"12.00","ocst":"000","ncmsh":"96081000","valorIpi":"0.00","valorIcms":"1.24","valorTotal":"7.32","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"7.32","codigoProduto":"029618","unidadeMedida":"UN","valorUnitario":"0.61","descricaoProduto":"Caneta Esferografica Compactor Economic 1.0mm Azul"},{"qtd":"20.00","ocst":"000","ncmsh":"96081000","valorIpi":"0.00","valorIcms":"2.07","valorTotal":"12.20","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"12.20","codigoProduto":"029618","unidadeMedida":"UN","valorUnitario":"0.61","descricaoProduto":"Caneta Esferografica Compactor Economic 1.0mm Azul"},{"qtd":"1.00","ocst":"100","ncmsh":"39191010","valorIpi":"0.83","valorIcms":"1.08","valorTotal":"5.50","aliquotaIpi":"15.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"6.33","codigoProduto":"050894","unidadeMedida":"UN","valorUnitario":"5.50","descricaoProduto":"Fita Adesiva Hot Melt Sooper PRO 45mmX45m Transparente"},{"qtd":"2.00","ocst":"000","ncmsh":"48119019","valorIpi":"6.78","valorIcms":"36.63","valorTotal":"208.66","aliquotaIpi":"3.25","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"215.44","codigoProduto":"041690","unidadeMedida":"UN","valorUnitario":"104.33","descricaoProduto":"Bobina Termica Rede Sim 80mmx80m 44g CX 16UN"},{"qtd":"1.00","ocst":"020","ncmsh":"17019900","valorIpi":"0.00","valorIcms":"1.57","valorTotal":"22.41","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"9.23","codigoProduto":"050962","unidadeMedida":"UN","valorUnitario":"22.41","descricaoProduto":"Acucar Refinado Alto Alegre Sache CX 400x5g"},{"qtd":"2.00","ocst":"000","ncmsh":"48232099","valorIpi":"0.00","valorIcms":"1.42","valorTotal":"8.38","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"8.38","codigoProduto":"009014","unidadeMedida":"UN","valorUnitario":"4.19","descricaoProduto":"Filtro de Papel Melitta No103 30UN"},{"qtd":"1.00","ocst":"200","ncmsh":"40151900","valorIpi":"0.00","valorIcms":"7.72","valorTotal":"45.41","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"45.41","codigoProduto":"020964","unidadeMedida":"CX","valorUnitario":"45.41","descricaoProduto":"Luva Latex Volk Cleanline Descartavel com Po G CX 100UN"},{"qtd":"2.00","ocst":"000","ncmsh":"68053090","valorIpi":"0.00","valorIcms":"0.33","valorTotal":"1.96","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"1.96","codigoProduto":"050637","unidadeMedida":"UN","valorUnitario":"0.98","descricaoProduto":"Esponja Esfrelux Lava Loucas Anti Bacteria"},{"qtd":"2.00","ocst":"200","ncmsh":"62160000","valorIpi":"0.00","valorIcms":"1.53","valorTotal":"9.00","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"9.00","codigoProduto":"025306","unidadeMedida":"PAR","valorUnitario":"4.50","descricaoProduto":"Luva Poliamida Volk Tatil PU Palma e Dedos Preta M"},{"qtd":"1.00","ocst":"000","ncmsh":"21039011","valorIpi":"0.00","valorIcms":"4.55","valorTotal":"26.78","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"26.78","codigoProduto":"100011581","unidadeMedida":"CX","valorUnitario":"26.78","descricaoProduto":"Maionese Sache Junior 7g CX 160UN"},{"qtd":"1.00","ocst":"100","ncmsh":"39235000","valorIpi":"3.45","valorIcms":"12.33","valorTotal":"69.05","aliquotaIpi":"5.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"72.50","codigoProduto":"053593","unidadeMedida":"CX","valorUnitario":"69.05","descricaoProduto":"Tampa Versaline PP Preta Copo de Papel PD 210ml CX 500UN"},{"qtd":"1.00","ocst":"000","ncmsh":"48211000","valorIpi":"0.00","valorIcms":"2.63","valorTotal":"15.46","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"15.46","codigoProduto":"053356","unidadeMedida":"ROL","valorUnitario":"15.46","descricaoProduto":"Etiqueta Validade Rede Sim 40x24mm RL 1000UN"},{"qtd":"12.00","ocst":"000","ncmsh":"39241000","valorIpi":"0.00","valorIcms":"9.28","valorTotal":"54.60","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"54.60","codigoProduto":"011523","unidadeMedida":"UN","valorUnitario":"4.55","descricaoProduto":"Copo Descartavel PS Branco 180ml PCT 100UN"},{"qtd":"1.00","ocst":"000","ncmsh":"21032010","valorIpi":"0.00","valorIcms":"4.53","valorTotal":"26.62","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"26.62","codigoProduto":"053435","unidadeMedida":"UN","valorUnitario":"26.62","descricaoProduto":"Ketchup Sache Junior 7g CX 168UN"},{"qtd":"1.00","ocst":"000","ncmsh":"39173229","valorIpi":"0.00","valorIcms":"0.83","valorTotal":"4.91","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"4.91","codigoProduto":"041209","unidadeMedida":"UN","valorUnitario":"4.91","descricaoProduto":"Canudo Oxi Biodegrad Strawplast Embalado Indiv 100UN"},{"qtd":"3.00","ocst":"000","ncmsh":"38089919","valorIpi":"0.00","valorIcms":"3.48","valorTotal":"20.49","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"20.49","codigoProduto":"054500","unidadeMedida":"UN","valorUnitario":"6.83","descricaoProduto":"Alcool Liquido 70o Super Vale 1L"},{"qtd":"2.00","ocst":"000","ncmsh":"48182000","valorIpi":"0.00","valorIcms":"13.49","valorTotal":"79.38","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"79.38","codigoProduto":"100010494","unidadeMedida":"CX","valorUnitario":"39.69","descricaoProduto":"Papel Higienico Rolo 300m Softpaper Eco FS 17g CX 8UN"},{"qtd":"2.00","ocst":"000","ncmsh":"39232190","valorIpi":"0.00","valorIcms":"2.15","valorTotal":"12.64","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"12.64","codigoProduto":"038796","unidadeMedida":"UN","valorUnitario":"6.32","descricaoProduto":"Saco para Lixo Basic Up Bag Azul 30L 50UN"},{"qtd":"2.00","ocst":"500","ncmsh":"48182000","valorIpi":"0.00","valorIcms":"29.07","valorTotal":"171.00","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"171.00","codigoProduto":"020684","unidadeMedida":"CX","valorUnitario":"85.50","descricaoProduto":"Papel Toalha Bobina 200m Softpaper Basic FS 24g CX 6UN"},{"qtd":"2.00","ocst":"020","ncmsh":"09012100","valorIpi":"0.00","valorIcms":"5.03","valorTotal":"71.78","aliquotaIpi":"0.00","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"29.56","codigoProduto":"047037","unidadeMedida":"UN","valorUnitario":"35.89","descricaoProduto":"Cafe em Po 1707 Tradicional Vacuo 500g"},{"qtd":"2.00","ocst":"100","ncmsh":"48236900","valorIpi":"37.59","valorIcms":"71.93","valorTotal":"385.54","aliquotaIpi":"9.75","cfopProduto":"5102","aliquotaIcms":"17.00","bCalculoIcms":"423.13","codigoProduto":"053592","unidadeMedida":"CX","valorUnitario":"192.77","descricaoProduto":"Copo Papel SIM PD 210ml FSCMisto70% CU-COC-855709 CX500UN"}],"natureza":"33","alocacoes":[],"valorNota":"1445.70","nomeFilial":"PF Praça Itália\t","numeroNota":"512288","dataEmissao":"14/07/2025","observacoes":"Vcto: 06/10/2025","existeDespesa":"Não","cnpjFornecedor":"03746938001387","dataVencimento":"06/10/2025","nomeFornecedor":"BRS SUPRIMENTOS CORPORATIVOS S/A","recebimentoFisico":"17/07/2025 14:52","filialEmpresaOrigem":"109"},
|
|
903
|
-
uuidProcesso='def194c2-ffa0-4b9e-b95c-920fb4ad4150',
|
|
904
|
-
nomProcesso='extracao_fechamento_emsys',
|
|
905
|
-
uuidFila="",
|
|
906
|
-
sistemas=[
|
|
907
|
-
{
|
|
908
|
-
"sistema": "EMSys",
|
|
909
|
-
"timeout": "1.0"
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
"sistema": "AutoSystem",
|
|
913
|
-
"timeout": "1.0"
|
|
914
|
-
}
|
|
915
|
-
],
|
|
916
|
-
historico_id='2c4429c8-26ae-4ec6-b775-21583992e82f'
|
|
917
|
-
)
|
|
918
|
-
asyncio.run(entrada_de_notas_33(task))
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/ahead_service.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/api/rdp_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/config/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/config/settings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/repeat.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/retry.py
RENAMED
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/decorators/timeit.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/models/__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
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/tasks/__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
|
|
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.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/env.py
RENAMED
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/logger.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/toast.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/updater.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.673 → worker_automate_hub-0.5.674}/worker_automate_hub/utils/util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|