worker-automate-hub 0.4.445__tar.gz → 0.4.446__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/PKG-INFO +1 -1
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/pyproject.toml +1 -1
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_7139.py +34 -14
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/util.py +103 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/README.md +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/ahead_service.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/client.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/helpers/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/helpers/api_helpers.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/rpa_fila_service.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/rpa_historico_service.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/cli.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/config/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/config/settings.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/config.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/core/so_manipulation.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/deprecation.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/rate_limit.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/repeat.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/retry.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/singleton.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/timeit.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dao/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dao/rpa_configuracao.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dao/rpa_historico.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dao/rpa_processo.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dto/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dto/rpa_historico_request_dto.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dto/rpa_processo_entrada_dto.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dto/rpa_processo_rdp_dto.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/models/dto/rpa_sistema_dto.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/coleta_dje_process.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/conexao_rdp.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/descartes.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_estadual_go.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_estadual_main.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_estadual_mt.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_estadual_sc.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_estadual_sp.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/ecac_federal.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_16.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_207.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_32.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_33.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_34.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_36.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_39.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_500.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_505.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/entrada_de_notas_9.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/exemplo_processo.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/fidc_gerar_nosso_numero.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/fidc_remessa_cobranca_cnab240.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/login_emsys.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/playground.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/sped_fiscal.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/jobs/transferencias.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/task_definitions.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/tasks/task_executor.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/__init__.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/env.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/get_creds_gworkspace.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/logger.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/toast.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/updater.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/utils_nfe_entrada.py +0 -0
- {worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/worker.py +0 -0
@@ -39,6 +39,7 @@ from worker_automate_hub.utils.util import (
|
|
39
39
|
worker_sleep,
|
40
40
|
check_nota_importada,
|
41
41
|
carregamento_import_xml,
|
42
|
+
errors_generate_after_import,
|
42
43
|
)
|
43
44
|
|
44
45
|
pyautogui.PAUSE = 0.5
|
@@ -276,23 +277,41 @@ async def entrada_de_notas_7139(task: RpaProcessoEntradaDTO) -> RpaRetornoProces
|
|
276
277
|
status=RpaHistoricoStatusEnum.Falha,
|
277
278
|
)
|
278
279
|
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
280
|
+
try:
|
281
|
+
console.print(
|
282
|
+
"Verificando a existencia de POP-UP de Itens não localizados ou NCM ...\n"
|
283
|
+
)
|
284
|
+
itens_by_supplier = await is_window_open_by_class("TFrmAguarde", "TMessageForm")
|
285
|
+
if itens_by_supplier["IsOpened"] == True:
|
286
|
+
itens_by_supplier_work = await itens_not_found_supplier(nota.get("nfe"))
|
287
|
+
if itens_by_supplier_work.get("window") == "NCM":
|
288
|
+
console.log(itens_by_supplier_work.get("retorno"), style="bold green")
|
289
|
+
else:
|
290
|
+
return RpaRetornoProcessoDTO(
|
291
|
+
sucesso=False,
|
292
|
+
retorno=itens_by_supplier_work.get("retorno"),
|
293
|
+
status=RpaHistoricoStatusEnum.Falha,
|
294
|
+
)
|
295
|
+
except Exception as error:
|
296
|
+
return RpaRetornoProcessoDTO(
|
297
|
+
sucesso=False,
|
298
|
+
retorno=f"Falha ao verificar a existência de POP-UP de itens não localizados: {error}",
|
299
|
+
status=RpaHistoricoStatusEnum.Falha,
|
300
|
+
)
|
301
|
+
|
302
|
+
|
303
|
+
logs_erro = await is_window_open_by_class("TFrmExibeLogErroImportacaoNfe","TFrmExibeLogErroImportacaoNfe")
|
304
|
+
if logs_erro["IsOpened"] == True:
|
305
|
+
errors_genetared = await errors_generate_after_import(nota.get("nfe"))
|
306
|
+
return RpaRetornoProcessoDTO(
|
307
|
+
sucesso=False,
|
308
|
+
retorno=errors_genetared.retorno,
|
309
|
+
status=RpaHistoricoStatusEnum.Falha,
|
310
|
+
)
|
293
311
|
|
294
312
|
await worker_sleep(6)
|
295
313
|
|
314
|
+
|
296
315
|
max_attempts = 7
|
297
316
|
i = 0
|
298
317
|
while i < max_attempts:
|
@@ -334,6 +353,7 @@ async def entrada_de_notas_7139(task: RpaProcessoEntradaDTO) -> RpaRetornoProces
|
|
334
353
|
f"Não foi possivel incluir o registro utilizando reconhecimento de imagem, Error: {e}...\n tentando inserir via posição...\n"
|
335
354
|
)
|
336
355
|
await incluir_registro()
|
356
|
+
|
337
357
|
|
338
358
|
await worker_sleep(6)
|
339
359
|
nf_imported = await check_nota_importada(nota.get("nfe"))
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/util.py
RENAMED
@@ -2188,6 +2188,7 @@ async def select_documento_type(document_type: str) -> RpaRetornoProcessoDTO:
|
|
2188
2188
|
main_window = app["TFrmNotaFiscalEntrada"]
|
2189
2189
|
|
2190
2190
|
main_window.set_focus()
|
2191
|
+
await worker_sleep(3)
|
2191
2192
|
|
2192
2193
|
console.print(
|
2193
2194
|
"Controles encontrados na janela 'Nota Fiscal de Entrada, navegando entre eles...\n"
|
@@ -3196,4 +3197,106 @@ async def kill_all_emsys():
|
|
3196
3197
|
sucesso=False,
|
3197
3198
|
retorno=f"Erro ao fechar o emsys, erro{e}",
|
3198
3199
|
status=RpaHistoricoStatusEnum.Falha,
|
3200
|
+
)
|
3201
|
+
|
3202
|
+
|
3203
|
+
async def errors_generate_after_import(xml_nota: str) -> RpaRetornoProcessoDTO:
|
3204
|
+
try:
|
3205
|
+
app = Application().connect(class_name="TFrmExibeLogErroImportacaoNfe")
|
3206
|
+
main_window = app["TFrmExibeLogErroImportacaoNfe"]
|
3207
|
+
console.print("Tela com itens com erro existe, salvando os itens...\n")
|
3208
|
+
|
3209
|
+
btn_save = main_window.child_window(
|
3210
|
+
title="Salvar", class_name="TBitBtn"
|
3211
|
+
)
|
3212
|
+
|
3213
|
+
if btn_save.exists():
|
3214
|
+
max_attempts = 3
|
3215
|
+
i = 0
|
3216
|
+
while i < max_attempts:
|
3217
|
+
console.print("Clicando no botão de salvar...\n")
|
3218
|
+
try:
|
3219
|
+
btn_save.click()
|
3220
|
+
except:
|
3221
|
+
console.print("Não foi possivel clicar no Botão OK... \n")
|
3222
|
+
|
3223
|
+
await worker_sleep(3)
|
3224
|
+
|
3225
|
+
console.print(
|
3226
|
+
"Verificando a existencia da tela para informar o caminho do arquivo...\n"
|
3227
|
+
)
|
3228
|
+
|
3229
|
+
try:
|
3230
|
+
app = Application().connect(title="Salvar")
|
3231
|
+
main_window = app["Salvar"]
|
3232
|
+
console.print(
|
3233
|
+
"Tela para informar o caminho do arquivo existe"
|
3234
|
+
)
|
3235
|
+
break
|
3236
|
+
except Exception as e:
|
3237
|
+
console.print(
|
3238
|
+
f"Tela para informar o caminho do arquivo não encontrada. Tentativa {i + 1}/{max_attempts}."
|
3239
|
+
)
|
3240
|
+
|
3241
|
+
i += 1
|
3242
|
+
|
3243
|
+
if i == max_attempts:
|
3244
|
+
raise Exception(
|
3245
|
+
"Número máximo de tentativas atingido. Tela para informar o caminho do arquivo existe."
|
3246
|
+
)
|
3247
|
+
|
3248
|
+
await worker_sleep(4)
|
3249
|
+
console.print(
|
3250
|
+
"Interagindo com a tela para informar o caminho do arquivo...\n"
|
3251
|
+
)
|
3252
|
+
app = Application().connect(title="Salvar")
|
3253
|
+
main_window = app["Salvar"]
|
3254
|
+
console.print(
|
3255
|
+
"Tela para informar o caminho do arquivo existe, inserindo o diretorio...\n"
|
3256
|
+
)
|
3257
|
+
await worker_sleep(2)
|
3258
|
+
main_window.type_keys("%n")
|
3259
|
+
username = getpass.getuser()
|
3260
|
+
path_to_txt = (
|
3261
|
+
f"C:\\Users\\{username}\\Downloads\\erro_itens{xml_nota}.txt"
|
3262
|
+
)
|
3263
|
+
pyautogui.write(path_to_txt)
|
3264
|
+
await worker_sleep(1)
|
3265
|
+
main_window.type_keys("%l")
|
3266
|
+
console.print(f"Arquivo salvo com sucesso... \n")
|
3267
|
+
|
3268
|
+
conteudo = ""
|
3269
|
+
await worker_sleep(3)
|
3270
|
+
with open(
|
3271
|
+
path_to_txt, "r", encoding="latin1", errors="replace"
|
3272
|
+
) as arquivo:
|
3273
|
+
conteudo = arquivo.read()
|
3274
|
+
console.print(
|
3275
|
+
f"Arquivo salvo com sucesso, itens com erro {conteudo}...\n"
|
3276
|
+
)
|
3277
|
+
|
3278
|
+
os.remove(path_to_txt)
|
3279
|
+
console.print(
|
3280
|
+
f"Removendo o arquivo e enviando os itens para o backoffice... \n"
|
3281
|
+
)
|
3282
|
+
console.print(
|
3283
|
+
f"Itens nao localizados para o fornecedor salvo e retornando como falha no backoffice para correção...\n"
|
3284
|
+
)
|
3285
|
+
return RpaRetornoProcessoDTO(
|
3286
|
+
sucesso=True,
|
3287
|
+
retorno=f"Itens nao localizados para o fornecedor, Mensagem: {conteudo}",
|
3288
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
3289
|
+
)
|
3290
|
+
else:
|
3291
|
+
console.print(f"Botao Salvar - Não foi encontrado...\n")
|
3292
|
+
return RpaRetornoProcessoDTO(
|
3293
|
+
sucesso=False,
|
3294
|
+
retorno=f"Erro ao processar - Tela de Erros gerados na importação do NF-e - Botao Salvar - Não foi encontrado",
|
3295
|
+
status=RpaHistoricoStatusEnum.Sucesso,
|
3296
|
+
)
|
3297
|
+
except Exception as e:
|
3298
|
+
return RpaRetornoProcessoDTO(
|
3299
|
+
sucesso=False,
|
3300
|
+
retorno=f"Erro ao processar - Tela de Erros gerados na importação do NF-e, {e}",
|
3301
|
+
status=RpaHistoricoStatusEnum.Falha,
|
3199
3302
|
)
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/ahead_service.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/api/client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/config/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/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.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/repeat.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/retry.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/decorators/timeit.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/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
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/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
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/__init__.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/env.py
RENAMED
File without changes
|
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/logger.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/toast.py
RENAMED
File without changes
|
{worker_automate_hub-0.4.445 → worker_automate_hub-0.4.446}/worker_automate_hub/utils/updater.py
RENAMED
File without changes
|
File without changes
|
File without changes
|