worker-automate-hub 0.5.765__py3-none-any.whl → 0.5.767__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/descartes.py +81 -67
- worker_automate_hub/tasks/jobs/entrada_de_notas_15.py +3 -46
- {worker_automate_hub-0.5.765.dist-info → worker_automate_hub-0.5.767.dist-info}/METADATA +1 -1
- {worker_automate_hub-0.5.765.dist-info → worker_automate_hub-0.5.767.dist-info}/RECORD +6 -6
- {worker_automate_hub-0.5.765.dist-info → worker_automate_hub-0.5.767.dist-info}/WHEEL +0 -0
- {worker_automate_hub-0.5.765.dist-info → worker_automate_hub-0.5.767.dist-info}/entry_points.txt +0 -0
@@ -18,6 +18,7 @@ from worker_automate_hub.models.dto.rpa_processo_entrada_dto import (
|
|
18
18
|
RpaProcessoEntradaDTO,
|
19
19
|
)
|
20
20
|
from worker_automate_hub.utils.logger import logger
|
21
|
+
from pywinauto.keyboard import send_keys
|
21
22
|
from worker_automate_hub.utils.toast import show_toast
|
22
23
|
from worker_automate_hub.utils.util import (
|
23
24
|
send_to_webhook,
|
@@ -151,18 +152,23 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
151
152
|
# await worker_sleep(1)
|
152
153
|
|
153
154
|
# Preenche o campo do cliente com o número da filial
|
154
|
-
console.print("Preenchendo o campo do cliente com o número da filial...\n")
|
155
|
-
|
156
|
-
|
157
|
-
)
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
155
|
+
console.print("Preenchendo o campo do cliente com o número da filial...\n")
|
156
|
+
campo = pre_venda.child_window(class_name="TDBIEditNumber", found_index=2)
|
157
|
+
campo.set_focus()
|
158
|
+
send_keys(task.configEntrada["filialEmpresaOrigem"])
|
159
|
+
send_keys("{TAB}")
|
160
|
+
|
161
|
+
# cliente_field_position = await find_element_center(
|
162
|
+
# ASSETS_BASE_PATH + "field_cliente.png", (795, 354, 128, 50), 10
|
163
|
+
# )
|
164
|
+
# if cliente_field_position == None:
|
165
|
+
# cliente_field_position = (884, 384)
|
166
|
+
|
167
|
+
# pyautogui.click(cliente_field_position)
|
168
|
+
# pyautogui.hotkey("ctrl", "a")
|
169
|
+
# pyautogui.hotkey("del")
|
170
|
+
# pyautogui.write(task.configEntrada["filialEmpresaOrigem"])
|
171
|
+
# pyautogui.hotkey("tab")
|
166
172
|
await worker_sleep(10)
|
167
173
|
|
168
174
|
try:
|
@@ -273,34 +279,38 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
273
279
|
|
274
280
|
# Define representante para "1"
|
275
281
|
console.print("Definindo representante para '1'\n")
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
)
|
282
|
+
campo_representate = pre_venda.child_window(class_name="TDBIEditCode", found_index=3)
|
283
|
+
campo_representate.set_focus()
|
284
|
+
send_keys("1")
|
285
|
+
send_keys("{TAB}")
|
286
|
+
# screenshot_path = take_screenshot()
|
287
|
+
# field_representante_position = find_target_position(
|
288
|
+
# screenshot_path, "Representante", 0, 50, attempts=15
|
289
|
+
# )
|
280
290
|
|
281
|
-
if field_representante_position == None:
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
if field_representante_position is not None:
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
else:
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
291
|
+
# if field_representante_position == None:
|
292
|
+
# field_representante_position = await find_element_center(
|
293
|
+
# ASSETS_BASE_PATH + "field_representante.png", (679, 416, 214, 72), 15
|
294
|
+
# )
|
295
|
+
# if field_representante_position is not None:
|
296
|
+
# lista = list(field_representante_position)
|
297
|
+
# lista[0] += 50
|
298
|
+
# lista[1] += 1
|
299
|
+
# field_representante_position = tuple(lista)
|
300
|
+
|
301
|
+
# if field_representante_position is not None:
|
302
|
+
# pyautogui.doubleClick(field_representante_position)
|
303
|
+
# pyautogui.hotkey("ctrl", "a")
|
304
|
+
# pyautogui.hotkey("del")
|
305
|
+
# pyautogui.write("1")
|
306
|
+
# pyautogui.hotkey("tab")
|
307
|
+
# else:
|
308
|
+
# pyautogui.doubleClick(800, 457)
|
309
|
+
# pyautogui.hotkey("ctrl", "a")
|
310
|
+
# pyautogui.hotkey("del")
|
311
|
+
# pyautogui.write("1")
|
312
|
+
# pyautogui.hotkey("tab")
|
313
|
+
# # pyautogui.move(789, 523)
|
304
314
|
await worker_sleep(5)
|
305
315
|
|
306
316
|
# Seleciona modelo de capa
|
@@ -322,29 +332,36 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
322
332
|
# model_descarte_position = tuple(lista)
|
323
333
|
|
324
334
|
# if model_descarte_position == None:
|
325
|
-
model_descarte_position = (848, 527)
|
326
|
-
|
327
|
-
if model_descarte_position is not None:
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
else:
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
335
|
+
# model_descarte_position = (848, 527)
|
336
|
+
|
337
|
+
# if model_descarte_position is not None:
|
338
|
+
# # pyautogui.click(848, 527)
|
339
|
+
# pyautogui.click(model_descarte_position)
|
340
|
+
# pyautogui.click(1500, 800)
|
341
|
+
# pyautogui.write("B")
|
342
|
+
# pyautogui.hotkey("tab")
|
343
|
+
# else:
|
344
|
+
# log_msg = f"Campo Modelo na capa da nota não encontrado | Número da nota: {nota_fiscal} | Valor: {valor_nota}"
|
345
|
+
# await send_to_webhook(
|
346
|
+
# task.configEntrada["urlRetorno"],
|
347
|
+
# "ERRO",
|
348
|
+
# log_msg,
|
349
|
+
# task.configEntrada["uuidSimplifica"],
|
350
|
+
# nota_fiscal,
|
351
|
+
# valor_nota,
|
352
|
+
# True
|
353
|
+
# )
|
354
|
+
# return RpaRetornoProcessoDTO(
|
355
|
+
# sucesso=False, retorno=log_msg, status=RpaHistoricoStatusEnum.Falha, tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
356
|
+
# )
|
357
|
+
try:
|
358
|
+
modelo = pre_venda.child_window(class_name="TDBIComboBox", found_index=0)
|
359
|
+
modelo.set_focus()
|
360
|
+
modelo.select("BAIXA DE EST. DECORRENTE DE PERDA, ROUBO OU DETERIORACAO")
|
361
|
+
except:
|
344
362
|
return RpaRetornoProcessoDTO(
|
345
|
-
sucesso=False, retorno=
|
363
|
+
sucesso=False, retorno="Modelo de capa não existe", status=RpaHistoricoStatusEnum.Falha, tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
346
364
|
)
|
347
|
-
|
348
365
|
# Abre Menu itens
|
349
366
|
console.print("Abrindo Menu Itens...\n")
|
350
367
|
menu_itens = await find_element_center(
|
@@ -352,7 +369,7 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
352
369
|
)
|
353
370
|
|
354
371
|
if menu_itens == None:
|
355
|
-
menu_itens = (570,
|
372
|
+
menu_itens = (570, 296)
|
356
373
|
|
357
374
|
if menu_itens is not None:
|
358
375
|
pyautogui.click(menu_itens)
|
@@ -380,10 +397,7 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
380
397
|
screenshot_path = take_screenshot()
|
381
398
|
# Clica no botão inclui para abrir a tela de item
|
382
399
|
console.print("Clicando em Incluir...\n")
|
383
|
-
button_incluir = (
|
384
|
-
905,
|
385
|
-
573,
|
386
|
-
) # find_target_position(screenshot_path, "Incluir", 0, 0, attempts=15)
|
400
|
+
button_incluir = (905,546,)
|
387
401
|
if button_incluir is not None:
|
388
402
|
pyautogui.click(button_incluir)
|
389
403
|
console.print("\nClicou em 'Incluir'", style="bold green")
|
@@ -401,6 +415,7 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
401
415
|
return RpaRetornoProcessoDTO(
|
402
416
|
sucesso=False, retorno=log_msg, status=RpaHistoricoStatusEnum.Falha, tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
|
403
417
|
)
|
418
|
+
|
404
419
|
await worker_sleep(3)
|
405
420
|
|
406
421
|
# Digita Almoxarifado
|
@@ -441,7 +456,7 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
441
456
|
console.print("Preenchendo o campo do item...\n")
|
442
457
|
field_item = (
|
443
458
|
841,
|
444
|
-
|
459
|
+
337,
|
445
460
|
) # find_target_position(screenshot_path, "Item", 0, 130, 15)
|
446
461
|
pyautogui.doubleClick(field_item)
|
447
462
|
pyautogui.hotkey("del")
|
@@ -932,7 +947,6 @@ async def descartes(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO:
|
|
932
947
|
pyautogui.click(875, 596)
|
933
948
|
else:
|
934
949
|
pyautogui.click(581, 747)
|
935
|
-
|
936
950
|
logger.info("\nNota Transmitida")
|
937
951
|
console.print("\nNota Transmitida", style="bold green")
|
938
952
|
|
@@ -511,7 +511,7 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
511
511
|
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
512
512
|
)
|
513
513
|
|
514
|
-
await worker_sleep(
|
514
|
+
await worker_sleep(5)
|
515
515
|
|
516
516
|
console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
|
517
517
|
app = Application().connect(class_name="TFrmNotaFiscalEntrada")
|
@@ -607,8 +607,8 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
607
607
|
)
|
608
608
|
await worker_sleep(5)
|
609
609
|
|
610
|
-
|
611
|
-
|
610
|
+
await emsys.verify_warning_and_error("Warning", "No")
|
611
|
+
await emsys.verify_warning_and_error("Warning", "&No")
|
612
612
|
|
613
613
|
try:
|
614
614
|
erro_pop_up = await is_window_open("Information")
|
@@ -681,49 +681,6 @@ async def entrada_de_notas_15(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso
|
|
681
681
|
except:
|
682
682
|
pass
|
683
683
|
|
684
|
-
await worker_sleep(20)
|
685
|
-
console.print("\nVerifica se a nota ja foi lançada...")
|
686
|
-
nf_chave_acesso = int(nota.get("nfe"))
|
687
|
-
status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
|
688
|
-
if status_nf_emsys.get("status") != "Lançada":
|
689
|
-
return RpaRetornoProcessoDTO(
|
690
|
-
sucesso=False,
|
691
|
-
retorno=f"Erro ao lançar nota",
|
692
|
-
status=RpaHistoricoStatusEnum.Falha,
|
693
|
-
)
|
694
|
-
else:
|
695
|
-
nf_imported = await check_nota_importada(nota.get("nfe"))
|
696
|
-
if nf_imported.sucesso == True:
|
697
|
-
await worker_sleep(12)
|
698
|
-
console.print("\nVerifica se a nota ja foi lançada...")
|
699
|
-
status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
|
700
|
-
if status_nf_emsys.get("status") == "Lançada":
|
701
|
-
console.print(
|
702
|
-
"\nNota lançada com sucesso, processo finalizado...",
|
703
|
-
style="bold green",
|
704
|
-
)
|
705
|
-
return RpaRetornoProcessoDTO(
|
706
|
-
sucesso=True,
|
707
|
-
retorno="Nota Lançada com sucesso!",
|
708
|
-
status=RpaHistoricoStatusEnum.Sucesso,
|
709
|
-
)
|
710
|
-
else:
|
711
|
-
console.print("Erro ao lançar nota", style="bold red")
|
712
|
-
return RpaRetornoProcessoDTO(
|
713
|
-
sucesso=False,
|
714
|
-
retorno=f"Pop-up nota incluida encontrada, porém nota encontrada como 'já lançada' trazendo as seguintes informações: {nf_imported.retorno} - {error_work}",
|
715
|
-
status=RpaHistoricoStatusEnum.Falha,
|
716
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)],
|
717
|
-
)
|
718
|
-
else:
|
719
|
-
console.print("Erro ao lançar nota", style="bold red")
|
720
|
-
return RpaRetornoProcessoDTO(
|
721
|
-
sucesso=False,
|
722
|
-
retorno=f"Erro ao lançar nota, erro: {nf_imported.retorno}",
|
723
|
-
status=RpaHistoricoStatusEnum.Falha,
|
724
|
-
tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)],
|
725
|
-
)
|
726
|
-
|
727
684
|
except Exception as ex:
|
728
685
|
observacao = f"Erro Processo Entrada de Notas: {str(ex)}"
|
729
686
|
logger.error(observacao)
|
@@ -41,7 +41,7 @@ worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ
|
|
41
41
|
worker_automate_hub/tasks/jobs/conexao_rdp.py,sha256=S6QC4xhuo0pB5FjaUJZNMm1LIgEjpjifReCTBDqxH-U,11719
|
42
42
|
worker_automate_hub/tasks/jobs/cte_manual.py,sha256=JucHpRMjMiy-QEJ0wtFnytLpN53tKXgCDI05nGLGclU,603
|
43
43
|
worker_automate_hub/tasks/jobs/cte_xml.py,sha256=m4BkJDgp95Vr3oqEh6wXeeb31qzZhRF2Sw0h_wsoL_k,15565
|
44
|
-
worker_automate_hub/tasks/jobs/descartes.py,sha256=
|
44
|
+
worker_automate_hub/tasks/jobs/descartes.py,sha256=CIL8RUj7AZ98lmK_HAilhxx4PsCd6oipj3EyL_8av_s,45465
|
45
45
|
worker_automate_hub/tasks/jobs/devolucao_ctf.py,sha256=7tdUihaDqjIf7POjM79EqKG0w-qqXbhC6jq6hteavkw,250822
|
46
46
|
worker_automate_hub/tasks/jobs/devolucao_ctf_35.py,sha256=e9t5k2mtZcUcEGKPWysbWzsH_gqrK-6aBXjWe2jWfTg,253948
|
47
47
|
worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=kzPJazDRbz2CLn8tKja2Lg1N4UzTRF1V4Nc1elIqTGY,272145
|
@@ -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=DZ06Kbiu4Cg0LeHNIUeXtVqrWmCeXvuL4YuL3vo32EM,28703
|
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
|
@@ -101,7 +101,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
|
|
101
101
|
worker_automate_hub/utils/util.py,sha256=V2WtWoETdTrAtGA8UgeqAAVphUj9KkGSZFzYsHJFATA,210055
|
102
102
|
worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
|
103
103
|
worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
|
104
|
-
worker_automate_hub-0.5.
|
105
|
-
worker_automate_hub-0.5.
|
106
|
-
worker_automate_hub-0.5.
|
107
|
-
worker_automate_hub-0.5.
|
104
|
+
worker_automate_hub-0.5.767.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
|
105
|
+
worker_automate_hub-0.5.767.dist-info/METADATA,sha256=MzVzuPHKjjyIzRxCiFiaUHDobNlSmO9J1ytv1tdk3EY,3049
|
106
|
+
worker_automate_hub-0.5.767.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
107
|
+
worker_automate_hub-0.5.767.dist-info/RECORD,,
|
File without changes
|
{worker_automate_hub-0.5.765.dist-info → worker_automate_hub-0.5.767.dist-info}/entry_points.txt
RENAMED
File without changes
|