Ejemplo n.º 1
0
        public ActionResult PrintCashCount(int id)
        {
            var model   = new CashCountReport();
            var session = CashSession.Find(id);
            var qry     = from x in CustomerPayment.Queryable
                          where x.CashSession.Id == session.Id
                          select new {
                Type   = x.Method,
                Amount = x.Amount
            };
            var list = from x in qry.ToList()
                       group x by x.Type into g
                       select new MoneyCount {
                Type = g.Key, Amount = g.Sum(y => y.Amount)
            };

            model.Cashier      = session.Cashier;
            model.CashDrawer   = session.CashDrawer;
            model.Start        = session.Start;
            model.End          = session.End;
            model.MoneyCounts  = list.ToList();
            model.CashCounts   = session.CashCounts.Where(x => x.Type == CashCountType.CountedCash).ToList();
            model.StartingCash = session.StartingCash;
            model.SessionId    = session.Id;

            return(PdfTicketView("_CashCountTicket", model));
        }
Ejemplo n.º 2
0
        public ActionResult PrintCashCount(int id)
        {
            var model = new CashCountReport ();
            var session = CashSession.Find (id);
            var qry = from x in CustomerPayment.Queryable
                  where x.CashSession.Id == session.Id
                  select new {
                      Type = x.Method,
                      Amount = x.Amount
                  };
            var list = from x in qry.ToList ()
                   group x by x.Type into g
                   select new MoneyCount { Type = g.Key, Amount = g.Sum (y => y.Amount) };

            model.Cashier = session.Cashier;
            model.CashDrawer = session.CashDrawer;
            model.Start = session.Start;
            model.End = session.End;
            model.MoneyCounts = list.ToList ();
            model.CashCounts = session.CashCounts.Where (x => x.Type == CashCountType.CountedCash).ToList ();
            model.StartingCash = session.StartingCash;
            model.SessionId = session.Id;

            return PdfTicketView ("_CashCountTicket", model);
        }