public ActionResult Edit(long id = 0) { if (id == 0) { return(View(new PayType())); } var info = PayTypeBll.GetById(id); return(View(info)); }
public ActionResult _WjsmxJs(long id) { var model = AgreeCompWjsmxRecordBll.GetById(id); //获取支付方式 var payTypeList = PayTypeBll.GetList(UserContext.CurrentUser.HotelId, true, true); var datas = new List <object>(); foreach (var item in payTypeList) { datas.Add(new AgreeCompWjsmxJsDetail { WjsmxId = id, PayTypeId = item.Id, PayTypeName = item.Name, Money = 0 }); } ViewBag.PayList = datas; return(View(model)); }
public ActionResult OverReportView(string id, long posId = 0) { var now = DateTime.Now; ViewBag.CurrentTime = now.ToString("yyyy-MM-dd HH:mm:ss"); var o = PosDefineBll.GetByProjectNo(id); if (posId != 0 && o == null) { o = PosDefineBll.GetById(posId); } ViewBag.HotelId = UserContext.CurrentUser.HotelId; ViewBag.PosId = o.Id; ViewBag.HotelId = UserContext.CurrentUser.HotelId; ViewBag.PayTypeList = PayTypeBll.GetList(UserContext.CurrentUser.HotelId, true, true); return(View()); }
public ActionResult Delete(long id) { var apiResult = new APIResult(); try { PayTypeBll.DeleteById(id); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public JsonResult Edit(PayType model) { var apiResult = new APIResult(); try { PayTypeBll.AddOrUpdate(model, UserContext.CurrentUser.HotelId); } catch (Exception ex) { apiResult.Ret = -1; apiResult.Msg = ex.Message; if (!(ex is OperationExceptionFacade)) { LogFactory.GetLogger().Log(LogLevel.Error, ex); } } return(Json(apiResult)); }
public string GetList(bool isJzfk, bool state) { var models = PayTypeBll.GetList(UserContext.CurrentUser.HotelId, isJzfk, state); return(JsonConvert.SerializeObject(models)); }
public string GetListByIds(long[] Ids) { var data = PosConsumeBll.GetListByIds(Ids); var user = UserContext.CurrentUser; var payTypeList = PayTypeBll.GetList(user.HotelId, true, true); if (payTypeList == null) { payTypeList = new List <PayType>(); } var outdata = new List <Dictionary <string, object> >(); foreach (var item in data) { var outitem = new Dictionary <string, object>(); outitem["Id"] = item.Id; outitem["PosId"] = item.PosId; if (item.RoomRegId != 0) { var roomReg = RoomRegBll.GetById(item.RoomRegId); outitem["RoomNo"] = roomReg.RoomNO; outitem["RoomRegIdStr"] = item.RoomRegId.ToString(); outitem["RoomRegDanJuNum"] = roomReg.DanJuNum; } else { } var details = PosConsumeDetailBll.GetList(item.Id); var sk_list = PosConsumeSkBll.GetList(item.Id); var tk_list = PosConsumeTkBll.GetList(item.Id); decimal roomAmount = 0; if (item.RoomRegId == 0) { foreach (var detail in details) { if (!detail.IsFree && detail.ToRoomRegId != 0) { roomAmount += detail.Amount; } } outitem["RoomAmount"] = roomAmount; } else { outitem["RoomAmount"] = item.AmountSum; } foreach (var o in sk_list) { foreach (var payType in payTypeList) { if (o.PayTypeId == payType.Id) { var key = "Amount" + o.PayTypeName; if (!outitem.ContainsKey(key)) { outitem[key] = o.Money; } else { outitem[key] = Convert.ToDecimal(outitem[key]) + o.Money; } } } } outitem["NightDate"] = item.NightDate; outitem["OrderNo"] = item.OrderNo; outitem["OrderDate"] = item.OrderDate; outitem["OutTime"] = item.OutTime; outitem["Amount"] = item.Amount; outitem["JzskMoney"] = item.JzskMoney; outdata.Add(outitem); } return(JsonConvert.SerializeObject(outdata)); }
public string GetJJList(long posId, string isToday, PosConsumeSearchInfo search) { var user = UserContext.CurrentUser; List <PosConsume> data = new List <PosConsume>(); if (search.hasValue()) { data = PosConsumeBll.GetListByPos(posId, search); } else if (isToday == "Y") { data = PosConsumeBll.GetTodayListByPos(posId); } else { data = PosConsumeBll.GetListByPos(posId); } data = data.Where(a => a.PosShiftId == 0 && a.CwState == 1).ToList(); var payTypeList = PayTypeBll.GetList(user.HotelId, true, true); if (payTypeList == null) { payTypeList = new List <PayType>(); } var outdata = new List <Dictionary <string, object> >(); foreach (var item in data) { var outitem = new Dictionary <string, object>(); outitem["Id"] = item.Id; outitem["PosId"] = item.PosId; if (item.RoomRegId != 0) { var roomReg = RoomRegBll.GetById(item.RoomRegId); outitem["RoomNo"] = roomReg.RoomNO; outitem["RoomRegIdStr"] = item.RoomRegId.ToString(); outitem["RoomRegDanJuNum"] = roomReg.DanJuNum; } else { } var details = PosConsumeDetailBll.GetList(item.Id); var sk_list = PosConsumeSkBll.GetList(item.Id); var tk_list = PosConsumeTkBll.GetList(item.Id); decimal roomAmount = 0; if (item.RoomRegId == 0) { foreach (var detail in details) { if (!detail.IsFree && detail.ToRoomRegId != 0) { roomAmount += detail.Amount; } } outitem["RoomAmount"] = roomAmount; } else { outitem["RoomAmount"] = item.AmountSum; } foreach (var o in sk_list) { foreach (var payType in payTypeList) { if (o.PayTypeId == payType.Id) { var key = "Amount" + o.PayTypeName; if (!outitem.ContainsKey(key)) { outitem[key] = o.Money; } else { outitem[key] = Convert.ToDecimal(outitem[key]) + o.Money; } } } } outitem["NightDate"] = item.NightDate; outitem["OrderNo"] = item.OrderNo; outitem["OrderDate"] = item.OrderDate; outitem["OutTime"] = item.OutTime; outitem["Amount"] = item.Amount; outitem["JzskMoney"] = item.JzskMoney; outdata.Add(outitem); } return(Newtonsoft.Json.JsonConvert.SerializeObject(outdata)); }
public string GetShiftHistoryList(long posId, PosConsumeSearchInfo search) { var shift_list = PosShiftBll.GetList(posId, search); var outdata = new List <Dictionary <string, object> >(); var user = UserContext.CurrentUser; var payTypeList = PayTypeBll.GetList(user.HotelId, true, true); if (payTypeList == null) { payTypeList = new List <PayType>(); } foreach (var item in shift_list) { var outitem = new Dictionary <string, object>(); outitem["Id"] = item.Id; outitem["PosId"] = item.PosId; outitem["DjNum"] = item.DjNum; outitem["ShiftId"] = item.ShiftId; outitem["ShiftName"] = ShiftBll.GetById(item.ShiftId).Name; outitem["NightDate"] = item.NightDate; List <PosConsume> data = PosConsumeBll.GetListByPosShift(item.Id); outitem["childrenIds"] = string.Join(",", data.Select(a => a.Id).Distinct().ToArray()); decimal roomAmount = 0; foreach (var consume in data) { var details = PosConsumeDetailBll.GetList(consume.Id); var sk_list = PosConsumeSkBll.GetList(consume.Id); if (consume.RoomRegId == 0) //计算转房间账 { foreach (var detail in details) { if (!detail.IsFree && detail.ToRoomRegId != 0) { roomAmount += detail.Amount; } } if (!outitem.ContainsKey("RoomAmount")) { outitem["RoomAmount"] = roomAmount; } else { outitem["RoomAmount"] = Convert.ToDecimal(outitem["RoomAmount"]) + roomAmount; } } else { if (!outitem.ContainsKey("RoomAmount")) { outitem["RoomAmount"] = consume.AmountSum; } else { outitem["RoomAmount"] = Convert.ToDecimal(outitem["RoomAmount"]) + consume.AmountSum; } } if (!outitem.ContainsKey("Amount")) { outitem["Amount"] = consume.AmountSum; } else { outitem["Amount"] = Convert.ToDecimal(outitem["Amount"]) + consume.AmountSum; } if (!outitem.ContainsKey("JzskMoney")) { outitem["JzskMoney"] = consume.JzskMoney; } else { outitem["JzskMoney"] = Convert.ToDecimal(outitem["JzskMoney"]) + consume.JzskMoney; } foreach (var o in sk_list) { foreach (var payType in payTypeList) { if (o.PayTypeId == payType.Id) { var key = "Amount" + o.PayTypeName; if (!outitem.ContainsKey(key)) { outitem[key] = o.Money; } else { outitem[key] = Convert.ToDecimal(outitem[key]) + o.Money; } } } } } outdata.Add(outitem); } return(Newtonsoft.Json.JsonConvert.SerializeObject(outdata)); }
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)); }
public ActionResult _ShiftDetails(long posShiftId) { ViewBag.PosShiftId = posShiftId; ViewBag.PayTypeList = PayTypeBll.GetList(UserContext.CurrentUser.HotelId, true, true); return(View()); }
public ActionResult Print(string Ids) { ViewBag.PayTypeList = PayTypeBll.GetList(UserContext.CurrentUser.HotelId, true, true); ViewBag.Ids = Ids; return(View()); }
/// <summary> /// 结账页面 /// </summary> /// <param name="roomRegId"></param> /// <param name="models"></param> /// <returns></returns> public ActionResult _Jz(long roomRegId, int jstype) { var user = UserContext.CurrentUser; var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg() { Id = 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; //获取未结账的联房数据 //获取未结算明细 //var wjsmxList = new List<RoomRegZw>(); if (jstype == (int)JzType.将其他所有联房费用数据转到该房间有该房间结账) { var lfList = RoomRegBll.Fetch($"where ZfDjId={roomReg.ZfDjId}"); //lfList = lfList.Where(m => m.CwState != 3 && m.CwState != 4 && m.CwState != 2).ToList(); lfList = lfList.Where(m => m.CwState == 1).ToList(); if (lfList == null || lfList.Count == 0) { return(Content("无未结算的联房数据")); } foreach (var lf in lfList) { //var wjsmx = RoomRegZwBll.GetFyListForBfjz(lf.Id); //if (wjsmx != null) // wjsmxList.AddRange(wjsmx); //计算汇总 if (lf.Id == roomRegId) { continue; } //roomReg.Yszk += lf.Yszk; roomReg.FfMoney += lf.FfMoney; roomReg.SpMoney += lf.SpMoney; roomReg.SwpcMoney += lf.SwpcMoney; roomReg.QtMoney += lf.QtMoney; roomReg.HcMoney += lf.HcMoney; roomReg.YhMoney += lf.YhMoney; roomReg.ExpYhMoney += lf.ExpYhMoney; roomReg.ZskMoney += lf.ZskMoney; roomReg.ZtkMoney += lf.ZtkMoney; } } //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(roomReg)); }
/// <summary> /// 部分结账页面--与结账页面大体相同 /// </summary> /// <param name="roomRegId"></param> /// <param name="models"></param> /// <returns></returns> public ActionResult _Bfjz(long roomRegId) { var user = UserContext.CurrentUser; var roomReg = RoomRegBll.GetById(roomRegId); if (roomReg == null) { roomReg = new Model.RoomReg() { Id = 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; return(View(roomReg)); }