Ejemplo n.º 1
0
                def cria_inteligence():
                    print('Intelligence does not exist')
                    self.driver = pgdas_driver(self.client_path)

                    self.loga_cert()

                    # driver.set_window_position(-1055, 0)

                    # muda o client, no ECAC, é apenas uma função teste
                    element = self.intelligence_cnpj_test_element(CNPJ)

                    if element != '':

                        client_db_name.append(CLIENTE)
                        cert_x_login.append('loginComCodSim')
                        self.loga_simples(CNPJ, CPF, CodSim, CLIENTE)

                        print(
                            f'Não preciso logar (if element != "") p/ criar inteligence. \n{CLIENTE}, '
                            f'por isso, break')
                        """
                        print(f'PRESSIONE ENTER P/ PROSSEGUIR, {CLIENTE}')
                        press_key_b4('enter')
                        while True:
                            try:
                                driver.implicitly_wait(5)
                                submit = driver.find_element_by_xpath("//input[@type='submit']").click()
                                break
                            except (NoSuchElementException, ElementClickInterceptedException):
                                print('sleeping, line 167. Cadê o submit?')
                                driver.refresh()

                        driver.implicitly_wait(5)
                        # implicitly_wait -> if element was already appeared, it'll not wait.
                        """

                    else:
                        client_db_name.append(CLIENTE)
                        cert_x_login.append('certificado')

                        print('SUCESSO, CERTIFICADO, ', CLIENTE)

                    # checa se a inteligencia não existe

                    try:
                        # driver.set_window_position(initial['x'], initial['y'])
                        driver.close()
                        # está ok o unbound me ajuda
                    except UnboundLocalError:
                        pass
Ejemplo n.º 2
0
    def __init__(self, compt_file=None):
        """
        :param compt_file: from GUI

        # remember past_only arg from self.get_atual_competencia
        """
        import pandas as pd
        from default.webdriver_utilities.pre_drivers import pgdas_driver
        from .relacao_nfs import tres_valores_faturados
        # O vencimento DAS(seja pra qual for a compt) está certo, haja vista que se trata do mes atual

        sh_names = 'sem_mov', 'G5_ISS', 'G5_ICMS'
        if compt_file is None:
            """# Atualização, 14/01/2021"""
            # self.set_compt_only() == self.set_get_compt_file(file_type=None)
            # a = self.set_get_compt_file(file_type=None, m_cont=12)
            # descobri como fazer..

            compt_file = self.compt_and_filename()
            compt, excel_file_name = compt_file
        else:
            compt, excel_file_name = compt_file

        intelligence_existence = self.intelligence_existence_done(
            'CERT_vs_LOGIN.xlsx')
        inteligence_db = {'CLIENT': [], 'CERT x LOGIN': []}
        client_db_name = inteligence_db['CLIENT']
        cert_x_login = inteligence_db['CERT x LOGIN']
        cont_inteligence = -1

        for sh_name in sh_names:
            # agora eu posso fazer downloalds sem me preocupar tendo a variável path
            mshExcelFile = pd.ExcelFile(excel_file_name)

            msh = mshExcelFile.parse(sheet_name=str(sh_name))
            col_str_dic = {column: str for column in list(msh)}
            msh = mshExcelFile.parse(sheet_name=str(sh_name),
                                     dtype=col_str_dic)
            READ = self.le_excel_each_one(msh)
            self.after_READ = self.readnew_lista(READ, False)
            after_READ = self.after_READ

            # if sh_name not in 'sem_mov':
            print(cont_inteligence)
            print(f'cont inteligence plan {sh_name}')
            for i, CNPJ in enumerate(after_READ['CNPJ']):
                if 'G5' in sh_name:
                    cont_inteligence += 1
                # ####################### A INTELIGENCIA EXCEL ESTÁ SEM OS SEM MOVIMENTOS NO MOMENTO
                CLIENTE = after_READ['Razão Social'][i]
                JA_DECLARED = after_READ['Declarado'][i].upper().strip()
                CodSim = after_READ['Código Simples'][i]
                CPF = after_READ['CPF'][i]
                cont_ret_n_ret = i
                if CLIENTE == '':
                    break
                self.now_person = CLIENTE
                self.client_path = self._files_path_v3(
                    CLIENTE, wexplorer_tup=compt_file)

                # if not existe o arquivo my_wised_check_path_file -> no momento atual, existe
                def cria_inteligence():
                    print('Intelligence does not exist')

                    self.loga_cert()

                    # driver.set_window_position(-1055, 0)

                    # muda o client, no ECAC, é apenas uma função teste
                    element = self.intelligence_cnpj_test_element(CNPJ)

                    if element != '':

                        client_db_name.append(CLIENTE)
                        cert_x_login.append('loginComCodSim')
                        self.loga_simples(CNPJ, CPF, CodSim, CLIENTE)

                        print(
                            f'Não preciso logar (if element != "") p/ criar inteligence. \n{CLIENTE}, '
                            f'por isso, break')
                        """
                        print(f'PRESSIONE ENTER P/ PROSSEGUIR, {CLIENTE}')
                        press_key_b4('enter')
                        while True:
                            try:
                                driver.implicitly_wait(5)
                                submit = driver.find_element_by_xpath("//input[@type='submit']").click()
                                break
                            except (NoSuchElementException, ElementClickInterceptedException):
                                print('sleeping, line 167. Cadê o submit?')
                                driver.refresh()

                        driver.implicitly_wait(5)
                        # implicitly_wait -> if element was already appeared, it'll not wait.
                        """

                    else:
                        client_db_name.append(CLIENTE)
                        cert_x_login.append('certificado')

                        print('SUCESSO, CERTIFICADO, ', CLIENTE)

                    # checa se a inteligencia não existe

                    try:
                        # driver.set_window_position(initial['x'], initial['y'])
                        driver.close()
                        # está ok o unbound me ajuda
                    except UnboundLocalError:
                        pass

                if isinstance(
                        intelligence_existence, list) and JA_DECLARED not in [
                            'S', 'OK', 'FORA'
                        ] and cont_inteligence >= 0:

                    __client_path = self.client_path
                    self.driver = pgdas_driver(__client_path)
                    driver = self.driver
                    super().__init__(driver)

                    driver.implicitly_wait(2)
                    # initial = driver.get_window_position()

                    driver.get('https://www.google.com.br')

                    print('ecac_or_simples')
                    try:
                        ecac_or_simples = intelligence_existence[
                            cont_inteligence][1]
                    except IndexError:
                        print('FINISH')
                        break
                    # input(intelligence_existence[cont_inteligence][0]) # -> O NOME DO CLIENTE
                    my_new_3valores = tres_valores_faturados(__client_path)
                    print(my_new_3valores, '----> my_new_3valores')

                    def return_valor():
                        if sh_names.index(sh_name) != 0:
                            if sh_names.index(sh_name) == 1:
                                if my_new_3valores:
                                    print(my_new_3valores[0])
                                    VALOR = [
                                        v for v in my_new_3valores[0].values()
                                    ][0]
                                else:
                                    VALOR = after_READ['Valor'][i]
                                    if VALOR == '0':
                                        # or VALOR == '':
                                        VALOR = ''
                                        return VALOR

                            else:

                                VALOR = after_READ['Valor'][i]
                                if VALOR == '0':  # or VALOR == '':
                                    VALOR = ''
                                    return VALOR
                            if 'zerou' in str(VALOR).lower():
                                VALOR = ''
                            else:
                                if '.' not in str(VALOR):
                                    VALOR = f'{VALOR},00'
                                elif VALOR != '':
                                    VALOR = f'{float(VALOR):.2f}'
                                    VALOR = self.trata_money_excel(VALOR)
                                else:
                                    self.icms_prossegue = False  # não está em uso ainda

                        else:
                            VALOR = ''

                        print('VALOR BEFORE RETURN', VALOR)
                        return VALOR

                    VALOR = return_valor()

                    # Tratei o que dá pra fazer no certificado e o que não dá
                    if ecac_or_simples == 'certificado':
                        self.loga_cert()
                        # loga ECAC, Insere CNPJ
                        self.change_ecac_client(CNPJ)

                        self.current_url = driver.current_url
                        self.opta_script() if self.m() == 12 else None

                    else:
                        self.loga_simples(CNPJ, CPF, CodSim, CLIENTE)
                        self.current_url = driver.current_url
                        self.opta_script() if self.m() == 12 else None

                    self.compt_typist(compt)

                    # faz outras declaracoes se necessarias
                    """NÃO FUNCIONANDO CORRETAMENTE AINDA"""
                    if self.check_make_pendencies():
                        for compt_p2 in self.check_make_pendencies():
                            print(compt_p2, 'compt_p2')
                            self.compt_typist(
                                compt_p2,
                                '/'.join(driver.current_url.split('/')[:-1]))
                            self.DECLARA(compt_p2, sh_names.index(sh_name), '',
                                         False, cont_ret_n_ret)
                            # # CRIAR NOVA PASTA, SALVAR NO LUGAR CERTO POIS NÃO TA SALVANDO ENFIM, CONFERIR O DECLARA ONDE ESTÁ SALVANDO
                        self.compt_typist(
                            compt,
                            '/'.join(driver.current_url.split('/')[:-1]))
                    else:
                        self.compt_typist(compt)

                    self.DECLARA(compt, sh_names.index(sh_name), VALOR,
                                 my_new_3valores, cont_ret_n_ret)

                    print('CLOSE DRIVE EM 5 SEGS')
                    sleep(5)
                    driver.close()

                elif cont_inteligence == -1:
                    if JA_DECLARED not in ['S', 'OK']:

                        print('estou em sem movimento, vou arrumar ainda')

                        __client_path = self.client_path
                        self.driver = pgdas_driver(__client_path)
                        driver = self.driver
                        super().__init__(self.driver)
                        if CodSim != '-' and CodSim != '':

                            # Código simples existe # SEM MOVIMENTO
                            self.loga_simples(CNPJ, CPF, CodSim, CLIENTE)
                        else:

                            # Código sim inexistente
                            self.loga_cert()
                            self.change_ecac_client(CNPJ)
                        self.current_url = driver.current_url
                        self.opta_script() if self.m() == 12 else None

                        VALOR = 'zerou'
                        print('!!!ZEROU!!!')

                        self.compt_typist(compt)
                        # faz outras declaracoes se necessarias
                        if self.check_make_pendencies():
                            for compt_p2 in self.check_make_pendencies():
                                print(compt_p2, 'compt_p2')
                                self.compt_typist(
                                    compt_p2, '/'.join(
                                        driver.current_url.split('/')[:-1]))
                                self.DECLARA(compt_p2, sh_names.index(sh_name),
                                             '', False, cont_ret_n_ret)
                            self.compt_typist(
                                compt,
                                '/'.join(driver.current_url.split('/')[:-1]))
                        else:
                            self.compt_typist(compt)

                        self.DECLARA(compt, sh_names.index(sh_name), VALOR,
                                     'zerou', cont_ret_n_ret)

                elif not intelligence_existence:
                    # se não existir vai criar.
                    cria_inteligence()

                else:
                    print(
                        f'{CLIENTE} \nJA DECLARADO: {JA_DECLARED}\n-----------------'
                    )
Ejemplo n.º 3
0
    def __init__(self, compt=None):
        """
        :param compt: from GUI

        # remember past_only arg from self.get_atual_competencia
        """
        import pandas as pd
        from default.webdriver_utilities.pre_drivers import pgdas_driver
        # O vencimento DAS(seja pra qual for a compt) está certo, haja vista que se trata do mes atual

        sh_names = ['DEFIS']
        sh_name = sh_names[0]

        if compt is None:
            compt = super().get_compt_only()

        excel_file_name = super().excel_file_path()

        COMPT = compt = f"DEFIS_{self.y()}"
        # transcrevendo compt para que não seja 02/2021

        # excel_file_name = '/'.join(excel_file_name.split('/')[:-1])
        excel_file_name = os.path.dirname(excel_file_name)
        excel_file_name += f'/DEFIS-anual.xlsx'
        pdExcelFile = pd.ExcelFile(excel_file_name)

        msh = pdExcelFile.parse(sheet_name=str(sh_name))
        col_str_dic = {column: str for column in list(msh)}

        msh = pdExcelFile.parse(sheet_name=str(sh_name), dtype=col_str_dic)
        READ = self.le_excel_each_one(msh)
        self.after_READ = self.readnew_lista(READ, False)

        msh_socio = pdExcelFile.parse(sheet_name='Socios')
        col_str_dic = {column: str for column in list(msh_socio)}
        msh_socio = pdExcelFile.parse(sheet_name='Socios', dtype=col_str_dic)
        self.after_socio = self.readnew_lista(
            self.le_excel_each_one(msh_socio))

        SK = list(self.after_socio.keys())
        #  ACHEI FINALMENTE O JEITO RESPONSIVO DE DECLARAR PRA NÃO FICAR TENDO QUE ESCREVER POR EXTENSO

        cont_soc = 0
        for i, CNPJ in enumerate(self.after_READ['CNPJ']):
            _cliente = self.empresa_now = self.after_READ['Razão Social'][i]
            _ja_declared = self.after_READ['Declarado'][i].upper().strip()
            _cod_sim = self.after_READ['Código Simples'][i]
            _cpf = self.after_READ['CPF'][i]
            _cert_or_login = self.after_READ['CERTORLOGIN'][i]

            # Defis exclusivos
            _dirf = self.after_READ['DIRF'][i]
            # +2 Pois começa da linha 2, logo o excel está reconhendo isso como index
            while int(self.after_socio[SK[-4]][cont_soc]) - 2 != i:
                cont_soc += 1
            __ate_soc = self.after_socio[SK[-3]][cont_soc]
            __ate_soc = int(__ate_soc) + cont_soc

            self.socios_now__cnpj = self.after_socio[SK[0]][cont_soc:__ate_soc]
            self.socios_now__cpf = self.after_socio[SK[1]][cont_soc:__ate_soc]
            self.socios_now__nome = self.after_socio[SK[2]][cont_soc:__ate_soc]
            self.socios_now__cota = self.after_socio[SK[3]][cont_soc:__ate_soc]
            self.socios_now__tipo = self.after_socio[SK[5]][cont_soc:__ate_soc]

            self.client_path = self.files_pathit(
                _cliente,
                COMPT,
            )
            if _ja_declared not in ['S', 'OK', 'FORA']:
                print('-' * 60)
                # print(f'CNPJ: {CNPJ}, {CNPJ.strip()==self.socios_now__cnpj[0]}')
                self.the_print()

                __client_path = self.client_path
                self.driver = pgdas_driver(__client_path)
                now_process = subprocess.Popen(f'explorer {__client_path}')
                driver = self.driver
                super().__init__(driver)

                if _cert_or_login == 'certificado':
                    self.loga_cert()
                    # loga ECAC, Insere CNPJ
                    self.change_ecac_client(CNPJ)

                    self.current_url = driver.current_url
                    self.opta_script() if self.m() == 12 else None

                else:
                    self.loga_simples(CNPJ, _cpf, _cod_sim, _cliente)
                    self.current_url = driver.current_url
                    self.opta_script() if self.m() == 12 else None

                driver.get(
                    'https://www8.receita.fazenda.gov.br/SimplesNacional/Aplicacoes/ATSPO/defis.app/entrada.aspx'
                )
                while True:
                    try:
                        WebDriverWait(self.driver, 10).until(
                            expected_conditions.presence_of_element_located(
                                (By.TAG_NAME, 'input')))
                        my_radios_bt = driver.find_elements_by_name(
                            'ctl00$conteudo$AnoC')
                        my_radios_bt[-2].click()
                        driver.find_element_by_id(
                            'ctl00_conteudo_lnkContinuar').click()
                        break
                    except TimeoutException:
                        driver.get(
                            'https://sinac.cav.receita.fazenda.gov.br/SimplesNacional/Aplicacoes/ATSPO/defis.app/entrada.aspx'
                        )
                (print('sleeping'), sleep(5))
                self.send_keys_anywhere(Keys.TAB, 2)
                self.send_keys_anywhere(Keys.ENTER, 1)
                self.contains_text(str(self.y() - 1)).click()
                self.contains_text('Continuar').click()
                driver.implicitly_wait(10)
                self.send_keys_anywhere(Keys.TAB, 9)
                self.send_keys_anywhere(Keys.ENTER, 1)
                self.send_keys_anywhere(Keys.TAB, 2)
                self.send_keys_anywhere(Keys.ENTER, 1)
                WebDriverWait(self.driver, 5)
                try:
                    self.send_keys_anywhere(Keys.TAB, 1)
                    self.send_keys_anywhere(Keys.ENTER, 1)
                except UnexpectedAlertPresentException:
                    pass
                else:
                    # se 3 => De toda MP
                    self.send_keys_anywhere(Keys.TAB, 2)
                    self.send_keys_anywhere(Keys.ENTER)

                    self.send_keys_anywhere(Keys.TAB, 1)
                    # Informações econômicas e fiscais do estabelecimento

                    ac = ActionChains(self.driver)
                    for sdc in range(13):
                        ac.send_keys('0')
                        ac.send_keys(Keys.TAB)
                    ac.perform()
                    self.send_keys_anywhere(Keys.TAB, 11, pause=.1)

                    self.send_keys_anywhere(Keys.RIGHT)
                    self.send_keys_anywhere(Keys.TAB)
                    self.send_keys_anywhere(Keys.RIGHT)

                    self.send_keys_anywhere(Keys.TAB, 15, pause=.001)
                    self.send_keys_anywhere(Keys.ENTER)

                    # Chega até os campos padrão

                print('\033[1;31m DIGITE F8 p/ prosseguir \033[m')
                which_one = press_key_b4('f8')
                now_process.kill()
            print('-' * 30)
            print(f'already declared {_cliente}')
            print('-' * 30)
Ejemplo n.º 4
0
    def __init__(self):
        print('filespathteste')
        """
        """
        import pandas as pd
        from default.webdriver_utilities.pre_drivers import pgdas_driver

        # O vencimento DAS(seja pra qual for a compt) está certo, haja vista que se trata do mes atual

        sh_names = ['_Dívidas']
        compt = super().get_compt_only()
        excel_file_name = super().excel_file_path()

        for sh_name in sh_names:
            # agora eu posso fazer downloalds sem me preocupar tendo a variável path
            mshExcelFile = pd.ExcelFile(excel_file_name)

            msh = mshExcelFile.parse(sheet_name=str(sh_name))
            col_str_dic = {column: str for column in list(msh)}
            msh = mshExcelFile.parse(sheet_name=str(sh_name),
                                     dtype=col_str_dic)
            READ = self.le_excel_each_one(msh)
            self.after_READ = self.readnew_lista(READ, False)
            after_READ = self.after_READ

            for i, CNPJ in enumerate(after_READ['CNPJ']):
                CLIENTE = after_READ['Razão Social'][i]
                JA_DECLARED = after_READ['Declarado'][i]
                simples_or_ativa = after_READ['tipo'][i]

                if JA_DECLARED not in ['S', 'OK', 'FORA']:

                    self.client_path = self.files_pathit(
                        'Dívidas_Simples_' + CLIENTE, compt)
                    __client_path = self.client_path

                    self.driver = pgdas_driver(__client_path)
                    super().__init__(self.driver)
                    driver = self.driver

                    self.loga_cert()
                    self.change_ecac_client(CNPJ)

                    driver.find_element_by_id('linkHome').click()

                    if simples_or_ativa == 'simples nacional':
                        driver.find_element_by_link_text(
                            'Simples Nacional').click()
                        driver.find_element_by_link_text(
                            'Solicitar, acompanhar e emitir DAS de parcelamento'
                        ).click()

                        driver.implicitly_wait(10)

                        driver.switch_to.frame(
                            driver.find_element_by_id('frmApp'))

                        empel = driver.find_element_by_id(
                            'ctl00_contentPlaceH_linkButtonEmitirDAS')
                        empel.click()
                        WebDriverWait(self.driver, 20).until(
                            expected_conditions.presence_of_element_located(
                                (By.XPATH,
                                 '//input[@value="Continuar"]'))).click()

                        imprimires = WebDriverWait(self.driver, 20).until(
                            expected_conditions.
                            presence_of_all_elements_located(
                                (By.LINK_TEXT, 'Imprimir')))
                        for imprimir in imprimires:
                            imprimir.click()
                        # Imprimir
                        driver.switch_to.default_content()
                    elif simples_or_ativa == 'dívida ativa':

                        driver.find_element_by_link_text(
                            'Dívida Ativa da União').click()
                        driver.find_element_by_link_text(
                            'Débitos Inscritos em Dívida Ativa da União'
                        ).click()

                        driver.switch_to.window(driver.window_handles[1])
                        driver.implicitly_wait(10)

                        sispar_url = f"{'/'.join(driver.current_url.split('/')[:-1])}/sispar"
                        driver.get(sispar_url)
                        try:
                            WebDriverWait(self.driver, 10).until(
                                expected_conditions.
                                presence_of_element_located(
                                    (By.TAG_NAME, 'button')))
                            self.tag_with_text('button',
                                               'Acessar o SISPAR').click()
                        except NoSuchElementException:
                            WebDriverWait(self.driver, 10).until(
                                expected_conditions.
                                presence_of_element_located(
                                    (By.TAG_NAME, 'button')))
                            self.tag_with_text('button', 'Acessar').click()
                            # provavelmente uma mudança no sistema mas vou validar
                        # WebDriverWait(self.driver, 10).until(expected_conditions.new_window_is_opened(driver.window_handles))
                        WebDriverWait(self.driver, 10).until(
                            expected_conditions.number_of_windows_to_be(3))
                        driver.switch_to.window(driver.window_handles[2])

                        driver.execute_script(
                            "PrimeFaces.addSubmitParam('cabecalho',{'cabecalho:j_idt45':'cabecalho:j_idt45'}).submit('cabecalho');"
                        )
                        self.click_elements_by_tt('DEFERIDO E CONSOLIDADO')
                        sleep(1)
                        WebDriverWait(self.driver, 20).until(
                            expected_conditions.presence_of_element_located(
                                (By.ID, 'formListaDarf:idbtnDarf'))).click()

                        WebDriverWait(self.driver, 20).until(
                            expected_conditions.presence_of_element_located(
                                (By.TAG_NAME, 'table')))
                        compt_dividas_ativas = f'{self.m():02d}/{self.y()}'
                        print(compt_dividas_ativas)

                        sleep(7)

                        dris = driver.find_elements_by_css_selector(
                            ".colunaAlinhaCentro")

                        elemitidos = driver.find_elements_by_css_selector(
                            f"[title*='Já emitido']")
                        for el in elemitidos:
                            el.click()
                            sleep(.5)
                            self.send_keys_anywhere(Keys.ENTER)
                        print('breakou, baixou JÁ EMITIDOS')
                        self.contains_title('Não emitido').click()
                        sleep(.5)
                        self.send_keys_anywhere(Keys.ENTER)
                        self.click_ac_elementors(
                            WebDriverWait(self.driver, 20).until(
                                expected_conditions.
                                presence_of_element_located((
                                    By.ID,
                                    'formResumoParcelamentoDarf:dlgInformacoesEmissaoDarf'
                                ))))
                        self.send_keys_anywhere(Keys.TAB)
                        self.send_keys_anywhere(Keys.TAB)
                        self.send_keys_anywhere(Keys.ENTER)

                        self.click_ac_elementors(
                            WebDriverWait(self.driver, 20).until(
                                expected_conditions.
                                presence_of_element_located((
                                    By.ID,
                                    'formResumoParcelamentoDarf:emitirDarf'))))

                        WebDriverWait(self.driver, 5)

                    else:
                        print('ACABOU, break')
                        break
Ejemplo n.º 5
0
    def __init__(self, compt_file=None):
        """
        :param compt_file: from GUI

        # remember past_only arg from self.get_atual_competencia
        """
        import pandas as pd
        from default.webdriver_utilities.pre_drivers import pgdas_driver

        # O vencimento DAS(seja pra qual for a compt) está certo, haja vista que se trata do mes atual

        sh_names = ['DEFIS']
        if compt_file is None:
            compt_file = self.compt_and_filename()
            compt, excel_file_name = compt_file
        else:
            compt, excel_file_name = compt_file

        COMPT = compt = f"DEFIS_{self.y()}"
        # transcrevendo compt para que não seja 02/2021

        # excel_file_name = '/'.join(excel_file_name.split('/')[:-1])
        excel_file_name = os.path.dirname(excel_file_name)
        excel_file_name += f'/DEFIS-anual.xlsx'
        pdExcelFile = pd.ExcelFile(excel_file_name)

        for sh_name in sh_names:
            # agora eu posso fazer downloalds sem me preocupar tendo a variável path

            msh = pdExcelFile.parse(sheet_name=str(sh_name))
            col_str_dic = {column: str for column in list(msh)}

            msh = pdExcelFile.parse(sheet_name=str(sh_name), dtype=col_str_dic)
            READ = self.le_excel_each_one(msh)
            self.after_READ = self.readnew_lista(READ, False)
            after_READ = self.after_READ

            for i, CNPJ in enumerate(after_READ['CNPJ']):
                # ####################### A INTELIGENCIA EXCEL ESTÁ SEM OS SEM MOVIMENTOS NO MOMENTO
                _cliente = after_READ['Razão Social'][i]
                _ja_declared = after_READ['Declarado'][i].upper().strip()
                _cod_sim = after_READ['Código Simples'][i]
                _cpf = after_READ['CPF'][i]
                _cert_or_login = after_READ['CERTORLOGIN'][i]

                # Defis exclusivos
                _dirf = after_READ['DIRF'][i]

                if _cliente == '':
                    break
                self.client_path = self._files_path_defis(_cliente, tup_path=(COMPT, excel_file_name))
                if _ja_declared not in ['S', 'OK', 'FORA']:

                    __client_path = self.client_path
                    input(self.client_path)
                    self.driver = pgdas_driver(__client_path)
                    driver = self.driver
                    super().__init__(driver)

                    if _cert_or_login == 'certificado':
                        self.loga_cert()
                        # loga ECAC, Insere CNPJ
                        self.change_ecac_client(CNPJ)

                        self.current_url = driver.current_url
                        self.opta_script() if self.m() == 12 else None

                    else:
                        self.loga_simples(CNPJ, _cpf, _cod_sim, _cliente)
                        self.current_url = driver.current_url
                        self.opta_script() if self.m() == 12 else None

                    print('\033[1;31m DIGITE F2 p/ prosseguir \033[m')
                    which_one = press_keys_b4('f2')