Exemplo n.º 1
0
        public ActionResult GenerarRep_Ventas_Por_Mes(int year)
        {
            EmpresaDTO objEmpresa = (new EmpresaBL()).getEmpresa(getCurrentUser().IdEmpresa);

            ReportesBL repBL = new ReportesBL();
            List<LiquidezDTO> lista = repBL.getGestionMensual(objEmpresa.IdEmpresa, year);

            if (lista == null)
                return RedirectToAction("ReportesGestion", new { message = 2 });

            System.Data.DataTable dt = new System.Data.DataTable();
            dt.Clear();

            dt.Columns.Add("Mes");
            dt.Columns.Add("Monto Con IGV");
            dt.Columns.Add("Monto Sin IGV");

            //int mesActual = DateTime.Now.Month;

            foreach (var obj in lista)
            {
                DataRow row = dt.NewRow();
                row["Mes"] = obj.nombreMes;
                row["Monto Con IGV"] = obj.Ingreso.ToString("N2", CultureInfo.InvariantCulture);
                row["Monto Sin IGV"] = obj.Ingreso_SinIGV.ToString("N2", CultureInfo.InvariantCulture);
                dt.Rows.Add(row);
            }

            DataRow rowFinal = dt.NewRow();
            rowFinal["Mes"] = "TOTAL";
            rowFinal["Monto Con IGV"] = lista.Sum(x => x.Ingreso).ToString("N2", CultureInfo.InvariantCulture);
            rowFinal["Monto Sin IGV"] = lista.Sum(x => x.Ingreso_SinIGV).ToString("N2", CultureInfo.InvariantCulture);
            dt.Rows.Add(rowFinal);

            GenerarPdf6(dt, "Ventas por Mes", "Ventas_por_Mes", objEmpresa, Response);

            return RedirectToAction("ReportesGestion", new { message = 2 });
        }
Exemplo n.º 2
0
        public ActionResult GenerarRep_Ventas_Gastos_Por_Mes(int year)
        {
            EmpresaDTO objEmpresa = (new EmpresaBL()).getEmpresa(getCurrentUser().IdEmpresa);

            ReportesBL repBL = new ReportesBL();
            List<LiquidezDTO> lista = repBL.getGestionMensual(objEmpresa.IdEmpresa, year);

            if (lista == null)
                return RedirectToAction("ReportesGestion", new { message = 2 });

            System.Data.DataTable dt = new System.Data.DataTable();
            dt.Clear();

            dt.Columns.Add("Mes");
            dt.Columns.Add("Detalle");
            dt.Columns.Add("Monto Con IGV");
            dt.Columns.Add("Monto Sin IGV");

            //int mesActual = DateTime.Now.Month;

            foreach (var obj in lista)
            {
                PintarGestionPorMesIE(obj, dt);
            }

            GenerarPdf6(dt, "Ventas-Gastos por Mes", "Ventas-Gastos_por_Mes", objEmpresa, Response);

            return RedirectToAction("ReportesGestion", new { message = 2 });
        }