internal InventoryIncomeVm GetIncomeVmByReportVm(InventoryReportVm reportVm)
        {
            decimal totalIncome         = 0;
            decimal totalSales          = 0;
            decimal totalOrder          = 0;
            List <InventorySale> sales  = _reportDal.GetSalesByReportVm(reportVm);
            List <Order>         orders = _reportDal.GetOrdersByReportVm(reportVm);

            if (sales != null)
            {
                foreach (var item in sales)
                {
                    totalSales = totalSales + item.Total;
                }
            }
            if (orders != null)
            {
                foreach (var item in orders)
                {
                    totalOrder = totalOrder + item.Total;
                }
            }

            totalIncome = totalSales - totalOrder;
            InventoryIncomeVm incomeVm = new InventoryIncomeVm();

            incomeVm.Sales       = sales;
            incomeVm.Orders      = orders;
            incomeVm.SalesTotal  = totalSales;
            incomeVm.OrdersTotal = totalOrder;
            incomeVm.TotalIncome = totalIncome;
            return(incomeVm);
        }
        public ActionResult IncomeReport(InventoryReportVm reportVm)
        {
            InventoryIncomeVm incomeVm = _reportBll.GetIncomeVmByReportVm(reportVm);

            _incomeVmForPdf  = incomeVm;
            ViewBag.OutletId = _reportBll.GetOutlet();
            return(View(incomeVm));
        }
 public ActionResult ExportIncomePdf(InventoryIncomeVm incomeVm)
 {
     return(new ActionAsPdf("IncomeReportPdf"));
 }