protected void btn_quitar_agendado_Click(object sender, EventArgs e)
        {
            string delete = "";

            foreach (GridViewRow dtgItem in this.G_DETALLE_ESTIMADOS_FACTURAS.Rows)
            {
                CheckBox Sel   = ((CheckBox)G_DETALLE_ESTIMADOS_FACTURAS.Rows[dtgItem.RowIndex].FindControl("chkAccept"));
                bool     valor = Sel.Checked;
                if (valor)
                {
                    string num_factura = G_DETALLE_ESTIMADOS_FACTURAS.Rows[dtgItem.RowIndex].Cells[4].Text;
                    delete += ReporteRNegocio.delete_fecha_cobro(num_factura);
                }
                else
                {
                }
            }

            if (!delete.Contains("ERROR"))
            {
                cont_filas = 0;
                sum_dolar  = 0;
                sum_pesos  = 0;
                DataTable auss = ReporteRNegocio.facturas_gestionadas(CB_DIAS_ELEGIDOS.SelectedValue.ToString());
                G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss;

                total_filas = auss.Rows.Count;
                G_DETALLE_ESTIMADOS_FACTURAS.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "mant_AN2ww", "<script language='javascript'>alert('Error al borrar');</script>", false);
            }
        }
        protected void btn_detalle_2_Click(object sender, EventArgs e)
        {
            if (chk_gestionado.Checked)
            {
                cont_filas = 0;
                sum_dolar  = 0;
                sum_pesos  = 0;
                DataTable auss     = ReporteRNegocio.facturas_gestionadas(CB_DIAS_ELEGIDOS.SelectedValue.ToString());
                int       columnas = auss.Columns.Count;
                total_filas = auss.Rows.Count;
                DataRow row;

                if (total_filas > 0)
                {
                    row = auss.NewRow();
                    for (int i = 0; i < columnas; i++)
                    {
                        try
                        {
                            row[i] = "";
                        }
                        catch
                        {
                            row[i] = 0;
                        }
                    }
                    auss.Rows.Add(row);
                    G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss;

                    G_DETALLE_ESTIMADOS_FACTURAS.DataBind();
                }
                else
                {
                    G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss; G_DETALLE_ESTIMADOS_FACTURAS.DataBind();
                }

                cont_filas = 0;
                sum_dolar  = 0;
                sum_pesos  = 0;
                DataTable auss2     = ReporteRNegocio.cheques_por_cobrar(CB_DIAS_ELEGIDOS.SelectedValue.ToString());
                int       columnas2 = auss2.Columns.Count;
                total_filas = auss2.Rows.Count;
                DataRow row2;
                if (total_filas > 0)
                {
                    row2 = auss2.NewRow();
                    for (int i = 0; i < columnas2; i++)
                    {
                        try
                        {
                            row2[i] = "";
                        }
                        catch
                        {
                            row2[i] = 0;
                        }
                    }
                    auss2.Rows.Add(row2);
                    G_DETALLE_CHEQUES_CARTERA.DataSource = auss2;
                    G_DETALLE_CHEQUES_CARTERA.DataBind();
                }
                else
                {
                    G_DETALLE_CHEQUES_CARTERA.DataSource = auss2; G_DETALLE_CHEQUES_CARTERA.DataBind();
                }


                ScriptManager.RegisterStartupScript(Page, this.GetType(), "mant_AN2", "<script language='javascript'>$('#ContentPlaceHolder_Contenido_tabla_html2').html('');</script>", false);

                div_facturas.Visible = true;
                div_cheques.Visible  = true;
            }
            else
            {
                cont_filas = 0;
                sum_dolar  = 0;
                sum_pesos  = 0;
                DataTable auss1     = ReporteRNegocio.facturas_solomon(CB_DIAS_ELEGIDOS.SelectedValue.ToString());
                int       columnas1 = auss1.Columns.Count;
                total_filas = auss1.Rows.Count;
                DataRow row1;
                if (total_filas > 0)
                {
                    row1 = auss1.NewRow();
                    for (int i = 0; i < columnas1; i++)
                    {
                        try
                        {
                            row1[i] = "";
                        }
                        catch
                        {
                            row1[i] = 0;
                        }
                    }
                    auss1.Rows.Add(row1);
                    G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss1;

                    G_DETALLE_ESTIMADOS_FACTURAS.DataBind();
                }
                else
                {
                    G_DETALLE_ESTIMADOS_FACTURAS.DataSource = auss1; G_DETALLE_ESTIMADOS_FACTURAS.DataBind();
                }



                cont_filas = 0;
                sum_dolar  = 0;
                sum_pesos  = 0;
                DataTable auss2     = ReporteRNegocio.cheques_por_cobrar(CB_DIAS_ELEGIDOS.SelectedValue.ToString());
                int       columnas2 = auss2.Columns.Count;
                total_filas = auss2.Rows.Count;
                DataRow row2;
                if (total_filas > 0)
                {
                    row2 = auss2.NewRow();
                    for (int i = 0; i < columnas2; i++)
                    {
                        try
                        {
                            row2[i] = "";
                        }
                        catch
                        {
                            row2[i] = 0;
                        }
                    }
                    auss2.Rows.Add(row2);
                    G_DETALLE_CHEQUES_CARTERA.DataSource = auss2;
                    G_DETALLE_CHEQUES_CARTERA.DataBind();
                }
                else
                {
                    G_DETALLE_CHEQUES_CARTERA.DataSource = auss2; G_DETALLE_CHEQUES_CARTERA.DataBind();
                }


                ScriptManager.RegisterStartupScript(Page, this.GetType(), "mant_AN2", "<script language='javascript'>$('#tabla_html2').html('');</script>", false);

                div_facturas.Visible = true;
                div_cheques.Visible  = true;
            }
        }