worker-automate-hub 0.5.687__py3-none-any.whl → 0.5.689__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +25 -17
- worker_automate_hub/tasks/jobs/integracao_contabil_generica.py +17 -13
- {worker_automate_hub-0.5.687.dist-info → worker_automate_hub-0.5.689.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.687.dist-info → worker_automate_hub-0.5.689.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.5.687.dist-info → worker_automate_hub-0.5.689.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.687.dist-info → worker_automate_hub-0.5.689.dist-info}/entry_points.txt +0 -0
@@ -2,12 +2,14 @@ import asyncio
|
|
2
2
|
from datetime import datetime
|
3
3
|
import getpass
|
4
4
|
import os
|
5
|
+
import re
|
5
6
|
import warnings
|
6
7
|
import uuid
|
7
8
|
import time
|
8
9
|
import win32clipboard
|
9
10
|
import difflib
|
10
|
-
|
11
|
+
# import sys
|
12
|
+
# sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..","..","..")))
|
11
13
|
import pyautogui
|
12
14
|
from pywinauto.keyboard import send_keys
|
13
15
|
from PIL import Image, ImageEnhance
|
@@ -139,17 +141,20 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
139
141
|
class_name="TDBIComboBox", found_index=1
|
140
142
|
)
|
141
143
|
|
142
|
-
|
143
|
-
|
144
|
-
"Clique select box, Tipo de documento realizado com sucesso, selecionando o tipo de documento...\n"
|
145
|
-
)
|
144
|
+
# Conectar à aplicação
|
145
|
+
app = Application(backend="win32").connect(title_re=".*Nota Fiscal.*")
|
146
146
|
|
147
|
-
|
147
|
+
# Acessar a janela
|
148
|
+
janela = app.window(class_name="TFrmNotaFiscalEntrada")
|
149
|
+
|
150
|
+
# Encontrar o combobox
|
151
|
+
combo = janela.child_window(class_name="TDBIComboBox", found_index=1)
|
152
|
+
|
153
|
+
# Expandir o combobox
|
154
|
+
combo.select("NOTA FISCAL DE ENTRADA ELETRONICA - DANFE")
|
155
|
+
|
156
|
+
print("Item selecionado com sucesso.")
|
148
157
|
|
149
|
-
set_combobox("||List", "NOTA FISCAL DE ENTRADA ELETRONICA - DANFE")
|
150
|
-
console.print(
|
151
|
-
"Tipo de documento 'NOTA FISCAL DE ENTRADA ELETRONICA - DANFE', selecionado com sucesso...\n"
|
152
|
-
)
|
153
158
|
|
154
159
|
await worker_sleep(4)
|
155
160
|
|
@@ -229,10 +234,8 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
229
234
|
combo_box_natureza_operacao = main_window.child_window(
|
230
235
|
class_name="TDBIComboBox", found_index=0
|
231
236
|
)
|
232
|
-
|
233
|
-
|
234
|
-
set_combobox("||List", "1652-COMPRA DE MERCADORIAS- 1.652")
|
235
|
-
await worker_sleep(3)
|
237
|
+
# Interage com o ComboBox
|
238
|
+
combo_box_natureza_operacao.select("1652-COMPRA DE MERCADORIAS- 1.652")
|
236
239
|
|
237
240
|
try:
|
238
241
|
console.print(f"Trabalhando com itens com multiplas referencias.\n")
|
@@ -572,11 +575,17 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
572
575
|
# set_combobox("||List", "BOLETO")
|
573
576
|
panel_tab_pagamento.child_window(class_name="TDBIComboBox", found_index=0).select("BOLETO")
|
574
577
|
|
578
|
+
valor_str = nota.get("valorNota")
|
579
|
+
if valor_str:
|
580
|
+
valor_str = valor_str.replace(',', '.')
|
581
|
+
else:
|
582
|
+
valor_str = None
|
583
|
+
|
575
584
|
await emsys.inserir_vencimento_e_valor(
|
576
585
|
nota.get("nomeFornecedor"),
|
577
586
|
nota.get("dataEmissao"),
|
578
587
|
nota.get("dataVencimento"),
|
579
|
-
|
588
|
+
valor_str,
|
580
589
|
)
|
581
590
|
|
582
591
|
await worker_sleep(8)
|
@@ -643,7 +652,7 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
643
652
|
await worker_sleep(5)
|
644
653
|
i += 1
|
645
654
|
|
646
|
-
await worker_sleep(
|
655
|
+
await worker_sleep(20)
|
647
656
|
console.print("\nVerifica se a nota ja foi lançada...")
|
648
657
|
nf_chave_acesso = int(nota.get("nfe"))
|
649
658
|
status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
|
@@ -696,4 +705,3 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
696
705
|
status=RpaHistoricoStatusEnum.Falha,
|
697
706
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
698
707
|
)
|
699
|
-
|
@@ -294,7 +294,9 @@ async def integracao_contabil_generica(
|
|
294
294
|
imagem_finalizada = "assets\\integracao_contabil\\pesquisa_finalizada.png"
|
295
295
|
|
296
296
|
if not os.path.exists(imagem_finalizada):
|
297
|
-
raise FileNotFoundError(
|
297
|
+
raise FileNotFoundError(
|
298
|
+
f"Imagem não encontrada no caminho: {imagem_finalizada}"
|
299
|
+
)
|
298
300
|
|
299
301
|
print("Aguardando a imagem aparecer...")
|
300
302
|
|
@@ -304,7 +306,9 @@ async def integracao_contabil_generica(
|
|
304
306
|
for tentativa in range(1, max_tentativas + 1):
|
305
307
|
print(f"Tentativa {tentativa} de {max_tentativas}...")
|
306
308
|
try:
|
307
|
-
localizacao = pyautogui.locateOnScreen(
|
309
|
+
localizacao = pyautogui.locateOnScreen(
|
310
|
+
imagem_finalizada, confidence=0.85
|
311
|
+
)
|
308
312
|
if localizacao:
|
309
313
|
console.print("Imagem encontrada!")
|
310
314
|
break
|
@@ -312,17 +316,17 @@ async def integracao_contabil_generica(
|
|
312
316
|
print("Imagem não encontrada ainda.")
|
313
317
|
except Exception as e:
|
314
318
|
print(f"Erro ao verificar a imagem: {e}")
|
315
|
-
|
319
|
+
|
316
320
|
await worker_sleep(20)
|
317
321
|
|
318
322
|
if not localizacao:
|
319
323
|
console.print("Imagem não foi encontrada após 300 tentativas")
|
320
324
|
return RpaRetornoProcessoDTO(
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
325
|
+
sucesso=False,
|
326
|
+
retorno="Imagem de pesquisa finalizada não encontrada, favor verificar.",
|
327
|
+
status=RpaHistoricoStatusEnum.Falha,
|
328
|
+
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
329
|
+
)
|
326
330
|
except Exception as e:
|
327
331
|
console.print(f"Erro ao procurar imagem: {e}")
|
328
332
|
|
@@ -451,11 +455,6 @@ async def integracao_contabil_generica(
|
|
451
455
|
if err:
|
452
456
|
console.print(f"[red]Erro encontrado:[/red] {mensagem}")
|
453
457
|
|
454
|
-
# Clique no botão OK da mensagem de erro antes de retornar
|
455
|
-
msg_box.child_window(
|
456
|
-
class_name="TBitBtn", found_index=0
|
457
|
-
).click_input()
|
458
|
-
|
459
458
|
return RpaRetornoProcessoDTO(
|
460
459
|
sucesso=False,
|
461
460
|
retorno=mensagem,
|
@@ -463,6 +462,11 @@ async def integracao_contabil_generica(
|
|
463
462
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
464
463
|
)
|
465
464
|
|
465
|
+
# Clique no botão OK da mensagem de erro antes de retornar
|
466
|
+
msg_box.child_window(
|
467
|
+
class_name="TBitBtn", found_index=0
|
468
|
+
).click_input()
|
469
|
+
|
466
470
|
await worker_sleep(1)
|
467
471
|
|
468
472
|
try:
|
@@ -53,7 +53,7 @@ worker_automate_hub/tasks/jobs/ecac_estadual_sp.py,sha256=AqSsn0SlK_nok4AhMCNUlA
|
|
53
53
|
worker_automate_hub/tasks/jobs/ecac_federal.py,sha256=VFOrbMuMHL3ac1sJ-z-N1p1WYtP-e-JJHbvUfgmfgNw,55748
|
54
54
|
worker_automate_hub/tasks/jobs/entrada_cte_1353.py,sha256=knwPbjZZsnvHKurs7O7gv7bFpQIAmv4qPB1rZa3zBsY,12102
|
55
55
|
worker_automate_hub/tasks/jobs/entrada_cte_333.py,sha256=FvpU_bsdPB2ANQ_i63Jlkdo5yZM4zJdr2mm41KTrJtE,13285
|
56
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256=
|
56
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_15.py,sha256=Mfisb9B79lhSc5RaqbnRslI8zeUgRBWEWbwQWkzNZOs,29763
|
57
57
|
worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=AFpFu2HezsRJKMrYrPYTHUJby0NFch_zlHqf1X-Fe7A,37101
|
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
|
@@ -78,7 +78,7 @@ worker_automate_hub/tasks/jobs/fidc_retorno_cobranca.py,sha256=mmBW7KetUeRjiZkjn
|
|
78
78
|
worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos.py,sha256=QzK2aG5d9pmFbb8cTaNm3LWf5NMkmCvBkgo70gcLu0c,14781
|
79
79
|
worker_automate_hub/tasks/jobs/geracao_aprovacao_pedidos_novo.py,sha256=5-wn583Cm0_NJ3TcVpYcurBTRxgwW6MU8WqaYawLS2k,21345
|
80
80
|
worker_automate_hub/tasks/jobs/integracao_contabil.py,sha256=psoIU0tjtTJq2W8aGXjXrfkAOYlIpUtHZyNolI7dp-0,16263
|
81
|
-
worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=
|
81
|
+
worker_automate_hub/tasks/jobs/integracao_contabil_generica.py,sha256=u1EsPsrTi4ypfGxSQ5nivc0PiVO2E4rjImLUbu5Pj9g,21572
|
82
82
|
worker_automate_hub/tasks/jobs/lancamento_pis_cofins.py,sha256=0mlu-oPwRd9qCocB-6tWsEI0-wd48mkBJn5juYqOAX8,40788
|
83
83
|
worker_automate_hub/tasks/jobs/lancamento_rateio.py,sha256=0cvbpuJiHl5mca5gpZudX7uQY5Rqe5xzwt6juQcMhjo,15875
|
84
84
|
worker_automate_hub/tasks/jobs/login_emsys.py,sha256=dO9S027qRTtjOfytF6IWO-m6hDld8kZqOVAsn91l1YA,5684
|
@@ -98,7 +98,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
98
98
|
worker_automate_hub/utils/util.py,sha256=xA13nQqZglwkvfAKH18Unv4UoZUyvL58CacSrzUpYTw,206352
|
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.689.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
102
|
+
worker_automate_hub-0.5.689.dist-info/METADATA,sha256=S8Rrbp5bj8VJnTLgmI142UR6fefZnfcuHyYRpmuiqk0,3049
|
103
|
+
worker_automate_hub-0.5.689.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
104
|
+
worker_automate_hub-0.5.689.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.687.dist-info → worker_automate_hub-0.5.689.dist-info}/entry_points.txt
RENAMED
File without changes
|