/// <summary> /// 初始化 /// </summary> private void DataInit() { string tourId = Utils.GetQueryStringValue("tourId"); //权限判断 PowerControl(tourId); //配置团队支出 TourMoneyOut.TourID = tourId; //团队基本数据 TourModelInit(tourId); //导游收入 TourGuideMoneyIn(tourId); //导游借款 Debit(tourId); //计调BLL BPlan bll = new BPlan(); //其他收入 OtherMoneyIn(bll, tourId); //报账汇总 TourSummarizing(bll, tourId); //团队收支总汇 TourInOutSum(bll, tourId); PrintPageHSD = new EyouSoft.BLL.ComStructure.BComSetting().GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.核算单); PrintPageHSD += "?referertype=1&tourid=" + tourId; }
/// <summary> /// 团队收支总汇 /// </summary> private void TourInOutSum(BPlan BLL, string tourID) { /*EyouSoft.Model.TourStructure.MOrderSum orders = new EyouSoft.Model.TourStructure.MOrderSum(); * new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(ref orders, tourID); * //团队收入 * decimal tourMoneyIn = 0; * if (orders != null) * { * tourMoneyIn = orders.ConfirmSettlementMoney; * } * //团队支出 * decimal tourMoneyOut = 0; * IList<EyouSoft.Model.PlanStructure.MPlanBaseInfo> ls = BLL.GetList(tourID); * if (ls != null && ls.Count > 0) * { * tourMoneyOut = ls.Sum(item => item.Confirmation); * } * //团队利润=团队收入-团队支出 * lbl_tourMoney.Text = (tourMoneyIn - tourMoneyOut).ToString(); * //利润率 = 团队利润/团队收入(不要把/100.00改成100 原因请参考.net基础之 加减乘除) * lbl_tourMoneyRate.Text = tourMoneyIn != 0 ? (((double)(Utils.GetDecimal(lbl_tourMoney.Text) / tourMoneyIn * 10000)) / 100.00).ToString("f2") + "%" : "0%"; * //格式化团队利润 * lbl_tourMoney.Text = UtilsCommons.GetMoneyString(lbl_tourMoney.Text, ProviderToMoney); * //格式化团队收入 * lbl_tourMoneyIn.Text = UtilsCommons.GetMoneyString(tourMoneyIn, ProviderToMoney); * //格式化团队支出 * lbl_tourMoneyOut.Text = UtilsCommons.GetMoneyString(tourMoneyOut, ProviderToMoney);*/ var info = new EyouSoft.BLL.PlanStructure.BPlan().GetTourTotalInOut(tourID); this.lbl_tourMoneyIn.Text = UtilsCommons.GetMoneyString(info.TourIncome + info.QiTaShouRu, ProviderToMoney); this.lbl_tourMoneyOut.Text = UtilsCommons.GetMoneyString(info.TourOutlay, ProviderToMoney); this.lbl_tourMoney.Text = UtilsCommons.GetMoneyString(info.TourProfit, ProviderToMoney); this.lbl_tourMoneyRate.Text = info.TourProRate.ToString("F2") + "%"; }
/// <summary> /// 初始化 /// </summary> private void DataInit() { //团队编号 string tourId = Utils.GetQueryStringValue("tourId"); PringPageJSD = new EyouSoft.BLL.ComStructure.BComSetting().GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.结算单); PrintPageHSD = new EyouSoft.BLL.ComStructure.BComSetting().GetPrintUri(SiteUserInfo.CompanyId, EyouSoft.Model.EnumType.ComStructure.PrintTemplateType.核算单); PrintPageHSD += "?referertype=4&tourid=" + tourId; //权限控制 PowerControl(tourId); //计调BLL BPlan bpBLL = new BPlan(); //初始化团队基本信息 TourModelInit(tourId); //团款收入 TourOrderInit(tourId); //初始化其他收入列表 OtherMoneyIn(bpBLL, tourId); //初始化团队支出列表 TourMoneyOut(bpBLL, tourId); //计算毛利 Price = Utils.FilterEndOfTheZeroDecimal(confirmSettlementMoney - tourMoneyOutSumNum); //报账总汇 TourSummarizing(bpBLL, tourId); //团队收支总汇 TourInOutSum(); }
/// <summary> /// 删除计调安排 /// </summary> void DeleteAnPai() { if (string.IsNullOrEmpty(AnPaiId)) { Utils.RCWE(UtilsCommons.AjaxReturnJson("-1", "操作失败")); } var bllRetCode = new BPlan().DelPlan(AnPaiId); Utils.RCWE(UtilsCommons.AjaxReturnJson(bllRetCode ? "1" : "-1", "操作失败")); }
/// <summary> /// 更新计调安排 /// </summary> void UpdateAnPai() { var info = GetFormInfo(); if (string.IsNullOrEmpty(info.PlanId)) { Utils.RCWE(UtilsCommons.AjaxReturnJson("-1", "操作失败")); } var bllRetCode = new BPlan().UpdPlan(info); Utils.RCWE(UtilsCommons.AjaxReturnJson(bllRetCode == 1 ? "1" : "-1", "操作失败")); }
/// <summary> /// 其他收入(这个"其他"不是计调项的其他,是财务的杂费收入) /// </summary> /// <param name="BLL">计调BLL</param> /// <param name="tourId">团队编号</param> private void OtherMoneyIn(BPlan BLL, string tourId) { IList <MOtherFeeInOut> ls = BLL.GetOtherIncome(tourId); if (ls != null && ls.Count > 0) { rpt_restsMoneyIn.DataSource = ls; rpt_restsMoneyIn.DataBind(); TourOtherIncome.Value = ls.Sum(item => item.FeeAmount).ToString(); } lbl_restsMoneyInMsg.Visible = !(ls != null && ls.Count > 0); }
/// <summary> /// 报账汇总 /// </summary> /// <param name="BLL">计调BLL</param> /// <param name="tourId">团号</param> private void TourSummarizing(BPlan BLL, string tourId) { MBZHZ model = BLL.GetBZHZ(tourId); if (model != null) { lbl_guidesIncome.Text = UtilsCommons.GetMoneyString(model.GuideIncome, ProviderToMoney); lbl_guidesBorrower.Text = UtilsCommons.GetMoneyString(model.GuideBorrow, ProviderToMoney); lbl_guidesSpending.Text = UtilsCommons.GetMoneyString(model.GuideOutlay, ProviderToMoney); lbl_replacementOrReturn.Text = UtilsCommons.GetMoneyString(model.GuideMoneyRtn, ProviderToMoney); lbl_RCSN.Text = model.GuideRelSign.ToString(); lbl_HUSN.Text = model.GuideUsed.ToString(); lbl_RSN.Text = model.GuideSignRtn.ToString(); } }
/// <summary> /// 其他收入(这个"其他"不是计调项的其他,是财务的杂费收入) /// </summary> /// <param name="BLL">计调BLL</param> /// <param name="tourId">团队编号</param> private void OtherMoneyIn(BPlan BLL, string tourId) { IList <MOtherFeeInOut> ls = BLL.GetOtherIncome(tourId); if (ls != null && ls.Count > 0) { repOtherMoneyIn.DataSource = ls; repOtherMoneyIn.DataBind(); } if (IsSubmit == false) { panMoneyInView.Visible = false; } }
/// <summary> /// 团队支出 /// </summary> /// <param name="BLL">计调BLL</param> /// <param name="tourId">团队编号</param> private void TourMoneyOut(BPlan BLL, string tourId) { IList <EyouSoft.Model.PlanStructure.MPlanBaseInfo> ls = BLL.GetList(tourId); if (ls != null && ls.Count > 0) { rpt_tourMoneyOut.DataSource = ls.Where(p => p.Type != PlanProject.购物); rpt_tourMoneyOut.DataBind(); //lbl_tourMoneyOutSumNum.Text = ls.Sum(item => item.Num).ToString(); lbl_tourMoneyOutSumConfirmation.Text = UtilsCommons.GetMoneyString((lbl_tourMoneyOut.Text = TourPay.Value = (tourMoneyOutSumNum = ls.Sum(item => item.Confirmation)).ToString()), ProviderToMoney); decimal yingFuJinE = ls.Sum(item => item.Confirmation); decimal yiFuJinE = ls.Sum(item => item.Prepaid); ltrYiFuJinE.Text = UtilsCommons.GetMoneyString(yiFuJinE, ProviderToMoney); ltrWeiFuJinE.Text = UtilsCommons.GetMoneyString(yingFuJinE - yiFuJinE, ProviderToMoney); } pan_tourMoneyOutMsg.Visible = !(pan_tourMoneyOut.Visible = ls != null && ls.Count > 0); }
/// <summary> /// 初始化 /// </summary> private void DataInit(string tourID) { PlanAddStatus?planAddStatus = null; IList <EnumObj> paymentList = EnumObj.GetList(typeof(Payment)); if (paymentList != null && paymentList.Count > 0) { for (int i = 0; i < paymentList.Count; i++) { if (IsChangeDaoYou == false && (Payment)Utils.GetInt(paymentList[i].Value) == Payment.导游现付) { //PaymentStr += "<option value='" + paymentList[i].Value + "'>" + paymentList[i].Text + "</option>"; } else { PaymentStr += "<option value='" + paymentList[i].Value + "'>" + paymentList[i].Text + "</option>"; } } } BPlan bll = new BPlan(); bool isShowMsg = true; planAddStatus = null; isShowMsg = Bind(rpt_CheDui, bll.GetList(PlanProject.用车, null, planAddStatus, true, null, tourID), pan_CheDui) && isShowMsg; isShowMsg = Bind(rpt_DaoYou, bll.GetList(PlanProject.导游, null, planAddStatus, true, null, tourID), pan_DaoYou) && isShowMsg; isShowMsg = Bind(rpt_DiJie, bll.GetList(PlanProject.地接, null, planAddStatus, true, null, tourID), pan_DiJie) && isShowMsg; isShowMsg = Bind(rpt_FeiJi, bll.GetList(PlanProject.飞机, null, planAddStatus, true, null, tourID), pan_FeiJi) && isShowMsg; isShowMsg = Bind(rpt_GuoNeiYouLun, bll.GetList(PlanProject.国内游轮, null, planAddStatus, true, null, tourID), pan_GuoNeiYouLun) && isShowMsg; isShowMsg = Bind(rpt_HuoChe, bll.GetList(PlanProject.火车, null, planAddStatus, true, null, tourID), pan_HuoChe) && isShowMsg; isShowMsg = Bind(rpt_JinDian, bll.GetList(PlanProject.景点, null, planAddStatus, true, null, tourID), pan_JinDian) && isShowMsg; isShowMsg = Bind(rpt_JiuDian, bll.GetList(PlanProject.酒店, null, planAddStatus, true, null, tourID), pan_JiuDian) && isShowMsg; isShowMsg = Bind(rpt_LingLiao, bll.GetList(PlanProject.领料, null, planAddStatus, true, null, tourID), pan_LinLiao) && isShowMsg; isShowMsg = Bind(rpt_QiChe, bll.GetList(PlanProject.汽车, null, planAddStatus, true, null, tourID), pan_QiChe) && isShowMsg; isShowMsg = Bind(rpt_QiTa, bll.GetList(PlanProject.其它, null, planAddStatus, true, null, tourID), pan_QiTa) && isShowMsg; isShowMsg = Bind(rpt_SheWaiYouLun, bll.GetList(PlanProject.涉外游轮, null, planAddStatus, true, null, tourID), pan_SheWaiYouLun) && isShowMsg; isShowMsg = Bind(rpt_YongCan, bll.GetList(PlanProject.用餐, null, planAddStatus, true, null, tourID), pan_YongCan) && isShowMsg; pan_Msg.Visible = isShowMsg && IsShowOperate == -1 && ParentType == null; }
/// <summary> /// 初始化数据 /// </summary> private void DataInit() { string b = Utils.GetQueryStringValue("mark"); switch (b) { case "1": this.lblMsg.Text = "提交成功!"; break; case "2": this.lblMsg.Text = "提交失败!"; break; case "3": this.lblMsg.Text = "保存成功!"; break; } string tourId = Utils.GetQueryStringValue("tourId"); BPlan bll = new BPlan(); //团队支出 IList <MPlanBaseInfo> list = bll.GetList(tourId); if (list != null && list.Count > 0) { rptList.DataSource = list; rptList.DataBind(); this.litFrist.Text = " <span>类型</span> - <span>名称</span> - <span>结算费用</span>"; } else { this.litFrist.Text = "暂无支出!"; } //导游收入 EyouSoft.Model.TourStructure.MOrderSum sum = new EyouSoft.Model.TourStructure.MOrderSum(); IList <EyouSoft.Model.TourStructure.MTourOrder> orders = new EyouSoft.BLL.TourStructure.BTourOrder().GetTourOrderListById(ref sum, tourId); if (orders != null && orders.Count > 0) { repGuidInMoney.DataSource = orders; repGuidInMoney.DataBind(); this.litSecond.Text = " <span>客源单位</span> - <span>团款现收</span>"; } else { this.litSecond.Text = "暂无收入!"; } //导游借款 IList <MDebit> ls = new EyouSoft.BLL.FinStructure.BFinance().GetDebitLstByTourId(tourId, true); if (ls != null && ls.Count > 0) { this.rptDebit.DataSource = ls; this.rptDebit.DataBind(); this.litThird.Text = " <span>姓名</span> - <span>日期</span> - <span>金额</span>"; } else { this.litThird.Text = "暂无借款!"; } //报账汇总 MBZHZ model = bll.GetBZHZ(tourId); if (model != null) { lbl_guidesIncome.Text = UtilsCommons.GetMoneyString(model.GuideIncome, ProviderToMoney); lbl_guidesBorrower.Text = UtilsCommons.GetMoneyString(model.GuideBorrow, ProviderToMoney); lbl_guidesSpending.Text = UtilsCommons.GetMoneyString(model.GuideOutlay, ProviderToMoney); lbl_replacementOrReturn.Text = UtilsCommons.GetMoneyString(model.GuideMoneyRtn, ProviderToMoney); } }
/// <summary> /// 获取表单信息 /// </summary> /// <returns></returns> MPlanBaseInfo GetFormInfo() { var anPaiLeiXing = (PlanProject?)Utils.GetEnumValueNull(typeof(PlanProject), Utils.GetFormValue("type")); string tourId = Utils.GetFormValue("TourID"); var uinfo = EyouSoft.Security.Membership.UserProvider.GetUserInfo(); if (!anPaiLeiXing.HasValue) { Utils.RCWE(UtilsCommons.AjaxReturnJson("-1")); } if (string.IsNullOrEmpty(tourId)) { Utils.RCWE(UtilsCommons.AjaxReturnJson("-1")); } MPlanBaseInfo info = null; if (!string.IsNullOrEmpty(AnPaiId)) { info = new BPlan().GetModel(PlanProject.导游, AnPaiId); } if (info == null) { info = new MPlanBaseInfo(); } info.CompanyId = uinfo.CompanyId; info.DeptId = uinfo.DeptId; info.OperatorId = uinfo.UserId; info.OperatorName = uinfo.Name; info.Confirmation = Utils.GetDecimal(Utils.GetFormValue("txt_confirmation")); info.CostDetail = Utils.GetFormValue("txt_costDetail").Trim(); info.IssueTime = DateTime.Now; info.Num = Utils.GetInt(Utils.GetFormValue("txt_num")); info.DNum = Utils.GetDecimal(Utils.GetFormValue("txt_num")); info.PaymentType = (Payment)Utils.GetInt(Utils.GetFormValue("sel_payment")); info.ContactName = Utils.GetFormValue("ContactName"); info.ContactPhone = Utils.GetFormValue("ContactPhone"); info.SourceName = Utils.GetFormValue("txt_sourceName").Trim(); info.SourceId = Utils.GetFormValue("hd_sourceId"); info.TourId = tourId; info.Type = anPaiLeiXing.Value; info.Status = PlanState.已落实; switch (info.Type) { case PlanProject.领料: info.SourceName = Utils.GetFormValue("txt_sourceName"); info.ContactName = Utils.GetFormValue("txt_contactName"); info.PlanGood = new EyouSoft.Model.GovStructure.MGovGoodUse(); info.PlanGood.GoodId = info.SourceId; info.PlanGood.CompanyId = info.CompanyId; info.PlanGood.DeptId = info.DeptId; info.PlanGood.GoodName = Utils.GetFormValue("txt_sourceName"); info.PlanGood.IssueTime = DateTime.Now; info.PlanGood.Number = info.Num; info.PlanGood.Operator = info.OperatorName; info.PlanGood.OperatorId = info.OperatorId; info.PlanGood.PlanId = info.PlanId; info.PlanGood.Price = Utils.GetDecimal(info.CostDetail); info.PlanGood.UserId = Utils.GetFormValue("txt_UserId"); info.PlanGood.UserName = Utils.GetFormValue("txt_contactName"); break; case PlanProject.火车: info.PlanLargeTime = new List <MPlanLargeTime>(); var item = new MPlanLargeTime(); item.PlanId = info.PlanId; item.PayNumber = info.Num; item.FreeNumber = Utils.GetInt(Utils.GetFormValue("txt_freeNumber")); info.PlanLargeTime.Add(item); break; case PlanProject.景点: info.PlanAttractions = new MPlanAttractions(); info.PlanAttractions.PlanId = info.PlanId; info.PlanAttractions.AdultNumber = Utils.GetInt(Utils.GetFormValue("txt_adultNumber")); info.PlanAttractions.ChildNumber = Utils.GetInt(Utils.GetFormValue("txt_childNumber")); break; case PlanProject.涉外游轮: case PlanProject.国内游轮: info.PlanShip = new MPlanShip(); info.PlanShip.PlanId = info.PlanId; info.PlanShip.PlanShipPriceList = new List <MPlanShipPrice>(); var item1 = new MPlanShipPrice(); item1.PlanId = info.PlanId; item1.DNum = Utils.GetDecimal(Utils.GetFormValue("txt_adultNumber")); item1.AdultNumber = Utils.GetInt(Utils.GetFormValue("txt_adultNumber")); item1.AdultNumber = Convert.ToInt32(item1.DNum); item1.ChildNumber = Utils.GetInt(Utils.GetFormValue("txt_childNumber")); info.PlanShip.PlanShipPriceList.Add(item1); info.Num = Convert.ToInt32(info.DNum); break; case PlanProject.酒店: info.PlanHotel = new MPlanHotel(); info.PlanHotel.PlanId = info.PlanId; info.PlanHotel.FreeNumber = Utils.GetInt(Utils.GetFormValue("txt_freeNumber")); break; } return(info); }