示例#1
0
        public ActionResult GetBooking_Payments(int transactionId)
        {
            BookingPaymentsViewModel bookpay = new BookingPaymentsViewModel();

            //  BookingsViewModel bbViewModel=new BookingsViewModel();
            try
            {
                decimal totalAmount = 0;
                bookpay.transId = transactionId;

                bookpay.Bookings = bookingsViewModel.GetListofBookings().SingleOrDefault(x => x.trn_Id == transactionId);

                totalAmount               = bookingPayments.Get_TotalAmountBook(transactionId);
                bookpay.t_amtBooking      = totalAmount;
                bookpay.t_addons          = bookingPayments.getTotalAddons(transactionId);
                bookpay.cateringdiscount  = bookingPayments.GetCateringDiscount(transactionId);
                bookpay.locationextcharge = transdetails.Get_extendedAmountLoc(transactionId);
                bookpay.generaldiscount   = bookingPayments.getBookingTransDiscount(transactionId, totalAmount);

                bookpay.PaymentList = bookingPayments.GetPaymentDetaiilsBooking(transactionId);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

            return(View(bookpay));
        }
示例#2
0
        public ActionResult GetBookingScheduleDataTableList(DateTime startDate, DateTime endDate, string filter)
        {
            List <CustomerBookingsViewModel> cusbooking_Schedule = new List <CustomerBookingsViewModel>();

            try
            {
                List <CustomerBookingsViewModel> lst = new List <CustomerBookingsViewModel>();
                List <Booking> listbookings          = new List <Booking>();
                listbookings = _dbEntities.Bookings.Where(
                    b => DbFunctions.TruncateTime(b.startdate) >= DbFunctions.TruncateTime(startDate) &&
                    DbFunctions.TruncateTime(b.startdate) <= DbFunctions.TruncateTime(endDate)).ToList();

                lst = (from l in listbookings
                       select new CustomerBookingsViewModel()
                {
                    transId = l.trn_Id,
                    cusId = l.c_Id,
                    cusfullname = Utilities.getfullname_nonreverse(l.Customer.lastname, l.Customer.firstname, l.Customer.middle),
                    occasion = l.occasion,
                    venue = l.venue,
                    bookdatetime = l.startdate,
                    package = l.Package.p_descripton,
                    packageDue = bookingPayments.Get_TotalAmountBook(l.trn_Id),
                    isServe = Convert.ToBoolean(l.serve_stat)
                }).ToList();

                if (filter == "serve")
                {
                    cusbooking_Schedule = (from c in lst where c.isServe == true select c).ToList();
                }
                else if (filter == "unserve")
                {
                    cusbooking_Schedule = (from c in lst where c.isServe == false select c).ToList();
                }
                else
                {
                    cusbooking_Schedule = (from c in lst select c).ToList();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            Thread.Sleep(3000);



            return(Json(new { data = cusbooking_Schedule }, JsonRequestBehavior.AllowGet));
        }
示例#3
0
        public ActionResult GetBookingsToday()
        {
            List <CustomerBookingsViewModel> lst = new List <CustomerBookingsViewModel>();
            List <Booking> listbookings          = new List <Booking>();

            DateTime dtoday = DateTime.Now;

            //var bookviewmodel=new BookingsViewModel();

            //listofBookingsToday = bookviewmodel.GetListofBookings().ToList()
            //    .Where(x => DbFunctions.TruncateTime(x.transdate) ==DbFunctions.TruncateTime(dtoday)).ToList();

            List <CustomerBookingsViewModel> cusbooking_Schedule = new List <CustomerBookingsViewModel>();

            try
            {
                listbookings = _dbcontext.Bookings.Where(
                    b => DbFunctions.TruncateTime(b.startdate) == DbFunctions.TruncateTime(dtoday)).ToList();

                lst = (from l in listbookings
                       select new CustomerBookingsViewModel()
                {
                    transId = l.trn_Id,
                    cusId = l.c_Id,
                    cusfullname = Utilities.getfullname_nonreverse(l.Customer.lastname, l.Customer.firstname, l.Customer.middle),
                    occasion = l.occasion,
                    venue = l.venue,
                    bookdatetime = l.startdate,
                    package = l.Package.p_descripton,
                    packageDue = bookingPayments.Get_TotalAmountBook(l.trn_Id),
                    isServe = Convert.ToBoolean(l.serve_stat)
                }).ToList();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }



            return(Json(new { data = lst }, JsonRequestBehavior.AllowGet));
        }
示例#4
0
        public ActionResult BookingRefundEntry(int transId)
        {
            var bookrefundinfo = new BookingRefundViewModel();
            //var refunndableAccount = _refundsView.GetAllRefundsList().FirstOrDefault(x => x.TransId == transId);

            var booking = (from b in dbEntities.Bookings select b).FirstOrDefault(x => x.trn_Id == transId);


            decimal totalbookAmount = bookingPayments.Get_TotalAmountBook(transId);
            decimal totalAmountPay  = (decimal)(from p in dbEntities.Payments select p).Where(s => s.trn_Id == transId).Sum(x => x.amtPay);

            bookrefundinfo.transId         = transId;
            bookrefundinfo.refundDeduction = 0;

            if ((bool)booking.is_cancelled)
            {
                decimal cancellationsdeduction = 10m / 100m;
                int     no_of_daysfreecancel   = 5;

                decimal cancellationAmt = totalbookAmount * cancellationsdeduction;

                DateTime booktransdate = Convert.ToDateTime(booking.startdate);


                bookrefundinfo.refundAmount = totalAmountPay;
                int x = Convert.ToInt16((booktransdate.Date - DateTime.Now.Date).TotalDays);
                bookrefundinfo.refundDeduction = no_of_daysfreecancel > x ? cancellationAmt :0;
                bookrefundinfo.refundNet       = no_of_daysfreecancel > x ? totalAmountPay - cancellationAmt : totalAmountPay;
            }
            else
            {
                decimal refundAmount = totalAmountPay - totalbookAmount;

                bookrefundinfo.refundAmount    = refundAmount;
                bookrefundinfo.refundDeduction = 0;
                bookrefundinfo.refundNet       = refundAmount;
            }



            return(PartialView("_CreateRefundEntry", bookrefundinfo));
        }