private void existenciaReporte_btn_Click(object sender, EventArgs e)
        {
            Program.ReporteMetodo = "ExistenciaActual";
            ReportesForm form = new ReportesForm();

            form.Show();
        }
        private void verDetalles_btn_Click(object sender, EventArgs e)
        {
            Program.ReporteMetodo = "ReimprimirFacturaCliente";
            Program.GfacturaId    = Convert.ToInt32(historialFacturas_dtg.CurrentRow.Cells[0].Value);
            ReportesForm form = new ReportesForm();

            form.Show();
        }
        public void InsertarFactura()
        {
            string msj  = "";
            string msj2 = "";

            F.Cliente   = cliente_txt.Text;
            F.idUsuario = Program.GidUsuario;
            F.Total     = Convert.ToDouble(total_lbl.Text);
            F.Efectivo  = Convert.ToDouble(efectivo_txt.Text);
            F.Descuento = Convert.ToDouble(descuento_txt.Text);
            msj         = F.RegistrarFactura();
            if (msj == "1")
            {
                msj2 = InsertarFacturaDetalles();
                if (msj2 == "OK")
                {
                    orden_dtg.Rows.Clear();
                    cliente_txt.Text = "";
                    CalcularTotalOrden();
                    crear_factura_btn.Enabled = true;
                    //MessageBox.Show("Factura Creada!", "Sistema Facturación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    numeroFactura_txt.Text = (Convert.ToInt32(F.NumeroFacturaSiguiente())).ToString("0000000");
                    Program.GfacturaId     = 0;
                    Program.ReporteMetodo  = "FacturaCliente";
                    ReportesForm form = new ReportesForm();
                    form.Show();
                    openCashDrawer();
                }
                else
                {
                    F.idFactura = Convert.ToInt32(msj2);
                    msj         = F.EliminarRegistroFallido();
                    if (msj == "1")
                    {
                        MessageBox.Show("Factura no pudo ser Creada!", "Sistema Facturación", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("Algunos datos no fueron guardados, elimine esta factura", "Sistema Facturación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    crear_factura_btn.Enabled = true;
                }
            }
            else
            {
                MessageBox.Show("Factura no pudo ser Creada!", "Sistema Facturación", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void ventasReporte_btn_Click(object sender, EventArgs e)
        {
            bool permiso = FG.ValidarPermisoTransaccion("REPORTE VENTAS");

            if (permiso)
            {
                Program.ReporteMetodo = "Reporte Ventas";
                ReportesForm form = new ReportesForm();
                form.Show();
            }

            else
            {
                MessageBox.Show("Usuario no tiene permiso", "Sistema Facturacion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }