worker-automate-hub 0.5.668__py3-none-any.whl → 0.5.670__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.
Potentially problematic release.
This version of worker-automate-hub might be problematic. Click here for more details.
- worker_automate_hub/tasks/jobs/cte_xml.py +7 -3
- worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +85 -4
- {worker_automate_hub-0.5.668.dist-info → worker_automate_hub-0.5.670.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.668.dist-info → worker_automate_hub-0.5.670.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.5.668.dist-info → worker_automate_hub-0.5.670.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.668.dist-info → worker_automate_hub-0.5.670.dist-info}/entry_points.txt +0 -0
|
@@ -51,7 +51,7 @@ async def click_importar_xml():
|
|
|
51
51
|
raise Exception(f"Erro ao conectar a janela: {e}")
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
async def importar_xml_conhecimento():
|
|
54
|
+
async def importar_xml_conhecimento(cfop: str):
|
|
55
55
|
|
|
56
56
|
try:
|
|
57
57
|
await worker_sleep(5)
|
|
@@ -64,7 +64,11 @@ async def importar_xml_conhecimento():
|
|
|
64
64
|
aquisicao_servico = main_window.child_window(
|
|
65
65
|
class_name="TDBIComboBox", found_index=1
|
|
66
66
|
)
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
if str(cfop).startswith("5"):
|
|
69
|
+
aquisicao_servico.select("1353 - AQUISICAO DE SERVICO DE TRANSPORTE D/E")
|
|
70
|
+
else:
|
|
71
|
+
aquisicao_servico.select("2353 - AQUISICAO DE SERVICO DE TRANSPORTE F/E")
|
|
68
72
|
|
|
69
73
|
await worker_sleep(2)
|
|
70
74
|
|
|
@@ -429,7 +433,7 @@ async def importar_cte_xml(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO
|
|
|
429
433
|
await save_xml_to_downloads(cte["chaveCte"])
|
|
430
434
|
await worker_sleep(5)
|
|
431
435
|
await click_importar_xml()
|
|
432
|
-
await importar_xml_conhecimento()
|
|
436
|
+
await importar_xml_conhecimento(cte["cfop"])
|
|
433
437
|
await selecionar_xml(cte)
|
|
434
438
|
await janela_conhecimento_frete(cte)
|
|
435
439
|
await worker_sleep(8)
|
|
@@ -5,11 +5,13 @@ import re
|
|
|
5
5
|
import warnings
|
|
6
6
|
import time
|
|
7
7
|
import uuid
|
|
8
|
-
|
|
8
|
+
import asyncio
|
|
9
9
|
import pyautogui
|
|
10
|
+
from datetime import datetime
|
|
10
11
|
import pytesseract
|
|
11
12
|
import win32clipboard
|
|
12
13
|
from PIL import Image, ImageEnhance
|
|
14
|
+
from pyscreeze import ImageNotFoundException
|
|
13
15
|
from pywinauto.application import Application
|
|
14
16
|
from pywinauto.keyboard import send_keys
|
|
15
17
|
from pywinauto.timings import wait_until
|
|
@@ -139,7 +141,7 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
139
141
|
await worker_sleep(5)
|
|
140
142
|
|
|
141
143
|
await get_xml(nota.get("nfe"))
|
|
142
|
-
await worker_sleep(
|
|
144
|
+
await worker_sleep(5)
|
|
143
145
|
|
|
144
146
|
# VERIFICANDO A EXISTENCIA DE WARNINGS
|
|
145
147
|
warning_pop_up = await is_window_open("Warning")
|
|
@@ -303,7 +305,7 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
303
305
|
"A opção 'Manter Natureza de Operação selecionada' selecionado com sucesso... \n"
|
|
304
306
|
)
|
|
305
307
|
|
|
306
|
-
await worker_sleep(
|
|
308
|
+
await worker_sleep(3)
|
|
307
309
|
console.print("Clicando em OK... \n")
|
|
308
310
|
|
|
309
311
|
max_attempts = 3
|
|
@@ -320,8 +322,87 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
320
322
|
except:
|
|
321
323
|
console.print("Não foi possivel clicar no Botão OK... \n")
|
|
322
324
|
|
|
323
|
-
await worker_sleep(
|
|
325
|
+
await worker_sleep(5)
|
|
326
|
+
|
|
327
|
+
# Aguarda a tela de aguarde
|
|
328
|
+
imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
329
|
+
timeout = 300 # 5 minutos
|
|
330
|
+
start_time = time.time()
|
|
331
|
+
|
|
332
|
+
try:
|
|
333
|
+
console.print("Aguardando a imagem desaparecer da tela (até 5 minutos)...")
|
|
334
|
+
|
|
335
|
+
while True:
|
|
336
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
337
|
+
|
|
338
|
+
if not localizacao:
|
|
339
|
+
console.print("Imagem não está mais na tela.")
|
|
340
|
+
break
|
|
341
|
+
|
|
342
|
+
if time.time() - start_time > timeout:
|
|
343
|
+
console.print("Tempo limite atingido. A imagem ainda está na tela.")
|
|
344
|
+
break
|
|
345
|
+
|
|
346
|
+
time.sleep(5) # Espera 5 segundos antes de verificar novamente
|
|
347
|
+
|
|
348
|
+
except:
|
|
349
|
+
pass
|
|
350
|
+
|
|
351
|
+
await worker_sleep(7)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
try:
|
|
355
|
+
app = Application().connect(class_name="TMessageForm", timeout=10)
|
|
356
|
+
main_window = app["TMessageForm"]
|
|
357
|
+
main_window.set_focus()
|
|
358
|
+
click_yes = main_window.child_window(class_name='TButton', found_index=1).click()
|
|
359
|
+
except:
|
|
360
|
+
pass
|
|
361
|
+
|
|
362
|
+
try:
|
|
363
|
+
# Verifica erro ncm nao encontrado
|
|
364
|
+
imagem_alvo = "assets\\entrada_notas\\nao_encontrado_ncm.png"
|
|
365
|
+
|
|
366
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
367
|
+
|
|
368
|
+
if localizacao:
|
|
369
|
+
console.print("Não encontrado o NCM cadastrado no sistema")
|
|
370
|
+
return RpaRetornoProcessoDTO(
|
|
371
|
+
sucesso=False,
|
|
372
|
+
retorno="Não encontrado o NCM cadastrado no sistema",
|
|
373
|
+
status=RpaHistoricoStatusEnum.Falha,
|
|
374
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
except ImageNotFoundException:
|
|
378
|
+
console.print(
|
|
379
|
+
"Imagem não encontrada continuando"
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
# Aguarda a tela de aguarde
|
|
383
|
+
imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
384
|
+
timeout = 300 # 5 minutos
|
|
385
|
+
start_time = time.time()
|
|
324
386
|
|
|
387
|
+
try:
|
|
388
|
+
console.print("Aguardando a imagem desaparecer da tela (até 5 minutos)...")
|
|
389
|
+
|
|
390
|
+
while True:
|
|
391
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
392
|
+
|
|
393
|
+
if not localizacao:
|
|
394
|
+
console.print("Imagem não está mais na tela.")
|
|
395
|
+
break
|
|
396
|
+
|
|
397
|
+
if time.time() - start_time > timeout:
|
|
398
|
+
console.print("Tempo limite atingido. A imagem ainda está na tela.")
|
|
399
|
+
break
|
|
400
|
+
|
|
401
|
+
time.sleep(2) # Espera 2 segundos antes de verificar novamente
|
|
402
|
+
|
|
403
|
+
except Exception as e:
|
|
404
|
+
console.print(f"Ocorreu um erro: {e}")
|
|
405
|
+
|
|
325
406
|
console.print(
|
|
326
407
|
"Verificando a existencia da tela Informações para importação da Nota Fiscal Eletrônica...\n"
|
|
327
408
|
)
|
|
@@ -40,7 +40,7 @@ worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py,sha256=mX5GeaqwTa-bu61
|
|
|
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
|
|
43
|
-
worker_automate_hub/tasks/jobs/cte_xml.py,sha256=
|
|
43
|
+
worker_automate_hub/tasks/jobs/cte_xml.py,sha256=m4BkJDgp95Vr3oqEh6wXeeb31qzZhRF2Sw0h_wsoL_k,15565
|
|
44
44
|
worker_automate_hub/tasks/jobs/descartes.py,sha256=E5kKef8j7e0PTm6NBeZAXkljUoAFEMjVWvHaJ8g2fv4,44451
|
|
45
45
|
worker_automate_hub/tasks/jobs/devolucao_ctf.py,sha256=zQcRXZ9TxJhyL4jHjBTS-iW5BcmRoSPv9FsBLy0-eWQ,250793
|
|
46
46
|
worker_automate_hub/tasks/jobs/devolucao_ctf_35.py,sha256=e9t5k2mtZcUcEGKPWysbWzsH_gqrK-6aBXjWe2jWfTg,253948
|
|
@@ -57,7 +57,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256=BYmdPLJFZEHD_lVSpua
|
|
|
57
57
|
worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=xVz5bhbAYt1IeXbkYYXG6JvFWZ8Z0-mHOi218evI1So,36829
|
|
58
58
|
worker_automate_hub/tasks/jobs/entrada_de_notas_207.py,sha256=A5HM2Eh2bGZueVefnQL9KiCWW95j8zX1v2MslgbDcUE,36871
|
|
59
59
|
worker_automate_hub/tasks/jobs/entrada_de_notas_32.py,sha256=lku233FqwOknXF14HHC6fZ75WubE69Jp32bAUhKPtGQ,34575
|
|
60
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=
|
|
60
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=54jl4ys2Tv4tJcf6WW3T2-kHkZoKL06oIZPPbpOXda0,36798
|
|
61
61
|
worker_automate_hub/tasks/jobs/entrada_de_notas_34.py,sha256=AXUL8DakrDeTxWW8dn36W830XfIuO47MFUusbUkrnUc,33586
|
|
62
62
|
worker_automate_hub/tasks/jobs/entrada_de_notas_36.py,sha256=z494n0SUyxorjhvpbat2ELnj7lbhtWPb9JOIsattwA8,35216
|
|
63
63
|
worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=whsK_TfNZSmzt0PNHnVi0q4OIxzfKiR5nGuB9WfEYeI,47071
|
|
@@ -98,7 +98,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
|
98
98
|
worker_automate_hub/utils/util.py,sha256=kXGtm91s6XJBtD7m_KyCrOxQ7mCeIBqEOnhbfYs3Vf8,206355
|
|
99
99
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=L_z1Aps6BFWl-6_Ibm45vDid1S4kFDz5O78N2uO1Rq0,36458
|
|
100
100
|
worker_automate_hub/worker.py,sha256=axdrr1xLTjWEyWfcyH3OCSpPTsyzck_fL_0u1DBLjvw,6525
|
|
101
|
-
worker_automate_hub-0.5.
|
|
102
|
-
worker_automate_hub-0.5.
|
|
103
|
-
worker_automate_hub-0.5.
|
|
104
|
-
worker_automate_hub-0.5.
|
|
101
|
+
worker_automate_hub-0.5.670.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
|
102
|
+
worker_automate_hub-0.5.670.dist-info/METADATA,sha256=mhyEvcufdGea7wpfG08QWDXkcat8mKzeYWUG5jIhrtI,3049
|
|
103
|
+
worker_automate_hub-0.5.670.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
104
|
+
worker_automate_hub-0.5.670.dist-info/RECORD,,
|
|
File without changes
|
{worker_automate_hub-0.5.668.dist-info → worker_automate_hub-0.5.670.dist-info}/entry_points.txt
RENAMED
|
File without changes
|