Exemplo n.º 1
0
        /// <summary>
        /// 获取收款提醒合计
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="receiptRemindType">收款提醒配置</param>
        /// <param name="sellerId">销售员编号 收款提醒配置成EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller时不可为空</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public void GetReceiptRemind(int companyId, EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType receiptRemindType, int?sellerId
                                     , EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo, out decimal daiShouKuanHeJi)
        {
            daiShouKuanHeJi = 0;

            if (CompanyId <= 0)
            {
                return;
            }
            if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && !sellerId.HasValue)
            {
                return;
            }

            //结算日之前不提醒
            DateTime today      = DateTime.Today;
            int      accountDay = today.Day;

            if (DateTime.DaysInMonth(today.Year, today.Month) == today.Day)
            {
                accountDay = 31;
            }

            //结算星期几开始往后提醒4天
            int[]     accountDayWeek = null;
            DayOfWeek dayOfWeek      = today.DayOfWeek;

            switch (dayOfWeek)
            {
            case DayOfWeek.Monday: accountDayWeek = new int[] { 0, 5, 6, 7, 1 }; break;

            case DayOfWeek.Tuesday: accountDayWeek = new int[] { 0, 6, 7, 1, 2 }; break;

            case DayOfWeek.Wednesday: accountDayWeek = new int[] { 0, 7, 1, 2, 3 }; break;

            case DayOfWeek.Thursday: accountDayWeek = new int[] { 0, 1, 2, 3, 4 }; break;

            case DayOfWeek.Friday: accountDayWeek = new int[] { 0, 2, 3, 4, 5 }; break;

            case DayOfWeek.Saturday: accountDayWeek = new int[] { 0, 3, 4, 5, 6 }; break;

            case DayOfWeek.Sunday: accountDayWeek = new int[] { 0, 4, 5, 6, 7 }; break;
            }

            string sellers = string.Empty;

            if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && sellerId.HasValue)
            {
                sellers = sellerId.ToString();
            }

            if (!string.IsNullOrEmpty(sellers))
            {
                idalCustomer.GetReceiptRemindByOrderSeller(CompanyId, accountDay, accountDayWeek, sellers, searchInfo, out daiShouKuanHeJi);
                return;
            }

            idalCustomer.GetReceiptRemind(CompanyId, accountDay, accountDayWeek, searchInfo, out daiShouKuanHeJi);
        }
Exemplo n.º 2
0
        /// <summary>
        /// to xls
        /// </summary>
        private void ToXls()
        {
            if (!CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_收款提醒栏目))
            {
                ResponseToXls(string.Empty);
            }


            EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo = new EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo();

            searchInfo.QianKuanDanWei    = Utils.GetQueryStringValue("sn");
            searchInfo.LSDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate"));
            searchInfo.LEDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate"));
            searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ",");
            searchInfo.OperatorIds       = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ",");

            EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType rrt = new EyouSoft.BLL.CompanyStructure.CompanySetting().GetReceiptRemindType(CurrentUserCompanyID);
            int?sellerId = null;

            if (rrt == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller)
            {
                sellerId = SiteUserInfo.ID;
            }

            int _pageSize    = Utils.GetInt(Utils.GetQueryStringValue("recordcount"));
            int _recordCount = 0;

            if (_pageSize < 1)
            {
                ResponseToXls(string.Empty);
            }

            var items = new EyouSoft.BLL.PersonalCenterStructure.TranRemind().GetReceiptRemind(_pageSize, 1, ref _recordCount, CurrentUserCompanyID, rrt, sellerId, searchInfo);

            StringBuilder s = new StringBuilder();

            s.Append("客源单位\t联系人\t电话\t待收金额\t责任销售\n");

            if (items != null && items.Count > 0)
            {
                foreach (var item in items)
                {
                    s.AppendFormat("{0}\t", item.CustomerName);
                    s.AppendFormat("{0}\t", item.ContactName);
                    s.AppendFormat("{0}\t", item.ContactTel);
                    s.AppendFormat("{0}\t", item.ArrearCash.ToString("C2"));
                    s.AppendFormat("{0}\n", item.SalerName);
                }
            }

            ResponseToXls(s.ToString());
        }
Exemplo n.º 3
0
        /// <summary>
        /// 初使化
        /// </summary>
        private void DataInit()
        {
            if (!CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_收款提醒栏目))
            {
                tbShow.Visible   = false;
                tbinfo.InnerHtml = "欢迎 " + SiteUserInfo.UserName + " 登录系统!";
            }
            else
            {
                EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo = new EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo();

                searchInfo.QianKuanDanWei    = S_QianKuanDanWei = Utils.GetQueryStringValue("sn");
                searchInfo.LSDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate"));
                searchInfo.LEDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate"));
                searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ",");
                searchInfo.OperatorIds       = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ",");

                pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
                EyouSoft.BLL.CompanyStructure.CompanySetting csBll             = new EyouSoft.BLL.CompanyStructure.CompanySetting();
                EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType rrt = csBll.GetReceiptRemindType(CurrentUserCompanyID);
                int?sellerId = null;
                if (rrt == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller)
                {
                    sellerId = SiteUserInfo.ID;
                }
                IList <EyouSoft.Model.PersonalCenterStructure.ReceiptRemind> list = null;
                list = trBll.GetReceiptRemind(pageSize, pageIndex, ref recordCount, CurrentUserCompanyID, rrt, sellerId, searchInfo);

                len = list == null ? 0 : list.Count;
                this.rptlist.DataSource = list;
                this.rptlist.DataBind();

                if (list != null && list.Count > 0)
                {
                    phDaiShouKuanHeJi.Visible = true;
                    decimal daiShouKuanHeJi = 0;
                    trBll.GetReceiptRemind(CurrentUserCompanyID, rrt, sellerId, searchInfo, out daiShouKuanHeJi);
                    ltrDaiShouKuanHeJi.Text = daiShouKuanHeJi.ToString("C2");
                }

                BindPage();

                RegisterScript(string.Format("var recordCount={0};", recordCount));
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 收款初使数据绑定
        /// </summary>
        /// <param name="type"></param>
        /// <param name="tid"></param>
        private void BindAppect()
        {
            //初使化条件
            int tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));

            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            int sellerId = Utils.GetInt(Utils.GetQueryStringValue("sellerid"));

            var searchInfo = new EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo();

            searchInfo.LSDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate"));
            searchInfo.LEDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate"));
            searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ",");
            searchInfo.OperatorIds       = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ",");

            //BLL实例化
            toBll = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo);
            IList <EyouSoft.Model.TourStructure.TourOrder> list = null;

            list = toBll.GetOrderListByBuyCompanyId(pageSize, pageIndex, ref recordCount, CurrentUserCompanyID, tid, sellerId, searchInfo);
            len  = list == null ? 0 : list.Count;
            this.repList.DataSource = list;
            this.repList.DataBind();
            //设置分页
            BindPage();

            if (len > 0)
            {
                phDaiShouKuanHeJi.Visible = true;
                decimal daiShouKuanHeJi = 0;
                toBll.GetOrderListByBuyCompanyId(CurrentUserCompanyID, tid, sellerId, searchInfo, out daiShouKuanHeJi);
                ltrDaiShouKuanHeJi.Text = daiShouKuanHeJi.ToString("C2");
            }

            RegisterScript(string.Format("var recordCount={0};", recordCount));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 分页获取收款提醒
        /// </summary>
        /// <param name="pageSize">每页显示数</param>
        /// <param name="pageIndex">当前页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="CompanyId">公司编号</param>
        /// <param name="receiptRemindType">收款提醒配置</param>
        /// <param name="sellerId">销售员编号 收款提醒配置成EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller时不可为空</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.PersonalCenterStructure.ReceiptRemind> GetReceiptRemind(int pageSize, int pageIndex, ref int recordCount, int CompanyId
                                                                                             , EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType receiptRemindType, int?sellerId
                                                                                             , EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo searchInfo)
        {
            if (CompanyId <= 0)
            {
                return(null);
            }
            if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && !sellerId.HasValue)
            {
                return(null);
            }

            //结算日之前不提醒
            DateTime today      = DateTime.Today;
            int      accountDay = today.Day;

            if (DateTime.DaysInMonth(today.Year, today.Month) == today.Day)
            {
                accountDay = 31;
            }

            //结算星期几开始往后提醒4天
            int[]     accountDayWeek = null;
            DayOfWeek dayOfWeek      = today.DayOfWeek;

            switch (dayOfWeek)
            {
            case DayOfWeek.Monday: accountDayWeek = new int[] { 0, 5, 6, 7, 1 }; break;

            case DayOfWeek.Tuesday: accountDayWeek = new int[] { 0, 6, 7, 1, 2 }; break;

            case DayOfWeek.Wednesday: accountDayWeek = new int[] { 0, 7, 1, 2, 3 }; break;

            case DayOfWeek.Thursday: accountDayWeek = new int[] { 0, 1, 2, 3, 4 }; break;

            case DayOfWeek.Friday: accountDayWeek = new int[] { 0, 2, 3, 4, 5 }; break;

            case DayOfWeek.Saturday: accountDayWeek = new int[] { 0, 3, 4, 5, 6 }; break;

            case DayOfWeek.Sunday: accountDayWeek = new int[] { 0, 4, 5, 6, 7 }; break;
            }

            string sellers = string.Empty;

            if (receiptRemindType == EyouSoft.Model.EnumType.CompanyStructure.ReceiptRemindType.OnlySeller && sellerId.HasValue)
            {
                sellers = sellerId.ToString();
            }

            if (!string.IsNullOrEmpty(sellers))
            {
                return(idalCustomer.GetReceiptRemindByOrderSeller(pageSize, pageIndex, ref recordCount, CompanyId, accountDay, accountDayWeek, sellers, searchInfo));
            }

            return(idalCustomer.GetReceiptRemind(pageSize, pageIndex, ref recordCount, CompanyId, accountDay, accountDayWeek, searchInfo));
        }
Exemplo n.º 6
0
        /// <summary>
        /// to xls
        /// </summary>
        private void ToXls()
        {
            string requestType = Utils.GetQueryStringValue("type");

            if (requestType == "Appect" && !CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_收款提醒栏目))
            {
                ResponseToXls(string.Empty);
            }
            if (requestType == "Pay" && !CheckGrant(global::Common.Enum.TravelPermission.个人中心_事务提醒_付款提醒栏目))
            {
                ResponseToXls(string.Empty);
            }

            StringBuilder s = new StringBuilder();

            if (requestType == "Appect")
            {
                int keHuDanWeiId = Utils.GetInt(Utils.GetQueryStringValue("tid"));
                int _pageSize    = Utils.GetInt(Utils.GetQueryStringValue("recordcount"));
                if (_pageSize < 1)
                {
                    ResponseToXls(string.Empty);
                }
                int _recordCount = 0;
                int sellerId     = Utils.GetInt(Utils.GetQueryStringValue("sellerid"));
                var searchInfo   = new EyouSoft.Model.PersonalCenterStructure.ReceiptRemindSearchInfo();
                searchInfo.LSDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate"));
                searchInfo.LEDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate"));
                searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ",");
                searchInfo.OperatorIds       = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ",");

                var items = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo).GetOrderListByBuyCompanyId(_pageSize, 1, ref _recordCount, CurrentUserCompanyID, keHuDanWeiId, sellerId, searchInfo);
                s.Append("团号\t线路名称\t出团日期\t总金额\t待收金额\n");
                if (items != null && items.Count > 0)
                {
                    foreach (var item in items)
                    {
                        s.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\n", item.TourNo, item.RouteName, item.LeaveDate.ToString("yyyy-MM-dd"), item.FinanceSum.ToString("C2"), item.NotReceived.ToString("C2"));
                    }
                }
            }

            if (requestType == "Pay")
            {
                string[] tid_type = (Utils.GetQueryStringValue("tid")).Split('_'); //供应商ID和类型
                int      tid      = 0;                                             //供应商ID
                int      suptype  = 0;                                             //供应商类型
                if (tid_type.Length == 2)
                {
                    tid     = Utils.GetInt(tid_type[0]);
                    suptype = Utils.GetInt(tid_type[1]);
                }

                var searchInfo = new EyouSoft.Model.PersonalCenterStructure.FuKuanTiXingChaXun();

                searchInfo.LSDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("lsdate"));
                searchInfo.LEDate            = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("ledate"));
                searchInfo.OperatorDepartIds = Utils.GetIntArray(Utils.GetQueryStringValue("departids"), ",");
                searchInfo.OperatorIds       = Utils.GetIntArray(Utils.GetQueryStringValue("operatorids"), ",");

                var items = new EyouSoft.BLL.PlanStruture.TravelAgency().GetFuKuanTiXingMingXi(CurrentUserCompanyID, tid, suptype, pageSize, pageIndex, ref recordCount, searchInfo);

                if (items != null && items.Count > 0)
                {
                    s.Append("团号\t线路名称\t出团日期\t总金额\t未付金额\n");
                    if (items != null && items.Count > 0)
                    {
                        foreach (var item in items)
                        {
                            s.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\n", item.TourCode, item.RouteName, item.LeaveDate.ToString("yyyy-MM-dd"), item.TotalAmount.ToString("C2"), item.Arrear.ToString("C2"));
                        }
                    }
                }
            }

            ResponseToXls(s.ToString());
        }