Beispiel #1
0
        public ActionResult _EditContent(long posId, string isReadonly, string fromType, long id = 0)
        {
            var now = DateTime.Now;

            ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss");
            ViewBag.HotelId     = UserContext.CurrentUser.HotelId;
            ViewBag.PosId       = posId;

            ViewBag.CurrentOrderNo = PosConsumeBll.GetNewOrderNo(posId);
            var pos = PosDefineBll.GetById(posId);

            ViewBag.Pos = pos;
            if (fromType == "History")
            {
                ViewBag.ReturnPage = "/PosConsume/History?id=" + pos.ProjectNo;
            }
            if (id == 0)
            {
                return(View(new PosConsume()
                {
                    OrderNo = PosConsumeBll.GetNewOrderNo(posId),
                    OpUserName = UserContext.CurrentUser.UserName,
                    PosId = posId
                }));
            }
            var info = PosConsumeBll.GetById(id);

            if (info.PosId == 0)
            {
                info.PosId = posId;
            }
            ViewBag.IsReadonly = isReadonly;
            return(View(info));
        }
Beispiel #2
0
        public ActionResult _Serve(long consumeId, decimal Amount, long roomRegId)
        {
            var now = DateTime.Now;

            ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss");

            ViewBag.ConsumeId = consumeId;
            ViewBag.HotelId   = UserContext.CurrentUser.HotelId;

            ViewBag.RoomRegId = roomRegId;
            var consume = PosConsumeBll.GetById(consumeId);
            var pos     = PosDefineBll.GetById(consume.PosId);

            ViewBag.Amount           = Amount;
            ViewBag.ServiceChargePer = pos.ServiceChargePer;
            ViewBag.DefaultAmount    = Convert.ToInt32(Amount * (decimal)0.01 * pos.ServiceChargePer);

            var data = new PosConsume()
            {
                Id = consumeId
            };

            data.ServeAmount = Convert.ToInt32(Amount * (decimal)0.01 * pos.ServiceChargePer);

            return(View(data));
        }
Beispiel #3
0
        public ActionResult _PosPrintContent(long id)
        {
            var info = PosConsumeBll.GetById(id);
            var now  = DateTime.Now;

            ViewBag.CurrentTime     = now.ToString("yyyy-MM-dd HH:mm");
            ViewBag.HotelId         = UserContext.CurrentUser.HotelId;
            ViewBag.PosId           = info.PosId;
            ViewBag.CurrentUserName = UserContext.CurrentUser.Name;
            var hotel = HotelBll.GetById(UserContext.CurrentUser.HotelId);

            if (hotel != null)
            {
                ViewBag.HotelName = hotel.Name;
            }

            var models = PosConsumeDetailBll.GetList(id);

            models = models.Where(a => a.ToRoomRegId == 0 && a.SourceRoomRegId == 0).ToList(); //没有入账房间 而且没有部分转入账房间

            ViewBag.DetailPrice         = models.Select(a => a.Price).Sum();
            ViewBag.DetailDiscountPrice = models.Select(a => a.DiscountPrice).Sum();
            ViewBag.DetailAmount        = models.Select(a => a.Amount).Sum();
            ViewBag.Detail = models;
            var pos = PosDefineBll.GetById(info.PosId);

            ViewBag.Pos     = pos;
            ViewBag.PosName = pos.MenuName;
            return(View(info));
        }
Beispiel #4
0
        public ActionResult _Zz(long PosConsumeId)
        {
            ViewBag.HotelId      = UserContext.CurrentUser.HotelId;
            ViewBag.PosConsumeId = PosConsumeId;
            var o = PosConsumeBll.GetById(PosConsumeId);

            ViewBag.RoomRegId = o.RoomRegId;
            return(View());
        }
Beispiel #5
0
        public string getEditPageDetailList(long id)
        {
            var info   = PosConsumeBll.GetById(id);
            var models = PosConsumeDetailBll.GetList(id);

            models = models.Where(a => a.ToRoomRegId == 0 && a.SourceRoomRegId == 0).ToList(); //没有入账房间 而且没有部分转入账房间


            return(JsonConvert.SerializeObject(models));
        }
Beispiel #6
0
        /// <summary>
        /// 房间财务里面显示的消费明细数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetDetailListForRoomDetail(long id, long roomRegId)
        {
            var models = PosConsumeDetailBll.GetList(id);

            models = models.Where(a => a.ToRoomRegId == roomRegId || a.SourceRoomRegId == roomRegId).ToList();



            var info = PosConsumeBll.GetById(id);

            return(JsonConvert.SerializeObject(models));
        }
Beispiel #7
0
        public ActionResult PrintDetail(long id)
        {
            ViewBag.Id = id;
            var info = PosConsumeBll.GetById(id);

            PosConsumeBll.LoadData(new List <PosConsume>()
            {
                info
            }, info.PosId);

            return(View(info));
        }
Beispiel #8
0
        public ActionResult _DetailView(long id, long roomRegId)
        {
            var now = DateTime.Now;

            ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss");
            ViewBag.HotelId     = UserContext.CurrentUser.HotelId;
            var data = PosConsumeBll.GetById(id);

            ViewBag.Pos       = PosDefineBll.GetById(data.PosId);
            ViewBag.PosId     = data.PosId;
            ViewBag.RoomRegId = roomRegId;
            return(View(data));
        }
Beispiel #9
0
        public ActionResult Index(long ConsumeId)
        {
            var consume = PosConsumeBll.GetById(ConsumeId);

            if (consume == null)
            {
                consume = new Model.PosConsume();
            }
            var model = new PosInvoice()
            {
                Id = 0, ConsumeId = consume.Id, DjdanNum = consume.OrderNo
            };

            ViewBag.Consume = consume;
            return(View(model));
        }
Beispiel #10
0
        public JsonResult SaveDetails(long id, string detailJson)
        {
            var apiResult = new APIResult();

            try
            {
                PosConsume model = PosConsumeBll.GetById(id);
                model.Details = JsonConvert.DeserializeObject <List <PosConsumeDetail> >(detailJson);

                PosConsumeBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
            }

            return(Json(apiResult));
        }
        public ActionResult InputBody(long posId, long roomRegId)
        {
            ViewBag.HotelId   = UserContext.CurrentUser.HotelId;
            ViewBag.RoomRegId = roomRegId;
            ViewBag.PosId     = posId;

            ViewBag.HotelId = UserContext.CurrentUser.HotelId;
            var types = PosCatBll.GetListByPos(posId);

            ViewBag.Types          = types;
            ViewBag.Room           = RoomRegBll.GetById(roomRegId);
            ViewBag.CurrentOrderNo = PosConsumeBll.GetNewOrderNo(posId);
            var o = PosConsumeBll.GetById(posId);

            return(View(new PosConsume()
            {
                OrderNo = PosConsumeBll.GetNewOrderNo(posId),
                OpUserName = UserContext.CurrentUser.UserName,
                RoomRegId = roomRegId,
                PosId = posId
            }));
        }
Beispiel #12
0
        public ActionResult _Jz(long consumeId, int jstype)
        {
            var user    = UserContext.CurrentUser;
            var consume = PosConsumeBll.GetById(consumeId);

            var details_list = PosConsumeDetailBll.GetList(consumeId);

            details_list      = details_list.Where(a => a.ToRoomRegId == 0 && a.SourceRoomRegId == 0).ToList();
            ViewBag.WjsmxList = details_list;

            var roomRegId = consume.RoomRegId;
            var roomReg   = new Model.RoomReg()
            {
                Id = consume.RoomRegId, HotelId = user.HotelId
            };

            if (consume.RoomRegId != 0)
            {
                roomReg = RoomRegBll.GetById(consume.RoomRegId);
                if (roomReg == null)
                {
                    roomReg = new Model.RoomReg()
                    {
                        Id = consume.RoomRegId, HotelId = user.HotelId
                    }
                }
                ;
            }
            if (roomReg.CustomerType == 2)
            {
                //如果是连房成员,则需要获取主房登记id
                var zf = RoomRegBll.GetById(roomReg.ZfDjId);
                if (zf.CustomerType == 3)
                {
                    //主房如果是酒店会员
                    var member = MemberBll.GetById(long.Parse(zf.MemCompId));
                    if (member == null)
                    {
                        member = new Member();
                    }
                    ViewBag.CustomerType = new CustomerTypeHelp {
                        Type = 3, Data = JsonConvert.SerializeObject(member)
                    };
                }
                else if (zf.CustomerType == 4)
                {
                    //主房如果是协议单位
                    var comAgree = AgreeCompanyBll.GetById(zf.MemCompId);
                    if (comAgree == null)
                    {
                        comAgree = new AgreeCompany();
                    }
                    ViewBag.CustomerType = new CustomerTypeHelp {
                        Type = 4, Data = JsonConvert.SerializeObject(comAgree)
                    };
                }
                else
                {
                    ViewBag.CustomerType = new CustomerTypeHelp {
                        Type = 1
                    };
                }
            }
            else if (roomReg.CustomerType == 3)
            {
                //如果是酒店会员
                var member = MemberBll.GetById(long.Parse(roomReg.MemCompId));
                if (member == null)
                {
                    member = new Member();
                }
                ViewBag.CustomerType = new CustomerTypeHelp {
                    Type = 3, Data = JsonConvert.SerializeObject(member)
                };
            }
            else if (roomReg.CustomerType == 4)
            {
                //如果是协议单位
                var comAgree = AgreeCompanyBll.GetById(roomReg.MemCompId);
                if (comAgree == null)
                {
                    comAgree = new AgreeCompany();
                }
                ViewBag.CustomerType = new CustomerTypeHelp {
                    Type = 4, Data = JsonConvert.SerializeObject(comAgree)
                };
            }
            else
            {
                ViewBag.CustomerType = new CustomerTypeHelp {
                    Type = 1
                };
            }
            //获取支付方式列表
            var payTypeList = PayTypeBll.GetList(user.HotelId, true, true);

            if (payTypeList == null)
            {
                payTypeList = new List <PayType>();
            }
            var payList = new List <RoomRegZwPaytypeHelp>();

            foreach (var item in payTypeList)
            {
                payList.Add(new RoomRegZwPaytypeHelp()
                {
                    Id      = item.Id.ToString(),
                    PayId   = item.Id.ToString(),
                    PayName = item.Name,
                    Money   = 0,
                });
            }
            ViewBag.PayList = payList;
            //获取卡类型
            var cardTypeList = CardTypeBll.GetList(UserContext.CurrentUser.HotelId);

            ViewBag.CardTypeList = cardTypeList;


            //ViewBag.WjsmxList = wjsmxList;
            //获取信用卡预授权
            var xykysqList = RoomRegXykBll.GetYsq(roomRegId);

            if (xykysqList == null || xykysqList.Count == 0)
            {
                xykysqList = new List <RoomRegXyk>();
            }
            ViewBag.Xykysq = xykysqList;
            ViewBag.jstype = jstype;
            return(View(consume));
        }