Exemplo n.º 1
0
        public ActionResult BuyerPaymentReport()
        {
            var concernId = Convert.ToInt32(Session["ConcernId"]);
            var userId    = Convert.ToInt32(Session["UserId"]);

            if (concernId > 0 && userId > 0)
            {
                DateTime         date            = DateTime.Now;
                var              firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                var              first           = firstDayOfMonth.ToString("yyyy-MM-dd");
                var              lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);
                var              last            = lastDayOfMonth.ToString("yyyy-MM-dd");
                var              buyers          = _context.Buyers.Where(x => x.IsDelete == 0).ToList();
                var              payment         = _report.BuyerDuPaymentReport(concernId, 0, first, last);
                ReportDuePayment data            = new ReportDuePayment()
                {
                    Buyer         = buyers,
                    PaymentReport = payment
                };
                return(View(data));
            }
            return(RedirectToAction("Login", "GlobalData", new { Area = "Global" }));
        }