private void btnPagarSaldo_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtImportePagado.Text == "")
            {
                MessageBox.Show("Debe ingresar un importe", Clases.cMensaje.Mensaje());
                return;
            }

            double Saldo   = fun.ToDouble(txtSaldo.Text);
            double Importe = fun.ToDouble(txtImportePagado.Text);

            if (Importe > Saldo)
            {
                MessageBox.Show("El saldo es superior al importe", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cMovimiento mov         = new Clases.cMovimiento();
            Clases.cSaldoCuota saldoCuotas = new Clases.cSaldoCuota();
            string             Descripcion = "PAGO DE SALDO CUOTA" + txtCuota.Text;

            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            Int32 Cuota    = Convert.ToInt32(txtCuota.Text);
            Int32 CodGrupo = Convert.ToInt32(txtCodGrupo.Text);

            Clases.cSaldoCuotasAnteriores salCuotas = new Clases.cSaldoCuotasAnteriores();
            Clases.cCuotasAnteriores      cuota     = new Clases.cCuotasAnteriores();
            DateTime Fecha = Convert.ToDateTime(txtFecha.Text);

            cuota.PagarSaldoCuota(CodGrupo, Cuota, Importe);
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion);
            salCuotas.InsertarSaldoCob(CodGrupo, Cuota, Fecha, Importe);
            MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje());
        }
示例#2
0
        private void BuscarDocumentos(Int32 CodGrupo)
        {   //
            cCuotasAnteriores cuota = new Clases.cCuotasAnteriores();
            DataTable         trdo  = cuota.GetDocumentosAnterioresxCodigo(CodGrupo);

            if (trdo.Rows.Count > 0)
            {
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtPatente.Text     = trdo.Rows[0]["Patente"].ToString();
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                if (trdo.Rows[0]["CodMarca"].ToString() != "")
                {
                    cmb_CodMarca.SelectedValue = trdo.Rows[0]["CodMarca"].ToString();
                }
                txtTelefono.Text  = trdo.Rows[0]["Telefono"].ToString();
                txtDireccion.Text = trdo.Rows[0]["Direccion"].ToString();
            }
            cFunciones fun   = new cFunciones();
            DataTable  tplan = cuota.GetPlan(CodGrupo);

            tplan = fun.TablaaMiles(tplan, "Importe");
            tplan = fun.TablaaMiles(tplan, "Saldo");
            GrillaCuotas.DataSource = tplan;
            fun.AnchoColumnas(GrillaCuotas, "20;20;20;20;20");
            btnGrabar.Visible = false;
        }
        private void GrillaCuotas_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string Cuota         = GrillaCuotas.CurrentRow.Cells[1].Value.ToString();
            string Importe       = GrillaCuotas.CurrentRow.Cells[3].Value.ToString();
            string ImportePagado = GrillaCuotas.CurrentRow.Cells[5].Value.ToString();
            string Fecha         = GrillaCuotas.CurrentRow.Cells[2].Value.ToString();
            string CodGrupo      = GrillaCuotas.CurrentRow.Cells[0].Value.ToString();

            GetPunitorio(Convert.ToInt32(CodGrupo), Convert.ToInt32(Cuota));
            Clases.cFunciones fun = new Clases.cFunciones();

            if (Cuota != "")
            {
                txtCuota.Text         = Cuota;
                txtImporte.Text       = Importe;
                txtImportePagado.Text = ImportePagado;
                txtFecha.Text         = Fecha;
                if (txtImporte.Text != "")
                {
                    //string xx = trdo.Rows[0]["Importe"].ToString().Replace (",",".").ToString();
                    txtImporte.Text  = fun.TransformarEntero(Importe);
                    txtImporte.Text  = fun.FormatoEnteroMiles(txtImporte.Text);
                    txtCodGrupo.Text = CodGrupo.ToString();
                    if (txtImportePagado.Text != "")
                    {
                        btnAnular.Enabled     = true;
                        btnPagarSaldo.Visible = true;
                        // txtImportePagado.ReadOnly = true;
                        btnGrabar.Enabled     = false;
                        txtImportePagado.Text = fun.TransformarEntero(txtImportePagado.Text);
                        txtImportePagado.Text = fun.FormatoEnteroMiles(txtImportePagado.Text);
                        txtSaldo.Text         = (fun.ToDouble(txtImporte.Text) - fun.ToDouble(txtImportePagado.Text)).ToString();
                    }
                    else
                    {
                        btnPagarSaldo.Visible = false;
                        txtSaldo.Text         = "";
                        btnAnular.Enabled     = false;
                        btnGrabar.Enabled     = true;
                        // txtImportePagado.ReadOnly = false;
                    }
                }
                //obtengo la deuda total
                Clases.cCuotasAnteriores objCuota = new Clases.cCuotasAnteriores();
                txtTotalDeuda.Text = objCuota.GetSaldoDeudaCuotas(Convert.ToInt32(CodGrupo)).ToString();
                if (txtTotalDeuda.Text != "")
                {
                    txtTotalDeuda.Text = fun.TransformarEntero(txtTotalDeuda.Text);
                    txtTotalDeuda.Text = fun.FormatoEnteroMiles(txtTotalDeuda.Text);
                }
            }
        }
        private void CargarPlandeCuotas(Int32 CodCompra)
        {
            Clases.cCuotasAnteriores cuota = new Clases.cCuotasAnteriores();
            DataTable trdo = cuota.GetCuotasxCodVenta(CodCompra);

            GrillaCuotas.DataSource            = trdo;
            GrillaCuotas.Columns[0].Visible    = false;
            GrillaCuotas.Columns[2].HeaderText = "Fecha Vto";
            GrillaCuotas.Columns[4].HeaderText = "Fecha Pago";
            GrillaCuotas.Columns[4].Width      = 120;
            GrillaCuotas.Columns[5].HeaderText = "Imp. pago";
            GrillaCuotas.Columns[4].Width      = 150;
        }
示例#5
0
        private void GrabarCuotas()
        {
            string Cuota             = "";
            string ImporteCuota      = "";
            string FechaVecimiento   = "";
            string ImporteSinInteres = "";
            string sqlInsertCuota    = "";
            string Nombre            = txtNombre.Text;
            string Apellido          = txtApellido.Text;
            string Telefono          = txtTelefono.Text;
            string Direccion         = txtDireccion.Text;
            Int32  CodMarca          = Convert.ToInt32(cmb_CodMarca.SelectedValue);
            string Anio = txtAnio.Text;

            Clases.cCuotasAnteriores cuotaAnt = new Clases.cCuotasAnteriores();
            Int32 CodGrupo = cuotaAnt.GetMaxCodGrupo();

            for (int i = 0; i < GrillaCuotas.Rows.Count - 1; i++)
            {
                Cuota             = GrillaCuotas.Rows[i].Cells[0].Value.ToString();
                ImporteCuota      = GrillaCuotas.Rows[i].Cells[1].Value.ToString();
                FechaVecimiento   = GrillaCuotas.Rows[i].Cells[2].Value.ToString();
                ImporteSinInteres = GrillaCuotas.Rows[i].Cells[3].Value.ToString();
                sqlInsertCuota    = "Insert into CuotasAnteriores(CodGrupo,Cuota,Importe,FechaVencimiento,Saldo,ImporteSinInteres,Nombre,Apellido,Telefono,Patente,Descripcion,CodMarca,Anio,Direccion)";
                sqlInsertCuota    = sqlInsertCuota + " values (";
                sqlInsertCuota    = sqlInsertCuota + CodGrupo.ToString();
                sqlInsertCuota    = sqlInsertCuota + "," + Cuota;
                sqlInsertCuota    = sqlInsertCuota + "," + ImporteCuota;
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + FechaVecimiento + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + ImporteCuota;
                sqlInsertCuota    = sqlInsertCuota + "," + ImporteSinInteres;
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + Nombre + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + Apellido + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + Telefono + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + txtPatente.Text + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + txtDescripcion.Text + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + CodMarca.ToString();
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + Anio + "'";
                sqlInsertCuota    = sqlInsertCuota + "," + "'" + Direccion + "'";
                sqlInsertCuota    = sqlInsertCuota + ")";
                Clases.cDb.ExecutarNonQuery(sqlInsertCuota);
            }
            MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje());
            Limpiar();
        }
        private void Buscar()
        {
            if (txtCodGrupo.Text == "")
            {
                MessageBox.Show("Debe ingresar una patente", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cCuotasAnteriores cuotas = new Clases.cCuotasAnteriores();
            DataTable trdo = cuotas.GetCuotasAnterioresxCodGrupo(Convert.ToInt32(txtCodGrupo.Text));

            if (trdo.Rows.Count > 0)
            {
                txtPatente.Text     = trdo.Rows[0]["Patente"].ToString();
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtCodGrupo.Text    = trdo.Rows[0]["CodGrupo"].ToString();
                txtTelefono.Text    = trdo.Rows[0]["Telefono"].ToString();
                txtAnio.Text        = trdo.Rows[0]["Anio"].ToString();
                if (trdo.Rows[0]["CodMarca"].ToString() != "")
                {
                    cmb_CodMarca.SelectedValue = trdo.Rows[0]["CodMarca"].ToString();
                }
                CargarPlandeCuotas(Convert.ToInt32(txtCodGrupo.Text));
            }
            else
            {
                txtDescripcion.Text        = "";
                txtTelefono.Text           = "";
                txtApellido.Text           = "";
                txtNombre.Text             = "";
                txtCodGrupo.Text           = "";
                txtAnio.Text               = "";
                cmb_CodMarca.SelectedIndex = 0;
                GrillaCuotas.DataSource    = null;
            }
        }
        private void btnAnular_Click(object sender, EventArgs e)
        {
            if (txtCuota.Text == "")
            {
                MessageBox.Show("Debe ingresar una cuota para continuar.", Clases.cMensaje.Mensaje());
                return;
            }
            if (txtImportePagado.Text == "")
            {
                MessageBox.Show("Debe ingresar un monto de la cuota.", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cFunciones fun           = new Clases.cFunciones();
            double            Importe       = fun.ToDouble(txtImporte.Text);
            double            ImportePagado = fun.ToDouble(txtImportePagado.Text);

            ImportePagado = ImportePagado * (-1);
            Int32 CodUsuario = Principal.CodUsuarioLogueado;
            Int32 Cuota      = Convert.ToInt32(txtCuota.Text);
            Int32 CodGrupo   = Convert.ToInt32(txtCodGrupo.Text);

            GetPunitorio(CodGrupo, Cuota);
            Double Punitorio = 0;

            if (txtPunitorio.Text != "")
            {
                Punitorio = fun.ToDouble(txtPunitorio.Text);
            }
            Punitorio = Punitorio * (-1);
            Clases.cCuotasAnteriores objCuota = new Clases.cCuotasAnteriores();
            if (objCuota.AnularCuota(CodGrupo, Cuota, ImportePagado, CodUsuario, txtPatente.Text, Punitorio))
            {
                MessageBox.Show("Datos grabados correctamente.", Clases.cMensaje.Mensaje());
                CargarPlandeCuotas(CodGrupo);
            }
        }
示例#8
0
        private void Actualizar()
        {
            //obtengo el importe de documentos a cobrar
            GetDeudasxPrestamo();
            GetEfectivosaPagar();
            GetCobranzaGeneral();
            GetChequesPagar();
            Clases.cFunciones        fun       = new Clases.cFunciones();
            Clases.cCuota            cuota     = new Clases.cCuota();
            Clases.cCuotasAnteriores cuotasAnt = new Clases.cCuotasAnteriores();
            Clases.cCheque           cheque    = new Clases.cCheque();
            Double ImporteCheque = cheque.GetTotalChequesaCobrar();

            Clases.cChequeCobrar chequeCob = new Clases.cChequeCobrar();
            ImporteCheque = ImporteCheque + chequeCob.GetTotalChequesaCobrar();
            Double Importe = cuota.GetMontoCuotasImpagas();
            Double ImporteCuotasAnteriores = cuotasAnt.GetMontoCuotasImpagas();

            Importe = Importe + ImporteCuotasAnteriores;
            Double ImporteSinInteres          = cuota.GetMontoCuotasImpagasSinInteres();
            double ImporteSinInteresCuotasAnt = cuotasAnt.GetMontoCuotasImpagasSinInteres();

            ImporteSinInteres            = ImporteSinInteres + ImporteSinInteresCuotasAnt;
            txtDocumentos.Text           = fun.TransformarEntero(Importe.ToString().Replace(",", "."));
            txtDocumentos.Text           = fun.FormatoEnteroMiles(txtDocumentos.Text);
            txtDocumentosSinInteres.Text = ImporteSinInteres.ToString();
            txtDocumentosSinInteres.Text = fun.TransformarEntero(ImporteSinInteres.ToString());
            txtDocumentosSinInteres.Text = fun.FormatoEnteroMiles(txtDocumentosSinInteres.Text);
            txtTotalCheque.Text          = fun.FormatoEnteroMiles(ImporteCheque.ToString());
            Clases.cResumenCuentas res = new Clases.cResumenCuentas();
            DataTable trdo             = res.GetResumenCuentas();

            if (trdo.Rows.Count > 0)
            {
                double ImporteEfectivo = Convert.ToDouble(trdo.Rows[0]["ImporteEfectivo"]);
                txtEfectivo.Text = fun.TransformarEntero(ImporteEfectivo.ToString().Replace(",", "."));
                txtEfectivo.Text = fun.FormatoEnteroMiles(txtEfectivo.Text);

                double ImporteAuto = Convert.ToDouble(trdo.Rows[0]["ImporteAuto"]);
                txtVehículo.Text = fun.TransformarEntero(ImporteAuto.ToString().Replace(",", "."));
                txtVehículo.Text = fun.FormatoEnteroMiles(txtVehículo.Text);

                double ImportePrenda = Convert.ToDouble(trdo.Rows[0]["ImportePrenda"]);
                txtPrenda.Text = fun.TransformarEntero(ImportePrenda.ToString().Replace(",", "."));
                txtPrenda.Text = fun.FormatoEnteroMiles(txtPrenda.Text);

                double ImporteCobranza = Convert.ToDouble(trdo.Rows[0]["ImporteCobranza"]);
                txtCobranzas.Text = fun.TransformarEntero(ImporteCobranza.ToString().Replace(",", "."));
                txtCobranzas.Text = fun.FormatoEnteroMiles(txtCobranzas.Text);

                double ImporteBanco = Convert.ToDouble(trdo.Rows[0]["ImporteBanco"]);
                txtBanco.Text = fun.TransformarEntero(ImporteBanco.ToString().Replace(",", "."));
                txtBanco.Text = fun.FormatoEnteroMiles(txtBanco.Text);

                Clases.cComisionVendedor com = new Clases.cComisionVendedor();
                txtComisiones.Text = com.GetComisionesPendientes().ToString();
                if (txtComisiones.Text != "")
                {
                    txtComisiones.Text = fun.FormatoEnteroMiles(txtComisiones.Text);
                }

                Clases.cGastosPagar gasto = new Clases.cGastosPagar();
                txtGastosPendientes.Text = gasto.GetGastosaPagar().ToString();

                if (txtGastosPendientes.Text != "")
                {
                    txtGastosPendientes.Text = fun.FormatoEnteroMiles(txtGastosPendientes.Text);
                }

                Clases.cCobranza cob = new Clases.cCobranza();
                txtCobranzas.Text = cob.GetTotalDeudaCobranzas().ToString();
                txtCobranzas.Text = fun.FormatoEnteroMiles(txtCobranzas.Text);
                GetPrendas();
                GetTotalVehiculo();
                GetTarjeta();
            }
        }
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (txtCuota.Text == "")
            {
                MessageBox.Show("Debe ingresar una cuota para continuar.", Clases.cMensaje.Mensaje());
                return;
            }
            if (txtImportePagado.Text == "")
            {
                MessageBox.Show("Debe ingresar un monto de la cuota.", Clases.cMensaje.Mensaje());
                return;
            }
            Clases.cFunciones fun           = new Clases.cFunciones();
            double            Importe       = fun.ToDouble(txtImporte.Text);
            double            ImportePagado = fun.ToDouble(txtImportePagado.Text);
            Int32             CodUsuario    = Principal.CodUsuarioLogueado;

            if (ImportePagado > Importe)
            {
                MessageBox.Show("El importe a abonar es superior al valor de la cuota", Clases.cMensaje.Mensaje());
                return;
            }

            if (ImportePagado < Importe)
            {
                var result = MessageBox.Show("El importe abonado es inferior al valor de la cuota, Confirma Pago de la cuota?", Clases.cMensaje.Mensaje(),
                                             MessageBoxButtons.YesNo,
                                             MessageBoxIcon.Question);

                // If the no button was pressed ...
                if (result == DialogResult.No)
                {
                    return;
                }
            }

            Int32    CodGrupo  = Convert.ToInt32(txtCodGrupo.Text);
            Int32    Cuota     = Convert.ToInt32(txtCuota.Text);
            DateTime FechaPago = Convert.ToDateTime(txtFecha.Text);
            double   Saldo     = Importe - ImportePagado;
            Double   Punitorio = 0;

            if (txtPunitorio.Text != "")
            {
                Punitorio = fun.ToDouble(txtPunitorio.Text);
            }
            Clases.cCuotasAnteriores objCuota = new Clases.cCuotasAnteriores();
            if (objCuota.GrabarCuota(CodGrupo, Cuota, FechaPago, ImportePagado, Saldo, CodUsuario, txtPatente.Text, Punitorio))
            {
                MessageBox.Show("Cuota grabada correctamente.", Clases.cMensaje.Mensaje());
                CargarPlandeCuotas(Convert.ToInt32(CodGrupo));

                txtTotalDeuda.Text = objCuota.GetSaldoDeudaCuotas(Convert.ToInt32(CodGrupo)).ToString();
                if (txtTotalDeuda.Text != "")
                {
                    txtTotalDeuda.Text = fun.TransformarEntero(txtTotalDeuda.Text);
                    txtTotalDeuda.Text = fun.FormatoEnteroMiles(txtTotalDeuda.Text);
                }
            }
            else
            {
                MessageBox.Show("Hubo un error en el proceso de grabación.", Clases.cMensaje.Mensaje());
            }
        }
示例#10
0
        private void GetGanancia()
        {
            Clases.cFunciones         fun                  = new Clases.cFunciones();
            Clases.cVenta             objVenta             = new Clases.cVenta();
            Clases.cPunitorioCobranza objPunitorioCobranza = new Clases.cPunitorioCobranza();
            Clases.cPunitorioCuota    objPunitorioCuota    = new Clases.cPunitorioCuota();
            DateTime  FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime  FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable trdo       = objVenta.GetVentasxFecha(FechaDesde, FechaHasta, "", null);

            Clases.cPreVenta objPreVenta = new Clases.cPreVenta();
            DataTable        trdo2       = objPreVenta.GetPreVentasxFecha(FechaDesde, FechaHasta, "", null);
            //le agre[g
            string Dato      = "";
            Int32  PosPintar = 0;

            PosPintar = trdo.Rows.Count;
            for (int i = 0; i < trdo2.Rows.Count; i++)
            {
                DataRow fila;
                fila = trdo.NewRow();
                for (int j = 0; j < trdo2.Columns.Count; j++)
                {
                    Dato    = trdo2.Rows[i][j].ToString();
                    fila[j] = Dato;
                }
                trdo.Rows.Add(fila);
            }
            Clases.cPunitorioCuotasAnteriores objPunDocAnt = new Clases.cPunitorioCuotasAnteriores();
            Int32 Cant = trdo.Rows.Count;

            txtCantidad.Text = Cant.ToString();
            trdo             = fun.TablaaMiles(trdo, "ImporteVenta");
            trdo             = fun.TablaaMiles(trdo, "ImporteEfectivo");
            trdo             = fun.TablaaMiles(trdo, "ImporteAutoPartePago");
            trdo             = fun.TablaaMiles(trdo, "ImporteCredito");
            trdo             = fun.TablaaMiles(trdo, "ImportePrenda");
            trdo             = fun.TablaaMiles(trdo, "Cheque");
            trdo             = fun.TablaaMiles(trdo, "ImporteCobranza");
            trdo             = fun.TablaaMiles(trdo, "Ganancia");
            double Utilidad = fun.TotalizarColumna(trdo, "Ganancia");
            Double ImportePunitorioCobranza        = objPunitorioCobranza.GetImportexFecha(FechaDesde, FechaHasta);
            Double ImportePunitorioCuota           = objPunitorioCuota.GetImportexFecha(FechaDesde, FechaHasta);
            Double ImportePunitorioCuotasAnterioes = objPunDocAnt.GetImportexFecha(FechaDesde, FechaHasta);
            Double TotalPunitorio = ImportePunitorioCobranza + ImportePunitorioCuota + ImportePunitorioCuotasAnterioes;

            txtUtilidad.Text = fun.TotalizarColumna(trdo, "Ganancia").ToString();
            txtUtilidad.Text = fun.FormatoEnteroMiles(txtUtilidad.Text);

            Clases.cGastosNegocio gastos = new Clases.cGastosNegocio();
            double TotalGastos           = gastos.GetGastosNegocioxFecha(FechaDesde, FechaHasta);

            txtGastos.Text = fun.SepararDecimales(TotalGastos.ToString());
            txtGastos.Text = fun.FormatoEnteroMiles(txtGastos.Text);

            Clases.cPagoIntereses objpago = new Clases.cPagoIntereses();
            double TotalPago = objpago.GetResumenPagosInteresesxFecha(FechaDesde, FechaHasta);

            txtInteresesPagados.Text = fun.SepararDecimales(TotalPago.ToString());
            txtInteresesPagados.Text = fun.FormatoEnteroMiles(txtInteresesPagados.Text);
            double InteresesGanados = 0;

            Clases.cCuotasAnteriores cuotasAnt = new Clases.cCuotasAnteriores();
            Clases.cCuota            cuota     = new Clases.cCuota();
            InteresesGanados         = cuota.GetGanaciaCobroCuotas(FechaDesde, FechaHasta);
            InteresesGanados         = InteresesGanados + cuotasAnt.GetGanaciaCobroCuotas(FechaDesde, FechaHasta);
            txtInteresesGanados.Text = InteresesGanados.ToString();
            txtInteresesGanados.Text = fun.FormatoEnteroMiles(txtInteresesGanados.Text);
            double Ganancia = Utilidad + TotalPunitorio - TotalPago - TotalGastos + InteresesGanados;

            txtResultado.Text = fun.SepararDecimales(Ganancia.ToString());
            txtResultado.Text = fun.FormatoEnteroMiles(txtResultado.Text);
            txtPunitorio.Text = TotalPunitorio.ToString();
            txtPunitorio.Text = fun.FormatoEnteroMiles(txtPunitorio.Text);
        }
示例#11
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                MessageBox.Show("Fecha desde incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                MessageBox.Show("Fecha hasta incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            if (Convert.ToDateTime(txtFechaDesde.Text) > Convert.ToDateTime(txtFechaHasta.Text))
            {
                MessageBox.Show("La fecha desde debe ser inferior a la fecha hasta", Clases.cMensaje.Mensaje());
                return;
            }

            Boolean SoloImpago = false;

            if (chkImpagos.Checked == true)
            {
                SoloImpago = true;
            }
            //Clases.cFunciones fun = new Clases.cFunciones();
            Clases.cCuotasAnteriores cuota = new Clases.cCuotasAnteriores();
            DateTime  FechaDesde           = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime  FechaHasta           = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable trdo = cuota.GetDeuda(FechaDesde, FechaHasta, SoloImpago, txtPatente.Text, txtApellido.Text);

            trdo          = fun.TablaaMiles(trdo, "Saldo");
            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            else
            {
                txtTotal.Text = "0";
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "ImportePagado");
            Grilla.DataSource            = trdo;
            Grilla.Columns[2].HeaderText = "Importe Pagado";
            //Grilla.Columns[6].HeaderText = "Teléfono";
            //Grilla.Columns[1].Width = 150;
            Grilla.Columns[2].Width = 150;
            //Grilla.Columns[3].Width = 150;
            //Grilla.Columns[0].Width = 78;
            //Grilla.Columns[5].Width = 150;
            //Grilla.Columns[6].Width = 150;
            //Grilla.Columns[7].Width = 150;
            //Grilla.Columns[8].Width = 150;
            //Grilla.Columns[6].Visible = false;
            //Grilla.Columns[7].Visible = false;
            //Grilla.Columns[8].Width = 120;
            //Grilla.Columns[3].Width = 80;
            Grilla.Columns[9].Width = 190;
            // Grilla.Columns[10].Width = 200;
        }