private void ImpresionFormato131()
        {
            var TablaMov_balancestock = new DataTable("mov_balancestock");
            var BL = new tb_60movimientosdetBL();
            var BE = new tb_60movimientosdet();

            var mes1 = Convert.ToInt32(cboPerimesini.SelectedValue.ToString());
            var mes2 = Convert.ToInt32(cboPerimesfin.SelectedValue.ToString());
            BE.moduloid = modulo;
            BE.local = local;
            BE.perianio = ((MERCADERIA.MainMercaderia)MdiParent).perianio;
            if (mes1 < 10)
            {
                BE.perimesini = "0" + Convert.ToString(cboPerimesini.SelectedValue.ToString());
            }
            else
            {
                BE.perimesini = Convert.ToString(cboPerimesini.SelectedValue.ToString());
            }

            if (mes2 < 10)
            {
                BE.perimesfin = "0" + Convert.ToString(cboPerimesfin.SelectedValue.ToString());
            }
            else
            {
                BE.perimesfin = Convert.ToString(cboPerimesfin.SelectedValue.ToString());
            }

            BE.lineaid = lineaid.Text.Trim();
            BE.grupoid = grupoid.Text.Trim();
            BE.subgrupoid = subgrupoid.Text.Trim();
            BE.productidini = productid.Text.Trim();

            var dt = new DataTable();
            dt = BL.GetAll_Balance(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            TablaMov_balancestock = dt;

            if (TablaMov_balancestock.Rows.Count == 0)
            {
                MessageBox.Show("No existe Información Procesada", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                var miForma = new Frm_Reportes();
                var reporteBalanceStock = new REPORTES.CR_mov_balancestock();
                miForma.Text = "Reporte Balance de Stock";

                Fech_impresion();
                reporteBalanceStock.DataDefinition.FormulaFields["empresaestable"].Text = "': " + VariablesPublicas.EmpresaEstablec.Trim() + "'";
                reporteBalanceStock.DataDefinition.FormulaFields["empresatipo"].Text = "': " + ((MERCADERIA.MainMercaderia)MdiParent).moduloname + "'";
                reporteBalanceStock.DataDefinition.FormulaFields["empresaperiodo"].Text = "': " + VariablesPublicas.N_PrimerMes1.Trim() + " " + VariablesPublicas.perianio.Trim() + "'";
                if (VariablesPublicas.N_FinMes1 == string.Empty)
                {
                    reporteBalanceStock.DataDefinition.FormulaFields["mesperifin"].Text = string.Empty;
                }
                else
                {
                    reporteBalanceStock.DataDefinition.FormulaFields["mesperifin"].Text = "'-   " + VariablesPublicas.N_FinMes1.Trim() + " " + VariablesPublicas.perianio.Trim() + "'";
                }
                reporteBalanceStock.DataDefinition.FormulaFields["fechaimpresion"].Text = "': " + VariablesPublicas.FechImpresion + "'";
                miForma.Table = TablaMov_balancestock;
                miForma.Reporte = reporteBalanceStock;
                miForma.Show();
            }
        }
        private DataTable Movimiento_mov_balancestock()
        {
            DtReporte = new DataTable("mov_balancestock");
            try
            {
                var BL = new tb_60movimientosdetBL();
                var BE = new tb_60movimientosdet();

                BE.moduloid = moduloid.ToString();
                BE.local = local.ToString();

                BE.perianio = Peranio.ToString();
                BE.perimesini = Mesdoini.ToString();
                BE.perimesfin = Mesdofin.ToString();
                BE.lineaid = lineaid.Trim();
                BE.grupoid = grupoid.Trim();
                BE.subgrupoid = subgrupoid.Trim();
                BE.productidini = productidini.Trim();

                if (accion)
                {
                    BE.accion = "0";
                }
                else
                {
                    BE.accion = "1";
                }

                DtReporte = BL.GetAll_Balance(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];

                if (DtReporte != null)
                {
                    return DtReporte;
                }
                else
                {
                    return DtReporte;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }