Exemplo n.º 1
0
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();

            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje());
                return;
            }



            Int32    CodComision = Convert.ToInt32(txtCodComision.Text);
            DateTime Fecha       = Convert.ToDateTime(txtFecha.Text);

            Clases.cComisionVendedor com = new Clases.cComisionVendedor();
            com.PagoComision(Fecha, CodComision);
            string Descripcion = "PAGO COMISIÓN " + txtNombre.Text + " " + txtApellido.Text;

            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            double Importe = fun.ToDouble(txtImporte.Text);

            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, Fecha, Descripcion);
            MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje());

            btnGrabar.Enabled = false;
            btnAnular.Enabled = false;
        }
Exemplo n.º 2
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;
                }
            }
        }
        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.cComisionVendedor comision = new Clases.cComisionVendedor();
            DataTable trdo = comision.GetComisionesxFecha(FechaDesde, FechaHasta, Impagos, txtApellido.Text, txtPatente.Text);

            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[0].Visible    = false;
            Grilla.Columns[1].Visible    = false;
            Grilla.Columns[1].Width      = 230;
            Grilla.Columns[2].Width      = 240;
            Grilla.Columns[5].HeaderText = "Fecha Pago";
            Grilla.Columns[5].Width      = 150;
            Grilla.Columns[6].Visible    = false;
            Grilla.Columns[8].Width      = 223;
            Grilla.Columns[8].HeaderText = "Descripción";
        }
Exemplo n.º 4
0
        private void btnAnular_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            string            msj = "Confirma anular el pago de la comisión ";
            var result            = MessageBox.Show(msj, "Información",
                                                    MessageBoxButtons.YesNo,
                                                    MessageBoxIcon.Question);

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

            if (fun.ValidarFecha(txtFecha.Text) == false)
            {
                MessageBox.Show("La fecha ingresada es incorrecta", Clases.cMensaje.Mensaje());
                return;
            }

            Int32    CodComision = Convert.ToInt32(txtCodComision.Text);
            DateTime Fecha       = Convert.ToDateTime(txtFecha.Text);

            Clases.cComisionVendedor com = new Clases.cComisionVendedor();
            com.AnularPagoComision(CodComision);
            string Descripcion = "ANULACIÓN PAGO COMISIÓN " + txtNombre.Text + " " + txtApellido.Text;

            Descripcion = Descripcion + ", PATENTE " + txtPatente.Text;
            double Importe = fun.ToDouble(txtImporte.Text);

            Clases.cMovimiento mov = new Clases.cMovimiento();
            mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, Fecha, Descripcion);
            MessageBox.Show("Datos grabados Correctamente", Clases.cMensaje.Mensaje());

            btnGrabar.Enabled = false;
            btnAnular.Enabled = false;
        }
Exemplo n.º 5
0
        private void Actualizar()
        {
            //obtengo el importe de documentos a cobrar
            GetDeudasxPrestamo();
            GetEfectivosaPagar();
            GetCobranzaGeneral();
            GetChequesPagar();
            Clases.cFunciones        fun       = new Clases.cFunciones();
            Clases.cCuota            cuota     = new Clases.cCuota();
            Clases.cCuotasAnteriores cuotasAnt = new Clases.cCuotasAnteriores();
            Clases.cCheque           cheque    = new Clases.cCheque();
            Double ImporteCheque = cheque.GetTotalChequesaCobrar();

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

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

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

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

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

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

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

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

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

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

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

                Clases.cCobranza cob = new Clases.cCobranza();
                txtCobranzas.Text = cob.GetTotalDeudaCobranzas().ToString();
                txtCobranzas.Text = fun.FormatoEnteroMiles(txtCobranzas.Text);
                GetPrendas();
                GetTotalVehiculo();
                GetTarjeta();
            }
        }