Ejemplo n.º 1
0
    public String PegaMoraDefault(String wcedente, Boolean lrec)
    {
        String sql = "PEGAMORADEFAULT";

        SqlParameter[] parametros =
        {
            new SqlParameter("@cedente", wcedente),
            new SqlParameter("@lrec",    lrec)
        };

        DataSet Ds = SreDblib.GetDsSp(sql, parametros);

        return(Srelib.PadDouble(Ds.Tables[0].Rows[0]["taxamora"].ToString()));
    }
Ejemplo n.º 2
0
    public void PegaDadosRamo(String pApelido, String pXml)
    {
        // Conexao Conn = new Conexao(pXml);

        String Qry = "EXEC crtotramo " +
                     Srelib.QStr(pApelido);


        DS = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "CRTOTCED1");
        DA.SelectCommand = Command;

        DA.Fill(DS);

        DataTable DT;

        DT = DS.Tables["CRTOTCED1"];
        DataRow DR = DT.Rows[0];

        op1 = Srelib.PadData(Convert.ToString(DR["op1"]));
        op2 = Srelib.PadData(Convert.ToString(DR["op2"]));
        op3 = Convert.ToString(DR["op3"]);
        op4 = Srelib.PadDouble(Convert.ToString(DR["op4"]));

        r1 = Srelib.PadDouble(Convert.ToString(DR["r1"]));
        r2 = Srelib.PadDouble(Convert.ToString(DR["r2"]));
        r3 = Srelib.PadDouble(Convert.ToString(DR["r3"]));

        s4 = Srelib.PadDouble(Convert.ToString(DR["s4"]));



        // Conn.SqlConn.Close();

        DS.Dispose();
    }
Ejemplo n.º 3
0
    public void CalculaBordero(Boolean lPrimeira, String pXml)
    {
        // Conexao Conn = new Conexao(pXml);

        if ((adicional == "") || (adicional == null))
        {
            adicional = "0.00";
        }
        Double naux = Convert.ToDouble(adicional) + Convert.ToDouble(PegaValorSerasa(pXml));

        adicional = Srelib.PadDouble(Convert.ToString(naux));

        String Qry = "EXEC CALCULA_BOR " +
                     Srelib.QStr(empresa) + "," +
                     Srelib.QStr(cedente) + "," +
                     tipo_operacao + "," +
                     bordero + "," +
                     Srelib.QStr(Srelib.DataQuery(data_oper, DM.FormatoData)) + "," +
                     Srelib.QStr(Srelib.DataQuery(data_cadastro, DM.FormatoData)) + "," +
                     dmais + "," +
                     criterio + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(tdesc)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(tserv)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(tiss)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(txiof)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(tmora)) + "," +
                     lcalc + "," +
                     Srelib.QStr(tipograva) + "," +
                     Srelib.QStr(iof_ts) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(cpmf)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_che)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_dup)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_doc)) + "," +
                     cobserv + "," +
                     cobiof + "," +
                     cobiss + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(recompra)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_che2)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_dup2)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(custo_doc2)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(pis)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(fin)) + "," +
                     Srelib.QStr(df_no_pis) + "," +
                     Srelib.QStr(df_no_fim) + "," +
                     Srelib.QStr(zera_custos) + "," +
                     tipo_custo + "," +
                     tipo_cdi + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(cdbano)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(cdbmes)) + "," +
                     dc + "," +
                     du + "," +
                     ccdmais + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(juros_bancarios)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(iof_custos)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(vtac)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(npis)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(nfin)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(niss)) + "," +
                     visao + "," +
                     ndoc + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(adicional)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(nirpj)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(ncsocial)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(txsaq)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(valsaque)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2(cpmf2)) + "," +
                     Srelib.forcaponto(Srelib.TrNumeroString2("0.00"));


        DataSet    _StProc = new DataSet();
        SqlCommand Command = new SqlCommand(Qry, DM.ConexaoSessao);

        Command.CommandTimeout = 99999;
        SqlDataAdapter DA = new SqlDataAdapter();

        DA.TableMappings.Add("Table", "calcbor");
        DA.SelectCommand = Command;
        DA.Fill(_StProc);
        DataTable DT;

        DT = _StProc.Tables["calcbor"];
        DataRow DR = DT.Rows[0];

        // moradefault = Convert.ToString(DR["taxamora"]);

        if (lPrimeira)
        {
            nche                 = Convert.ToString(DR["nche"]);
            ndup                 = Convert.ToString(DR["ndup"]);
            cpmf                 = Convert.ToString(DR["cpmf"]);
            vche                 = Convert.ToString(DR["custo_che"]);
            vdup                 = Convert.ToString(DR["custo_dup"]);
            vdoc                 = Convert.ToString(DR["custo_doc"]);
            tche                 = Convert.ToString(DR["tche"]);
            tdup                 = Convert.ToString(DR["tdup"]);
            tdoc                 = Convert.ToString(DR["tdoc"]);
            adicional            = Convert.ToString(DR["adicional"]);
            txsaque              = Convert.ToDouble(DR["txsaque"]);
            valsaque             = Convert.ToString(DR["valsaque"]);
            cbcpmf               = Convert.ToString(DR["cbcpmf"]);
            cbnche               = Convert.ToString(DR["cbnche"]);
            cbndup               = Convert.ToString(DR["cbndup"]);
            cbndoc               = Convert.ToString(DR["cbndoc"]);
            cbndoc               = ndoc;
            cbvche               = Convert.ToString(DR["custo_che2"]);
            cbvdup               = Convert.ToString(DR["custo_dup2"]);
            cbvdoc               = Convert.ToString(DR["custo_doc2"]);
            cbtche               = Convert.ToString(DR["cbtche"]);
            cbtdup               = Convert.ToString(DR["cbtdup"]);
            cbtdoc               = Convert.ToString(DR["cbtdoc"]);
            tipo_custo           = Convert.ToString(DR["tipo_custo"]);
            tipo_cdi             = Convert.ToString(DR["tipo_cdi"]);
            cdbano               = Convert.ToString(DR["cdbano"]);
            cdbmes               = Convert.ToString(DR["cdbmes"]);
            dc                   = Convert.ToString(DR["dc"]);
            du                   = Convert.ToString(DR["du"]);
            ccdmais              = Convert.ToString(DR["ccdmais"]);
            jb                   = Convert.ToString(DR["juros_bancarios"]);
            iof_custos           = Convert.ToString(DR["iof_custos"]);
            vtac                 = Convert.ToString(DR["vtac"]);
            db                   = Convert.ToString(DR["kdb"]);
            liquido              = Convert.ToString(DR["kliquido"]);
            perc_retencao_ir     = Convert.ToString(DR["perc_retencao_ir"]);
            perc_retencao2_total = Convert.ToString(DR["perc_retencao2_total"]);
            retencao_ir          = Convert.ToString(DR["retencao_ir"]);
            retencao2_total      = Convert.ToString(DR["retencao2_total"]);
            perc_retencao_pis    = Convert.ToString(DR["perc_retencao_pis"]);
            perc_retencao_cofins = Convert.ToString(DR["perc_retencao_cofins"]);
            perc_retencao_csll   = Convert.ToString(DR["perc_retencao_csll"]);
            retencao_pis         = Convert.ToString(DR["retencao_pis"]);
            retencao_cofins      = Convert.ToString(DR["retencao_cofins"]);
            retencao_csll        = Convert.ToString(DR["retencao_csll"]);
            recompra             = Convert.ToString(DR["recompra"]);
            pago                 = Convert.ToString(DR["kpago"]);
            vcpmf                = Convert.ToString(DR["kvcpmf"]);
            tcpmf                = Convert.ToString(DR["ktcpmf"]);
            treceita             = Convert.ToString(DR["treceita"]);
            tdespesa             = Convert.ToString(DR["tdespesa"]);
            lucro                = Convert.ToString(DR["lucro"]);
            margem               = Convert.ToString(DR["margem"]);
            margem30             = Convert.ToString(DR["margem30"]);
            totimp               = Convert.ToString(DR["totimp"]);
            cdbmes               = Convert.ToString(DR["cdbmes"]);
            tover                = Convert.ToString(DR["tover"]);
            totcc                = Convert.ToString(DR["totcc"]);
            vjb                  = Convert.ToString(DR["vjb"]);
            viof_custos          = Convert.ToString(DR["viof_custos"]);
        }

        lPrimeira = false;
        empresa   = Convert.ToString(DR["empresa"]);
        cedente   = Convert.ToString(DR["cedente"]);
        nbord     = bordero;

        data_oper     = String.Format("{0:dd/MM/yyyy}", Convert.ToDateTime(DR["data_oper"]));
        data_cadastro = String.Format("{0:dd/MM/yyyy}", Convert.ToDateTime(DR["data_cadastro"]));

        dmais     = Convert.ToString(DR["dmais"]);
        criterio  = Convert.ToString(DR["criterio"]);
        tdesc     = Convert.ToString(DR["tdesc"]);
        tserv     = Convert.ToString(DR["tserv"]);
        tiss      = Convert.ToString(DR["tiss"]);
        txiof     = Convert.ToString(DR["txiof"]);
        tmora     = Convert.ToString(DR["tmora"]);
        vtt       = Convert.ToString(DR["ktotaltitulos"]);
        tdesconto = Convert.ToString(DR["totaldesconto"]);
        df        = Convert.ToString(DR["ktotaldesagio"]);
        pmpx      = Convert.ToString(DR["kpmpx"]);
        pmp0      = Convert.ToString(DR["kpmp0"]);
        ts        = Convert.ToString(DR["kts"]);
        iss       = Convert.ToString(DR["kiss"]);
        niof      = Convert.ToString(DR["niof"]);
        viof      = Convert.ToString(DR["viof"]);
        tiof      = Convert.ToString(DR["tiof"]);
        iof       = Convert.ToString(DR["iof"]);
        cbvcpmf   = Convert.ToString(DR["kcbvcpmf"]);
        cbtcpmf   = Convert.ToString(DR["kcbtcpmf"]);
        totcb     = Convert.ToString(DR["ktotcb"]);
        npis      = Convert.ToString(DR["npis"]);
        nfin      = Convert.ToString(DR["nfin"]);
        niss      = Convert.ToString(DR["niss"]);
        vpis      = Convert.ToString(DR["vpis"]);
        tpis      = Convert.ToString(DR["tpis"]);
        vfin      = Convert.ToString(DR["vfin"]);
        tfin      = Convert.ToString(DR["tfin"]);
        viss      = Convert.ToString(DR["viss"]);
        tiss2     = Convert.ToString(DR["tiss2"]);
        obs1      = "IMPORTADO DA APROVAÇÃO - GESTOR";
        obs2      = "";
        nirpj     = Convert.ToString(DR["nirpj"]);
        virpj     = Convert.ToString(DR["virpj"]);
        tirpj     = Convert.ToString(DR["tirpj"]);
        ncsocial  = Convert.ToString(DR["ncsocial"]);
        vcsocial  = Convert.ToString(DR["vcsocial"]);
        tcsocial  = Convert.ToString(DR["tcsocial"]);
        // gerente       =   ""; // _Cedente.PegaGerente(xCedente);
        ntitulos = Convert.ToString(DR["numtit"]);
        status   = "1";

        // Conn.SqlConn.Close();
    }
Ejemplo n.º 4
0
    public void PegaDadosDoCedente(String wcedente)
    {
        String sql = @"Select cnpj,
                              apelido, nome,
                              endereco,
                              bairro, cidade, uf, cep,
                              fone, contato, gerente, ramo, grupo,
                              isnull(l_acum,0.00) l_acum, 
                              isnull(l_acumch,0.00) l_acumch,
                              isnull(l_acumdp,0.00) l_acumdp,
                              isnull(l_sac,0.00) l_sac, 
                              isnull(l_sacch,0.00) l_sacch,
                              isnull(l_sacdp,0.00) l_sacdp,
                              dlimite,
                              isnull(l_valor,0.00) l_valor, 
                              isnull(l_titulos,0.00) l_titulos, 
                              vencimento,
                              isnull(l_nconf,0.00) l_nconf, 
                              isnull(limitech,0.00) limitech, 
                              isnull(pconfir,0.00) pconfir, 
                              isnull(cnpjmin,0.00) cnpjmin, 
                              isnull(prazomin,0) prazomin, 
                              isnull(prazomax,0) prazomax,
                              isnull(tdesc,0.00) tdesc, 
                              isnull(txserv,0.00) txserv 
                       from cedente where apelido=@cedente";

        SqlParameter[] parametros = { new SqlParameter("@cedente", wcedente) };
        DataSet        Ds         = SreDblib.GetDsCp(sql, parametros);

        // dados
        apelido       = "";
        cnpjformatado = "";
        cnpj          = "";
        raiz_cnpj     = "";
        grupo         = "";
        gerente       = "";
        ramo          = "";
        razaosocial   = "";
        endereco      = "";
        bairro        = "";
        cidade        = "";
        uf            = "";
        cep           = "";
        fones         = "";
        contatos      = "";
        l_acum        = "0.00";
        l_acumch      = "0.00";
        l_acumdp      = "0.00";
        l_sac         = "0.00";
        l_sacch       = "0.00";
        l_sacdp       = "0.00";
        fixacao       = "";
        l_valor       = "0.00";
        l_titulos     = "0";
        vencimento    = "";
        l_nconf       = "0.00";
        limitech      = "0.00";
        pconfir       = "0.00";
        cnpjmin       = "0.00";
        prazomin      = "0";
        prazomax      = "0";
        tdesc         = "0.00";
        txserv        = "0.00";

        if (Ds.Tables.Count > 0)
        {
            apelido   = Ds.Tables[0].Rows[0]["apelido"].ToString();
            cnpj      = Ds.Tables[0].Rows[0]["cnpj"].ToString();
            raiz_cnpj = cnpj;
            if (cnpj.Trim().Length == 14)
            {
                raiz_cnpj = raiz_cnpj.Substring(0, 8);
            }
            cnpjformatado = Srelib.FormataCPFCNPJ(cnpj);
            razaosocial   = Ds.Tables[0].Rows[0]["nome"].ToString();
            endereco      = Ds.Tables[0].Rows[0]["endereco"].ToString();
            bairro        = Ds.Tables[0].Rows[0]["bairro"].ToString();
            cidade        = Ds.Tables[0].Rows[0]["cidade"].ToString();
            uf            = Ds.Tables[0].Rows[0]["uf"].ToString();
            cep           = Ds.Tables[0].Rows[0]["cep"].ToString();
            fones         = Ds.Tables[0].Rows[0]["fone"].ToString();
            contatos      = Ds.Tables[0].Rows[0]["contato"].ToString();
            gerente       = Ds.Tables[0].Rows[0]["gerente"].ToString();
            ramo          = Ds.Tables[0].Rows[0]["ramo"].ToString();
            grupo         = Ds.Tables[0].Rows[0]["grupo"].ToString();

            l_titulos  = Ds.Tables[0].Rows[0]["l_titulos"].ToString();
            l_valor    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_valor"].ToString());
            l_acum     = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acum"].ToString());
            l_acumdp   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acumdp"].ToString());
            l_acumch   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_acumch"].ToString());
            l_sac      = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sac"].ToString());
            l_sacdp    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sacdp"].ToString());
            l_sacch    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_sacch"].ToString());
            vencimento = Srelib.PadData(Ds.Tables[0].Rows[0]["vencimento"].ToString());
            l_nconf    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["l_nconf"].ToString());
            limitech   = Srelib.PadDouble(Ds.Tables[0].Rows[0]["limitech"].ToString());
            pconfir    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["pconfir"].ToString());
            cnpjmin    = Srelib.PadDouble(Ds.Tables[0].Rows[0]["cnpjmin"].ToString());
            prazomin   = Ds.Tables[0].Rows[0]["prazomin"].ToString();
            prazomax   = Ds.Tables[0].Rows[0]["prazomax"].ToString();
            fixacao    = Srelib.PadData(Ds.Tables[0].Rows[0]["dlimite"].ToString());
            tdesc      = Srelib.PadDouble(Ds.Tables[0].Rows[0]["tdesc"].ToString());
            txserv     = Srelib.PadDouble(Ds.Tables[0].Rows[0]["txserv"].ToString());
        }
    }