worker-automate-hub 0.5.765__py3-none-any.whl → 0.5.766__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.
@@ -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
- cliente_field_position = await find_element_center(
156
- ASSETS_BASE_PATH + "field_cliente.png", (795, 354, 128, 50), 10
157
- )
158
- if cliente_field_position == None:
159
- cliente_field_position = (884, 384)
160
-
161
- pyautogui.click(cliente_field_position)
162
- pyautogui.hotkey("ctrl", "a")
163
- pyautogui.hotkey("del")
164
- pyautogui.write(task.configEntrada["filialEmpresaOrigem"])
165
- pyautogui.hotkey("tab")
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
- screenshot_path = take_screenshot()
277
- field_representante_position = find_target_position(
278
- screenshot_path, "Representante", 0, 50, attempts=15
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
- field_representante_position = await find_element_center(
283
- ASSETS_BASE_PATH + "field_representante.png", (679, 416, 214, 72), 15
284
- )
285
- if field_representante_position is not None:
286
- lista = list(field_representante_position)
287
- lista[0] += 50
288
- lista[1] += 1
289
- field_representante_position = tuple(lista)
290
-
291
- if field_representante_position is not None:
292
- pyautogui.doubleClick(field_representante_position)
293
- pyautogui.hotkey("ctrl", "a")
294
- pyautogui.hotkey("del")
295
- pyautogui.write("1")
296
- pyautogui.hotkey("tab")
297
- else:
298
- pyautogui.doubleClick(800, 457)
299
- pyautogui.hotkey("ctrl", "a")
300
- pyautogui.hotkey("del")
301
- pyautogui.write("1")
302
- pyautogui.hotkey("tab")
303
- # pyautogui.move(789, 523)
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
- # pyautogui.click(848, 527)
329
- pyautogui.click(model_descarte_position)
330
- pyautogui.click(1500, 800)
331
- pyautogui.write("B")
332
- pyautogui.hotkey("tab")
333
- else:
334
- log_msg = f"Campo Modelo na capa da nota não encontrado | Número da nota: {nota_fiscal} | Valor: {valor_nota}"
335
- await send_to_webhook(
336
- task.configEntrada["urlRetorno"],
337
- "ERRO",
338
- log_msg,
339
- task.configEntrada["uuidSimplifica"],
340
- nota_fiscal,
341
- valor_nota,
342
- True
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=log_msg, status=RpaHistoricoStatusEnum.Falha, tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
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, 317)
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
- 339,
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.765
3
+ Version: 0.5.766
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -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=23t3a3snfjx-tf4wVAF1m0PXDiqsfhHXCTPKG8sMM68,44608
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
@@ -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.765.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
105
- worker_automate_hub-0.5.765.dist-info/METADATA,sha256=k5ENS9MGMq8upe8_VTtCTidPE3Tygsf7De6o1ukopaU,3049
106
- worker_automate_hub-0.5.765.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
107
- worker_automate_hub-0.5.765.dist-info/RECORD,,
104
+ worker_automate_hub-0.5.766.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
105
+ worker_automate_hub-0.5.766.dist-info/METADATA,sha256=TipFnb5v_u8hAl3KtJB_n5aVPdy2B-pxA-KRIwtA1pA,3049
106
+ worker_automate_hub-0.5.766.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
107
+ worker_automate_hub-0.5.766.dist-info/RECORD,,