示例#1
0
def thread_start():
    global stop
    _stop = False
    while _stop == False:
        print(_stop)
        print("Sequencia de comandos: " + str(commands_list))
        for command in commands_list:
            if command[:15] == "clique esquerdo":
                temp_coord = command[command.find('[') + 1:command.find(']')]
                temp_x = temp_coord[:temp_coord.find(',')]
                temp_y = temp_coord[temp_coord.find(',') + 2:]
                mc.left_click_at(temp_x, temp_y)

            elif command[:14] == "clique direito":
                temp_coord = command[command.find('[') + 1:command.find(']')]
                temp_x = temp_coord[:temp_coord.find(',')]
                temp_y = temp_coord[temp_coord.find(',') + 2:]
                mc.right_click_at(temp_x, temp_y)

            elif command[:7] == 'esperar':
                if app.getEntry("label_1_2") == "" or int(
                        app.getEntry("label_1_2")) < 0:
                    tempo = 0
                else:
                    tempo = int(command[8:])
                time.sleep(int(tempo))

            elif command[:7] == 'digitar':
                digitar = command[8:]
                kb.type_this(digitar)
        time.sleep(intervalo)
示例#2
0
    kb.press_this(Key.f7)
    print('f7')

    # Apertar 'o'
    kb.press_this('o')
    # Apertar 'o'
    kb.press_this('o')
    print('double o')

    # time.sleep(2)

    # Apertar enter
    kb.press_this(Key.enter)

    # Clicar em cancelar (658, 713)
    mc.left_click_at(658, 713)

    # Clicar em novo (664, 710)
    mc.left_click_at(664, 710)

    # Digitar codigo: '21116'
    limpar_campo(468, 255)
    kb.type_this('21116')
    kb.press_this(Key.enter)
    time.sleep(2)

    # Verifica se a conta ja existe
    if cs.teste_imagens() > 2000:  # nao existe
        # Digitar classificacao: '2.0.05.00.06'
        kb.type_this('20050006')
        kb.press_this(Key.enter)
示例#3
0
coordenadas_ConfigurarIntegracao = [500, 685]

lancamentos_Folha = [5150, 5151, 5152, 5153]
lancamentos_Ferias = [5101, 5107, 5108]

for id in ids:
    # Abrir busca de empresas
    kb.press_this(Key.f8)

    # Digitar id da empresa
    kb.type_this(str(id))
    kb.press_this(Key.enter)
    time.sleep(7)

    if cs.teste_imagens_4() < 1000:
        mc.left_click_at(861, 506)
        time.sleep(2)
        mc.left_click_at(867, 524)
        time.sleep(1)

    # Fechar possiveis avisos
    kb.press_this(Key.esc)

    # Clicar em Arquivo
    mc.left_click_at(coordenadas_Arquivo[0],coordenadas_Arquivo[1])
    time.sleep(1)

    if cs.teste_imagens_3() < 1000: # Testar se existe o botão contabilidade
        # Clicar em Contabilidade
        mc.left_click_at(coordenadas_Contabilidade[0], coordenadas_Contabilidade[1])
示例#4
0
def _relatorio_tomados(cnpj, nome_contabil, ano, mes, segundos):
    path = "P:\documentos\OneDrive - Novus Contabilidade\Doc Compartilhado\Contábil\\NFSe tomados\\"
    path += nome_contabil + "\\" + ano + "\\" + mes
    os.mkdir(path)

    # Clicar no campo de CNPJ
    mc.left_click_at(X=275, Y=407)
    time.sleep(segundos)

    # Digitar CNPJ
    kb.type_this(cnpj)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clique em Prestador
    mc.left_click_at(X=320, Y=677)
    time.sleep(segundos)

    # Clique em Livro Digital
    mc.left_click_at(X=1060, Y=138)
    time.sleep(segundos)

    # Clique no outro Livro Digital
    mc.left_click_at(X=1056, Y=190)
    time.sleep(segundos)

    # Clique Gerar Novo Livro Digital
    mc.left_click_at(X=300, Y=855)
    time.sleep(segundos)

    # Clique em tipo de declaracao (diferenca pro prestados)
    mc.left_click_at(X=331, Y=375)
    time.sleep(segundos)

    # Clique em tomados (diferenca pro prestados)
    mc.left_click_at(
        X=308,
        Y=416,
    )
    time.sleep(segundos)

    # Clique em Gerar
    mc.left_click_at(X=255, Y=619)
    time.sleep(segundos)

    # Clique em OK
    mc.left_click_at(X=886, Y=163)
    time.sleep(segundos)

    # Salvar DAM
    # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Clicar em imprimir
    mc.left_click_at(X=718, Y=629)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1063, Y=690)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1034, Y=170)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1189, Y=821)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)

    # Salvar relatorio
    # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Clicar em imprimir
    mc.left_click_at(X=718, Y=629)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1063, Y=690)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1034, Y=170)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1189, Y=821)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)
示例#5
0
def _exportar_notas_fiscais_prestados(nome_contabil, segundos):
    path = "P:\documentos\OneDrive - Novus Contabilidade\Doc Compartilhado\Contábil\\NFSe\\"
    path += nome_contabil

    # Clicar em Notas Eletrônicas
    mc.left_click_at(X=806, Y=139)
    time.sleep(segundos)

    # Clicar em Exportar Notas
    mc.left_click_at(X=797, Y=640)
    time.sleep(segundos)

    # Clicar em == Mes ==
    mc.left_click_at(X=441, Y=420)
    time.sleep(segundos)

    # Digitar o mes
    kb.type_this(_converte_mes())
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em == Ano ==
    mc.left_click_at(X=815, Y=420)
    time.sleep(segundos)

    # Digitar o ano
    kb.type_this(str(app.getEntry("ano")))
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Exportar XML Abrasf 2.02
    mc.left_click_at(X=829, Y=459)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1034, Y=170)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1189, Y=821)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)
示例#6
0
def _relatorio_prestados(nome_fiscal, ano, mes, segundos):
    path = "P:\documentos\OneDrive - Novus Contabilidade\Doc Compartilhado\Fiscal\Impostos\Federais\Empresas\\"
    path += nome_fiscal + "\\" + ano + "\\" + mes
    os.mkdir(path)

    # Clique Gerar Novo Livro Digital
    mc.left_click_at(X=300, Y=855)
    time.sleep(segundos + 2)

    # Clique em Gerar
    mc.left_click_at(X=255, Y=619)
    time.sleep(segundos + 2)

    # Clique em OK
    mc.left_click_at(X=890, Y=162)
    time.sleep(segundos)

    # Clique em OK, de novo
    mc.left_click_at(X=889, Y=183)
    time.sleep(segundos)

    # Salvar o DAM de prestados
    # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Clicar em imprimir
    mc.left_click_at(X=718, Y=629)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1063, Y=690)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1034, Y=170)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1189, Y=821)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)  # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Salvar o relatorio de prestados
    # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Clicar em imprimir
    mc.left_click_at(X=718, Y=629)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1063, Y=690)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1034, Y=170)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1189, Y=821)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)
示例#7
0
def _exportar_notas_fiscais_tomados(nome_contabil, segundos):
    path = "P:\documentos\OneDrive - Novus Contabilidade\Doc Compartilhado\Contábil\\NFSe tomados\\"
    path += nome_contabil

    # Clicar em procurar
    mc.left_click_at(X=268, Y=351)
    time.sleep(segundos)

    # Clicar em competencia
    mc.left_click_at(X=266, Y=405)
    time.sleep(segundos)

    # Digitar a competencia
    competencia = ano + "-" + mes[:2]
    kb.type_this(competencia)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Procurar
    mc.left_click_at(X=264, Y=789)
    time.sleep(segundos)

    # Apertar page down
    kb.press_this(Key.page_down)
    time.sleep(segundos)

    # Clicar na caixinha
    mc.left_click_at(X=243, Y=355)
    time.sleep(segundos)

    # Clicar em selecionar todos
    mc.left_click_at(X=1069, Y=398)
    time.sleep(segundos)

    # Clicar em Exportar XML Abrasf 2.02
    mc.left_click_at(X=905, Y=685)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1004, Y=169)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1182, Y=824)
    time.sleep(segundos)
示例#8
0
def _pdf_notas_tomados(nome_contabil, ano, mes, segundos):
    path = "P:\documentos\OneDrive - Novus Contabilidade\Doc Compartilhado\Contábil\\NFSe tomados\\"
    path += nome_contabil + "\\" + ano + "\\" + mes

    # Clicar em servicos tomados
    mc.left_click_at(X=937, Y=139)
    time.sleep(segundos)

    # Clicar em notas tomadas no municipio
    mc.left_click_at(X=919, Y=258)
    time.sleep(segundos)

    # Clicar em procurar
    mc.left_click_at(X=268, Y=351)
    time.sleep(segundos)

    # Clicar em competencia
    mc.left_click_at(X=266, Y=405)
    time.sleep(segundos)

    # Digitar a competencia
    competencia = ano + "-" + mes[:2]
    kb.type_this(competencia)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Clicar em Procurar
    mc.left_click_at(X=264, Y=789)
    time.sleep(segundos)

    # Apertar page down
    kb.press_this(Key.page_down)
    time.sleep(segundos)

    # Clicar na caixinha
    mc.left_click_at(X=243, Y=355)
    time.sleep(segundos)

    # Clicar em selecionar todos
    mc.left_click_at(X=1069, Y=398)
    time.sleep(segundos)

    # Clicar em PDF
    mc.left_click_at(X=301, Y=684)
    time.sleep(segundos + 3)

    # Botao direito no centro da tela
    mc.right_click_at(X=670, Y=505)
    time.sleep(segundos)

    # Clicar em imprimir
    mc.left_click_at(X=718, Y=629)
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1063, Y=690)
    time.sleep(segundos)

    # Clique para digitar o caminho
    mc.left_click_at(X=1004, Y=169)
    time.sleep(segundos)

    # Digitar o caminho
    kb.type_this(path)
    time.sleep(segundos)

    # Enter
    kb.press_this(Key.enter)
    time.sleep(segundos)

    # Limpar campo do nome do arquivo
    _limpar_campo(X=1118, Y=749)

    # Digitar nome do arquivo
    kb.type_this("Notas")
    time.sleep(segundos)

    # Clicar em Salvar
    mc.left_click_at(X=1194, Y=819)
    time.sleep(segundos)

    # Fechar a aba
    kb.press_this_with_LCTRL("w")
    time.sleep(segundos)