worker-automate-hub 0.4.392__py3-none-any.whl → 0.4.394__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +5 -5
- worker_automate_hub/utils/updater.py +19 -0
- worker_automate_hub/worker.py +3 -0
- {worker_automate_hub-0.4.392.dist-info → worker_automate_hub-0.4.394.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.4.392.dist-info → worker_automate_hub-0.4.394.dist-info}/RECORD +7 -7
- {worker_automate_hub-0.4.392.dist-info → worker_automate_hub-0.4.394.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.4.392.dist-info → worker_automate_hub-0.4.394.dist-info}/entry_points.txt +0 -0
@@ -547,7 +547,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
547
547
|
panel_TTabSheet.click()
|
548
548
|
send_keys("{DOWN " + ("2") + "}")
|
549
549
|
|
550
|
-
await worker_sleep(
|
550
|
+
await worker_sleep(6)
|
551
551
|
try:
|
552
552
|
panel_TPage = main_window.child_window(class_name="TPage", title="Formulario")
|
553
553
|
panel_TTabSheet = panel_TPage.child_window(class_name="TPageControl")
|
@@ -605,7 +605,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
605
605
|
recebimento_fisico = datetime.strptime(recebimento_fisico, "%d/%m/%Y")
|
606
606
|
|
607
607
|
#se a data do aceite no Ahead ultrapassar dois dias após a emissão da nota, deve-se colocar o vencimento para a mesma data do “Receb. Físico”/Aceite.
|
608
|
-
if ((recebimento_fisico
|
608
|
+
if ((recebimento_fisico >= dt_emissao + timedelta(days=2)) and ("vibra" in nota.get("nomeFornecedor").lower() or "ipiranga" in nota.get("nomeFornecedor").lower() or "raizen" in nota.get("nomeFornecedor").lower() or "charrua" in nota.get("nomeFornecedor").lower())):
|
609
609
|
recebimento_fisico = recebimento_fisico.strftime("%d/%m/%Y")
|
610
610
|
console.print(f"Informando a data de vencimento, {recebimento_fisico}... \n")
|
611
611
|
vencimento = panel_TabParcelamento.child_window(
|
@@ -664,7 +664,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
664
664
|
match = re.search(pattern, nota.get("recebimentoFisico"))
|
665
665
|
recebimento_fisico = match.group(1) if match else None
|
666
666
|
recebimento_fisico = datetime.strptime(recebimento_fisico, "%d/%m/%Y")
|
667
|
-
if recebimento_fisico
|
667
|
+
if recebimento_fisico >= dt_emissao + timedelta(days=2):
|
668
668
|
recebimento_fisico = recebimento_fisico.strftime("%d/%m/%Y")
|
669
669
|
console.print(f"Informando a data de vencimento, {recebimento_fisico}... \n")
|
670
670
|
data_vencimento = recebimento_fisico
|
@@ -754,7 +754,7 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
754
754
|
class_name="TDBIEditNumber", found_index=3
|
755
755
|
)
|
756
756
|
valor.set_edit_text(valores_restantes_text)
|
757
|
-
await worker_sleep(
|
757
|
+
await worker_sleep(5)
|
758
758
|
console.print(f"Adicionando o pagamento... \n")
|
759
759
|
btn_add = panel_TabParcelamento.child_window(
|
760
760
|
class_name="TDBIBitBtn", found_index=1
|
@@ -929,4 +929,4 @@ async def entrada_de_notas_9(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoD
|
|
929
929
|
|
930
930
|
finally:
|
931
931
|
# Deleta o xml
|
932
|
-
await delete_xml(nota["nfe"])
|
932
|
+
await delete_xml(nota["nfe"])
|
@@ -5,6 +5,7 @@ import threading
|
|
5
5
|
from pathlib import Path
|
6
6
|
from typing import Optional
|
7
7
|
|
8
|
+
import psutil
|
8
9
|
import requests
|
9
10
|
import toml
|
10
11
|
from packaging import version
|
@@ -200,3 +201,21 @@ def check_for_update(stop_event: threading.Event):
|
|
200
201
|
err_msg = f"Erro ao verificar novas versões do pacote: {e}"
|
201
202
|
console.print(f"\n{err_msg}\n", style="bold red")
|
202
203
|
logger.error(err_msg)
|
204
|
+
|
205
|
+
def close_other_cmd_windows():
|
206
|
+
"""
|
207
|
+
Fecha outras janelas do cmd, deixando apenas a janela atual aberta.
|
208
|
+
"""
|
209
|
+
try:
|
210
|
+
current_pid = os.getpid()
|
211
|
+
for proc in psutil.process_iter(attrs=["pid", "name", "cmdline"]):
|
212
|
+
try:
|
213
|
+
if proc.info["name"] == "cmd.exe" and proc.info["pid"] != current_pid:
|
214
|
+
proc.terminate()
|
215
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
216
|
+
continue
|
217
|
+
|
218
|
+
except Exception as e:
|
219
|
+
err_msg = f"Erro ao fechar outras janelas do cmd: {e}"
|
220
|
+
console.print(f"\n{err_msg}\n", style="bold red")
|
221
|
+
logger.error(err_msg)
|
worker_automate_hub/worker.py
CHANGED
@@ -23,6 +23,7 @@ from worker_automate_hub.tasks.task_definitions import is_uuid_in_tasks
|
|
23
23
|
from worker_automate_hub.tasks.task_executor import perform_task
|
24
24
|
from worker_automate_hub.utils.logger import logger
|
25
25
|
from worker_automate_hub.utils.updater import (
|
26
|
+
close_other_cmd_windows,
|
26
27
|
get_installed_version,
|
27
28
|
update_version_in_toml,
|
28
29
|
)
|
@@ -78,6 +79,8 @@ def run_async_last_alive(stop_event: threading.Event):
|
|
78
79
|
|
79
80
|
|
80
81
|
def main_process(stop_event: threading.Event):
|
82
|
+
close_other_cmd_windows()
|
83
|
+
|
81
84
|
current_dir = Path.cwd()
|
82
85
|
toml_file_path = os.path.join(current_dir, "settings.toml")
|
83
86
|
atual_version = get_installed_version("worker-automate-hub")
|
@@ -48,7 +48,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=XkSEe6Y2S5Zf8Eq619d
|
|
48
48
|
worker_automate_hub/tasks/jobs/entrada_de_notas_500.py,sha256=ryl5AZ2617aROSVcS-N5wQIBlFQ1Bp0khUH9fP4DOzU,26542
|
49
49
|
worker_automate_hub/tasks/jobs/entrada_de_notas_505.py,sha256=jIml8gjXPdI6_x7S9VVV8IrKZRF7_PTNOMnhNmYMDTU,14490
|
50
50
|
worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py,sha256=8XP9G3n0PUeshbRWkWKOMnyUGRWspIolPZVqQTR3SMI,14184
|
51
|
-
worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=
|
51
|
+
worker_automate_hub/tasks/jobs/entrada_de_notas_9.py,sha256=q-jFf98aMh0RrMdV9iIY9I8QxUPaJlGpPe1ytEI3Uv8,43764
|
52
52
|
worker_automate_hub/tasks/jobs/exemplo_processo.py,sha256=3-zxbb-9YHPmSA_K1Qgxp_FwSqg2QDjGBRCLxDZ8QoQ,3451
|
53
53
|
worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py,sha256=Y-mKYcgX1kwcy_sOHvctn7clXnY3O3fohvOs7tKPMkM,9484
|
54
54
|
worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py,sha256=QBGm6eS5JghgNWNqZlk1g2a2iV8LnBLiOTBBL3Giet0,4181
|
@@ -63,11 +63,11 @@ worker_automate_hub/utils/env.py,sha256=TacQjGRO7PUNpttrhTAc5Gnegaiysl2Knsv1P8qf
|
|
63
63
|
worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1wiaMoJAGZeSy0D37sYdU,2212
|
64
64
|
worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
|
65
65
|
worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
|
66
|
-
worker_automate_hub/utils/updater.py,sha256=
|
66
|
+
worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
|
67
67
|
worker_automate_hub/utils/util.py,sha256=YCbgMMBwhp9LD6NUmE5S2K6S12TNEpGJm25FqfsIKPE,119544
|
68
68
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=GsvN7XMWAmCFHqC0YMZsjsb0myL-7ahuzHN4jPNn0zc,27623
|
69
|
-
worker_automate_hub/worker.py,sha256=
|
70
|
-
worker_automate_hub-0.4.
|
71
|
-
worker_automate_hub-0.4.
|
72
|
-
worker_automate_hub-0.4.
|
73
|
-
worker_automate_hub-0.4.
|
69
|
+
worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
|
70
|
+
worker_automate_hub-0.4.394.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
71
|
+
worker_automate_hub-0.4.394.dist-info/METADATA,sha256=qYSTJDhtF1a8FP-FtT7V5b2BmjfowOKjUpwt7a1rix0,2895
|
72
|
+
worker_automate_hub-0.4.394.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
73
|
+
worker_automate_hub-0.4.394.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.4.392.dist-info → worker_automate_hub-0.4.394.dist-info}/entry_points.txt
RENAMED
File without changes
|