Ejemplo n.º 1
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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);

            Clases.cGastosNegocio gasto = new Clases.cGastosNegocio();
            DataTable             trdo  = gasto.GetGastosNegocioxFecha(FechaDesde, FechaHasta, txtDescripcion.Text);

            trdo                      = fun.TablaaMiles(trdo, "Importe");
            txtTotal.Text             = fun.TotalizarColumna(trdo, "Importe").ToString();
            txtTotal.Text             = fun.FormatoEnteroMiles(txtTotal.Text);
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = false;
            Grilla.Columns[2].Width   = 523;
        }
Ejemplo n.º 2
0
        private void BuscarAutosdeStock(string Patente, Int32?CodMarca)
        {
            double Total = 0;

            Clases.cFunciones fun   = new Clases.cFunciones();
            Clases.cStockAuto stock = new Clases.cStockAuto();
            DataTable         trdo  = stock.GetStockDetalladosVigente(Patente, CodMarca);

            trdo  = fun.TablaaMiles(trdo, "Costo");
            Total = fun.TotalizarColumna(trdo, "Costo");
            txtTotalVehiculos.Text       = trdo.Rows.Count.ToString();
            Grilla.DataSource            = trdo;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[2].Width      = 195;
            Grilla.Columns[3].Width      = 280;
            Grilla.Columns[4].Width      = 90;
            Grilla.Columns[5].Width      = 200;
            Grilla.Columns[4].HeaderText = "Fecha";
            Grilla.Columns[5].HeaderText = "Ex Titular";
            Grilla.Columns[7].HeaderText = "Concesión";
            txtMontoTotal.Text           = Total.ToString();
            if (txtMontoTotal.Text != "")
            {
                txtMontoTotal.Text = fun.SepararDecimales(txtMontoTotal.Text);
                txtMontoTotal.Text = fun.FormatoEnteroMiles(txtMontoTotal.Text);
            }
        }
        private void Buscar()
        {
            if (fun.ValidarFecha(txtFechaDesde.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }

            if (fun.ValidarFecha(txtFechaHasta.Text) == false)
            {
                Mensaje("La fecha desde es incorrecta");
                return;
            }
            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);

            if (FechaDesde > FechaHasta)
            {
                Mensaje("La fecha desde es superior a la fecha hasta ");
                return;
            }

            Clases.cAnotacion obj          = new Clases.cAnotacion();
            DataTable         trdo         = obj.GetAnotacionesxFecha(FechaDesde, FechaHasta, txtConcepto.Text.Trim());
            double            TotalIngreso = fun.TotalizarColumna(trdo, "ImporteIngreso");
            double            TotalEgreso  = fun.TotalizarColumna(trdo, "ImporteEgreso");

            trdo = fun.TablaaMiles(trdo, "ImporteIngreso");
            trdo = fun.TablaaMiles(trdo, "ImporteEgreso");
            Grilla.DataSource = trdo;
            double dif = TotalIngreso - TotalEgreso;

            txtTotal.Text = dif.ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            Grilla.Columns[1].HeaderText = "Descripción";
            Grilla.Columns[3].HeaderText = "Ingreso";
            Grilla.Columns[4].HeaderText = "Egreso";
            Grilla.Columns[1].Width      = 500;
            Grilla.Columns[3].Width      = 100;
            Grilla.Columns[4].Width      = 103;
            Grilla.Columns[0].Visible    = false;
        }
Ejemplo n.º 4
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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      Impagos    = 0;
            Int32?   CodBanco   = null;
            string   NroCheque  = "";

            if (cmbBanco.SelectedIndex > 0)
            {
                CodBanco = Convert.ToInt32(cmbBanco.SelectedValue);
            }
            NroCheque = txtNumeroCheque.Text;
            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }
            Clases.cCheque cheque = new Clases.cCheque();
            DataTable      trdo   = cheque.GetChequesxFecha(FechaDesde, FechaHasta, Impagos, CodBanco, NroCheque);

            trdo          = fun.TablaaMiles(trdo, "Importe");
            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].Width      = 100;
            Grilla.Columns[1].HeaderText = "Fec. Cobro";
            Grilla.Columns[2].Width      = 100;
            Grilla.Columns[2].HeaderText = "Fecha Vto.";
            Grilla.Columns[3].Width      = 140;
            Grilla.Columns[3].HeaderText = "Nro. Cheque";
            Grilla.Columns[5].Width      = 220;
            Grilla.Columns[6].Visible    = false;
        }
Ejemplo n.º 5
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;
            }

            int Impago = 0;

            if (chkImpagos.Checked == true)
            {
                Impago = 1;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      Impagos    = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }
            Clases.cChequesaPagar cheque = new Clases.cChequesaPagar();
            DataTable             trdo   = cheque.GetChequesPagar(FechaDesde, FechaHasta, Impago, txtPatente.Text);

            txtTotal.Text                = fun.TotalizarColumna(trdo, "Importe").ToString();
            txtTotal.Text                = fun.FormatoEnteroMiles(txtTotal.Text);
            trdo                         = fun.TablaaMiles(trdo, "Importe");
            trdo                         = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].HeaderText = "Nro de cheque";
            Grilla.Columns[6].HeaderText = "Fecha Pago";
            Grilla.Columns[9].HeaderText = "Fecha Vto";
            Grilla.Columns[5].Width      = 130;
            Grilla.Columns[1].Width      = 140;
            Grilla.Columns[2].Width      = 150;
            Grilla.Columns[3].Width      = 100;
            Grilla.Columns[6].Width      = 110;
            Grilla.Columns[7].Width      = 180;
            Grilla.Columns[7].HeaderText = "Descripción";
            Grilla.Columns[0].Visible    = false;
        }
Ejemplo n.º 6
0
        private void CargarGrilla()
        {
            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;
            }

            int soloImpago = 0;

            if (chkImpagos.Checked)
            {
                soloImpago = 1;
            }
            string Nombre = txtNombre.Text;

            Clases.cPrestamo prestamo   = new Clases.cPrestamo();
            DateTime         FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime         FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable        tb         = prestamo.GetPrestamosxFecha(FechaDesde, FechaHasta, Nombre, soloImpago);

            tb            = fun.TablaaMiles(tb, "Importe");
            tb            = fun.TablaaMiles(tb, "ImporteaPagar");
            txtTotal.Text = fun.TotalizarColumna(tb, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            Grilla.DataSource            = tb;
            Grilla.Columns[1].Width      = 290;
            Grilla.Columns[2].Width      = 170;
            Grilla.Columns[5].HeaderText = "Fecha";
            Grilla.Columns[5].Width      = 100;
            Grilla.Columns[7].HeaderText = "Importe a pagar";
            Grilla.Columns[7].Width      = 140;
            Grilla.Columns[8].HeaderText = "Fecha Pago";
            Grilla.Columns[8].Width      = 130;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[4].Visible    = false;
        }
Ejemplo n.º 7
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;
            }

            int Impagos = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }

            Clases.cPrenda prenda     = new Clases.cPrenda();
            DateTime       FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime       FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable      trdo       = prenda.GetPrendasxFecha(FechaDesde, FechaHasta, Impagos, txtPatente.Text, txtApellido.Text);

            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            trdo = fun.TablaaMiles(trdo, "ImportePagado");
            trdo = fun.TablaaMiles(trdo, "Diferencia");
            Grilla.DataSource            = trdo;
            Grilla.Columns[1].HeaderText = "Descripción";
            Grilla.Columns[1].Width      = 150;
            Grilla.Columns[2].Width      = 350;
            Grilla.Columns[5].HeaderText = "Fecha Pago";
            Grilla.Columns[5].Width      = 140;
            Grilla.Columns[6].Visible    = false;
            Grilla.Columns[7].HeaderText = "Pagado";
            Grilla.Columns[8].HeaderText = "Diferencia";
        }
Ejemplo n.º 8
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            //arreglar que no graba el cod cliente en cobranza
            //en eo form de venta

            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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            Int32    SoloImpago = 0;

            if (chkImpago.Checked == true)
            {
                SoloImpago = 1;
            }
            Clases.cCobranza cob  = new Clases.cCobranza();
            DataTable        trdo = cob.GetCobranzaxFecha(FechaDesde, FechaHasta, txtPatente.Text, txtApellido.Text, SoloImpago);

            trdo          = fun.TablaaMiles(trdo, "Saldo");
            txtTotal.Text = fun.TotalizarColumna(trdo, "Saldo").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource            = trdo;
            Grilla.Columns[4].HeaderText = "Fecha Pago";
            Grilla.Columns[6].HeaderText = "Fecha Comp.";
            Grilla.Columns[1].Width      = 150;
            Grilla.Columns[2].Width      = 200;
            Grilla.Columns[4].Width      = 120;
            Grilla.Columns[5].Width      = 120;
            Grilla.Columns[6].Width      = 158;
        }
        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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      SoloImpago = 0;

            if (chkSoloImpagos.Checked)
            {
                SoloImpago = 1;
            }
            cCobranzaGeneral cob  = new cCobranzaGeneral();
            DataTable        trdo = cob.GetCobranzasGeneralesxFecha(FechaDesde, FechaHasta, SoloImpago, txtConcepto.Text, txtCliente.Text);

            txtTotal.Text                = fun.TotalizarColumna(trdo, "Saldo").ToString();
            trdo                         = fun.TablaaMiles(trdo, "Importe");
            trdo                         = fun.TablaaMiles(trdo, "ImportePagado");
            trdo                         = fun.TablaaMiles(trdo, "Saldo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[4].HeaderText = "Importe Pagado";
            Grilla.Columns[5].HeaderText = "Fecha Pago";
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[1].Width      = 240;
            Grilla.Columns[4].Width      = 140;
            Grilla.Columns[5].Width      = 120;
            Grilla.Columns[7].Width      = 120;
            if (txtTotal.Text != "" && txtTotal.Text != "0")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
        }
Ejemplo n.º 10
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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            int      Impagos    = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }
            //Clases.cFunciones fun = new Clases.cFunciones();
            Clases.cGastosPagar gasto = new Clases.cGastosPagar();
            DataTable           trdo  = gasto.GetGastosPagarxFecha(FechaDesde, FechaHasta, txtPatente.Text, Impagos);

            trdo                         = fun.TablaaMiles(trdo, "Importe");
            txtTotal.Text                = fun.TotalizarColumna(trdo, "Importe").ToString();
            Grilla.DataSource            = trdo;
            Grilla.Columns[5].HeaderText = "Fecha Pago";
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[1].Width      = 160;
            Grilla.Columns[2].Width      = 355;
            Grilla.Columns[4].Width      = 120;
            Grilla.Columns[5].Width      = 110;
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
        }
        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;
            }

            int Impagos = 0;

            if (chkImpagos.Checked == true)
            {
                Impagos = 1;
            }

            Clases.cPrenda prenda     = new Clases.cPrenda();
            DateTime       FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime       FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);

            Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar();
            DataTable trdo             = obj.GetEfectivosaPagarxFecha(FechaDesde, FechaHasta, txtPatente.Text.Trim(), Impagos);

            trdo = fun.TablaaMiles(trdo, "Saldo");
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource         = trdo;
            Grilla.Columns[0].Visible = true;
            Grilla.Columns[5].Width   = 150;
            Grilla.Columns[6].Width   = 150;
            Grilla.Columns[7].Width   = 240;
            txtTotal.Text             = fun.TotalizarColumna(trdo, "Saldo").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
        }
Ejemplo n.º 12
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;
            }

            DateTime FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);

            Clases.cPagoIntereses pago = new Clases.cPagoIntereses();
            DataTable             trdo = pago.GetPagosInteresxFecha(FechaDesde, FechaHasta);

            txtTotal.Text = fun.TotalizarColumna(trdo, "Importe").ToString();
            if (txtTotal.Text != "")
            {
                txtTotal.Text = fun.SepararDecimales(txtTotal.Text);
                txtTotal.Text = fun.FormatoEnteroMiles(txtTotal.Text);
            }
            trdo = fun.TablaaMiles(trdo, "Importe");
            Grilla.DataSource       = trdo;
            Grilla.Columns[0].Width = 630;
        }
Ejemplo n.º 13
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            int ConDeuda = 0;

            if (ChkVencida.Checked == true)
            {
                ConDeuda = 1;
            }
            Clases.cFunciones fun    = new Clases.cFunciones();
            DataTable         tResul = fun.CrearTabla("Codigo;Tipo;Cuota;Patente;Descripcion;Apellido;Telefono;Celular;Importe;Saldo;Vencimiento");

            if (txtPatente.Text == "" && txtApellido.Text == "")
            {
                Mensaje("Debe ingresar un criterio de búsqueda");
                return;
            }
            DateTime  Fecha = Convert.ToDateTime(txtFecha.Text);
            string    Valor = "";
            cCuota    cuota = new cCuota();
            DataTable trdo  = cuota.GetCuotasAdeudadas(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda);

            for (int i = 0; i < trdo.Rows.Count; i++)
            {
                Valor  = trdo.Rows[i]["CodVenta"].ToString();
                Valor  = Valor + ";" + "Cuotas";
                Valor  = Valor + ";" + trdo.Rows[i]["Cuota"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Apellido"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Celular"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["Saldo"].ToString();
                Valor  = Valor + ";" + trdo.Rows[i]["FechaVencimiento"].ToString();
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            cCuotasAnteriores cuotasAnt  = new cCuotasAnteriores();
            DataTable         tcuotasAnt = cuotasAnt.GetCuotasAnterioresAdeudades(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda);

            for (int i = 0; i < tcuotasAnt.Rows.Count; i++)
            {
                Valor  = tcuotasAnt.Rows[i]["CodGrupo"].ToString();
                Valor  = Valor + ";" + "Doc. Anteriores";
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Cuota"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Apellido"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["Saldo"].ToString();
                Valor  = Valor + ";" + tcuotasAnt.Rows[i]["FechaVencimiento"].ToString();
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            cCobranza cob  = new cCobranza();
            DataTable tcob = cob.GetCobranzasAdeudadas(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda);

            for (int i = 0; i < tcob.Rows.Count; i++)
            {
                Valor  = tcob.Rows[i]["CodCobranza"].ToString();
                Valor  = Valor + ";" + "Cobranza";
                Valor  = Valor + ";1";
                Valor  = Valor + ";" + tcob.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Apellido"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Celular"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["Saldo"].ToString();
                Valor  = Valor + ";" + tcob.Rows[i]["FechaCompromiso"].ToString();
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            cCheque   cheque  = new cCheque();
            DataTable tcheque = cheque.GetChequesAdeudados(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda);

            for (int i = 0; i < tcheque.Rows.Count; i++)
            {
                Valor  = tcheque.Rows[i]["CodVenta"].ToString();
                Valor  = Valor + ";" + "Cheque";
                Valor  = Valor + ";1";
                Valor  = Valor + ";" + tcheque.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Apellido"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Celular"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tcheque.Rows[i]["FechaVencimiento"].ToString();
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            cPrenda   prenda  = new cPrenda();
            DataTable tPrenda = prenda.GetPrendasAdeudadas(txtPatente.Text, txtApellido.Text, Fecha, ConDeuda);

            for (int i = 0; i < tPrenda.Rows.Count; i++)
            {
                Valor  = tPrenda.Rows[i]["CodPrenda"].ToString();
                Valor  = Valor + ";" + "Prenda";
                Valor  = Valor + ";1";
                Valor  = Valor + ";" + tPrenda.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Apellido"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Celular"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tPrenda.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";";
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            cCobranzaGeneral cobGen = new cCobranzaGeneral();
            // if (txtApellido.Text != "")
            // {
            DataTable tCobGen = cobGen.GetDedudaCobranzaGeneral(txtApellido.Text, txtPatente.Text);

            for (int i = 0; i < tCobGen.Rows.Count; i++)
            {
                Valor  = tCobGen.Rows[i]["CodCobranza"].ToString();
                Valor  = Valor + ";" + "Cobranza General";
                Valor  = Valor + ";1";
                Valor  = Valor + ";" + tCobGen.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + tCobGen.Rows[i]["Descripcion"].ToString();
                Valor  = Valor + ";" + tCobGen.Rows[i]["Cliente"].ToString();
                Valor  = Valor + ";" + tCobGen.Rows[i]["Telefono"].ToString();
                Valor  = Valor + ";";
                Valor  = Valor + ";" + tCobGen.Rows[i]["Importe"].ToString();
                Valor  = Valor + ";" + tCobGen.Rows[i]["Saldo"].ToString();
                Valor  = Valor + ";";
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            //}
            //DateTime Fecha = Convert.ToDateTime(txtFecha.Text);
            DateTime FechaDesde = Fecha.AddDays(-200);
            DateTime FechaHasta = Fecha.AddDays(10);

            Clases.cAlarma alarma  = new Clases.cAlarma();
            DataTable      talarma = alarma.GetAlertasxRangoFecha(FechaDesde, FechaHasta, "", txtPatente.Text, txtApellido.Text);

            for (int i = 0; i < talarma.Rows.Count; i++)
            {
                Valor  = talarma.Rows[i]["CodAlarma"].ToString();
                Valor  = Valor + ";" + "Alerta";
                Valor  = Valor + ";1";
                Valor  = Valor + ";" + talarma.Rows[i]["Patente"].ToString();
                Valor  = Valor + ";" + talarma.Rows[i]["Nombre"].ToString();
                Valor  = Valor + ";" + talarma.Rows[i]["Cliente"].ToString();
                Valor  = Valor + ";" + "";
                Valor  = Valor + ";";
                Valor  = Valor + ";" + "0";
                Valor  = Valor + ";" + "0";
                Valor  = Valor + ";";
                tResul = fun.AgregarFilas(tResul, Valor);
            }
            Double TotalImporte = 0;
            Double TotalSaldo   = 0;

            TotalImporte              = fun.TotalizarColumna(tResul, "Importe");
            TotalSaldo                = fun.TotalizarColumna(tResul, "Saldo");
            Valor                     = ";" + "Total";
            Valor                     = Valor + ";;;;;;";
            Valor                     = Valor + ";" + TotalImporte.ToString();
            Valor                     = Valor + ";" + TotalSaldo.ToString();
            Valor                     = Valor + ";";
            tResul                    = fun.AgregarFilas(tResul, Valor);
            tResul                    = fun.TablaaMiles(tResul, "Importe");
            tResul                    = fun.TablaaMiles(tResul, "Saldo");
            Grilla.DataSource         = tResul;
            Grilla.Columns[0].Visible = false;
            Pintar();
            for (int i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                if (i == (Grilla.Rows.Count - 2))
                {
                    Grilla.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
                }
            }
        }
Ejemplo n.º 14
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;
            }
            string Apellido = null;

            if (txtApellido.Text != "")
            {
                Apellido = txtApellido.Text;
            }
            Clases.cVenta objVenta   = new Clases.cVenta();
            DateTime      FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime      FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            DataTable     trdo       = objVenta.GetVentasxFecha(FechaDesde, FechaHasta, txtPatente.Text.Trim(), Apellido);

            Clases.cPreVenta objPreVenta = new Clases.cPreVenta();

            DataTable trdo2 = objPreVenta.GetPreVentasxFecha(FechaDesde, FechaHasta, txtPatente.Text.Trim(), Apellido);
            //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);
            }



            Int32 Cant = trdo.Rows.Count;

            txtCantidadVentas.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");
            txtTotal.Text     = fun.TotalizarColumna(trdo, "Ganancia").ToString();
            txtTotal.Text     = fun.FormatoEnteroMiles(txtTotal.Text);
            Grilla.DataSource = trdo;
            //
            Clases.cVenta ven = new Clases.cVenta();
            //pinto las ventas sin saldo
            for (int k = 0; k < Grilla.Rows.Count - 1; k++)
            {
                Int32 CodVenta = Convert.ToInt32(Grilla.Rows[k].Cells[0].Value.ToString());
                if (k < PosPintar)
                {
                    double ImporteDocumento = 0;
                    double Prenda           = 0;
                    double Cheque           = 0;
                    double Cobranza         = 0;
                    if (Grilla.Rows[k].Cells[10].Value.ToString() != "")
                    {
                        ImporteDocumento = GetSaldoCuotaxCodVenta(CodVenta);
                    }

                    if (Grilla.Rows[k].Cells[11].Value.ToString() != "")
                    {
                        Prenda = GetSaldoPrendaxCodVenta(CodVenta);
                    }

                    if (Grilla.Rows[k].Cells[12].Value.ToString() != "")
                    {
                        Cheque = GetSaldoChequexCodVenta(CodVenta);
                    }

                    if (Grilla.Rows[k].Cells[13].Value.ToString() != "")
                    {
                        Cobranza = GetSaldoCobranza(CodVenta);
                    }
                    double Suma = (ImporteDocumento + Prenda + Cheque + Cobranza);
                    if (Suma == 0)
                    {
                        //pinto
                        Grilla.Rows[k].DefaultCellStyle.BackColor = Color.LightGreen;
                    }
                    int TieneDeuda = ven.TieneDeuda(CodVenta);
                    if (TieneDeuda == 1)
                    {
                        Grilla.Rows[k].DefaultCellStyle.BackColor = Color.LightCyan;
                    }
                }
            }
            //
            Grilla.Columns[0].Visible     = false;
            Grilla.Columns[2].HeaderText  = "Descripción";
            Grilla.Columns[7].HeaderText  = "Total";
            Grilla.Columns[8].HeaderText  = "Efectivo";
            Grilla.Columns[9].HeaderText  = "Vehículo";
            Grilla.Columns[10].HeaderText = "Documentos";
            Grilla.Columns[11].HeaderText = "Prenda";
            Grilla.Columns[13].HeaderText = "Cobranza";
            Grilla.Columns[15].Visible    = false;

            Grilla.Columns[1].Width      = 105;
            Grilla.Columns[5].Visible    = false;
            Grilla.Columns[3].HeaderText = "Parte Pago";
            Grilla.Columns[7].Width      = 80;
            Grilla.Columns[8].Width      = 80;
            Grilla.Columns[9].Width      = 80;
            Grilla.Columns[10].Width     = 80;
            Grilla.Columns[11].Width     = 80;
            Grilla.Columns[12].Width     = 80;
            Grilla.Columns[13].Width     = 80;
            for (int k = 0; k < Grilla.Rows.Count - 1; k++)
            {
                if (k >= PosPintar)
                {
                    Grilla.Rows[k].DefaultCellStyle.BackColor = Color.LightGray;
                }
            }
        }
Ejemplo n.º 15
0
        private void ArmarDataTableDeudores()
        {
            string Apellido = null;

            if (txtApellido.Text != "")
            {
                Apellido = txtApellido.Text;
            }
            Clases.cVenta objVenta   = new Clases.cVenta();
            DateTime      FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
            DateTime      FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
            Int32         CodVenta   = 0;
            Double        Cobranza   = 0;

            Clases.cFunciones fun         = new Clases.cFunciones();
            cCobranza         objCobranza = new cCobranza();
            string            Col         = "CodVenta;Patente;Descripcion;Apellido;ImporteVenta;Cuotas;Cheque;Cobranza;Prenda;Telefono;Tipo";

            //Tipo se usa para saber a donde tiene que abrir
            Clases.cCuota  cuota        = new Clases.cCuota();
            Clases.cCheque objCheque    = new Clases.cCheque();
            cPrenda        objPrenda    = new cPrenda();
            string         telefono     = "";
            int            TieneDeuda   = 0;
            Double         Cuotas       = 0;
            Double         Prenda       = 0;
            Double         Cheque       = 0;
            string         val          = "";
            int            TipoPantalla = 1;
            DataTable      tb           = new DataTable();

            tb = fun.CrearTabla(Col);
            DataTable trdo = objVenta.GetVentasxFecha(FechaDesde, FechaHasta, txtPatente.Text.Trim(), Apellido);

            for (int i = 0; i < trdo.Rows.Count; i++)
            {
                CodVenta   = Convert.ToInt32(trdo.Rows[i]["CodVenta"].ToString());
                TieneDeuda = objVenta.TieneDeuda(CodVenta);
                if (TieneDeuda == 1)
                {
                    Cuotas   = cuota.GetSaldoDeudaCuotas(CodVenta);
                    Cheque   = objCheque.GetSaldoCheque(CodVenta);
                    Cobranza = objCobranza.GetSaldoCobranza(CodVenta);
                    Prenda   = objPrenda.ImporteAdeudado(CodVenta);
                    telefono = BuscarTelefonoCliente(CodVenta);
                    val      = CodVenta.ToString();
                    val      = val + ";" + trdo.Rows[i]["Patente"].ToString();
                    val      = val + ";" + trdo.Rows[i]["Descripcion"].ToString();
                    val      = val + ";" + trdo.Rows[i]["Apellido"].ToString();
                    val      = val + ";" + trdo.Rows[i]["ImporteVenta"].ToString();
                    val      = val + ";" + Cuotas.ToString();
                    val      = val + ";" + Cheque.ToString();
                    val      = val + ";" + Cobranza.ToString();
                    val      = val + ";" + Prenda.ToString();
                    val      = val + ";" + telefono.ToString();
                    val      = val + ";" + TipoPantalla.ToString();
                    tb       = fun.AgregarFilas(tb, val);
                }
            }
            TipoPantalla = 2;
            //agrego las cuotas anteriores
            cCuotasAnteriores cuotasAnt  = new cCuotasAnteriores();
            DataTable         tcuotasAnt = cuotasAnt.GetCuotasAnterioresAdeudadesxFecha(txtPatente.Text, txtApellido.Text, FechaDesde, FechaHasta);

            for (int i = 0; i < tcuotasAnt.Rows.Count; i++)
            {
                val = tcuotasAnt.Rows[i]["CodGrupo"].ToString();
                val = val + ";" + tcuotasAnt.Rows[i]["Patente"].ToString();
                val = val + ";" + tcuotasAnt.Rows[i]["Descripcion"].ToString();
                val = val + ";" + tcuotasAnt.Rows[i]["Apellido"].ToString();
                val = val + ";" + tcuotasAnt.Rows[i]["Importe"].ToString();
                val = val + ";";
                val = val + ";";
                val = val + ";";
                val = val + ";";
                val = val + ";" + tcuotasAnt.Rows[i]["Telefono"].ToString();
                val = val + ";" + TipoPantalla.ToString();
                tb  = fun.AgregarFilas(tb, val);
            }
            TipoPantalla = 3;
            //Cobranza general
            cCobranzaGeneral cobGen   = new cCobranzaGeneral();
            DataTable        tbCobGen = cobGen.GetDedudaCobranzaGeneralxFecha(Apellido, txtPatente.Text, FechaDesde, FechaHasta);

            for (int i = 0; i < tbCobGen.Rows.Count; i++)
            {
                val = tbCobGen.Rows[i]["CodCobranza"].ToString();
                val = val + ";" + tbCobGen.Rows[i]["Patente"].ToString();
                val = val + ";" + tbCobGen.Rows[i]["Descripcion"].ToString();
                val = val + ";" + tbCobGen.Rows[i]["Cliente"].ToString();
                val = val + ";" + tbCobGen.Rows[i]["Importe"].ToString();
                val = val + ";" + tbCobGen.Rows[i]["Importe"].ToString();
                val = val + ";";
                val = val + ";" + tbCobGen.Rows[i]["Importe"].ToString();
                val = val + ";";
                val = val + ";" + tbCobGen.Rows[i]["Telefono"].ToString();
                val = val + ";" + TipoPantalla.ToString();
                tb  = fun.AgregarFilas(tb, val);
            }
            //

            Double TotalVenta    = fun.TotalizarColumna(tb, "ImporteVenta");
            Double TotalCuotas   = fun.TotalizarColumna(tb, "Cuotas");
            Double TotalPrenda   = fun.TotalizarColumna(tb, "Prenda");
            Double TotalCobranza = fun.TotalizarColumna(tb, "Cobranza");
            Double TotalCheque   = fun.TotalizarColumna(tb, "Cheque");

            val = "";
            val = val + ";";
            val = val + ";";
            val = val + ";";
            val = val + ";" + TotalVenta.ToString();
            val = val + ";" + TotalCuotas.ToString();
            val = val + ";" + TotalCheque.ToString();
            val = val + ";" + TotalCobranza.ToString();
            val = val + ";" + TotalPrenda.ToString();
            val = val + ";" + telefono.ToString();
            tb  = fun.AgregarFilas(tb, val);

            tb = fun.TablaaMiles(tb, "ImporteVenta");
            tb = fun.TablaaMiles(tb, "Cuotas");
            tb = fun.TablaaMiles(tb, "Cheque");
            tb = fun.TablaaMiles(tb, "Cobranza");
            tb = fun.TablaaMiles(tb, "Prenda");
            Grilla.DataSource            = tb;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[10].Visible   = false;
            Grilla.Columns[4].HeaderText = "Total";
            Grilla.Columns[5].HeaderText = "Documentos";
            for (int i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                if (i == (Grilla.Rows.Count - 2))
                {
                    Grilla.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
                }
            }
        }
Ejemplo n.º 16
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.cCuota cuota      = new Clases.cCuota();
            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   = 100;
            Grilla.Columns[10].Width  = 220;
        }
Ejemplo n.º 17
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);
        }