worker-automate-hub 0.5.669__py3-none-any.whl → 0.5.671__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.

Potentially problematic release.


This version of worker-automate-hub might be problematic. Click here for more details.

@@ -51,7 +51,7 @@ async def click_importar_xml():
51
51
  raise Exception(f"Erro ao conectar a janela: {e}")
52
52
 
53
53
 
54
- async def importar_xml_conhecimento():
54
+ async def importar_xml_conhecimento(cfop: str):
55
55
 
56
56
  try:
57
57
  await worker_sleep(5)
@@ -64,7 +64,11 @@ async def importar_xml_conhecimento():
64
64
  aquisicao_servico = main_window.child_window(
65
65
  class_name="TDBIComboBox", found_index=1
66
66
  )
67
- aquisicao_servico.select("1353 - AQUISICAO DE SERVICO DE TRANSPORTE D/E")
67
+
68
+ if str(cfop).startswith("5"):
69
+ aquisicao_servico.select("1353 - AQUISICAO DE SERVICO DE TRANSPORTE D/E")
70
+ else:
71
+ aquisicao_servico.select("2353 - AQUISICAO DE SERVICO DE TRANSPORTE F/E")
68
72
 
69
73
  await worker_sleep(2)
70
74
 
@@ -429,7 +433,7 @@ async def importar_cte_xml(task: RpaProcessoEntradaDTO) -> RpaRetornoProcessoDTO
429
433
  await save_xml_to_downloads(cte["chaveCte"])
430
434
  await worker_sleep(5)
431
435
  await click_importar_xml()
432
- await importar_xml_conhecimento()
436
+ await importar_xml_conhecimento(cte["cfop"])
433
437
  await selecionar_xml(cte)
434
438
  await janela_conhecimento_frete(cte)
435
439
  await worker_sleep(8)
@@ -14,9 +14,14 @@ from pypdf import PdfReader
14
14
  from PIL import Image, ImageEnhance
15
15
  from pywinauto.keyboard import send_keys
16
16
  from pywinauto.mouse import double_click
17
+ from pyautogui import ImageNotFoundException
17
18
  import win32clipboard
18
19
  from pywinauto_recorder.player import set_combobox
19
20
  from rich.console import Console
21
+ import sys
22
+
23
+ # Adiciona a raiz do projeto no sys.path
24
+ # sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")))
20
25
  from worker_automate_hub.api.ahead_service import save_xml_to_downloads
21
26
  from worker_automate_hub.api.client import (
22
27
  get_config_by_name,
@@ -308,17 +313,27 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
308
313
 
309
314
  # Procura campo documento
310
315
  console.print("Navegando pela Janela de Nota Fiscal de Entrada...\n")
311
- document_type = await select_documento_type("NFe - NOTA FISCAL ELETRONICA PROPRIA - DANFE SERIE 077")
312
- if document_type.sucesso == True:
313
- console.log(document_type.retorno, style="bold green")
314
- else:
315
- retorno = f"{document_type.retorno} \nEtapas Executadas:\n{steps}"
316
- return RpaRetornoProcessoDTO(
317
- sucesso=False,
318
- retorno=retorno,
319
- status=RpaHistoricoStatusEnum.Falha,
320
- tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
316
+ app = Application().connect(class_name="TFrmNotaFiscalEntrada", timeout=10)
317
+ main_window = app["TFrmNotaFiscalEntrada"]
318
+ main_window.set_focus()
319
+ modelo_select = main_window.child_window(class_name="TDBIComboBox", found_index=1)
320
+ modelo_select.click()
321
+ try:
322
+ # Verifica mensagem danfe 077
323
+ imagem_alvo = "assets\\entrada_notas\\danfe077.png"
324
+ # imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\danfe077.png"
325
+
326
+ localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
327
+
328
+ if localizacao:
329
+ centro = pyautogui.center(localizacao)
330
+ pyautogui.click(centro)
331
+
332
+ except ImageNotFoundException:
333
+ console.print(
334
+ "Imagem não encontrada (exceção capturada). Tentando clicar no OK."
321
335
  )
336
+
322
337
 
323
338
  await worker_sleep(4)
324
339
 
@@ -367,7 +382,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
367
382
  itens = nota.get('itens', [])
368
383
  itens_arla = [item for item in itens if item['descricao'].lower() == 'arla']
369
384
 
370
-
371
385
  #SELECIONAO A NOP
372
386
  console.print("SELECIONANDO A NOP...\n")
373
387
  select_box_nop_select = main_window.child_window(class_name="TDBIComboBox", found_index=0)
@@ -398,7 +412,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
398
412
  else:
399
413
  if '1662' in item and (('c/fi' in item.lower() or 'c /fi' in item.lower())):
400
414
  nop_to_be_select = item
401
- break
415
+ break
402
416
 
403
417
 
404
418
  if nop_to_be_select != '':
@@ -797,8 +811,23 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
797
811
 
798
812
  console.print(f"Selecionando a Especie de Caixa... \n")
799
813
  tipo_cobranca.click()
800
- await worker_sleep(1)
801
- set_combobox("||List", "13 - DEVOLUCAO DE VENDA")
814
+
815
+ await worker_sleep(2)
816
+
817
+ try:
818
+ # Verifica mensagem sem lote pra integrar
819
+ imagem_alvo = "assets\\entrada_notas\\devolucao_venda.png"
820
+ # imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\devolucao_venda.png"
821
+ localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
822
+
823
+ if localizacao:
824
+ centro = pyautogui.center(localizacao)
825
+ pyautogui.click(centro)
826
+
827
+ except ImageNotFoundException:
828
+ console.print(
829
+ "Imagem não encontrada (exceção capturada). Tentando clicar no OK."
830
+ )
802
831
 
803
832
  await worker_sleep(2)
804
833
 
@@ -994,7 +1023,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
994
1023
  await worker_sleep(2)
995
1024
  pyautogui.press("enter")
996
1025
  await worker_sleep(5)
997
- console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso",style="bold green")
1026
+ console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso 1ª Etapa",style="bold green")
998
1027
  pesquisar_venda_devolucao = await is_window_open_by_class("TFrmGerenciadorNFe2", "TFrmGerenciadorNFe2")
999
1028
  if pesquisar_venda_devolucao["IsOpened"] == True:
1000
1029
  console.print(f"\n'Gerenciador de Notas Fiscais'aberta com sucesso",style="bold green")
@@ -1172,7 +1201,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1172
1201
  await worker_sleep(2)
1173
1202
  pyautogui.press("enter")
1174
1203
  await worker_sleep(5)
1175
- console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso",style="bold green")
1204
+ console.print(f"\nPesquisa: 'Gerenciador de Notas Fiscais' realizada com sucesso 2ª Etapa",style="bold green")
1176
1205
  pesquisar_venda_devolucao = await is_window_open_by_class("TFrmGerenciadorNFe2", "TFrmGerenciadorNFe2")
1177
1206
  if pesquisar_venda_devolucao["IsOpened"] == True:
1178
1207
  console.print(f"\n'Gerenciador de Notas Fiscais'aberta com sucesso",style="bold green")
@@ -1853,7 +1882,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1853
1882
  )
1854
1883
 
1855
1884
 
1856
- await worker_sleep(1)
1885
+ await worker_sleep(5)
1857
1886
  console.print("Natureza da operação selecionado com sucesso, preenchendo os itens...\n")
1858
1887
 
1859
1888
  #INSERINDO A QUANTIDADE
@@ -1864,24 +1893,24 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1864
1893
  field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=8)
1865
1894
  console.print("Inserindo a quantidade de Itens...\n")
1866
1895
  field_quantidade.click()
1867
- await worker_sleep(1)
1896
+ await worker_sleep(2)
1868
1897
  pyautogui.press('del')
1869
- await worker_sleep(1)
1898
+ await worker_sleep(2)
1870
1899
  pyautogui.press('backspace')
1871
- await worker_sleep(1)
1900
+ await worker_sleep(2)
1872
1901
  pyautogui.write(quantidade)
1873
1902
  #field_quantidade.set_edit_text(quantidade)
1874
- await worker_sleep(1)
1903
+ await worker_sleep(2)
1875
1904
  pyautogui.press('tab')
1876
1905
  await worker_sleep(2)
1877
1906
 
1878
1907
  #INSERINDO O VALOR INDIVIDUAL DO ITEM
1879
- console.print("Inserindo o valor indivual do Item...\n")
1908
+ console.print("Inserindo o valor indivual do Item... 1ª Etapa\n")
1880
1909
  btn_valor_unitario = panel_tabSheet.child_window(class_name="TDBIBitBtn", found_index=0)
1881
1910
  btn_valor_unitario.click()
1882
1911
  #Garantindo o click em valor individual "..."
1883
1912
  pyautogui.click(973, 658)
1884
- await worker_sleep(2)
1913
+ await worker_sleep(3)
1885
1914
 
1886
1915
  app = Application().connect(class_name="TFrmInputBoxNumero", timeout=60)
1887
1916
  main_window = app["TFrmInputBoxNumero"]
@@ -1899,7 +1928,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1899
1928
 
1900
1929
  main_window.set_focus()
1901
1930
  send_keys("%o")
1902
- await worker_sleep(2)
1931
+ await worker_sleep(3)
1903
1932
  console.print("Valor inserido com sucesso...\n")
1904
1933
 
1905
1934
  console.print("Fechando tela de incluir item pre venda...\n")
@@ -1907,7 +1936,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
1907
1936
  main_window = app["TFrmIncluiItemPreVenda"]
1908
1937
  main_window.set_focus()
1909
1938
  send_keys("%i")
1910
- await worker_sleep(2)
1939
+ await worker_sleep(3)
1911
1940
  #Divergencia de nop na capa e no item
1912
1941
  await find_nop_divergence()
1913
1942
  await worker_sleep(5)
@@ -2050,7 +2079,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
2050
2079
 
2051
2080
  #CONFIRMANDO NA TELA DE PRE VENDA
2052
2081
  try:
2053
- console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
2082
+ console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA 1ª Etapa... \n")
2054
2083
  app = Application().connect(class_name="TFrmPreVenda", timeout=10)
2055
2084
  main_window = app["Confirm"]
2056
2085
  main_window.set_focus()
@@ -2382,6 +2411,16 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
2382
2411
 
2383
2412
 
2384
2413
  console.print("Processo de ajustar aliquota realizado com sucesso, adicionando a mensagem... \n")
2414
+ try:
2415
+ information_pop_up = await is_window_open("Information")
2416
+ if information_pop_up["IsOpened"] == True:
2417
+ app = Application().connect(title="Information", timeout=10)
2418
+ main_window = app["Information"]
2419
+ main_window.set_focus()
2420
+ btn_ok = main_window.child_window(class_name="TButton", found_index=0)
2421
+ btn_ok.click()
2422
+ except:
2423
+ pass
2385
2424
  try:
2386
2425
  console.print("Conectando a janela de pre venda... \n")
2387
2426
  app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=60)
@@ -2462,7 +2501,21 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
2462
2501
  modelo_select = panel_Ttabsheet.child_window(class_name="TDBIComboBox", found_index=1)
2463
2502
  modelo_select.click()
2464
2503
  await worker_sleep(1)
2465
- set_combobox("||List", "NFe - NOTA FISCAL ELETRONICA PROPRIA - DANFE SERIE 077")
2504
+ try:
2505
+ # Verifica mensagem danfe 077
2506
+ imagem_alvo = "assets\\entrada_notas\\danfe077.png"
2507
+ # imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\danfe077.png"
2508
+
2509
+ localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
2510
+
2511
+ if localizacao:
2512
+ centro = pyautogui.center(localizacao)
2513
+ pyautogui.click(centro)
2514
+
2515
+ except ImageNotFoundException:
2516
+ console.print(
2517
+ "Imagem não encontrada (exceção capturada). Tentando clicar no OK."
2518
+ )
2466
2519
  await worker_sleep(3)
2467
2520
  console.print("Verificando se o tipo de nota foi selecionado corretamente \n")
2468
2521
  modelo_select = panel_Ttabsheet.child_window(class_name="TDBIComboBox", found_index=1)
@@ -3158,7 +3211,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
3158
3211
  await worker_sleep(2)
3159
3212
 
3160
3213
  #INSERINDO O VALOR INDIVIDUAL DO ITEM
3161
- console.print("Inserindo o valor indivual do Item...\n")
3214
+ console.print("Inserindo o valor indivual do Item... 2ª Etapa\n")
3162
3215
  btn_valor_unitario = panel_tabSheet.child_window(class_name="TDBIBitBtn", found_index=0)
3163
3216
  btn_valor_unitario.click()
3164
3217
  await worker_sleep(2)
@@ -3192,164 +3245,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
3192
3245
  await worker_sleep(5)
3193
3246
  main_window.close()
3194
3247
  await worker_sleep(5) #FIM DO LOOP ITENS NOTA CONJUNTA
3195
-
3196
- #FOR OUTROS ITENS NOTA
3197
- # for item in itens_nota:
3198
- # quantidade = item['quantidade']
3199
- # preco = item['valor_unitario']
3200
- # descricao = item['descricao']
3201
- # descricao = 'Diesel Comum' if descricao == 'Diesel S500' else descricao
3202
- # item_cod = item['codigo']
3203
- # #descricao = descricao.replace(".",",")
3204
-
3205
- # if 'arla' in descricao.lower():
3206
- # item_arla = True
3207
- # continue #continue para pular o item arla
3208
-
3209
- # console.print(quantidade, preco, descricao)
3210
-
3211
- # app = Application().connect(class_name="TFrmPreVenda", timeout=60)
3212
- # main_window = app["TFrmPreVenda"]
3213
- # main_window.set_focus()
3214
-
3215
- # console.print("Itens acessado com sucesso, clicando em Incluir...\n")
3216
- # panel_TGroup_Box= panel_TPage.child_window(class_name="TGroupBox", found_index=0)
3217
- # btn_incluir = panel_TGroup_Box.child_window(class_name="TDBIBitBtn", found_index=4)
3218
- # btn_incluir.click()
3219
- # await worker_sleep(5)
3220
- # console.print("Incluir clicado com sucesso...\n")
3221
-
3222
- # #VERIFICANDO A EXISTENCIA DE WARNINGS
3223
- # console.print("Verificando a existência de Warning... \n")
3224
- # warning_pop_up = await is_window_open("Warning")
3225
- # if warning_pop_up["IsOpened"] == True:
3226
- # console.print("possui Pop-up de Warning, analisando... \n")
3227
- # ocr_pop_warning = await ocr_warnings(numero_cupom_fiscal)
3228
- # if ocr_pop_warning.sucesso == True:
3229
- # return RpaRetornoProcessoDTO(
3230
- # sucesso=False,
3231
- # retorno=f"POP UP Warning não mapeado para seguimento do processo, mensagem: {ocr_pop_warning.retorno}",
3232
- # status=RpaHistoricoStatusEnum.Falha,
3233
- # tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
3234
- # )
3235
- # else:
3236
- # return RpaRetornoProcessoDTO(
3237
- # sucesso=False,
3238
- # retorno=f"POP UP Warning não mapeado para seguimento do processo",
3239
- # status=RpaHistoricoStatusEnum.Falha,
3240
- # tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
3241
- # )
3242
-
3243
- # app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
3244
- # main_window = app["TFrmIncluiItemPreVenda"]
3245
- # main_window.set_focus()
3246
- # panel_TGroup_Box= main_window.child_window(class_name="TPanel", found_index=2)
3247
- # almoxarificado_index = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=1)
3248
- # cod_almoxarificado = str(cod_empresa)+"50"
3249
- # almoxarificado_index.click()
3250
- # await worker_sleep(1)
3251
- # for _ in range(5):
3252
- # pyautogui.press("del")
3253
- # pyautogui.press("backspace")
3254
- # await worker_sleep(1)
3255
- # pyautogui.write(cod_almoxarificado)
3256
- # pyautogui.press('tab')
3257
- # await worker_sleep(3)
3258
-
3259
- # cod_item_index = panel_TGroup_Box.child_window(class_name="TDBIEditNumber", found_index=0)
3260
- # cod_item_index.click()
3261
- # await worker_sleep(1)
3262
-
3263
- # for _ in range(5):
3264
- # pyautogui.press("del")
3265
- # pyautogui.press("backspace")
3266
-
3267
- # await worker_sleep(1)
3268
- # pyautogui.write(str(item_cod))
3269
- # pyautogui.press('tab')
3270
- # await worker_sleep(3)
3271
-
3272
-
3273
- # natureza_oper_select = panel_TGroup_Box.child_window(class_name="TDBIComboBox", found_index=0)
3274
- # nop_selected = natureza_oper_select.window_text()
3275
- # nop_selected_value = nop_selected[:4]
3276
-
3277
- # itens_to_select = natureza_oper_select.texts()
3278
- # nop_to_be_select = ''
3279
-
3280
- # for item in itens_to_select:
3281
- # if nop_selected_value in item and (('c/' in item.lower() or 'c /' in item.lower()) and ('s/' in item.lower() or 's /' in item.lower())):
3282
- # nop_to_be_select = item
3283
- # break
3284
-
3285
- # natureza_oper_select.click()
3286
- # await worker_sleep(1)
3287
- # console.print(f"Descrição: {descricao}")
3288
- # if 'gasolina' in descricao.lower() or 'diesel' in descricao.lower() or 'gnv' in descricao.lower() or 'etanol' in descricao.lower():
3289
- # try:
3290
- # console.print("Selecionando NOP do item: '5667 - VENDA DE COMB OU LUBRI - SEM ESTOQ E COM FINANC'")
3291
- # natureza_oper_select.select("5667 - VENDA DE COMB OU LUBRI - SEM ESTOQ E COM FINANC")
3292
-
3293
- # except:
3294
- # console.print("Selecionando NOP: 5656 - VENDA DE COMB OU LUB ADQ DE TERCEIRO C/ FIN S/ ESTOQUE")
3295
- # natureza_oper_select.select("5656 - VENDA DE COMB OU LUB ADQ DE TERCEIRO C/ FIN S/ ESTOQUE")
3296
-
3297
- # elif 'arla' in descricao.lower():
3298
- # try:
3299
- # #PRECISA DO ESPAÇO NO FINAL!!!
3300
- # console.print("Selecionando NOP do item: '5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ ESTOQ C/ FINAN '")
3301
- # natureza_oper_select.select("5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ ESTOQ C/ FINAN ")
3302
-
3303
- # except:
3304
- # console.print("Selecionando NOP do item: '5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ESTOQ C/ FINAN FE'")
3305
- # natureza_oper_select.select("5102 - VENDA MERCAD. ADQ. DE TERCEIRO- 5.102 S/ESTOQ C/ FINAN FE")
3306
-
3307
- # else:
3308
- # if nop_to_be_select != '':
3309
- # console.print(f"Selecionando NOP do item: '{nop_to_be_select}'")
3310
- # natureza_oper_select.select(nop_to_be_select)
3311
- # # set_combobox("||List", nop_to_be_select)
3312
- # else:
3313
- # retorno = f"Não foi possivel encontrar a nop para o item, nop original {nop_selected} \nEtapas Executadas:\n{steps}"
3314
- # return RpaRetornoProcessoDTO(
3315
- # sucesso=False,
3316
- # retorno=retorno,
3317
- # status=RpaHistoricoStatusEnum.Falha,
3318
- # tags=[RpaTagDTO(descricao=RpaTagEnum.Negocio)]
3319
- # )
3320
-
3321
- # await worker_sleep(1)
3322
- # console.print("Natureza da operação selecionado com sucesso, preenchendo os itens...\n")
3323
-
3324
- # #INSERINDO A QUANTIDADE
3325
- # main_window.set_focus()
3326
- # panel_TPage_Control= main_window.child_window(class_name="TcxPageControl", found_index=0)
3327
- # panel_tabSheet = panel_TPage_Control.child_window(class_name="TcxTabSheet", found_index=0)
3328
-
3329
- # field_quantidade = panel_tabSheet.child_window(class_name="TDBIEditNumber", found_index=8)
3330
- # console.print("Inserindo a quantidade de Itens...\n")
3331
- # field_quantidade.click()
3332
- # await worker_sleep(1)
3333
- # pyautogui.press('del')
3334
- # await worker_sleep(1)
3335
- # pyautogui.press('backspace')
3336
- # await worker_sleep(1)
3337
- # pyautogui.write(quantidade)
3338
- # #field_quantidade.set_edit_text(quantidade)
3339
- # await worker_sleep(1)
3340
- # pyautogui.press('tab')
3341
- # await worker_sleep(2)
3342
-
3343
- # console.print("Verificando inclui itiem Pre Venda")
3344
- # app = Application().connect(class_name="TFrmIncluiItemPreVenda", timeout=60)
3345
- # main_window = app["TFrmIncluiItemPreVenda"]
3346
- # main_window.set_focus()
3347
- # send_keys("%i")
3348
- # await worker_sleep(2)
3349
- # #Divergencia de nop na capa e no item
3350
- # await find_nop_divergence()
3351
- # await worker_sleep(5)
3352
- # main_window.close()
3353
3248
 
3354
3249
  # Inclui registro
3355
3250
  console.print(f"Incluindo registro...\n")
@@ -3480,7 +3375,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
3480
3375
 
3481
3376
  #CONFIRMANDO NA TELA DE PRE VENDA
3482
3377
  try:
3483
- console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
3378
+ console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA 2ª Etapa... \n")
3484
3379
  app = Application().connect(class_name="TFrmPreVenda", timeout=10)
3485
3380
  main_window = app["Confirm"]
3486
3381
  main_window.set_focus()
@@ -3809,15 +3704,28 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
3809
3704
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
3810
3705
  )
3811
3706
 
3812
-
3707
+ await worker_sleep(5)
3708
+
3813
3709
  console.print("Processo de ajustar aliquota realizado com sucesso, adicionando a mensagem... \n")
3710
+ try:
3711
+ information_pop_up = await is_window_open("Information")
3712
+ if information_pop_up["IsOpened"] == True:
3713
+ app = Application().connect(title="Information", timeout=10)
3714
+ main_window = app["Information"]
3715
+ main_window.set_focus()
3716
+ await worker_sleep(2)
3717
+ btn_ok = main_window.child_window(class_name="TButton", found_index=0)
3718
+ btn_ok.click()
3719
+ except:
3720
+ pass
3814
3721
  try:
3815
3722
  console.print("Conectando a janela de pre venda... \n")
3816
- app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=60)
3723
+ app = Application().connect(class_name="TFrmDadosFaturamentoPreVenda", timeout=30)
3817
3724
  main_window = app["TFrmDadosFaturamentoPreVenda"]
3818
3725
  main_window.set_focus()
3819
- send_keys("%m")
3820
3726
  await worker_sleep(2)
3727
+ send_keys("%m")
3728
+ await worker_sleep(5)
3821
3729
 
3822
3730
  mensagem_tab = pyautogui.locateOnScreen(ASSETS_PATH + "\\notas_saida\\icon_mensagem.png", confidence=0.7)
3823
3731
  if mensagem_tab:
@@ -4064,7 +3972,7 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
4064
3972
 
4065
3973
  #CONFIRMANDO NA TELA DE PRE VENDA
4066
3974
  try:
4067
- console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA ... \n")
3975
+ console.print("CONFIRMANDO POP UP DE Deseja realmente confirmar esta PRÉ VENDA Etapa... \n")
4068
3976
  app = Application().connect(class_name="TFrmPreVenda", timeout=10)
4069
3977
  main_window = app["Confirm"]
4070
3978
  main_window.set_focus()
@@ -4445,9 +4353,6 @@ async def devolucao_prazo_a_faturar(task: RpaProcessoEntradaDTO) -> RpaRetornoPr
4445
4353
  status=RpaHistoricoStatusEnum.Falha,
4446
4354
  tags=[RpaTagDTO(descricao=RpaTagEnum.Tecnico)]
4447
4355
  )
4448
-
4449
-
4450
-
4451
4356
 
4452
4357
  console.print(f"\nNavegando entre os elementos do Rel Boletim Caixa ",style="bold green")
4453
4358
  try:
@@ -4528,22 +4528,24 @@ async def cadastro_pre_venda_header(
4528
4528
 
4529
4529
  if localizacao:
4530
4530
  centro = pyautogui.center(localizacao)
4531
+ await worker_sleep(1)
4531
4532
  pyautogui.click(centro)
4532
4533
 
4533
4534
  except ImageNotFoundException:
4534
4535
  console.print(
4535
4536
  "Imagem não encontrada (exceção capturada). Tentando clicar no OK."
4536
4537
  )
4537
-
4538
- else:
4538
+
4539
+ elif "21 dias" in cod_pagamento.lower():
4539
4540
  try:
4540
4541
  # Verifica mensagem sem lote pra integrar
4541
- imagem_alvo = "assets\\entrada_notas\\a_vista.png"
4542
-
4542
+ imagem_alvo = "assets\\entrada_notas\\21_dias.png"
4543
+ # imagem_alvo = r"C:\Users\automatehub\Documents\GitHub\worker-automate-hub\worker_automate_hub\assets\entrada_notas\21_dias.png"
4543
4544
  localizacao = pyautogui.locateOnScreen(imagem_alvo, confidence=0.9)
4544
4545
 
4545
4546
  if localizacao:
4546
4547
  centro = pyautogui.center(localizacao)
4548
+ await worker_sleep(1)
4547
4549
  pyautogui.click(centro)
4548
4550
 
4549
4551
  except ImageNotFoundException:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.669
3
+ Version: 0.5.671
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
@@ -40,11 +40,11 @@ worker_automate_hub/tasks/jobs/abertura_livros_fiscais.py,sha256=mX5GeaqwTa-bu61
40
40
  worker_automate_hub/tasks/jobs/coleta_dje_process.py,sha256=UkLWTC5Ub2qBb0yY-8IZ0DLLOVJOfNTq_z9krx_t25Q,29476
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
- worker_automate_hub/tasks/jobs/cte_xml.py,sha256=hvKWRF46Pcl_Mp-l2FjgXaqrQ5UgKVkTJMc3fEHXVeo,15398
43
+ worker_automate_hub/tasks/jobs/cte_xml.py,sha256=m4BkJDgp95Vr3oqEh6wXeeb31qzZhRF2Sw0h_wsoL_k,15565
44
44
  worker_automate_hub/tasks/jobs/descartes.py,sha256=E5kKef8j7e0PTm6NBeZAXkljUoAFEMjVWvHaJ8g2fv4,44451
45
45
  worker_automate_hub/tasks/jobs/devolucao_ctf.py,sha256=zQcRXZ9TxJhyL4jHjBTS-iW5BcmRoSPv9FsBLy0-eWQ,250793
46
46
  worker_automate_hub/tasks/jobs/devolucao_ctf_35.py,sha256=e9t5k2mtZcUcEGKPWysbWzsH_gqrK-6aBXjWe2jWfTg,253948
47
- worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=TYRFo6voeLtDn_mtbsmLOQ0_8MnoYSKI07b_HVeQhIU,278006
47
+ worker_automate_hub/tasks/jobs/devolucao_prazo_a_faturar.py,sha256=xDuTEtvTGwU6vHAb3wXzTjp23rxx7XpY9N1a8atyFuA,271308
48
48
  worker_automate_hub/tasks/jobs/ecac_estadual_go.py,sha256=dKkf22nH5gp3RErq5u0UzRsKyJ81fc6ZZ4vLtUuMwHA,21002
49
49
  worker_automate_hub/tasks/jobs/ecac_estadual_main.py,sha256=8WmKe4-MRtzHobXz2S4YBDNN8alfawkC-BBlRY-mn1g,1726
50
50
  worker_automate_hub/tasks/jobs/ecac_estadual_mt.py,sha256=C26zmpGQGUq6sP9lU9nanM3Fje-rkyx5tjwmRy4lyL8,25300
@@ -95,10 +95,10 @@ worker_automate_hub/utils/get_creds_gworkspace.py,sha256=ZJ0IIEjM4IXIV9rwfbOZ1V1
95
95
  worker_automate_hub/utils/logger.py,sha256=FYV9fg0_RAYJF_ZOCJEbqQAiCXlXk2gMpvUU1rzT_xs,671
96
96
  worker_automate_hub/utils/toast.py,sha256=xPHc5r5uOxB_cZlCzm13Kt2qSKLLFZALncU6Qg3Ft68,1162
97
97
  worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbVlwDl49Y,7972
98
- worker_automate_hub/utils/util.py,sha256=kXGtm91s6XJBtD7m_KyCrOxQ7mCeIBqEOnhbfYs3Vf8,206355
98
+ worker_automate_hub/utils/util.py,sha256=yCi3QVgNJS_kVdAvqKEcDFFnIhKTgaOcQPTkTJjEMtk,206633
99
99
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=L_z1Aps6BFWl-6_Ibm45vDid1S4kFDz5O78N2uO1Rq0,36458
100
100
  worker_automate_hub/worker.py,sha256=axdrr1xLTjWEyWfcyH3OCSpPTsyzck_fL_0u1DBLjvw,6525
101
- worker_automate_hub-0.5.669.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
102
- worker_automate_hub-0.5.669.dist-info/METADATA,sha256=K66D_5ZC8ibq8nfUHFxsXqQaQ8bZANGnGwEj8QYvjLo,3049
103
- worker_automate_hub-0.5.669.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
104
- worker_automate_hub-0.5.669.dist-info/RECORD,,
101
+ worker_automate_hub-0.5.671.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
102
+ worker_automate_hub-0.5.671.dist-info/METADATA,sha256=Pnwe864FBwEYDwCvs5RlH44R0AvX5JoM-S1UqG4pDHE,3049
103
+ worker_automate_hub-0.5.671.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
104
+ worker_automate_hub-0.5.671.dist-info/RECORD,,