worker-automate-hub 0.4.410__py3-none-any.whl → 0.4.411__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/entrada_de_notas_39.py +31 -116
 - {worker_automate_hub-0.4.410.dist-info → worker_automate_hub-0.4.411.dist-info}/METADATA +1 -1
 - {worker_automate_hub-0.4.410.dist-info → worker_automate_hub-0.4.411.dist-info}/RECORD +5 -5
 - {worker_automate_hub-0.4.410.dist-info → worker_automate_hub-0.4.411.dist-info}/WHEEL +0 -0
 - {worker_automate_hub-0.4.410.dist-info → worker_automate_hub-0.4.411.dist-info}/entry_points.txt +0 -0
 
| 
         @@ -640,20 +640,20 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso 
     | 
|
| 
       640 
640 
     | 
    
         
             
                        main_window.set_focus()
         
     | 
| 
       641 
641 
     | 
    
         | 
| 
       642 
642 
     | 
    
         
             
                        select_box_nop_select = main_window.child_window(class_name="TDBIComboBox", found_index=0)
         
     | 
| 
       643 
     | 
    
         
            -
                         
     | 
| 
      
 643 
     | 
    
         
            +
                        select_box_nop_select.click()
         
     | 
| 
      
 644 
     | 
    
         
            +
                        nop_value = "1152 - ENTRADAS P/ TRANSFERENCIAS DE MERCADORIA- 1.152"
         
     | 
| 
      
 645 
     | 
    
         
            +
                        await worker_sleep(2)
         
     | 
| 
      
 646 
     | 
    
         
            +
                        set_combobox("||List", nop_value)
         
     | 
| 
      
 647 
     | 
    
         
            +
                        await worker_sleep(1)
         
     | 
| 
      
 648 
     | 
    
         
            +
                        pyautogui.press('down')
         
     | 
| 
       644 
649 
     | 
    
         | 
| 
      
 650 
     | 
    
         
            +
                        nop_selected = select_box_nop_select.window_text()
         
     | 
| 
       645 
651 
     | 
    
         
             
                        if '1152' in nop_selected:
         
     | 
| 
       646 
652 
     | 
    
         
             
                            console.print(f"NOP selecionada corretamente, {nop_selected} ...\n")
         
     | 
| 
       647 
653 
     | 
    
         
             
                        else:
         
     | 
| 
       648 
     | 
    
         
            -
                             
     | 
| 
       649 
     | 
    
         
            -
                                select_box_nop_select.click()                
         
     | 
| 
       650 
     | 
    
         
            -
                            except:
         
     | 
| 
       651 
     | 
    
         
            -
                                pyautogui.click(618, 330)
         
     | 
| 
       652 
     | 
    
         
            -
             
     | 
| 
       653 
     | 
    
         
            -
                            await worker_sleep(2)
         
     | 
| 
       654 
     | 
    
         
            -
                            nop_value = "1152 - ENTRADAS P/ TRANSFERENCIAS DE MERCADORIA- 1.152"
         
     | 
| 
      
 654 
     | 
    
         
            +
                            select_box_nop_select.click()
         
     | 
| 
       655 
655 
     | 
    
         
             
                            console.print(f"Inserindo a informação da NOP: {nop_value} ...\n")
         
     | 
| 
       656 
     | 
    
         
            -
                            await worker_sleep( 
     | 
| 
      
 656 
     | 
    
         
            +
                            await worker_sleep(2)
         
     | 
| 
       657 
657 
     | 
    
         
             
                            set_combobox("||List", nop_value)
         
     | 
| 
       658 
658 
     | 
    
         
             
                            await worker_sleep(2)
         
     | 
| 
       659 
659 
     | 
    
         
             
                            pyautogui.hotkey("enter")
         
     | 
| 
         @@ -668,37 +668,14 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso 
     | 
|
| 
       668 
668 
     | 
    
         
             
                            else:
         
     | 
| 
       669 
669 
     | 
    
         
             
                                return RpaRetornoProcessoDTO(
         
     | 
| 
       670 
670 
     | 
    
         
             
                                    sucesso=False,
         
     | 
| 
       671 
     | 
    
         
            -
                                    retorno=f"Erro  
     | 
| 
      
 671 
     | 
    
         
            +
                                    retorno=f"Erro não foi possivel selecionar NOP correta, NOP selecionada: {nop_selected}",
         
     | 
| 
       672 
672 
     | 
    
         
             
                                    status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       673 
673 
     | 
    
         
             
                                )
         
     | 
| 
       674 
     | 
    
         
            -
             
     | 
| 
       675 
     | 
    
         
            -
                         
     | 
| 
      
 674 
     | 
    
         
            +
                        console.print(f"Clicando para incluir a nota...\n")
         
     | 
| 
      
 675 
     | 
    
         
            +
                        pyautogui.click(593, 297)
         
     | 
| 
      
 676 
     | 
    
         
            +
                        await worker_sleep(40)
         
     | 
| 
       676 
677 
     | 
    
         
             
                        await emsys.verify_warning_and_error("Aviso", "OK")
         
     | 
| 
       677 
     | 
    
         
            -
                         
     | 
| 
       678 
     | 
    
         
            -
                        retorno = await verify_nf_incuded()
         
     | 
| 
       679 
     | 
    
         
            -
                        await worker_sleep(60)
         
     | 
| 
       680 
     | 
    
         
            -
             
     | 
| 
       681 
     | 
    
         
            -
                        console.print("\nVerifica se a nota ja foi lançada...")
         
     | 
| 
       682 
     | 
    
         
            -
                        nf_chave_acesso = int(nota.get("nfe"))
         
     | 
| 
       683 
     | 
    
         
            -
                        status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
         
     | 
| 
       684 
     | 
    
         
            -
                        if status_nf_emsys.get("status") != "Lançada":
         
     | 
| 
       685 
     | 
    
         
            -
                            return RpaRetornoProcessoDTO(
         
     | 
| 
       686 
     | 
    
         
            -
                                sucesso=False,
         
     | 
| 
       687 
     | 
    
         
            -
                                retorno=f"Erro na validação de CFOP, foi encontrado mais de uma opção com a mesma informação",
         
     | 
| 
       688 
     | 
    
         
            -
                                status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       689 
     | 
    
         
            -
                            )
         
     | 
| 
       690 
     | 
    
         
            -
                        
         
     | 
| 
       691 
     | 
    
         
            -
                    except Exception as e:
         
     | 
| 
       692 
     | 
    
         
            -
                        return RpaRetornoProcessoDTO(
         
     | 
| 
       693 
     | 
    
         
            -
                                sucesso=False,
         
     | 
| 
       694 
     | 
    
         
            -
                                retorno=f"Erro ao alterar o NOP, erro {e}",
         
     | 
| 
       695 
     | 
    
         
            -
                                status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       696 
     | 
    
         
            -
                                )
         
     | 
| 
       697 
     | 
    
         
            -
             
     | 
| 
       698 
     | 
    
         
            -
                    await worker_sleep(3)
         
     | 
| 
       699 
     | 
    
         
            -
                    retorno = False
         
     | 
| 
       700 
     | 
    
         
            -
                    try:
         
     | 
| 
       701 
     | 
    
         
            -
                        max_attempts = 60
         
     | 
| 
      
 678 
     | 
    
         
            +
                        max_attempts = 50
         
     | 
| 
       702 
679 
     | 
    
         
             
                        i = 0
         
     | 
| 
       703 
680 
     | 
    
         | 
| 
       704 
681 
     | 
    
         
             
                        while i < max_attempts:
         
     | 
| 
         @@ -709,92 +686,30 @@ async def entrada_de_notas_39(task: RpaProcessoEntradaDTO) -> RpaRetornoProcesso 
     | 
|
| 
       709 
686 
     | 
    
         
             
                                console.print(f"Aguardando confirmação de nota incluida...\n")
         
     | 
| 
       710 
687 
     | 
    
         
             
                                await worker_sleep(4)
         
     | 
| 
       711 
688 
     | 
    
         
             
                                i += 1
         
     | 
| 
       712 
     | 
    
         
            -
             
     | 
| 
       713 
     | 
    
         
            -
                         
     | 
| 
       714 
     | 
    
         
            -
             
     | 
| 
       715 
     | 
    
         
            -
                         
     | 
| 
       716 
     | 
    
         
            -
             
     | 
| 
       717 
     | 
    
         
            -
             
     | 
| 
       718 
     | 
    
         
            -
             
     | 
| 
       719 
     | 
    
         
            -
             
     | 
| 
       720 
     | 
    
         
            -
             
     | 
| 
       721 
     | 
    
         
            -
             
     | 
| 
       722 
     | 
    
         
            -
                            console.print(f"Tirando print da janela do Information para realização do OCR...\n")
         
     | 
| 
       723 
     | 
    
         
            -
             
     | 
| 
       724 
     | 
    
         
            -
                            window_rect = main_window.rectangle()
         
     | 
| 
       725 
     | 
    
         
            -
                            screenshot = pyautogui.screenshot(
         
     | 
| 
       726 
     | 
    
         
            -
                                region=(
         
     | 
| 
       727 
     | 
    
         
            -
                                    window_rect.left,
         
     | 
| 
       728 
     | 
    
         
            -
                                    window_rect.top,
         
     | 
| 
       729 
     | 
    
         
            -
                                    window_rect.width(),
         
     | 
| 
       730 
     | 
    
         
            -
                                    window_rect.height(),
         
     | 
| 
       731 
     | 
    
         
            -
                                )
         
     | 
| 
       732 
     | 
    
         
            -
                            )
         
     | 
| 
       733 
     | 
    
         
            -
                            username = getpass.getuser()
         
     | 
| 
       734 
     | 
    
         
            -
                            path_to_png = f"C:\\Users\\{username}\\Downloads\\information_popup_{nota.get("nfe")}.png"
         
     | 
| 
       735 
     | 
    
         
            -
                            screenshot.save(path_to_png)
         
     | 
| 
       736 
     | 
    
         
            -
                            console.print(f"Print salvo em {path_to_png}...\n")
         
     | 
| 
       737 
     | 
    
         
            -
             
     | 
| 
       738 
     | 
    
         
            -
                            console.print(
         
     | 
| 
       739 
     | 
    
         
            -
                                f"Preparando a imagem para maior resolução e assertividade no OCR...\n"
         
     | 
| 
       740 
     | 
    
         
            -
                            )
         
     | 
| 
       741 
     | 
    
         
            -
                            image = Image.open(path_to_png)
         
     | 
| 
       742 
     | 
    
         
            -
                            image = image.convert("L")
         
     | 
| 
       743 
     | 
    
         
            -
                            enhancer = ImageEnhance.Contrast(image)
         
     | 
| 
       744 
     | 
    
         
            -
                            image = enhancer.enhance(2.0)
         
     | 
| 
       745 
     | 
    
         
            -
                            image.save(path_to_png)
         
     | 
| 
       746 
     | 
    
         
            -
                            console.print(f"Imagem preparada com sucesso...\n")
         
     | 
| 
       747 
     | 
    
         
            -
                            console.print(f"Realizando OCR...\n")
         
     | 
| 
       748 
     | 
    
         
            -
                            captured_text = pytesseract.image_to_string(Image.open(path_to_png))
         
     | 
| 
       749 
     | 
    
         
            -
                            console.print(
         
     | 
| 
       750 
     | 
    
         
            -
                                f"Texto Full capturado {captured_text}...\n"
         
     | 
| 
      
 689 
     | 
    
         
            +
                        
         
     | 
| 
      
 690 
     | 
    
         
            +
                        await worker_sleep(15)
         
     | 
| 
      
 691 
     | 
    
         
            +
                        console.print("\nVerifica se a nota ja foi lançada...")
         
     | 
| 
      
 692 
     | 
    
         
            +
                        nf_chave_acesso = int(nota.get("nfe"))
         
     | 
| 
      
 693 
     | 
    
         
            +
                        status_nf_emsys = await get_status_nf_emsys(nf_chave_acesso)
         
     | 
| 
      
 694 
     | 
    
         
            +
                        if status_nf_emsys.get("status") != "Lançada":
         
     | 
| 
      
 695 
     | 
    
         
            +
                            return RpaRetornoProcessoDTO(
         
     | 
| 
      
 696 
     | 
    
         
            +
                                sucesso=False,
         
     | 
| 
      
 697 
     | 
    
         
            +
                                retorno=f"Erro na validação de CFOP, foi encontrado mais de uma opção com a mesma informação",
         
     | 
| 
      
 698 
     | 
    
         
            +
                                status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       751 
699 
     | 
    
         
             
                            )
         
     | 
| 
       752 
     | 
    
         
            -
                            os.remove(path_to_png)
         
     | 
| 
       753 
     | 
    
         
            -
                            if 'nota fiscal inc' in captured_text.lower():
         
     | 
| 
       754 
     | 
    
         
            -
                                console.print(f"Tentando clicar no Botão OK...\n")
         
     | 
| 
       755 
     | 
    
         
            -
                                btn_ok = main_window.child_window(class_name="TButton")
         
     | 
| 
       756 
     | 
    
         
            -
             
     | 
| 
       757 
     | 
    
         
            -
                                if btn_ok.exists():
         
     | 
| 
       758 
     | 
    
         
            -
                                    btn_ok.click()
         
     | 
| 
       759 
     | 
    
         
            -
                                    retorno = True
         
     | 
| 
       760 
     | 
    
         
            -
                            else:
         
     | 
| 
       761 
     | 
    
         
            -
                                return RpaRetornoProcessoDTO(
         
     | 
| 
       762 
     | 
    
         
            -
                                    sucesso=False,
         
     | 
| 
       763 
     | 
    
         
            -
                                    retorno=f"Pop_up Informantion não mapeado para andamento do robô, mensagem {captured_text}",
         
     | 
| 
       764 
     | 
    
         
            -
                                    status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       765 
     | 
    
         
            -
                                )
         
     | 
| 
       766 
700 
     | 
    
         
             
                        else:
         
     | 
| 
       767 
     | 
    
         
            -
                             
     | 
| 
       768 
     | 
    
         
            -
                            print("romero brito?")
         
     | 
| 
       769 
     | 
    
         
            -
                            retorno = await verify_nf_incuded()
         
     | 
| 
       770 
     | 
    
         
            -
             
     | 
| 
       771 
     | 
    
         
            -
                    except Exception as e:
         
     | 
| 
       772 
     | 
    
         
            -
                        console.print(f"Erro ao conectar à janela Information: {e}\n")
         
     | 
| 
       773 
     | 
    
         
            -
                        return RpaRetornoProcessoDTO(
         
     | 
| 
       774 
     | 
    
         
            -
                            sucesso=False,
         
     | 
| 
       775 
     | 
    
         
            -
                            retorno=f"Erro em obter o retorno, Nota inserida com sucesso, erro {e}",
         
     | 
| 
       776 
     | 
    
         
            -
                            status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       777 
     | 
    
         
            -
                        )
         
     | 
| 
       778 
     | 
    
         
            -
             
     | 
| 
       779 
     | 
    
         
            -
                    await emsys.verify_warning_and_error("Aviso", "OK")
         
     | 
| 
       780 
     | 
    
         
            -
                    await emsys.verify_warning_and_error("Aviso", "&OK")
         
     | 
| 
       781 
     | 
    
         
            -
             
     | 
| 
       782 
     | 
    
         
            -
                    if retorno:
         
     | 
| 
       783 
     | 
    
         
            -
                        console.print("\nNota lançada com sucesso...", style="bold green")
         
     | 
| 
       784 
     | 
    
         
            -
                        await worker_sleep(6)
         
     | 
| 
       785 
     | 
    
         
            -
                        return RpaRetornoProcessoDTO(
         
     | 
| 
      
 701 
     | 
    
         
            +
                            return RpaRetornoProcessoDTO(
         
     | 
| 
       786 
702 
     | 
    
         
             
                            sucesso=True,
         
     | 
| 
       787 
703 
     | 
    
         
             
                            retorno="Nota Lançada com sucesso!",
         
     | 
| 
       788 
704 
     | 
    
         
             
                            status=RpaHistoricoStatusEnum.Sucesso,
         
     | 
| 
       789 
705 
     | 
    
         
             
                        )
         
     | 
| 
       790 
     | 
    
         
            -
                    else:
         
     | 
| 
       791 
     | 
    
         
            -
                        console.print("Erro ao lançar nota", style="bold red")
         
     | 
| 
       792 
     | 
    
         
            -
                        return RpaRetornoProcessoDTO(
         
     | 
| 
       793 
     | 
    
         
            -
                            sucesso=False,
         
     | 
| 
       794 
     | 
    
         
            -
                            retorno=f"Erro ao lançar nota",
         
     | 
| 
       795 
     | 
    
         
            -
                            status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
       796 
     | 
    
         
            -
                        )
         
     | 
| 
       797 
706 
     | 
    
         | 
| 
      
 707 
     | 
    
         
            +
                    except Exception as e:
         
     | 
| 
      
 708 
     | 
    
         
            +
                        return RpaRetornoProcessoDTO(
         
     | 
| 
      
 709 
     | 
    
         
            +
                                sucesso=False,
         
     | 
| 
      
 710 
     | 
    
         
            +
                                retorno=f"Erro ao alterar o NOP, erro {e}",
         
     | 
| 
      
 711 
     | 
    
         
            +
                                status=RpaHistoricoStatusEnum.Falha,
         
     | 
| 
      
 712 
     | 
    
         
            +
                                )
         
     | 
| 
       798 
713 
     | 
    
         
             
                except Exception as ex:
         
     | 
| 
       799 
714 
     | 
    
         
             
                    observacao = f"Erro Processo Entrada de Notas: {str(ex)}"
         
     | 
| 
       800 
715 
     | 
    
         
             
                    logger.error(observacao)
         
     | 
| 
         @@ -44,7 +44,7 @@ worker_automate_hub/tasks/jobs/entrada_de_notas_32.py,sha256=0cneKY6bQU5neo3TKlG 
     | 
|
| 
       44 
44 
     | 
    
         
             
            worker_automate_hub/tasks/jobs/entrada_de_notas_33.py,sha256=ktXc_kdMhlz9cbb7XjfMJhME29mgMFd_FnatxSZZU_s,31457
         
     | 
| 
       45 
45 
     | 
    
         
             
            worker_automate_hub/tasks/jobs/entrada_de_notas_34.py,sha256=iaSmtWTWlazHDtGp22yTV5J5rHDhUCbEaCAnpU7UWyM,31808
         
     | 
| 
       46 
46 
     | 
    
         
             
            worker_automate_hub/tasks/jobs/entrada_de_notas_36.py,sha256=vFkDcgJ9uxrMMLYdeONCMxh6_evnhgF1Sun5HEHAWa4,22716
         
     | 
| 
       47 
     | 
    
         
            -
            worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256= 
     | 
| 
      
 47 
     | 
    
         
            +
            worker_automate_hub/tasks/jobs/entrada_de_notas_39.py,sha256=KMUDMW4pj14v234s46AOsHft8g5vOlK2IX3fFrT9COI,30439
         
     | 
| 
       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
         
     | 
| 
         @@ -67,7 +67,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV 
     | 
|
| 
       67 
67 
     | 
    
         
             
            worker_automate_hub/utils/util.py,sha256=YQkdPMCgrwuCJG_069p1cIG7xTg8VgvSHlGnIQrlyHo,119625
         
     | 
| 
       68 
68 
     | 
    
         
             
            worker_automate_hub/utils/utils_nfe_entrada.py,sha256=yQFyDzvXPSO-UYV1m38WLJ3AWQgZYcyUkHZdCKE1jG4,28360
         
     | 
| 
       69 
69 
     | 
    
         
             
            worker_automate_hub/worker.py,sha256=KDBU3L2kVobndrnN5coRZFTwVmBLKmPJjRv20sCo5Hc,4697
         
     | 
| 
       70 
     | 
    
         
            -
            worker_automate_hub-0.4. 
     | 
| 
       71 
     | 
    
         
            -
            worker_automate_hub-0.4. 
     | 
| 
       72 
     | 
    
         
            -
            worker_automate_hub-0.4. 
     | 
| 
       73 
     | 
    
         
            -
            worker_automate_hub-0.4. 
     | 
| 
      
 70 
     | 
    
         
            +
            worker_automate_hub-0.4.411.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
         
     | 
| 
      
 71 
     | 
    
         
            +
            worker_automate_hub-0.4.411.dist-info/METADATA,sha256=mOOl1bGReoaRGJkGP4EsibZlSMQHsn09GFbPAVNzb14,2895
         
     | 
| 
      
 72 
     | 
    
         
            +
            worker_automate_hub-0.4.411.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
         
     | 
| 
      
 73 
     | 
    
         
            +
            worker_automate_hub-0.4.411.dist-info/RECORD,,
         
     | 
| 
         
            File without changes
         
     | 
    
        {worker_automate_hub-0.4.410.dist-info → worker_automate_hub-0.4.411.dist-info}/entry_points.txt
    RENAMED
    
    | 
         
            File without changes
         
     |