public ActionResult QuarterDetailsPartial(int?quarter, int?year)
        {
            DateTime start, end;

            if (!year.HasValue || !quarter.HasValue)
            {
                int q, y;
                TaxDateHelper.CalculateQuarter(DateTime.Now, out q, out y, out start, out end);
                quarter = q;
                year    = y;
            }
            else
            {
                start = TaxDateHelper.GetStartDate(quarter.Value, year.Value);
                end   = TaxDateHelper.GetEndDate(quarter.Value, year.Value);
            }

            ViewBag.PurchaseTypes = (from p in db.PurchaseTypes
                                     select p).ToList();

            QuarterSummary quarter_Summary = new QuarterSummary()
            {
                Year   = year.Value,
                Month1 = GetSummary(start, start.AddMonths(1).AddDays(-1)),
                Month2 = GetSummary(start.AddMonths(1), start.AddMonths(2).AddDays(-1)),
                Month3 = GetSummary(start.AddMonths(2), end)
            };

            ViewBag.Year    = year.Value;
            ViewBag.Quarter = quarter.Value;

            return(PartialView("QuarterDetailsPartial", quarter_Summary));
        }
        public ActionResult ThisYearSummary()
        {
            int         year = DateTime.Now.Year;
            YearSummary y    = new YearSummary();

            y.Q1 = GetSummary(TaxDateHelper.GetStartDate(1, year), TaxDateHelper.GetStartDate(2, year).AddDays(-1));
            y.Q2 = GetSummary(TaxDateHelper.GetStartDate(2, year), TaxDateHelper.GetStartDate(3, year).AddDays(-1));
            y.Q3 = GetSummary(TaxDateHelper.GetStartDate(3, year), TaxDateHelper.GetStartDate(4, year).AddDays(-1));
            y.Q4 = GetSummary(TaxDateHelper.GetStartDate(4, year), TaxDateHelper.GetStartDate(1, year).AddYears(1).AddDays(-1));


            return(PartialView("YearSummary", y));
        }
        public ActionResult YearSummary(int id)
        {
            YearSummary y = new YearSummary();

            y.Q1      = GetSummary(TaxDateHelper.GetStartDate(1, id), TaxDateHelper.GetStartDate(2, id).AddDays(-1));
            y.Q1.Year = id;

            y.Q2      = GetSummary(TaxDateHelper.GetStartDate(2, id), TaxDateHelper.GetStartDate(3, id).AddDays(-1));
            y.Q2.Year = id;

            y.Q3      = GetSummary(TaxDateHelper.GetStartDate(3, id), TaxDateHelper.GetStartDate(4, id).AddDays(-1));
            y.Q3.Year = id;

            y.Q4      = GetSummary(TaxDateHelper.GetStartDate(4, id), TaxDateHelper.GetStartDate(1, id).AddYears(1).AddDays(-1));
            y.Q4.Year = id;


            return(PartialView("YearSummary", y));
        }