worker-automate-hub 0.5.742__py3-none-any.whl → 0.5.744__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 +12 -1
- worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +20 -3
- worker_automate_hub/tasks/jobs/entrada_de_notas_503.py +24 -2
- worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +3 -3
- worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py +3 -3
- worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py +26 -22
- {worker_automate_hub-0.5.742.dist-info → worker_automate_hub-0.5.744.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.742.dist-info → worker_automate_hub-0.5.744.dist-info}/RECORD +10 -10
- {worker_automate_hub-0.5.742.dist-info → worker_automate_hub-0.5.744.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.742.dist-info → worker_automate_hub-0.5.744.dist-info}/entry_points.txt +0 -0
@@ -593,7 +593,18 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
593
593
|
)
|
594
594
|
|
595
595
|
await worker_sleep(8)
|
596
|
-
|
596
|
+
try:
|
597
|
+
retorno = await emsys.incluir_registro(chave_nfe=nota.get("nfe"))
|
598
|
+
if retorno.sucesso == True:
|
599
|
+
return RpaRetornoProcessoDTO(
|
600
|
+
sucesso=retorno.sucesso,
|
601
|
+
retorno=retorno.retorno,
|
602
|
+
status=retorno.status,
|
603
|
+
)
|
604
|
+
except:
|
605
|
+
console.print(
|
606
|
+
"A Nota fiscal ainda não foi incluída, continuando o processo..."
|
607
|
+
)
|
597
608
|
await worker_sleep(5)
|
598
609
|
|
599
610
|
# await emsys.verify_warning_and_error("Warning", "No")
|
@@ -713,7 +713,16 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
713
713
|
pyautogui.write(nota["valorNota"])
|
714
714
|
await worker_sleep(3)
|
715
715
|
|
716
|
-
|
716
|
+
try:
|
717
|
+
retorno = await emsys.incluir_registro()
|
718
|
+
if retorno.sucesso == True:
|
719
|
+
return RpaRetornoProcessoDTO(
|
720
|
+
sucesso=retorno.sucesso,
|
721
|
+
retorno=retorno.retorno,
|
722
|
+
status=retorno.status,
|
723
|
+
)
|
724
|
+
except:
|
725
|
+
console.print("A Nota fiscal ainda não foi incluída, continuando o processo...")
|
717
726
|
await worker_sleep(25)
|
718
727
|
|
719
728
|
console.print(
|
@@ -775,8 +784,16 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
775
784
|
status=RpaHistoricoStatusEnum.Falha,
|
776
785
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
777
786
|
)
|
778
|
-
|
779
|
-
|
787
|
+
try:
|
788
|
+
retorno = await emsys.incluir_registro()
|
789
|
+
if retorno.sucesso == True:
|
790
|
+
return RpaRetornoProcessoDTO(
|
791
|
+
sucesso=retorno.sucesso,
|
792
|
+
retorno=retorno.retorno,
|
793
|
+
status=retorno.status,
|
794
|
+
)
|
795
|
+
except:
|
796
|
+
console.print("A Nota fiscal ainda não foi incluída, continuando o processo...")
|
780
797
|
await worker_sleep(25)
|
781
798
|
|
782
799
|
console.print("Verificando a existencia de POP-UP de Itens que Ultrapassam a Variação Máxima de Custo ...\n")
|
@@ -710,7 +710,18 @@ async def entrada_de_notas_503(task: RpaProcessoEntradaDTO) -> RpaRetornoProcess
|
|
710
710
|
pyautogui.write(nota["valorNota"])
|
711
711
|
await worker_sleep(3)
|
712
712
|
|
713
|
-
|
713
|
+
try:
|
714
|
+
retorno = await emsys.incluir_registro(chave_nfe=nota.get("nfe"))
|
715
|
+
if retorno.sucesso == True:
|
716
|
+
return RpaRetornoProcessoDTO(
|
717
|
+
sucesso=retorno.sucesso,
|
718
|
+
retorno=retorno.retorno,
|
719
|
+
status=retorno.status,
|
720
|
+
)
|
721
|
+
except:
|
722
|
+
console.print(
|
723
|
+
"A Nota fiscal ainda não foi incluída, continuando o processo..."
|
724
|
+
)
|
714
725
|
await worker_sleep(25)
|
715
726
|
|
716
727
|
console.print(
|
@@ -773,7 +784,18 @@ async def entrada_de_notas_503(task: RpaProcessoEntradaDTO) -> RpaRetornoProcess
|
|
773
784
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
774
785
|
)
|
775
786
|
|
776
|
-
|
787
|
+
try:
|
788
|
+
retorno = await emsys.incluir_registro(chave_nfe=nota.get("nfe"))
|
789
|
+
if retorno.sucesso == True:
|
790
|
+
return RpaRetornoProcessoDTO(
|
791
|
+
sucesso=retorno.sucesso,
|
792
|
+
retorno=retorno.retorno,
|
793
|
+
status=retorno.status,
|
794
|
+
)
|
795
|
+
except:
|
796
|
+
console.print(
|
797
|
+
"A Nota fiscal ainda não foi incluída, continuando o processo..."
|
798
|
+
)
|
777
799
|
await worker_sleep(25)
|
778
800
|
|
779
801
|
console.print("Verificando a existencia de POP-UP de Itens que Ultrapassam a Variação Máxima de Custo ...\n")
|
@@ -1172,9 +1172,9 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
1172
1172
|
retorno = await emsys.incluir_registro(chave_nfe=nota.get("nfe"))
|
1173
1173
|
if retorno.sucesso == True:
|
1174
1174
|
return RpaRetornoProcessoDTO(
|
1175
|
-
sucesso=
|
1176
|
-
retorno=
|
1177
|
-
status=
|
1175
|
+
sucesso=retorno.sucesso,
|
1176
|
+
retorno=retorno.retorno,
|
1177
|
+
status=retorno.status,
|
1178
1178
|
)
|
1179
1179
|
except:
|
1180
1180
|
console.print("A Nota fiscal ainda não foi incluída, continuando o processo...")
|
@@ -1190,9 +1190,9 @@ async def entrada_de_notas_9000(task: RpaProcessoEntradaDTO) -> RpaRetornoProces
|
|
1190
1190
|
retorno = await emsys.incluir_registro(chave_nfe=nota.get("nfe"))
|
1191
1191
|
if retorno.sucesso == True:
|
1192
1192
|
return RpaRetornoProcessoDTO(
|
1193
|
-
sucesso=
|
1194
|
-
retorno=
|
1195
|
-
status=
|
1193
|
+
sucesso=retorno.sucesso,
|
1194
|
+
retorno=retorno.retorno,
|
1195
|
+
status=retorno.status,
|
1196
1196
|
)
|
1197
1197
|
except:
|
1198
1198
|
console.print("A Nota fiscal ainda não foi incluída, continuando o processo...")
|
@@ -4,7 +4,10 @@ from datetime import datetime
|
|
4
4
|
from pywinauto import Application, timings, findwindows
|
5
5
|
import sys
|
6
6
|
import io
|
7
|
-
|
7
|
+
|
8
|
+
sys.path.append(
|
9
|
+
os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
|
10
|
+
)
|
8
11
|
|
9
12
|
from worker_automate_hub.models.dto.rpa_historico_request_dto import (
|
10
13
|
RpaHistoricoStatusEnum,
|
@@ -45,9 +48,9 @@ pyautogui.FAILSAFE = False
|
|
45
48
|
async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
46
49
|
try:
|
47
50
|
config = await get_config_by_name("login_emsys")
|
48
|
-
periodo = task.configEntrada[
|
49
|
-
periodo_format = periodo.replace("/","")
|
50
|
-
filial = task.configEntrada[
|
51
|
+
periodo = task.configEntrada["periodo"]
|
52
|
+
periodo_format = periodo.replace("/", "")
|
53
|
+
filial = task.configEntrada["filialEmpresaOrigem"]
|
51
54
|
historico_id = task.historico_id
|
52
55
|
await kill_all_emsys()
|
53
56
|
|
@@ -80,7 +83,7 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
80
83
|
##### Janela Relatório Saldos do Estoque #####
|
81
84
|
# Marcar check box data
|
82
85
|
app = Application().connect(class_name="TFrmRelSaldoEstoque", timeout=60)
|
83
|
-
main_window = app["TFrmRelSaldoEstoque"]
|
86
|
+
main_window = app["TFrmRelSaldoEstoque"]
|
84
87
|
main_window.set_focus()
|
85
88
|
|
86
89
|
# Captura o campo de data
|
@@ -90,39 +93,39 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
90
93
|
|
91
94
|
await worker_sleep(2)
|
92
95
|
# Insere a data
|
93
|
-
data_input = main_window.child_window(
|
94
|
-
|
95
|
-
)
|
96
|
-
|
96
|
+
data_input = main_window.child_window(class_name="TDBIEditDate", found_index=0)
|
97
|
+
|
97
98
|
data_input.set_edit_text(periodo)
|
98
99
|
|
99
100
|
# Clicar em gerar relatório
|
100
101
|
btn_gerar = main_window.child_window(
|
101
102
|
class_name="TBitBtn", found_index=0
|
102
|
-
).click_input()
|
103
|
+
).click_input()
|
103
104
|
|
104
105
|
# Aguarda até 60 segundos para a janela aparecer
|
105
106
|
timings.wait_until_passes(
|
106
107
|
timeout=1800,
|
107
108
|
retry_interval=1,
|
108
|
-
func=lambda: Application().connect(class_name="TFrmPreviewRelatorio")
|
109
|
+
func=lambda: Application().connect(class_name="TFrmPreviewRelatorio"),
|
109
110
|
)
|
110
111
|
|
111
112
|
await worker_sleep(2)
|
112
113
|
|
113
|
-
# Conecta à janela Preview Relatorio
|
114
|
+
# Conecta à janela Preview Relatorio
|
114
115
|
app = Application().connect(class_name="TFrmPreviewRelatorio")
|
115
116
|
main_window = app["TFrmPreviewRelatorio"]
|
116
117
|
main_window.set_focus()
|
117
118
|
|
118
119
|
# Clicar em salvar
|
119
|
-
caminho = r"assets\\
|
120
|
+
caminho = r"assets\\extracao_relatorios\\btn_salvar.png"
|
120
121
|
# Verifica se o arquivo existe
|
121
122
|
if os.path.isfile(caminho):
|
122
123
|
print("A imagem existe:", caminho)
|
123
124
|
|
124
125
|
# Procura a imagem na tela
|
125
|
-
pos = pyautogui.locateCenterOnScreen(
|
126
|
+
pos = pyautogui.locateCenterOnScreen(
|
127
|
+
caminho, confidence=0.9
|
128
|
+
) # ajuste o confidence se necessário
|
126
129
|
if pos:
|
127
130
|
pyautogui.click(pos) # clica no centro da imagem
|
128
131
|
print("Clique realizado na imagem.")
|
@@ -151,8 +154,8 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
151
154
|
|
152
155
|
# Clicar em Salvar
|
153
156
|
btn_salvar = main_window.child_window(
|
154
|
-
|
155
|
-
).click_input()
|
157
|
+
class_name="TBitBtn", found_index=1
|
158
|
+
).click_input()
|
156
159
|
|
157
160
|
await worker_sleep(5)
|
158
161
|
|
@@ -161,7 +164,9 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
161
164
|
main_window = app.window(title_re="Salvar para arquivo")
|
162
165
|
|
163
166
|
# Campo Nome (Edit) - use set_edit_text para evitar problemas de escape
|
164
|
-
campo_nome = main_window.child_window(
|
167
|
+
campo_nome = main_window.child_window(
|
168
|
+
class_name="Edit", control_id=1148
|
169
|
+
).wrapper_object()
|
165
170
|
caminho_arquivo = rf"C:\Users\automatehub\Downloads\saldo_estoque_{periodo_format}_{filial}.xlsx"
|
166
171
|
campo_nome.set_focus()
|
167
172
|
campo_nome.set_edit_text(caminho_arquivo)
|
@@ -169,15 +174,15 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
169
174
|
print("✅ Texto inserido no campo Nome")
|
170
175
|
|
171
176
|
await worker_sleep(2)
|
172
|
-
|
177
|
+
|
173
178
|
# Clicar em ok para salvar
|
174
179
|
btn_ok = main_window.child_window(
|
175
180
|
class_name="Button", found_index=0
|
176
|
-
).click_input()
|
181
|
+
).click_input()
|
177
182
|
|
178
183
|
await worker_sleep(5)
|
179
184
|
|
180
|
-
caminho_img = r"assets\\
|
185
|
+
caminho_img = r"assets\\extracao_relatorios\\janela_printing.png"
|
181
186
|
|
182
187
|
# Aguarda até a janela com título "Printing" (ou "Salvando...") fechar
|
183
188
|
try:
|
@@ -191,7 +196,7 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
191
196
|
except findwindows.ElementNotFoundError:
|
192
197
|
print("⚠️ Janela 'Printing' não estava aberta.")
|
193
198
|
|
194
|
-
nome_com_extensao = f
|
199
|
+
nome_com_extensao = f"saldo_estoque_{periodo_format}_{filial}.xlsx"
|
195
200
|
# lê o arquivo
|
196
201
|
with open(f"{caminho_arquivo}", "rb") as file:
|
197
202
|
file_bytes = io.BytesIO(file.read())
|
@@ -229,4 +234,3 @@ async def extracao_saldo_estoque(task: RpaProcessoEntradaDTO):
|
|
229
234
|
status=RpaHistoricoStatusEnum.Falha,
|
230
235
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
231
236
|
)
|
232
|
-
|
@@ -53,24 +53,24 @@ 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=Lb-19OLyOVM_EV9h4A7ylkHeilnf4G1aBfdbBdNoJXk,30928
|
57
57
|
worker_automate_hub/tasks/jobs/entrada_de_notas_16.py,sha256=XgCaZTn0lTxio9yLTYIf0J-PA8e80dSDa7wsUnZiffI,37783
|
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
60
|
worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=ODp82BkWaiF40t6uZLJYxG2nGGnvDyeQBHhkkh9ZgPI,35994
|
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
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=
|
63
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=cuIKcQJctyFhfm9vjxA8kIPAqUxMaitu8Uj9vIvJ46I,48693
|
64
64
|
worker_automate_hub/tasks/jobs/entrada_de_notas_500.py,sha256=WBsCRbH7ANiCjEn0aEDc5AqGf6grEFhxyBoAIh3zJ40,44160
|
65
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_503.py,sha256=
|
65
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_503.py,sha256=bcNKy6X1aaVe6lxW-TMyUKJ_GXzHEK-8V6x9SOzOshw,48365
|
66
66
|
worker_automate_hub/tasks/jobs/entrada_de_notas_505.py,sha256=xXeNipdXTSll8yAtAmN7v0sjN3oMlWU4THu30mKDddc,30339
|
67
67
|
worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py,sha256=7POfKc7nisc8-ysgqazrK8kT7kmFIq8irGwCMixPAE0,37948
|
68
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=
|
69
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py,sha256=
|
68
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=qV-XS8K099BySDBfkCjXoMeyCVdLYvFnpTFF6VXLlXA,64633
|
69
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_9000.py,sha256=0mOmS28tQKF5m7vMzInblDuWH48_qIgrohOU5UwYZ10,65498
|
70
70
|
worker_automate_hub/tasks/jobs/exemplo_processo.py,sha256=nV0iLoip2FH2-FhLmhX3nPqsfl_MPufZ3E5Q5krJvdc,3544
|
71
71
|
worker_automate_hub/tasks/jobs/extracao_fechamento_contabil.py,sha256=6Kr5DKjKLqtFvGzyiXtt7xrQsuU898l8pQXDq9C6AX8,19567
|
72
72
|
worker_automate_hub/tasks/jobs/extracao_fechamento_emsys.py,sha256=-T2nZUDiFrUGm_KLxJd_4qcrageDxVpWW3KAAniLFC4,21448
|
73
|
-
worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=
|
73
|
+
worker_automate_hub/tasks/jobs/extracao_saldo_estoque.py,sha256=xkwAoEJVBmEa5DCkUJouqR_Mj1X6HSzm3tHju3Lcp04,8241
|
74
74
|
worker_automate_hub/tasks/jobs/fechar_conexao_rdp.py,sha256=UWAKCS2dbfgDlSQOBdjmVJXfD1MMuUrOi3weDgB0CAc,5718
|
75
75
|
worker_automate_hub/tasks/jobs/fidc_exportacao_docs_portal_b2b.py,sha256=tWUmYy3Zhi3JEt8AoqTsWpU-wbf5-OxhCrTOooh1WH4,15616
|
76
76
|
worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=FAmcCqKVjedf7wIped8XRLIZ9S3oWc6fakF-r1Zm0kg,12637
|
@@ -100,7 +100,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
100
100
|
worker_automate_hub/utils/util.py,sha256=nV09AF8lu5poiMzWMAAgVS_VWvEuIRfNDmx46V7Nvzk,207279
|
101
101
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
|
102
102
|
worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
|
103
|
-
worker_automate_hub-0.5.
|
104
|
-
worker_automate_hub-0.5.
|
105
|
-
worker_automate_hub-0.5.
|
106
|
-
worker_automate_hub-0.5.
|
103
|
+
worker_automate_hub-0.5.744.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
104
|
+
worker_automate_hub-0.5.744.dist-info/METADATA,sha256=ak32PIs2Zky0uLTFBvUS6jPzq7IkbjAaeLi2y3qCYyw,3049
|
105
|
+
worker_automate_hub-0.5.744.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
106
|
+
worker_automate_hub-0.5.744.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.742.dist-info → worker_automate_hub-0.5.744.dist-info}/entry_points.txt
RENAMED
File without changes
|