/// <summary> /// 店铺结算明细 /// </summary> /// <param name="page"></param> /// <param name="pagesize"></param> /// <returns></returns> public DataGridModel <ShopAccountItem> GetShopAccountItem(int page = 1, int pagesize = 10, bool?isIncome = null) { CheckShopManageLogin(); var shop = CurrentShop; long shopId = shop.Id; var query = new ShopAccountItemQuery() { PageNo = page, PageSize = pagesize, ShopId = shopId, IsIncome = isIncome }; var model = BillingApplication.GetShopAccountItem(query); DataGridModel <ShopAccountItem> result = new DataGridModel <ShopAccountItem>() { rows = model.Models, total = model.Total }; return(result); }
public JsonResult SettlementList(DateTime?startDate, DateTime?endDate, int page, int rows) { if (startDate == null) { startDate = endDate.HasValue ? endDate.Value.AddYears(-1).Date : DateTime.Now.AddYears(-1).Date; } var query = new ShopAccountItemQuery(); query.PageNo = page; query.PageSize = rows; query.TimeStart = startDate; query.TimeEnd = endDate; query.ShopAccountType = ShopAccountType.SettlementIncome; query.ShopId = CurrentSellerManager.ShopId; var data = BillingApplication.GetShopAccountItem(query); if (data.Models == null || data.Models.Count == 0) { return(Json(new { rows = new object[0], total = 0 }, true)); } var models = data.Models.Select(item => { return(new { Id = item.Id, Amount = item.Amount, DetailId = item.DetailId, CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), Cycle = item.Cycle }); }); return(Json(new { rows = models, data.Total }, true)); }
public JsonResult SettlementList(ShopAccountItemQuery query) { if (!query.TimeStart.HasValue) { query.TimeStart = query.TimeEnd.HasValue ? query.TimeEnd.Value.AddYears(-1).Date : DateTime.Now.AddYears(-1).Date; } query.ShopAccountType = ShopAccountType.SettlementIncome; var data = BillingApplication.GetShopAccountItem(query); var models = data.Models.Select(item => new SettlementListModel { Id = item.Id, ShopId = item.ShopId, ShopName = item.ShopName, Amount = item.Amount, DetailId = item.DetailId, CreateTime = item.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), Cycle = item.Cycle }); return(Json(new { rows = models, data.Total }, true)); }
public JsonResult GetShopAccountItemlist(DateTime?startDate, DateTime?endDate, ShopAccountType?type, int page, int rows) { ShopAccountItemQuery query = new ShopAccountItemQuery(); query.PageNo = page; query.PageSize = rows; query.TimeStart = startDate; query.TimeEnd = endDate; query.ShopAccountType = type; query.ShopId = CurrentSellerManager.ShopId; var model = BillingApplication.GetShopAccountItem(query); var result = new { rows = model.Models.Select(p => new { p.Id, p.ShopId, p.ShopName, CreateTime = p.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"), p.AccountNo, p.AccountType, p.ShopAccountType, p.Balance, p.DetailId, p.DetailLink, p.IsIncome, p.Amount, p.Income, p.Expenditure, p.ReMark, p.AccoutID }), total = model.Total }; return(Json(result)); }