worker-automate-hub 0.5.670__tar.gz → 0.5.672__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.670 → worker_automate_hub-0.5.672}/PKG-INFO +1 -1
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/pyproject.toml +1 -1
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py +151 -226
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +35 -5
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/util.py +29 -31
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/README.md +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/datalake_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/rdp_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/rpa_fila_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/webhook_service.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/rpa_fila.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dao/rpa_robo.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/rpa_sap_dto.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/cte_manual.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/cte_xml.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/devolucao_ctf.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/devolucao_ctf_35.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_cte_1353.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_cte_333.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_503.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos_novo.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/integracao_contabil.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/integracao_contabil_generica.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/lancamento_rateio.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/login_emsys_versao_especifica.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/notas_faturamento_sap.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/worker.py +0 -0
|
@@ -14,9 +14,14 @@ from pypdf import PdfReader
|
|
|
14
14
|
from PIL import Image, ImageEnhance
|
|
15
15
|
from pywinauto.keyboard import send_keys
|
|
16
16
|
from pywinauto.mouse import double_click
|
|
17
|
+
from pyautogui import ImageNotFoundException
|
|
17
18
|
import win32clipboard
|
|
18
19
|
from pywinauto_recorder.player import set_combobox
|
|
19
20
|
from rich.console import Console
|
|
21
|
+
import sys
|
|
22
|
+
|
|
23
|
+
# Adiciona a raiz do projeto no sys.path
|
|
24
|
+
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")))
|
|
20
25
|
from worker_automate_hub.api.ahead_service import save_xml_to_downloads
|
|
21
26
|
from worker_automate_hub.api.client import (
|
|
22
27
|
get_config_by_name,
|
|
@@ -308,17 +313,28 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
308
313
|
|
|
309
314
|
# Procura campo documento
|
|
310
315
|
console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
app = Application().connect(class_name="TFrmNotaFiscalEntrada", timeout=10)
|
|
317
|
+
main_window = app["TFrmNotaFiscalEntrada"]
|
|
318
|
+
main_window.set_focus()
|
|
319
|
+
modelo_select = main_window.child_window(class_name="TDBIComboBox", found_index=1)
|
|
320
|
+
modelo_select.click()
|
|
321
|
+
await worker_sleep(3)
|
|
322
|
+
try:
|
|
323
|
+
# Verifica mensagem danfe 077
|
|
324
|
+
imagem_alvo = "assets\\entrada_notas\\danfe077.png"
|
|
325
|
+
# imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\danfe077.png"
|
|
326
|
+
|
|
327
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
328
|
+
|
|
329
|
+
if localizacao:
|
|
330
|
+
centro = pyautogui.center(localizacao)
|
|
331
|
+
pyautogui.click(centro)
|
|
332
|
+
|
|
333
|
+
except ImageNotFoundException:
|
|
334
|
+
console.print(
|
|
335
|
+
"Imagem não encontrada (exceção capturada). Tentando clicar no OK."
|
|
321
336
|
)
|
|
337
|
+
|
|
322
338
|
|
|
323
339
|
await worker_sleep(4)
|
|
324
340
|
|
|
@@ -360,62 +376,79 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
360
376
|
else:
|
|
361
377
|
field_fornecedor.set_edit_text(cod_empresa)
|
|
362
378
|
field_fornecedor.click()
|
|
363
|
-
pyautogui.press("
|
|
379
|
+
pyautogui.press("enter")
|
|
364
380
|
await worker_sleep(2)
|
|
365
381
|
|
|
366
382
|
|
|
367
383
|
itens = nota.get('itens', [])
|
|
368
384
|
itens_arla = [item for item in itens if item['descricao'].lower() == 'arla']
|
|
369
385
|
|
|
370
|
-
|
|
371
|
-
#SELECIONAO A NOP
|
|
386
|
+
# SELECIONA A NOP
|
|
372
387
|
console.print("SELECIONANDO A NOP...\n")
|
|
373
388
|
select_box_nop_select = main_window.child_window(class_name="TDBIComboBox", found_index=0)
|
|
374
389
|
select_box_nop_select.click()
|
|
375
390
|
|
|
391
|
+
await worker_sleep(3)
|
|
392
|
+
|
|
376
393
|
itens_to_select = select_box_nop_select.texts()
|
|
377
394
|
nop_to_be_select = ''
|
|
378
395
|
|
|
396
|
+
def normaliza(texto):
|
|
397
|
+
return texto.lower().replace(" ", "").strip()
|
|
398
|
+
|
|
399
|
+
# Função para buscar a NOP com sufixo prioritariamente
|
|
400
|
+
def buscar_nop(itens, codigo, sufixo_normalizado=None):
|
|
401
|
+
for item in itens:
|
|
402
|
+
if codigo in item:
|
|
403
|
+
item_normalizado = normaliza(item)
|
|
404
|
+
if sufixo_normalizado and sufixo_normalizado in item_normalizado:
|
|
405
|
+
return item # prioriza item com sufixo
|
|
406
|
+
for item in itens:
|
|
407
|
+
if codigo in item:
|
|
408
|
+
return item # fallback para item com mesmo código
|
|
409
|
+
return ''
|
|
410
|
+
|
|
411
|
+
# Lógica de seleção da NOP
|
|
379
412
|
if len(itens_arla) == len(itens):
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
for item in itens_to_select:
|
|
389
|
-
if uf_posto:
|
|
390
|
-
if uf_posto != uf_cliente:
|
|
391
|
-
if '2662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
|
|
392
|
-
nop_to_be_select = item
|
|
393
|
-
break
|
|
394
|
-
else:
|
|
395
|
-
if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
|
|
396
|
-
nop_to_be_select = item
|
|
397
|
-
break
|
|
398
|
-
else:
|
|
399
|
-
if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
|
|
400
|
-
nop_to_be_select = item
|
|
401
|
-
break
|
|
402
|
-
|
|
413
|
+
nop_to_be_select = buscar_nop(itens_to_select, '1202', 's/estc/fin')
|
|
414
|
+
if not nop_to_be_select:
|
|
415
|
+
nop_to_be_select = buscar_nop(itens_to_select, '2202', 's/estc/fin')
|
|
416
|
+
else:
|
|
417
|
+
if uf_posto and uf_posto != uf_cliente:
|
|
418
|
+
nop_to_be_select = buscar_nop(itens_to_select, '2662', 'devcombc/fi')
|
|
419
|
+
else:
|
|
420
|
+
nop_to_be_select = buscar_nop(itens_to_select, '1662', 'devcombc/fi')
|
|
403
421
|
|
|
422
|
+
# Se encontrou, faz a seleção precisa no combobox
|
|
404
423
|
if nop_to_be_select != '':
|
|
405
424
|
console.print(f"Nop a ser considerada: {nop_to_be_select}...\n")
|
|
406
425
|
await worker_sleep(1)
|
|
407
426
|
try:
|
|
408
|
-
|
|
409
|
-
except:
|
|
427
|
+
# Clica para ativar o combobox
|
|
410
428
|
select_box_nop_select.click()
|
|
411
429
|
await worker_sleep(1)
|
|
412
|
-
|
|
430
|
+
|
|
431
|
+
# Digita apenas o código inicial (ex: "1662") para posicionar
|
|
432
|
+
codigo_nop = nop_to_be_select.split('-')[0].strip()
|
|
433
|
+
select_box_nop_select.type_keys(codigo_nop)
|
|
413
434
|
await worker_sleep(1)
|
|
414
|
-
select_box_nop_select.select(nop_to_be_select)
|
|
415
|
-
#set_combobox("||List", nop_to_be_select)
|
|
416
435
|
|
|
436
|
+
# Navega pela lista até encontrar o texto exato
|
|
437
|
+
for _ in range(10): # tenta até 10 movimentos para baixo
|
|
438
|
+
current_text = select_box_nop_select.window_text()
|
|
439
|
+
if nop_to_be_select.strip().lower() in current_text.strip().lower():
|
|
440
|
+
select_box_nop_select.type_keys('{ENTER}')
|
|
441
|
+
break
|
|
442
|
+
else:
|
|
443
|
+
select_box_nop_select.type_keys('{DOWN}')
|
|
444
|
+
await worker_sleep(0.5)
|
|
445
|
+
|
|
446
|
+
await worker_sleep(1)
|
|
447
|
+
select_box_nop_select.type_keys('{TAB}')
|
|
448
|
+
except Exception as e:
|
|
449
|
+
console.print(f"[red]Erro ao selecionar a NOP: {e}[/red]")
|
|
417
450
|
else:
|
|
418
|
-
retorno = f"Não foi
|
|
451
|
+
retorno = f"Não foi possível encontrar a NOP\nEtapas Executadas:\n{steps}"
|
|
419
452
|
return RpaRetornoProcessoDTO(
|
|
420
453
|
sucesso=False,
|
|
421
454
|
retorno=retorno,
|
|
@@ -423,6 +456,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
423
456
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
424
457
|
)
|
|
425
458
|
|
|
459
|
+
|
|
426
460
|
await worker_sleep(7)
|
|
427
461
|
try:
|
|
428
462
|
pesquisar_icon = pyautogui.locateOnScreen(ASSETS_PATH + "\\emsys\\selecionar_venda.png", confidence=0.8)
|
|
@@ -797,8 +831,23 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
797
831
|
|
|
798
832
|
console.print(f"Selecionando a Especie de Caixa... \n")
|
|
799
833
|
tipo_cobranca.click()
|
|
800
|
-
|
|
801
|
-
|
|
834
|
+
|
|
835
|
+
await worker_sleep(2)
|
|
836
|
+
|
|
837
|
+
try:
|
|
838
|
+
# Verifica mensagem sem lote pra integrar
|
|
839
|
+
imagem_alvo = "assets\\entrada_notas\\devolucao_venda.png"
|
|
840
|
+
# imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\devolucao_venda.png"
|
|
841
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
842
|
+
|
|
843
|
+
if localizacao:
|
|
844
|
+
centro = pyautogui.center(localizacao)
|
|
845
|
+
pyautogui.click(centro)
|
|
846
|
+
|
|
847
|
+
except ImageNotFoundException:
|
|
848
|
+
console.print(
|
|
849
|
+
"Imagem não encontrada (exceção capturada). Tentando clicar no OK."
|
|
850
|
+
)
|
|
802
851
|
|
|
803
852
|
await worker_sleep(2)
|
|
804
853
|
|
|
@@ -991,10 +1040,10 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
991
1040
|
#STEP 3
|
|
992
1041
|
type_text_into_field("Gerenciador de Notas Fiscais", app["TFrmMenuPrincipal"]["Edit"], True, "50")
|
|
993
1042
|
pyautogui.press("enter")
|
|
994
|
-
await worker_sleep(
|
|
1043
|
+
await worker_sleep(5)
|
|
995
1044
|
pyautogui.press("enter")
|
|
996
1045
|
await worker_sleep(5)
|
|
997
|
-
console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso",style="bold green")
|
|
1046
|
+
console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso 1ª Etapa",style="bold green")
|
|
998
1047
|
pesquisar_venda_devolucao = await is_window_open_by_class("TFrmGerenciadorNFe2", "TFrmGerenciadorNFe2")
|
|
999
1048
|
if pesquisar_venda_devolucao["IsOpened"] == True:
|
|
1000
1049
|
console.print(f"\n'Gerenciador de Notas Fiscais'aberta com sucesso",style="bold green")
|
|
@@ -1169,10 +1218,10 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
1169
1218
|
|
|
1170
1219
|
type_text_into_field("Gerenciador de Notas Fiscais", app["TFrmMenuPrincipal"]["Edit"], True, "50")
|
|
1171
1220
|
pyautogui.press("enter")
|
|
1172
|
-
await worker_sleep(
|
|
1221
|
+
await worker_sleep(5)
|
|
1173
1222
|
pyautogui.press("enter")
|
|
1174
1223
|
await worker_sleep(5)
|
|
1175
|
-
console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso",style="bold green")
|
|
1224
|
+
console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso 2ª Etapa",style="bold green")
|
|
1176
1225
|
pesquisar_venda_devolucao = await is_window_open_by_class("TFrmGerenciadorNFe2", "TFrmGerenciadorNFe2")
|
|
1177
1226
|
if pesquisar_venda_devolucao["IsOpened"] == True:
|
|
1178
1227
|
console.print(f"\n'Gerenciador de Notas Fiscais'aberta com sucesso",style="bold green")
|
|
@@ -1853,7 +1902,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
1853
1902
|
)
|
|
1854
1903
|
|
|
1855
1904
|
|
|
1856
|
-
await worker_sleep(
|
|
1905
|
+
await worker_sleep(5)
|
|
1857
1906
|
console.print("Natureza da operação selecionado com sucesso, preenchendo os itens...\n")
|
|
1858
1907
|
|
|
1859
1908
|
#INSERINDO A QUANTIDADE
|
|
@@ -1864,24 +1913,24 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
1864
1913
|
field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=8)
|
|
1865
1914
|
console.print("Inserindo a quantidade de Itens...\n")
|
|
1866
1915
|
field_quantidade.click()
|
|
1867
|
-
await worker_sleep(
|
|
1916
|
+
await worker_sleep(2)
|
|
1868
1917
|
pyautogui.press('del')
|
|
1869
|
-
await worker_sleep(
|
|
1918
|
+
await worker_sleep(2)
|
|
1870
1919
|
pyautogui.press('backspace')
|
|
1871
|
-
await worker_sleep(
|
|
1920
|
+
await worker_sleep(2)
|
|
1872
1921
|
pyautogui.write(quantidade)
|
|
1873
1922
|
#field_quantidade.set_edit_text(quantidade)
|
|
1874
|
-
await worker_sleep(
|
|
1923
|
+
await worker_sleep(2)
|
|
1875
1924
|
pyautogui.press('tab')
|
|
1876
1925
|
await worker_sleep(2)
|
|
1877
1926
|
|
|
1878
1927
|
#INSERINDO O VALOR INDIVIDUAL DO ITEM
|
|
1879
|
-
console.print("Inserindo o valor indivual do Item
|
|
1928
|
+
console.print("Inserindo o valor indivual do Item... 1ª Etapa\n")
|
|
1880
1929
|
btn_valor_unitario = panel_tabSheet.child_window(class_name="TDBIBitBtn", found_index=0)
|
|
1881
1930
|
btn_valor_unitario.click()
|
|
1882
1931
|
#Garantindo o click em valor individual "..."
|
|
1883
1932
|
pyautogui.click(973, 658)
|
|
1884
|
-
await worker_sleep(
|
|
1933
|
+
await worker_sleep(3)
|
|
1885
1934
|
|
|
1886
1935
|
app = Application().connect(class_name="TFrmInputBoxNumero", timeout=60)
|
|
1887
1936
|
main_window = app["TFrmInputBoxNumero"]
|
|
@@ -1899,7 +1948,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
1899
1948
|
|
|
1900
1949
|
main_window.set_focus()
|
|
1901
1950
|
send_keys("%o")
|
|
1902
|
-
await worker_sleep(
|
|
1951
|
+
await worker_sleep(3)
|
|
1903
1952
|
console.print("Valor inserido com sucesso...\n")
|
|
1904
1953
|
|
|
1905
1954
|
console.print("Fechando tela de incluir item pre venda...\n")
|
|
@@ -1907,7 +1956,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
1907
1956
|
main_window = app["TFrmIncluiItemPreVenda"]
|
|
1908
1957
|
main_window.set_focus()
|
|
1909
1958
|
send_keys("%i")
|
|
1910
|
-
await worker_sleep(
|
|
1959
|
+
await worker_sleep(3)
|
|
1911
1960
|
#Divergencia de nop na capa e no item
|
|
1912
1961
|
await find_nop_divergence()
|
|
1913
1962
|
await worker_sleep(5)
|
|
@@ -2050,7 +2099,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
2050
2099
|
|
|
2051
2100
|
#CONFIRMANDO NA TELA DE PRE VENDA
|
|
2052
2101
|
try:
|
|
2053
|
-
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
|
|
2102
|
+
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA 1ª Etapa... \n")
|
|
2054
2103
|
app = Application().connect(class_name="TFrmPreVenda", timeout=10)
|
|
2055
2104
|
main_window = app["Confirm"]
|
|
2056
2105
|
main_window.set_focus()
|
|
@@ -2382,6 +2431,16 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
2382
2431
|
|
|
2383
2432
|
|
|
2384
2433
|
console.print("Processo de ajustar aliquota realizado com sucesso, adicionando a mensagem... \n")
|
|
2434
|
+
try:
|
|
2435
|
+
information_pop_up = await is_window_open("Information")
|
|
2436
|
+
if information_pop_up["IsOpened"] == True:
|
|
2437
|
+
app = Application().connect(title="Information", timeout=10)
|
|
2438
|
+
main_window = app["Information"]
|
|
2439
|
+
main_window.set_focus()
|
|
2440
|
+
btn_ok = main_window.child_window(class_name="TButton", found_index=0)
|
|
2441
|
+
btn_ok.click()
|
|
2442
|
+
except:
|
|
2443
|
+
pass
|
|
2385
2444
|
try:
|
|
2386
2445
|
console.print("Conectando a janela de pre venda... \n")
|
|
2387
2446
|
app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=60)
|
|
@@ -2462,7 +2521,21 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
2462
2521
|
modelo_select = panel_Ttabsheet.child_window(class_name="TDBIComboBox", found_index=1)
|
|
2463
2522
|
modelo_select.click()
|
|
2464
2523
|
await worker_sleep(1)
|
|
2465
|
-
|
|
2524
|
+
try:
|
|
2525
|
+
# Verifica mensagem danfe 077
|
|
2526
|
+
imagem_alvo = "assets\\entrada_notas\\danfe077.png"
|
|
2527
|
+
# imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\danfe077.png"
|
|
2528
|
+
|
|
2529
|
+
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
2530
|
+
|
|
2531
|
+
if localizacao:
|
|
2532
|
+
centro = pyautogui.center(localizacao)
|
|
2533
|
+
pyautogui.click(centro)
|
|
2534
|
+
|
|
2535
|
+
except ImageNotFoundException:
|
|
2536
|
+
console.print(
|
|
2537
|
+
"Imagem não encontrada (exceção capturada). Tentando clicar no OK."
|
|
2538
|
+
)
|
|
2466
2539
|
await worker_sleep(3)
|
|
2467
2540
|
console.print("Verificando se o tipo de nota foi selecionado corretamente \n")
|
|
2468
2541
|
modelo_select = panel_Ttabsheet.child_window(class_name="TDBIComboBox", found_index=1)
|
|
@@ -3158,7 +3231,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
3158
3231
|
await worker_sleep(2)
|
|
3159
3232
|
|
|
3160
3233
|
#INSERINDO O VALOR INDIVIDUAL DO ITEM
|
|
3161
|
-
console.print("Inserindo o valor indivual do Item
|
|
3234
|
+
console.print("Inserindo o valor indivual do Item... 2ª Etapa\n")
|
|
3162
3235
|
btn_valor_unitario = panel_tabSheet.child_window(class_name="TDBIBitBtn", found_index=0)
|
|
3163
3236
|
btn_valor_unitario.click()
|
|
3164
3237
|
await worker_sleep(2)
|
|
@@ -3192,164 +3265,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
3192
3265
|
await worker_sleep(5)
|
|
3193
3266
|
main_window.close()
|
|
3194
3267
|
await worker_sleep(5) #FIM DO LOOP ITENS NOTA CONJUNTA
|
|
3195
|
-
|
|
3196
|
-
#FOR OUTROS ITENS NOTA
|
|
3197
|
-
# for item in itens_nota:
|
|
3198
|
-
# quantidade = item['quantidade']
|
|
3199
|
-
# preco = item['valor_unitario']
|
|
3200
|
-
# descricao = item['descricao']
|
|
3201
|
-
# descricao = 'Diesel Comum' if descricao == 'Diesel S500' else descricao
|
|
3202
|
-
# item_cod = item['codigo']
|
|
3203
|
-
# #descricao = descricao.replace(".",",")
|
|
3204
|
-
|
|
3205
|
-
# if 'arla' in descricao.lower():
|
|
3206
|
-
# item_arla = True
|
|
3207
|
-
# continue #continue para pular o item arla
|
|
3208
|
-
|
|
3209
|
-
# console.print(quantidade, preco, descricao)
|
|
3210
|
-
|
|
3211
|
-
# app = Application().connect(class_name="TFrmPreVenda", timeout=60)
|
|
3212
|
-
# main_window = app["TFrmPreVenda"]
|
|
3213
|
-
# main_window.set_focus()
|
|
3214
|
-
|
|
3215
|
-
# console.print("Itens acessado com sucesso, clicando em Incluir...\n")
|
|
3216
|
-
# panel_TGroup_Box= panel_TPage.child_window(class_name="TGroupBox", found_index=0)
|
|
3217
|
-
# btn_incluir = panel_TGroup_Box.child_window(class_name="TDBIBitBtn", found_index=4)
|
|
3218
|
-
# btn_incluir.click()
|
|
3219
|
-
# await worker_sleep(5)
|
|
3220
|
-
# console.print("Incluir clicado com sucesso...\n")
|
|
3221
|
-
|
|
3222
|
-
# #VERIFICANDO A EXISTENCIA DE WARNINGS
|
|
3223
|
-
# console.print("Verificando a existência de Warning... \n")
|
|
3224
|
-
# warning_pop_up = await is_window_open("Warning")
|
|
3225
|
-
# if warning_pop_up["IsOpened"] == True:
|
|
3226
|
-
# console.print("possui Pop-up de Warning, analisando... \n")
|
|
3227
|
-
# ocr_pop_warning = await ocr_warnings(numero_cupom_fiscal)
|
|
3228
|
-
# if ocr_pop_warning.sucesso == True:
|
|
3229
|
-
# return RpaRetornoProcessoDTO(
|
|
3230
|
-
# sucesso=False,
|
|
3231
|
-
# retorno=f"POP UP Warning não mapeado para seguimento do processo, mensagem: {ocr_pop_warning.retorno}",
|
|
3232
|
-
# status=RpaHistoricoStatusEnum.Falha,
|
|
3233
|
-
# tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
3234
|
-
# )
|
|
3235
|
-
# else:
|
|
3236
|
-
# return RpaRetornoProcessoDTO(
|
|
3237
|
-
# sucesso=False,
|
|
3238
|
-
# retorno=f"POP UP Warning não mapeado para seguimento do processo",
|
|
3239
|
-
# status=RpaHistoricoStatusEnum.Falha,
|
|
3240
|
-
# tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
3241
|
-
# )
|
|
3242
|
-
|
|
3243
|
-
# app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
|
|
3244
|
-
# main_window = app["TFrmIncluiItemPreVenda"]
|
|
3245
|
-
# main_window.set_focus()
|
|
3246
|
-
# panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
|
|
3247
|
-
# almoxarificado_index = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=1)
|
|
3248
|
-
# cod_almoxarificado = str(cod_empresa)+"50"
|
|
3249
|
-
# almoxarificado_index.click()
|
|
3250
|
-
# await worker_sleep(1)
|
|
3251
|
-
# for _ in range(5):
|
|
3252
|
-
# pyautogui.press("del")
|
|
3253
|
-
# pyautogui.press("backspace")
|
|
3254
|
-
# await worker_sleep(1)
|
|
3255
|
-
# pyautogui.write(cod_almoxarificado)
|
|
3256
|
-
# pyautogui.press('tab')
|
|
3257
|
-
# await worker_sleep(3)
|
|
3258
|
-
|
|
3259
|
-
# cod_item_index = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=0)
|
|
3260
|
-
# cod_item_index.click()
|
|
3261
|
-
# await worker_sleep(1)
|
|
3262
|
-
|
|
3263
|
-
# for _ in range(5):
|
|
3264
|
-
# pyautogui.press("del")
|
|
3265
|
-
# pyautogui.press("backspace")
|
|
3266
|
-
|
|
3267
|
-
# await worker_sleep(1)
|
|
3268
|
-
# pyautogui.write(str(item_cod))
|
|
3269
|
-
# pyautogui.press('tab')
|
|
3270
|
-
# await worker_sleep(3)
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
# natureza_oper_select = panel_TGroup_Box.child_window(class_name="TDBIComboBox", found_index=0)
|
|
3274
|
-
# nop_selected = natureza_oper_select.window_text()
|
|
3275
|
-
# nop_selected_value = nop_selected[:4]
|
|
3276
|
-
|
|
3277
|
-
# itens_to_select = natureza_oper_select.texts()
|
|
3278
|
-
# nop_to_be_select = ''
|
|
3279
|
-
|
|
3280
|
-
# for item in itens_to_select:
|
|
3281
|
-
# if nop_selected_value in item and (('c/' in item.lower() or 'c /' in item.lower()) and ('s/' in item.lower() or 's /' in item.lower())):
|
|
3282
|
-
# nop_to_be_select = item
|
|
3283
|
-
# break
|
|
3284
|
-
|
|
3285
|
-
# natureza_oper_select.click()
|
|
3286
|
-
# await worker_sleep(1)
|
|
3287
|
-
# console.print(f"Descrição: {descricao}")
|
|
3288
|
-
# if 'gasolina' in descricao.lower() or 'diesel' in descricao.lower() or 'gnv' in descricao.lower() or 'etanol' in descricao.lower():
|
|
3289
|
-
# try:
|
|
3290
|
-
# console.print("Selecionando NOP do item: '5667 - VENDA DE COMB OU LUBRI - SEM ESTOQ E COM FINANC'")
|
|
3291
|
-
# natureza_oper_select.select("5667 - VENDA DE COMB OU LUBRI - SEM ESTOQ E COM FINANC")
|
|
3292
|
-
|
|
3293
|
-
# except:
|
|
3294
|
-
# console.print("Selecionando NOP: 5656 - VENDA DE COMB OU LUB ADQ DE TERCEIRO C/ FIN S/ ESTOQUE")
|
|
3295
|
-
# natureza_oper_select.select("5656 - VENDA DE COMB OU LUB ADQ DE TERCEIRO C/ FIN S/ ESTOQUE")
|
|
3296
|
-
|
|
3297
|
-
# elif 'arla' in descricao.lower():
|
|
3298
|
-
# try:
|
|
3299
|
-
# #PRECISA DO ESPAÇO NO FINAL!!!
|
|
3300
|
-
# console.print("Selecionando NOP do item: '5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ ESTOQ C/ FINAN '")
|
|
3301
|
-
# natureza_oper_select.select("5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ ESTOQ C/ FINAN ")
|
|
3302
|
-
|
|
3303
|
-
# except:
|
|
3304
|
-
# console.print("Selecionando NOP do item: '5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ESTOQ C/ FINAN FE'")
|
|
3305
|
-
# natureza_oper_select.select("5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ESTOQ C/ FINAN FE")
|
|
3306
|
-
|
|
3307
|
-
# else:
|
|
3308
|
-
# if nop_to_be_select != '':
|
|
3309
|
-
# console.print(f"Selecionando NOP do item: '{nop_to_be_select}'")
|
|
3310
|
-
# natureza_oper_select.select(nop_to_be_select)
|
|
3311
|
-
# # set_combobox("||List", nop_to_be_select)
|
|
3312
|
-
# else:
|
|
3313
|
-
# retorno = f"Não foi possivel encontrar a nop para o item, nop original {nop_selected} \nEtapas Executadas:\n{steps}"
|
|
3314
|
-
# return RpaRetornoProcessoDTO(
|
|
3315
|
-
# sucesso=False,
|
|
3316
|
-
# retorno=retorno,
|
|
3317
|
-
# status=RpaHistoricoStatusEnum.Falha,
|
|
3318
|
-
# tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
|
|
3319
|
-
# )
|
|
3320
|
-
|
|
3321
|
-
# await worker_sleep(1)
|
|
3322
|
-
# console.print("Natureza da operação selecionado com sucesso, preenchendo os itens...\n")
|
|
3323
|
-
|
|
3324
|
-
# #INSERINDO A QUANTIDADE
|
|
3325
|
-
# main_window.set_focus()
|
|
3326
|
-
# panel_TPage_Control= main_window.child_window(class_name="TcxPageControl", found_index=0)
|
|
3327
|
-
# panel_tabSheet = panel_TPage_Control.child_window(class_name="TcxTabSheet", found_index=0)
|
|
3328
|
-
|
|
3329
|
-
# field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=8)
|
|
3330
|
-
# console.print("Inserindo a quantidade de Itens...\n")
|
|
3331
|
-
# field_quantidade.click()
|
|
3332
|
-
# await worker_sleep(1)
|
|
3333
|
-
# pyautogui.press('del')
|
|
3334
|
-
# await worker_sleep(1)
|
|
3335
|
-
# pyautogui.press('backspace')
|
|
3336
|
-
# await worker_sleep(1)
|
|
3337
|
-
# pyautogui.write(quantidade)
|
|
3338
|
-
# #field_quantidade.set_edit_text(quantidade)
|
|
3339
|
-
# await worker_sleep(1)
|
|
3340
|
-
# pyautogui.press('tab')
|
|
3341
|
-
# await worker_sleep(2)
|
|
3342
|
-
|
|
3343
|
-
# console.print("Verificando inclui itiem Pre Venda")
|
|
3344
|
-
# app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
|
|
3345
|
-
# main_window = app["TFrmIncluiItemPreVenda"]
|
|
3346
|
-
# main_window.set_focus()
|
|
3347
|
-
# send_keys("%i")
|
|
3348
|
-
# await worker_sleep(2)
|
|
3349
|
-
# #Divergencia de nop na capa e no item
|
|
3350
|
-
# await find_nop_divergence()
|
|
3351
|
-
# await worker_sleep(5)
|
|
3352
|
-
# main_window.close()
|
|
3353
3268
|
|
|
3354
3269
|
# Inclui registro
|
|
3355
3270
|
console.print(f"Incluindo registro...\n")
|
|
@@ -3480,7 +3395,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
3480
3395
|
|
|
3481
3396
|
#CONFIRMANDO NA TELA DE PRE VENDA
|
|
3482
3397
|
try:
|
|
3483
|
-
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
|
|
3398
|
+
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA 2ª Etapa... \n")
|
|
3484
3399
|
app = Application().connect(class_name="TFrmPreVenda", timeout=10)
|
|
3485
3400
|
main_window = app["Confirm"]
|
|
3486
3401
|
main_window.set_focus()
|
|
@@ -3809,15 +3724,28 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
3809
3724
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
|
3810
3725
|
)
|
|
3811
3726
|
|
|
3812
|
-
|
|
3727
|
+
await worker_sleep(5)
|
|
3728
|
+
|
|
3813
3729
|
console.print("Processo de ajustar aliquota realizado com sucesso, adicionando a mensagem... \n")
|
|
3730
|
+
try:
|
|
3731
|
+
information_pop_up = await is_window_open("Information")
|
|
3732
|
+
if information_pop_up["IsOpened"] == True:
|
|
3733
|
+
app = Application().connect(title="Information", timeout=10)
|
|
3734
|
+
main_window = app["Information"]
|
|
3735
|
+
main_window.set_focus()
|
|
3736
|
+
await worker_sleep(2)
|
|
3737
|
+
btn_ok = main_window.child_window(class_name="TButton", found_index=0)
|
|
3738
|
+
btn_ok.click()
|
|
3739
|
+
except:
|
|
3740
|
+
pass
|
|
3814
3741
|
try:
|
|
3815
3742
|
console.print("Conectando a janela de pre venda... \n")
|
|
3816
|
-
app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=
|
|
3743
|
+
app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=30)
|
|
3817
3744
|
main_window = app["TFrmDadosFaturamentoPreVenda"]
|
|
3818
3745
|
main_window.set_focus()
|
|
3819
|
-
send_keys("%m")
|
|
3820
3746
|
await worker_sleep(2)
|
|
3747
|
+
send_keys("%m")
|
|
3748
|
+
await worker_sleep(5)
|
|
3821
3749
|
|
|
3822
3750
|
mensagem_tab = pyautogui.locateOnScreen(ASSETS_PATH + "\\notas_saida\\icon_mensagem.png", confidence=0.7)
|
|
3823
3751
|
if mensagem_tab:
|
|
@@ -4064,7 +3992,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
4064
3992
|
|
|
4065
3993
|
#CONFIRMANDO NA TELA DE PRE VENDA
|
|
4066
3994
|
try:
|
|
4067
|
-
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
|
|
3995
|
+
console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA 3ª Etapa... \n")
|
|
4068
3996
|
app = Application().connect(class_name="TFrmPreVenda", timeout=10)
|
|
4069
3997
|
main_window = app["Confirm"]
|
|
4070
3998
|
main_window.set_focus()
|
|
@@ -4445,9 +4373,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
|
|
|
4445
4373
|
status=RpaHistoricoStatusEnum.Falha,
|
|
4446
4374
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
|
4447
4375
|
)
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
4376
|
|
|
4452
4377
|
console.print(f"\nNavegando entre os elementos do Rel Boletim Caixa ",style="bold green")
|
|
4453
4378
|
try:
|
|
@@ -17,6 +17,8 @@ from pywinauto.keyboard import send_keys
|
|
|
17
17
|
from pywinauto.timings import wait_until
|
|
18
18
|
from pywinauto_recorder.player import set_combobox
|
|
19
19
|
from rich.console import Console
|
|
20
|
+
import sys
|
|
21
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")))
|
|
20
22
|
from worker_automate_hub.api.ahead_service import save_xml_to_downloads
|
|
21
23
|
from worker_automate_hub.api.client import (
|
|
22
24
|
get_config_by_name,
|
|
@@ -325,7 +327,8 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
325
327
|
await worker_sleep(5)
|
|
326
328
|
|
|
327
329
|
# Aguarda a tela de aguarde
|
|
328
|
-
imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
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"
|
|
329
332
|
timeout = 300 # 5 minutos
|
|
330
333
|
start_time = time.time()
|
|
331
334
|
|
|
@@ -362,7 +365,7 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
362
365
|
try:
|
|
363
366
|
# Verifica erro ncm nao encontrado
|
|
364
367
|
imagem_alvo = "assets\\entrada_notas\\nao_encontrado_ncm.png"
|
|
365
|
-
|
|
368
|
+
imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\nao_encontrado_ncm.png"
|
|
366
369
|
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
367
370
|
|
|
368
371
|
if localizacao:
|
|
@@ -380,7 +383,8 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
380
383
|
)
|
|
381
384
|
|
|
382
385
|
# Aguarda a tela de aguarde
|
|
383
|
-
imagem_alvo = "assets\\entrada_notas\\aguarde.png"
|
|
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"
|
|
384
388
|
timeout = 300 # 5 minutos
|
|
385
389
|
start_time = time.time()
|
|
386
390
|
|
|
@@ -693,10 +697,14 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
693
697
|
await worker_sleep(3)
|
|
694
698
|
console.print(f"Incluindo registro...\n")
|
|
695
699
|
try:
|
|
696
|
-
ASSETS_PATH = "assets"
|
|
700
|
+
# ASSETS_PATH = "assets"
|
|
701
|
+
ASSETS_PATH = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\IncluirRegistro.png"
|
|
697
702
|
inserir_registro = pyautogui.locateOnScreen(
|
|
698
|
-
ASSETS_PATH
|
|
703
|
+
ASSETS_PATH, confidence=0.8
|
|
699
704
|
)
|
|
705
|
+
# inserir_registro = pyautogui.locateOnScreen(
|
|
706
|
+
# ASSETS_PATH + "\\entrada_notas\\IncluirRegistro.png", confidence=0.8
|
|
707
|
+
# )
|
|
700
708
|
pyautogui.click(inserir_registro)
|
|
701
709
|
except Exception as e:
|
|
702
710
|
console.print(
|
|
@@ -886,3 +894,25 @@ async def entrada_de_notas_33(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
|
886
894
|
finally:
|
|
887
895
|
# Deleta o xml
|
|
888
896
|
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))
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/util.py
RENAMED
|
@@ -4509,47 +4509,45 @@ async def cadastro_pre_venda_header(
|
|
|
4509
4509
|
|
|
4510
4510
|
console.print("Navegando nos elementos...\n")
|
|
4511
4511
|
panel_TPage = main_window.child_window(class_name="TPage", found_index=0)
|
|
4512
|
-
panel_TGroup_Box = panel_TPage.child_window(
|
|
4513
|
-
class_name="TGroupBox", found_index=0
|
|
4514
|
-
)
|
|
4512
|
+
panel_TGroup_Box = panel_TPage.child_window(class_name="TGroupBox", found_index=0)
|
|
4515
4513
|
|
|
4516
4514
|
console.print("Selecionando a condição de pagamento...\n")
|
|
4517
|
-
condicao_select = panel_TGroup_Box.child_window(
|
|
4518
|
-
class_name="TDBIComboBox", found_index=2
|
|
4519
|
-
)
|
|
4515
|
+
condicao_select = panel_TGroup_Box.child_window(class_name="TDBIComboBox", found_index=2)
|
|
4520
4516
|
condicao_select.click_input()
|
|
4521
|
-
await worker_sleep(
|
|
4522
|
-
if "vista" in cod_pagamento.lower():
|
|
4523
|
-
try:
|
|
4524
|
-
# Verifica mensagem sem lote pra integrar
|
|
4525
|
-
imagem_alvo ="assets\\entrada_notas\\a_vista.png" #ALTERAR CAMINHO PARA ASSETS
|
|
4526
|
-
|
|
4527
|
-
localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
|
|
4517
|
+
await worker_sleep(2)
|
|
4528
4518
|
|
|
4529
|
-
|
|
4530
|
-
centro = pyautogui.center(localizacao)
|
|
4531
|
-
pyautogui.click(centro)
|
|
4519
|
+
condicao_desejada = ""
|
|
4532
4520
|
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4521
|
+
if "vista" in cod_pagamento.lower():
|
|
4522
|
+
condicao_desejada = "A VISTA"
|
|
4523
|
+
elif "21 dias" in cod_pagamento.lower():
|
|
4524
|
+
condicao_desejada = "21 DIAS"
|
|
4537
4525
|
|
|
4538
|
-
|
|
4526
|
+
if condicao_desejada:
|
|
4527
|
+
# Opcional: capturar os itens disponíveis, para debug
|
|
4539
4528
|
try:
|
|
4540
|
-
|
|
4541
|
-
|
|
4529
|
+
itens_disponiveis = condicao_select.texts()
|
|
4530
|
+
console.print(f"Opções disponíveis: {itens_disponiveis}")
|
|
4531
|
+
except:
|
|
4532
|
+
itens_disponiveis = []
|
|
4533
|
+
|
|
4534
|
+
# Digita parte inicial para ajudar no filtro (por exemplo "21" ou "A")
|
|
4535
|
+
condicao_select.type_keys(condicao_desejada[:2], with_spaces=True)
|
|
4536
|
+
await worker_sleep(1)
|
|
4542
4537
|
|
|
4543
|
-
|
|
4538
|
+
# Percorre até encontrar o valor exato
|
|
4539
|
+
for _ in range(10):
|
|
4540
|
+
texto_atual = condicao_select.window_text()
|
|
4541
|
+
if condicao_desejada.lower() in texto_atual.lower():
|
|
4542
|
+
condicao_select.type_keys("{ENTER}")
|
|
4543
|
+
break
|
|
4544
|
+
else:
|
|
4545
|
+
condicao_select.type_keys("{DOWN}")
|
|
4546
|
+
await worker_sleep(0.5)
|
|
4544
4547
|
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
pyautogui.click(centro)
|
|
4548
|
+
# Confirma e sai do campo
|
|
4549
|
+
condicao_select.type_keys("{TAB}")
|
|
4548
4550
|
|
|
4549
|
-
except ImageNotFoundException:
|
|
4550
|
-
console.print(
|
|
4551
|
-
"Imagem não encontrada (exceção capturada). Tentando clicar no OK."
|
|
4552
|
-
)
|
|
4553
4551
|
await worker_sleep(2)
|
|
4554
4552
|
|
|
4555
4553
|
console.print("Inserindo codigo do cliente...\n")
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/ahead_service.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/api/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/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.670 → worker_automate_hub-0.5.672}/worker_automate_hub/config/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/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.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/repeat.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/retry.py
RENAMED
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/decorators/timeit.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/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.670 → worker_automate_hub-0.5.672}/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
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/__init__.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/env.py
RENAMED
|
File without changes
|
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/logger.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/toast.py
RENAMED
|
File without changes
|
{worker_automate_hub-0.5.670 → worker_automate_hub-0.5.672}/worker_automate_hub/utils/updater.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|