예제 #1
0
                    arquivo = open('PadroesEncontrados.txt','a')
                    arquivo.write("A empresa "+chave.getCnpj()+" tem esse pivor : "+chave.getChave()+"\n")
                    arquivo.close()
                    print "A empresa ",chave.getCnpj()," tem esse pivor : ",chave.getChave() 

                    continuarProcurando = False
                    break
                    
                elif "confere com a figura" in resposta:
                    nada = 1
                        
                elif "existe na base" in resposta:
                    print "Erro - CHAVE", chave.getChave()                        
                    
                    if int(chave.getAno()) >= int(str(data.year)[2:]) and int(chave.getMes()) >= int(str(data.month)):
                        if int(chave.getNumero()) == 3000:
                            arquivo = open('PadroesEncontrados.txt','a')
                            arquivo.write("A empresa "+chave.getCnpj()+" nao tem padrao de repeticao.\n")
                            arquivo.close()
                            continuarProcurando = False
                            break
                        else:
                            chave.setAno("10")
                            chave.setMes("04")
                            chave.incrementarChave()

                    else:
                        chave.incrementarData()
                        

                else:
예제 #2
0
        if not os.path.exists('./Notas/'+chave.getCnpj()):
            os.mkdir ('./Notas/'+chave.getCnpj())
            os.mkdir ('./Notas/'+chave.getCnpj()+'/canceladas')
            print "----------------------------------------------------------------------"
            print "Diretorio criado - ", chave.getCnpj()
            print "----------------------------------------------------------------------"

        else:
            if not os.path.exists('./Notas/'+chave.getCnpj()+'/canceladas'):
                os.mkdir ('./Notas/'+chave.getCnpj()+'/canceladas')


        if chave.existeChave():
            print "Chave ja baixada - ",chave.getChave()
            encontrouXML = "sim"
            if int(chave.getNumero()) == 1:
                procurandoAbaixo = False
                chave = Chave(chavePivor.getChave(),chavePivor.getTipo())

        if chave.existeCanceladaChave():
            chaveTemp = Chave(chave.getChave(), tupla[1])
        if procurandoAbaixo:
        chaveTemp.decrementarData()
        if chaveTemp.existeCanceladaChave():
                    print "Chave cancelada confirmada - ",chave.getChave()
                    encontrouXML = "sim"
                    if etapa1 == 1:
                        chave.incrementarData()
                        etapa1 = 0
            else:
        chaveTemp.incrementarData()