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();
            }
        }
Пример #2
0
        public void GetPrendaxCod(Int32 CodPrenda)
        {
            txtFecha.Text = DateTime.Now.ToShortDateString();
            Clases.cPrenda prenda = new Clases.cPrenda();
            DataTable      trdo   = prenda.GetPrendaxCodigo(CodPrenda);

            Clases.cFunciones fun = new Clases.cFunciones();
            if (trdo.Rows.Count > 0)
            {
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                txtNombre.Text      = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text    = trdo.Rows[0]["Apellido"].ToString();
                txtCodCliente.Text  = trdo.Rows[0]["CodCliente"].ToString();
                if (trdo.Rows[0]["CodPrenda"].ToString() != "")
                {
                    CargarPrenda(Convert.ToInt32(trdo.Rows[0]["CodPrenda"].ToString()));
                }
                txtPatente.Text = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text = trdo.Rows[0]["Importe"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.ParteEntera(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }
                txtCodVenta.Text   = trdo.Rows[0]["CodVenta"].ToString();
                txtDiferencia.Text = trdo.Rows[0]["Diferencia"].ToString();
                if (trdo.Rows[0]["ImportePagado"].ToString() != "")
                {
                    txtImporteaPagar.Text = trdo.Rows[0]["ImportePagado"].ToString();
                    txtImporteaPagar.Text = fun.ParteEntera(txtImporteaPagar.Text);
                    txtImporteaPagar.Text = fun.FormatoEnteroMiles(txtImporteaPagar.Text);
                }
                if (txtDiferencia.Text != "")
                {
                    txtDiferencia.Text = fun.ParteEntera(txtDiferencia.Text);
                    txtDiferencia.Text = fun.FormatoEnteroMiles(txtDiferencia.Text);
                }
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime fec = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFecha.Text            = fec.ToShortDateString();
                    btnGrabar.Enabled        = false;
                    btnAnular.Enabled        = true;
                    txtImporteaPagar.Enabled = false;
                }
                else
                {
                    btnGrabar.Enabled        = true;
                    btnAnular.Enabled        = false;
                    txtImporteaPagar.Enabled = true;
                }
            }
            else
            {
                txtDescripcion.Text = "";
                txtNombre.Text      = "";
                txtApellido.Text    = "";
                Grilla.DataSource   = null;
            }
        }
        public void GetCobranzas(Int32 CodCobranza)
        {
            Clases.cFunciones       fun = new Clases.cFunciones();
            Clases.cCobranzaGeneral cob = new Clases.cCobranzaGeneral();
            DataTable trdo = cob.GetCobranzaxCodigo(CodCobranza);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["Fecha"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["Fecha"].ToString());
                    txtFecha.Text = Fecha.ToShortDateString();
                }

                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFechaCobro.Text = Fecha.ToShortDateString();
                }

                if (trdo.Rows[0]["FechaPago"].ToString() == "")
                {
                    btnGuardar.Enabled    = true;
                    btnAnular.Enabled     = false;
                    btnPagarSaldo.Visible = false;
                }
                else
                {
                    btnGuardar.Enabled    = false;
                    btnAnular.Enabled     = true;
                    btnPagarSaldo.Visible = true;
                }
                txtTotalCobrado.Text = trdo.Rows[0]["ImportePagado"].ToString();
                txtDescripcion.Text  = trdo.Rows[0]["Descripcion"].ToString();
                txtImporte.Text      = trdo.Rows[0]["Importe"].ToString();
                txtPatente.Text      = trdo.Rows[0]["Patente"].ToString();
                txtSaldo.Text        = trdo.Rows[0]["Saldo"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                }

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

                if (txtSaldo.Text != "")
                {
                    txtSaldo.Text = fun.SepararDecimales(txtSaldo.Text);
                    txtSaldo.Text = fun.FormatoEnteroMiles(txtSaldo.Text);
                }
            }
        }
Пример #4
0
        private void Cargar(Int32 CodCheque)
        {
            Clases.cFunciones     fun    = new Clases.cFunciones();
            Clases.cChequesaPagar cheque = new Clases.cChequesaPagar();
            DataTable             trdo   = cheque.GetChequesPagarxCodigo(CodCheque);

            if (trdo.Rows.Count > 0)
            {
                txtNroCheque.Text = trdo.Rows[0]["NroCheque"].ToString();
                txtImporte.Text   = trdo.Rows[0]["Importe"].ToString();
                txtCliente.Text   = trdo.Rows[0]["Nombre"].ToString();
                txtCliente.Text   = txtCliente.Text + " " + trdo.Rows[0]["Apellido"].ToString();
                txtPatente.Text   = trdo.Rows[0]["Patente"].ToString();
                txtSaldo.Text     = trdo.Rows[0]["Saldo"].ToString();
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFecha.Text = Fecha.ToShortDateString();
                }

                if (trdo.Rows[0]["FechaVencimiento"].ToString() != "")
                {
                    DateTime Fecha = Convert.ToDateTime(trdo.Rows[0]["FechaVencimiento"].ToString());
                    txtFechaVto.Text = Fecha.ToShortDateString();
                }

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

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

                if (txtSaldo.Text == "0")
                {
                    btnGrabar.Enabled = false;
                }
            }

            Clases.cPagoCheque pago   = new Clases.cPagoCheque();
            DataTable          tresul = pago.GetPagosCheques(CodCheque);

            tresul            = fun.TablaaMiles(tresul, "Importe");
            Grilla.DataSource = tresul;
            // Grilla.Columns[0].Visible = false;
            //  Grilla.Columns[1].Visible = false;
            Grilla.Columns[2].Width = 280;
        }
        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);
                }
            }
        }
Пример #6
0
        private void CargarCheques(Int32 CodStock)
        {
            Clases.cFunciones fun       = new Clases.cFunciones();
            Clases.cCompra    compra    = new Clases.cCompra();
            Int32             CodCompra = compra.GetCodCompraxCodStock(CodStock);

            Clases.cChequesaPagar cheque = new Clases.cChequesaPagar();
            DataTable             trdo   = cheque.GetChequesxCodCompra(CodCompra);

            trdo = fun.TablaaMiles(trdo, "Importe");
            GrillaCheques.DataSource            = trdo;
            GrillaCheques.Columns[3].HeaderText = "Fecha Pago";
            GrillaCheques.Columns[3].Width      = 100;
            GrillaCheques.Columns[4].Width      = 270;
            GrillaCheques.Columns[5].Visible    = false;
            GrillaCheques.Columns[6].Visible    = false;
            DataTable tComp = compra.GetCompraxCodigo(CodCompra);

            GetEfectivoPagar(CodCompra);
            if (tComp.Rows.Count > 0)
            {
                if (tComp.Rows[0]["ImporteEfectivo"].ToString() != "")
                {
                    txtEfectivo.Text = tComp.Rows[0]["ImporteEfectivo"].ToString();
                    txtEfectivo.Text = fun.SepararDecimales(txtEfectivo.Text);
                    txtEfectivo.Text = fun.FormatoEnteroMiles(txtEfectivo.Text);
                }

                if (tComp.Rows[0]["ImporteAutoPartePago"].ToString() != "")
                {
                    txtImporteAutoPartePago.Text = tComp.Rows[0]["ImporteAutoPartePago"].ToString();
                    txtImporteAutoPartePago.Text = fun.SepararDecimales(txtImporteAutoPartePago.Text);
                    txtImporteAutoPartePago.Text = fun.FormatoEnteroMiles(txtImporteAutoPartePago.Text);
                }

                if (tComp.Rows[0]["CodStockSalida"].ToString() != "")
                {
                    Clases.cStockAuto stock = new Clases.cStockAuto();
                    DataTable         tauto = stock.GetStockxCodigo(Convert.ToInt32(tComp.Rows[0]["CodStockSalida"].ToString()));
                    if (tauto.Rows.Count > 0)
                    {
                        txtPatente2.Text     = tauto.Rows[0]["Patente"].ToString();
                        txtDescripcion2.Text = tauto.Rows[0]["Descripcion"].ToString();
                    }
                }
                //GetStockxCodigo
            }
        }
Пример #7
0
 private void GetChequesPagar()
 {
     Clases.cChequesaPagar che = new Clases.cChequesaPagar();
     txtTotalDeudaCheque.Text = che.GetTotalChequesaPagar().ToString();
     Clases.cFunciones fun = new Clases.cFunciones();
     txtTotalDeudaCheque.Text = fun.FormatoEnteroMiles(txtTotalDeudaCheque.Text);
 }
Пример #8
0
        public void GetAutoPartePago(Int32 CodVenta)
        {
            Clases.cFunciones fun  = new Clases.cFunciones();
            Clases.cVenta     obj  = new Clases.cVenta();
            DataTable         trdo = obj.GetAutosPartePago(CodVenta);

            if (trdo.Rows.Count > 0)
            {
                if (trdo.Rows[0]["CodAuto"].ToString() != "")
                {
                    string sImporte = trdo.Rows[0]["Importe"].ToString();
                    if (sImporte != "" && sImporte != "0")
                    {
                        sImporte = fun.SepararDecimales(sImporte);
                        sImporte = fun.FormatoEnteroMiles(sImporte);
                    }
                    Int32        CodAuto = Convert.ToInt32(trdo.Rows[0]["CodAuto"].ToString());
                    Clases.cAuto auto    = new Clases.cAuto();
                    DataTable    tauto   = auto.GetAutoxCodigo(CodAuto);
                    {
                        if (tauto.Rows.Count > 0)
                        {
                            string Descrip = " Un vehículo" + tauto.Rows[0]["Marca"].ToString() + " " + tauto.Rows[0]["Descripcion"].ToString();
                            Descrip = Descrip + " MOTOR N º" + tauto.Rows[0]["Motor"].ToString();
                            Descrip = Descrip + " CHASIS N º" + tauto.Rows[0]["Chasis"].ToString();
                            Descrip = Descrip + " AÑO " + tauto.Rows[0]["Anio"].ToString();
                            Descrip = Descrip + " DOMINIO " + tauto.Rows[0]["Patente"].ToString();
                            Descrip = Descrip + " valuado en " + sImporte;
                            txtAutoPartePago.Text = Descrip;
                        }
                    }
                }
            }
        }
Пример #9
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;
        }
Пример #10
0
        private void CargarDatos(Int32 CodComision)
        {
            Clases.cFunciones        fun = new Clases.cFunciones();
            Clases.cComisionVendedor com = new Clases.cComisionVendedor();
            DataTable trdo = com.GetComisionesxCodigo(CodComision);

            if (trdo.Rows.Count > 0)
            {
                txtNombre.Text   = trdo.Rows[0]["Nombre"].ToString();
                txtApellido.Text = trdo.Rows[0]["Apellido"].ToString();
                txtPatente.Text  = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text  = trdo.Rows[0]["Importe"].ToString();
                if (trdo.Rows[0]["FechaPago"].ToString() != "")
                {
                    DateTime fecha = Convert.ToDateTime(trdo.Rows[0]["FechaPago"].ToString());
                    txtFecha.Text = fecha.ToShortDateString();
                }
                txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                if (trdo.Rows[0]["FechaPago"].ToString() == "")
                {
                    btnAnular.Enabled = false;
                    btnGrabar.Enabled = true;
                }
                else
                {
                    btnAnular.Enabled = true;
                    btnGrabar.Enabled = false;
                }
            }
        }
Пример #11
0
        private void CargarGasto(Int32 CodGasto)
        {
            Clases.cFunciones   fun   = new Clases.cFunciones();
            Clases.cGastosPagar gasto = new Clases.cGastosPagar();
            DataTable           trdo  = gasto.GetGastosPagarxCodGasto(CodGasto);

            if (trdo.Rows.Count > 0)
            {
                txtPatente.Text     = trdo.Rows[0]["Patente"].ToString();
                txtImporte.Text     = trdo.Rows[0]["Importe"].ToString();
                txtDescripcion.Text = trdo.Rows[0]["Descripcion"].ToString();
                txtCodVenta.Text    = trdo.Rows[0]["CodVenta"].ToString();
                if (txtImporte.Text != "")
                {
                    txtImporte.Text = fun.SepararDecimales(txtImporte.Text);
                    txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
                    txtTope.Text    = txtImporte.Text;
                }
                txtFechaPago.Text = trdo.Rows[0]["FechaPago"].ToString();
                if (fun.ValidarFecha(txtFechaPago.Text) == true)
                {
                    btnAnular.Enabled  = true;
                    btnGrabar.Enabled  = false;
                    txtImporte.Enabled = false;
                }
                else
                {
                    btnAnular.Enabled  = false;
                    btnGrabar.Enabled  = true;
                    txtImporte.Enabled = true;
                }
            }
        }
Пример #12
0
        private void BuscarCheques(Int32 CodPrenda)
        {
            Clases.cCheque cheque = new Clases.cCheque();
            DataTable      trdo   = cheque.GetChequexCodPrenda(CodPrenda);

            Clases.cFunciones fun = new Clases.cFunciones();
            trdo = fun.TablaaMiles(trdo, "Importe");
            GrillaCheques.DataSource            = trdo;
            GrillaCheques.Columns[0].HeaderText = "Cheque";
            GrillaCheques.Columns[2].HeaderText = "Vencimiento";
            GrillaCheques.Columns[3].Visible    = false;
            GrillaCheques.Columns[4].Width      = 310;
            GrillaCheques.Columns[1].Width      = 100;
            txtImporteCheque.Text    = "";
            txtCheque.Text           = "";
            txtFechaVencimiento.Text = "";
            double TotalCheques = 0;

            for (int i = 0; i < trdo.Rows.Count; i++)
            {
                TotalCheques = TotalCheques + Convert.ToDouble(trdo.Rows[i][1].ToString());
            }
            txtTotalCheque.Text = TotalCheques.ToString();
            //Clases.cFunciones fun = new Clases.cFunciones();
            txtTotalCheque.Text = fun.ParteEntera(txtTotalCheque.Text);
            txtTotalCheque.Text = fun.FormatoEnteroMiles(txtTotalCheque.Text);
            CalcularDiferencias();
        }
Пример #13
0
        private void CalcularPorcentaje()
        {
            if (txtPorcentaje.Text != "0" && txtImporte.Text != "0")
            {
                Clases.cFunciones fun    = new Clases.cFunciones();
                double            Por    = 0;
                double            Monto  = 0;
                double            aPagar = 0;
                if (txtPorcentaje.Text != "")
                {
                    Por = Convert.ToDouble(txtPorcentaje.Text.Replace(".", ","));
                }

                if (txtImporte.Text != "")
                {
                    Monto = fun.ToDouble(txtImporte.Text);
                }
                aPagar = (Monto * Por) / 100;
                txtMontoApagar.Text = aPagar.ToString();
                if (txtMontoApagar.Text != "")
                {
                    decimal m = Convert.ToDecimal(aPagar);
                    txtMontoApagar.Text = decimal.Round(m, 0).ToString();
                    txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text);
                }
                //txtMontoApagar.Text = fun.FormatoEnteroMiles(txtMontoApagar.Text);
            }
        }
Пример #14
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);
            }
        }
Пример #15
0
 private void txtCapital_Leave(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     if (txtCapital.Text != "")
     {
         txtCapital.Text = fun.FormatoEnteroMiles(txtCapital.Text);
     }
 }
Пример #16
0
 private void txtMontoModificar_Leave(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     if (txtMontoModificar.Text != "")
     {
         txtMontoModificar.Text = fun.FormatoEnteroMiles(txtMontoModificar.Text);
     }
 }
Пример #17
0
 private void txtImportePagado_Leave(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     txtImportePagado.Text = fun.FormatoEnteroMiles(txtImportePagado.Text);
     double Importe       = 0;
     double ImportePagado = 0;
     double Saldo         = 0;
 }
Пример #18
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);
 }
Пример #19
0
 private void txtImporteGasto_Leave(object sender, EventArgs e)
 {
     if (txtImporteGasto.Text != "")
     {
         Clases.cFunciones fun = new Clases.cFunciones();
         txtImporteGasto.Text = fun.FormatoEnteroMiles(txtImporteGasto.Text);
     }
 }
Пример #20
0
 private void txtImporte_Leave(object sender, EventArgs e)
 {
     if (txtImporte.Text != "")
     {
         Clases.cFunciones fun = new Clases.cFunciones();
         txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
         CalcularPorcentaje();
     }
 }
Пример #21
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;
        }
Пример #22
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;
        }
Пример #23
0
        private void GetPrendas()
        {
            Clases.cPrenda prenda  = new Clases.cPrenda();
            double         Importe = prenda.GetTotalPrenda();

            txtPrenda.Text = Importe.ToString();
            Clases.cFunciones fun = new Clases.cFunciones();
            txtPrenda.Text = fun.SepararDecimales(txtPrenda.Text);
            txtPrenda.Text = fun.FormatoEnteroMiles(txtPrenda.Text);
        }
Пример #24
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;
        }
Пример #25
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txtMontoModificar.Text == "")
            {
                MessageBox.Show("Debe ingresar un monto para continuar ", Clases.cMensaje.Mensaje());
                return;
            }

            Int32    CodPrestamo        = Convert.ToInt32(Principal.CodigoPrincipalAbm);
            DateTime Fecha              = Convert.ToDateTime(txtFechaPago.Text);
            double   Importe            = fun.ToDouble(txtMontoModificar.Text);
            string   DescripcionDetalle = "INGRESO PRESTAMO " + Importe.ToString().Replace(",", ".");
            double   MontoAnterio       = fun.ToDouble(txtImporte.Text);
            double   MontoModificar     = fun.ToDouble(txtMontoModificar.Text);

            if (CmbOpciones.SelectedIndex == 0)
            {
                DescripcionDetalle = "AGREGAR CAPITAL " + Importe.ToString();
            }
            else
            {
                MontoModificar     = -1 * MontoModificar;
                DescripcionDetalle = "DESCUENTO DE CAPITAL " + Importe.ToString();
            }
            txtImporte.Text = (fun.ToDouble(txtImporte.Text) + fun.ToDouble(MontoModificar.ToString())).ToString();
            txtImporte.Text = fun.FormatoEnteroMiles(txtImporte.Text);
            CalcularPorcentaje();

            Clases.cDetallePrestamo detalle = new Clases.cDetallePrestamo();
            detalle.InsertarDetallePrestamo(CodPrestamo, Importe, DescripcionDetalle, Fecha);
            //cargo el nuevo porcentaje
            double   Por              = Convert.ToDouble(txtPorcentaje.Text.Replace(".", ","));
            double   MontoFinal       = fun.ToDouble(txtImporte.Text);
            double   ImporteaPagar    = fun.ToDouble(txtMontoApagar.Text);
            DateTime FechaVencimiento = Convert.ToDateTime(txtFechaVencimiento.Text);

            Clases.cPrestamo prestamo = new Clases.cPrestamo();
            prestamo.ModificarPorcentajePrestamo(CodPrestamo, Por, ImporteaPagar, Fecha, MontoFinal);
            CargarDetalle(CodPrestamo);
            string DescripcionMovimiento = "";

            if (MontoModificar > 0)
            {
                DescripcionMovimiento = " INGRESO PRESTAMO " + txtNombre.Text;
            }
            else
            {
                DescripcionMovimiento = " RETIRO PRESTAMO " + txtNombre.Text;
            }
            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, MontoModificar, 0, 0, 0, 0, Fecha, DescripcionMovimiento);
            MessageBox.Show("Datos grabados correctamente", Clases.cMensaje.Mensaje());
        }
        private void GetPunitorio(Int32 CodGrupo, Int32 Cuota)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            Clases.cPunitorioCuotasAnteriores puni = new Clases.cPunitorioCuotasAnteriores();
            Double Importe = puni.GetImportePunitorio(CodGrupo, Cuota);

            txtPunitorio.Text = Importe.ToString();
            if (txtPunitorio.Text != "")
            {
                txtPunitorio.Text = fun.FormatoEnteroMiles(txtPunitorio.Text);
            }
        }
Пример #27
0
        public static void FormatoColumnasMiles(DataGridView Grilla, string Columna)
        {
            cFunciones fun   = new cFunciones();
            string     Valor = "";

            for (int i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                Valor = Grilla.Rows[i].Cells[Columna].Value.ToString();
                Valor = fun.ParteEntera(Valor);
                Grilla.Rows[i].Cells[Columna].Value = fun.FormatoEnteroMiles(Valor);
            }
        }
Пример #28
0
        public void CalcularTotalGeneral()
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            int    i          = 0;
            double Total      = 0;
            double TotalTotal = 0;

            TotalTotal = fun.ToDouble(txtImporte.Text);
            for (i = 0; i < Grilla.Rows.Count - 1; i++)
            {
                if (Grilla.Rows[i].Cells[4].Value != "")
                {
                    Total = Total + Convert.ToDouble(Grilla.Rows[i].Cells[4].Value);
                }
            }
            TotalTotal           = TotalTotal + Total;
            txtTotal.Text        = Total.ToString();
            txtTotal.Text        = fun.FormatoEnteroMiles(txtTotal.Text);
            txtTotalGeneral.Text = TotalTotal.ToString();
            txtTotalGeneral.Text = fun.FormatoEnteroMiles(txtTotalGeneral.Text);
        }
Пример #29
0
        private void Buscar()
        {
            Clases.cFunciones fun      = new Clases.cFunciones();
            string            Patente  = txtPatente.Text;
            Int32?            CodMarca = null;

            if (cmbMarca.SelectedIndex > 0)
            {
                CodMarca = Convert.ToInt32(cmbMarca.SelectedValue);
            }
            Clases.cStockAuto stock = new Clases.cStockAuto();
            DataTable         trdo  = stock.GetStockDetalladosVigente(Patente, CodMarca);

            txtTotalVehiculos.Text = trdo.Rows.Count.ToString();
            trdo = fun.TablaaMiles(trdo, "Costo");
            Grilla.DataSource            = trdo;
            Grilla.Columns[0].Visible    = false;
            Grilla.Columns[7].HeaderText = "Concesión";
            //Grilla.Columns[7].Visible = false;
            Grilla.Columns[2].Width = 170;
            Grilla.Columns[3].Width = 200;
            Grilla.Columns[4].Width = 100;
            Grilla.Columns[5].Width = 200;
            //double Total = fun.TotalizarColumna(trdo, "Costo");
            double Total          = fun.TotalizarColumnaCondicion(trdo, "Costo", "Concesion", "0");
            double TotalConcesion = fun.TotalizarColumnaCondicion(trdo, "Costo", "Concesion", "1");

            txtMontoTotal.Text = Total.ToString();
            txtConcesion.Text  = TotalConcesion.ToString();
            if (txtMontoTotal.Text != "")
            {
                txtMontoTotal.Text = fun.SepararDecimales(txtMontoTotal.Text);
                txtMontoTotal.Text = fun.FormatoEnteroMiles(txtMontoTotal.Text);
            }
            if (txtConcesion.Text != "")
            {
                txtConcesion.Text = fun.SepararDecimales(txtConcesion.Text);
                txtConcesion.Text = fun.FormatoEnteroMiles(txtConcesion.Text);
            }
        }
Пример #30
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";
        }