private void CargarDatos(Int32 CodRegistro)
        {
            Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar();
            DataTable trdo             = obj.GetEfectivosaPagarxCodigo(CodRegistro);

            if (trdo.Rows.Count > 0)
            {
                string cliente = trdo.Rows[0]["Nombre"].ToString();
                cliente         = cliente + " " + trdo.Rows[0]["Apellido"].ToString();
                txtCliente.Text = cliente;
                string auto = trdo.Rows[0]["Patente"].ToString();
                auto = auto + " " + trdo.Rows[0]["Descripcion"].ToString();
                txtDescripcion.Text = auto;
                txtPatente.Text     = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text     = trdo.Rows[0]["Importe"].ToString();
                txtSaldo.Text       = trdo.Rows[0]["Saldo"].ToString();
                txtFecha.Text       = trdo.Rows[0]["FechaPago"].ToString();

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

                if (txtSaldo.Text != "")
                {
                    txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                    txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
                }
                txtIngresarImporte.Focus();
            }
        }
        private void btnAnular_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                Mensaje("La fecha ingresada es incorrecta");
                return;
            }
            DateTime Fecha       = Convert.ToDateTime(txtFecha.Text);
            Int32    CodRegistro = Convert.ToInt32(Principal.CodigoPrincipalAbm);

            Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar();
            string Descripcion         = "ANULACION DE PAGO A " + txtCliente.Text;

            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            double Total  = fun.ToDouble(txtImporte.Text);
            double Saldo  = fun.ToDouble(txtSaldo.Text);
            double Pagado = Total - Saldo;

            if (Total == Saldo)
            {
                Mensaje("No hay registros para anular");
                return;
            }

            Clases.cSaldoEfectivoPagar saldoEf = new Clases.cSaldoEfectivoPagar();
            obj.Anular(CodRegistro);
            saldoEf.Borrar(CodRegistro);
            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Convert.ToInt32(Principal.CodigoPrincipalAbm), Pagado, 0, 0, 0, 0, Fecha, Descripcion);
            Mensaje("Datos grabados correctamente");
            btnAnular.Enabled = false;
            btnGrabar.Enabled = false;
        }
Esempio n. 3
0
 private void GetEfectivosaPagar()
 {
     Clases.cEfectivoaPagar eft = new Clases.cEfectivoaPagar();
     txtEfectivosaPagar.Text = eft.TotalSaldo().ToString();
     Clases.cFunciones fun = new Clases.cFunciones();
     txtEfectivosaPagar.Text = fun.SepararDecimales(txtEfectivosaPagar.Text);
     txtEfectivosaPagar.Text = fun.FormatoEnteroMiles(txtEfectivosaPagar.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);
            }
        }
Esempio n. 5
0
        private void GetEfectivoPagar(Int32 CodCompra)
        {
            Clases.cFunciones      fun = new Clases.cFunciones();
            Clases.cEfectivoaPagar eft = new Clases.cEfectivoaPagar();
            DataTable trdo             = eft.GetEfectivoPagarxCodCompra(CodCompra);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["Importe"].ToString() != "")
                {
                    txtEfectivoPagar.Text = trdo.Rows[0]["Importe"].ToString();
                    txtEfectivoPagar.Text = fun.SepararDecimales(txtEfectivoPagar.Text);
                    txtEfectivoPagar.Text = fun.FormatoEnteroMiles(txtEfectivoPagar.Text);
                }
            }
        }
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                Mensaje("La fecha ingresada es incorrecta");
                return;
            }

            if (txtIngresarImporte.Text == "")
            {
                Mensaje("Debe ingresar un importe para continuar");
                return;
            }

            DateTime Fecha          = Convert.ToDateTime(txtFecha.Text);
            Int32    CodRegistro    = Convert.ToInt32(Principal.CodigoPrincipalAbm);
            double   Importe        = fun.ToDouble(txtIngresarImporte.Text);
            double   Saldo          = fun.ToDouble(txtSaldo.Text);
            double   aPagar         = fun.ToDouble(txtIngresarImporte.Text);
            double   ImporteInicial = fun.ToDouble(txtImporte.Text);

            if (aPagar > Saldo)
            {
                Mensaje("El Importe a pagar supera el saldo");
                return;
            }
            Clases.cSaldoEfectivoPagar objSaldo = new Clases.cSaldoEfectivoPagar();

            Clases.cEfectivoaPagar obj = new Clases.cEfectivoaPagar();
            obj.ActualizarPago(CodRegistro, Fecha, Importe);
            string Descripcion = "PAGO EFECTIVO " + txtCliente.Text;

            objSaldo.InsertarSaldo(CodRegistro, Fecha, Importe);
            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion);
            Mensaje("Datos grabados correctamente");
            txtImporte.Text   = "";
            btnGrabar.Enabled = false;
        }