Пример #1
0
        /// <summary>
        /// 搁置单据
        /// </summary>
        /// <param name="BillNo"></param>
        /// <param name="Type"></param>
        /// <returns></returns>
        public string ShelveBill(string BillNo, string Type, string Remark)
        {
            var    employee = Marisfrolg.Public.Common.GetEmployeeInfo();
            string status   = String.Empty;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("ApprovalStatus", "5");
            dic.Add("ApprovalPost", Remark);
            dic.Add("ShelveNo", employee.EmployeeNo);
            switch (Type.ToUpper())
            {
            case "FEEBILL":
                status = new FeeBill().PublicEditMethod(BillNo, dic);
                break;

            case "NOTICEBILL":
                status = new NoticeBill().PublicEditMethod(BillNo, dic);
                break;

            case "BORROWBILL":
                status = new BorrowBill().PublicEditMethod(BillNo, dic);
                break;

            case "REFUNDBILL":
                status = new RefundBill().PublicEditMethod(BillNo, dic);
                break;

            default:
                break;
            }
            return(status);
        }
Пример #2
0
        public string ExistBillNo(string BillNo, string No)
        {
            string Result = "";

            BillNo = BillNo.Trim().ToUpper();
            var FeeModel = new FeeBill().GetBillModel(BillNo, No);

            if (FeeModel != null)
            {
                Result = "FeeBill";
                return(Result);
            }
            var NoticeModel = new NoticeBill().GetBillModel(BillNo, No);

            if (NoticeModel != null)
            {
                Result = "NoticeBill";
                return(Result);
            }
            var BorrowModel = new BorrowBill().GetBillModel(BillNo, No);

            if (BorrowModel != null)
            {
                Result = "BorrowBill";
                return(Result);
            }
            var RefundModel = new RefundBill().GetBillModel(BillNo, No);

            if (RefundModel != null)
            {
                Result = "RefundBill";
                return(Result);
            }
            return(Result);
        }
Пример #3
0
        public string AddPrintedCount(string BillNo, string BillType)
        {
            string Status = "";

            switch (BillType)
            {
            case "1":
                Status = new FeeBill().AddPrintedNum(BillNo);
                break;

            case "2":
                Status = new NoticeBill().AddPrintedNum(BillNo);
                break;

            case "3":
                Status = new BorrowBill().AddPrintedNum(BillNo);
                break;

            case "4":
                Status = new RefundBill().AddPrintedNum(BillNo);
                break;

            default:
                break;
            }
            return("");
        }
Пример #4
0
        /// <summary>
        /// 添加附件
        /// </summary>
        /// <param name="Model">附件列表</param>
        /// <returns></returns>
        public string AddPhoto(AddPhotoModel Model)
        {
            string result = "";

            Dictionary <string, List <PhotoModel> > dic = new Dictionary <string, List <PhotoModel> >();

            dic.Add("Photos", Model.Photos);

            switch (Model.Type.ToUpper())
            {
            case "1":
                result = new FeeBill().PublicEditMethod <List <PhotoModel> >(Model.BillNo, dic);
                break;

            case "2":
                result = new NoticeBill().PublicEditMethod <List <PhotoModel> >(Model.BillNo, dic);
                break;

            case "3":
                result = new BorrowBill().PublicEditMethod <List <PhotoModel> >(Model.BillNo, dic);
                break;

            case "4":
                result = new RefundBill().PublicEditMethod <List <PhotoModel> >(Model.BillNo, dic);
                break;

            default:
                break;
            }

            return(result);
        }
Пример #5
0
        private string GetWorkFlowID(string BillNo)
        {
            BillNo = BillNo.Trim(' ');
            string WorkFlowID = string.Empty;

            if (BillNo.Contains("FB"))
            {
                var model = new FeeBill().GetBillModel(BillNo);
                if (model != null)
                {
                    WorkFlowID = model.WorkFlowID;
                }
                else
                {
                    var model1 = new RefundBill().GetBillModel(BillNo);
                    WorkFlowID = model1.WorkFlowID;
                }
            }
            else if (BillNo.Contains("FT"))
            {
                var model = new NoticeBill().GetBillModel(BillNo);
                WorkFlowID = model.WorkFlowID;
            }
            else if (BillNo.Contains("JS"))
            {
                var model = new BorrowBill().GetBillModel(BillNo);
                WorkFlowID = model.WorkFlowID;
            }
            else
            {
                var model = new RefundBill().GetBillModel(BillNo);
                WorkFlowID = model.WorkFlowID;
            }
            return(WorkFlowID);
        }
Пример #6
0
        public string GetBillTypeFrmBillNo(string BillNo)
        {
            var model = new FeeBill().GetBillModel(BillNo);

            if (model != null)
            {
                return("FeeBill");
            }
            var model1 = new NoticeBill().GetBillModel(BillNo);

            if (model != null)
            {
                return("NoticeBill");
            }
            var model2 = new BorrowBill().GetBillModel(BillNo);

            if (model2 != null)
            {
                return("BorrowBill");
            }
            var model3 = new RefundBill().GetBillModel(BillNo);

            if (model3 != null)
            {
                return("RefundBill");
            }
            return("");
        }
Пример #7
0
        public string MoveRecycleBin(string BillNo, string Type, string Status)
        {
            string result = "";
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("RecycleBin", Status);
            switch (Type.ToUpper())
            {
            case "FEEBILL":
                result = new FeeBill().PublicEditMethod(BillNo, dic);
                break;

            case "NOTICEBILL":
                result = new NoticeBill().PublicEditMethod(BillNo, dic);
                break;

            case "BORROWBILL":
                result = new BorrowBill().PublicEditMethod(BillNo, dic);
                break;

            case "REFUNDBILL":
                result = new RefundBill().PublicEditMethod(BillNo, dic);
                break;

            default:
                break;
            }
            return(result);
        }
Пример #8
0
        /// <summary>
        /// 删除单据
        /// </summary>
        /// <param name="BillNo">单号</param>
        /// <param name="Type">类型</param>
        /// <returns></returns>
        public string DelectMyBill(string BillNo, int Type)
        {
            string result = "";

            switch (Type)
            {
            case 1:
                result = new FeeBill().DelectFeeBill(BillNo);
                break;

            case 2:
                result = new NoticeBill().DelectNotcieBill(BillNo);
                break;

            case 3:
                result = new BorrowBill().DelectBorrowBill(BillNo);
                break;

            case 4:
                result = new RefundBill().DelectRefundBill(BillNo);
                break;

            default:
                break;
            }
            return(result);
        }
Пример #9
0
        private string GetPostName(string BillNo, int Type)
        {
            string FlowType = string.Empty;

            switch (Type)
            {
            case 1:
                var f1 = new FeeBill().GetBillModel(BillNo);
                FlowType = f1.BillsType;
                break;

            case 2:
                var f2 = new NoticeBill().GetBillModel(BillNo);
                FlowType = f2.BillsType;
                break;

            case 3:
                var f3 = new BorrowBill().GetBillModel(BillNo);
                FlowType = f3.BillsType;
                break;

            case 4:
                var f4 = new RefundBill().GetBillModel(BillNo);
                FlowType = f4.BillsType;
                break;

            default:
                break;
            }
            var name = DbContext.FEE_ACCOUNT_DICTIONARY.Where(c => c.CODE == FlowType).Select(x => x.NAME).FirstOrDefault();

            return(name);
        }
Пример #10
0
        public ActionResult TransferAuditor(string BillNos, string No)
        {
            List <string> list = BillNos.ToUpper().Replace(",", "").Replace(",", "").Replace(" ", "").Replace("/", "").Replace("F", ",F").Replace("J", ",J").Replace("H", ",H").Split(',').ToList();

            list.Remove("");
            var em = DbContext.EMPLOYEE.Where(c => c.NO == No && c.LEAVE == "0" && c.AVAILABLE == "1").FirstOrDefault();

            if (em == null)
            {
                return(Json(new { Msg = "工号无效", Status = "error" }));
            }

            string str = string.Empty;

            foreach (var item in list)
            {
                string Wk_Id  = string.Empty;
                string obj_ID = new FeeBill().GetTransferData(item, out Wk_Id);

                string url = "http://192.168.2.14/WorkFlowServer/WorkFlowServer/upApproval";

                string postDataStr = string.Format("WorkFlowId={0}&AssignmentIds={1}&userids={2}", Wk_Id, obj_ID, No);

                string jsonList = this.HttpGet(url, postDataStr);

                if (jsonList == "0")
                {
                    str += "单号" + item + ",";
                }
            }

            if (!string.IsNullOrEmpty(str))
            {
                str += "未转移成功";
            }

            return(Json(new { Msg = str, Status = "success" }, JsonRequestBehavior.AllowGet));
        }
Пример #11
0
        public string EditColletion(string BillList, string username, string bankname, string code, string number)
        {
            string error = string.Empty;
            string msg   = string.Empty;

            if (string.IsNullOrEmpty(BillList) || string.IsNullOrEmpty(username) || string.IsNullOrEmpty(bankname) || string.IsNullOrEmpty(code) || string.IsNullOrEmpty(number))
            {
                error = "1";
                msg   = "信息缺失";
                return(Public.JsonSerializeHelper.SerializeToJson(new { error = error, msg = msg }));
            }

            BillList = BillList.ToUpper().Replace(",", "").Replace(" ", "").Replace("/", "").Replace("F", ",F").Replace("J", ",J").Replace("H", ",H");
            var list = BillList.Split(',').ToList();

            var FB = new FeeBill();
            var JS = new BorrowBill();
            var RB = new RefundBill();


            Dictionary <string, CollectionInfo> dic = new Dictionary <string, CollectionInfo>();
            CollectionInfo coll = new CollectionInfo();

            coll.Name              = username;
            coll.SubbranchBank     = bankname;
            coll.SubbranchBankCode = number;
            coll.CardCode          = code;
            dic.Add("CollectionInfo", coll);


            foreach (var item in list)
            {
                if (item.Contains("FB"))
                {
                    var model = FB.GetBillModel(item);
                    if (model != null)
                    {
                        //审批通过了
                        if (model.ApprovalStatus == 2)
                        {
                            //不予许通过
                            msg += "单号" + item + "未做处理;";
                        }
                        else
                        {
                            //进行修改
                            FB.PublicEditMethod <CollectionInfo>(item, dic);
                        }
                    }
                    else
                    {
                        var model2 = RB.GetBillModel(item);
                        if (model2.ApprovalStatus == 2)
                        {
                            msg += "单号" + item + "未做处理;";
                        }
                        else
                        {
                            RB.PublicEditMethod <CollectionInfo>(item, dic);
                        }
                    }
                }
                else if (item.Contains("JS"))
                {
                    var Model3 = JS.GetBillModel(item);
                    if (Model3.ApprovalStatus == 2)
                    {
                        msg += "单号" + item + "未做处理;";
                    }
                    else
                    {
                        JS.PublicEditMethod <CollectionInfo>(item, dic);
                    }
                }
            }

            error = "0";
            if (string.IsNullOrEmpty(msg))
            {
                msg = "修改成功";
            }

            return(Public.JsonSerializeHelper.SerializeToJson(new { error = error, msg = msg }));
        }
Пример #12
0
        public string UpdatePayCode(string BillNo, string code)
        {
            string error = string.Empty;
            string msg   = string.Empty;

            if (string.IsNullOrEmpty(BillNo))
            {
                error = "1";
                msg   = "单号为空";
                return(Public.JsonSerializeHelper.SerializeToJson(new { error = error, msg = msg }));
            }

            BillNo = BillNo.ToUpper().Replace(",", "").Replace(" ", "").Replace("/", "").Replace("F", ",F").Replace("J", ",J").Replace("H", ",H");
            var list = BillNo.Split(',').ToList();

            list.Remove("");

            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("PaymentCompanyCode", code);

            var FB = new FeeBill();
            var FT = new NoticeBill();
            var JS = new BorrowBill();
            var RB = new RefundBill();

            try
            {
                foreach (var item in list)
                {
                    if (item.Contains("FB"))
                    {
                        var isFee = FB.GetBillModel(item);
                        if (isFee != null)
                        {
                            FB.PublicEditMethod(item, dic);

                            string sql = string.Format(" Update FEE_FEEBILL set PAYCOMPANYCODE='{0}' where BIllno='{1}' ", code, item);
                            DbContext.Database.ExecuteSqlCommand(sql);

                            DbContext.SaveChanges();
                        }
                        else
                        {
                            RB.PublicEditMethod(item, dic);

                            string sql = string.Format(" Update FEE_FEEREFUNDBILL set PAYCOMPANYCODE='{0}' where BIllno='{1}' ", code, item);
                            DbContext.Database.ExecuteSqlCommand(sql);

                            DbContext.SaveChanges();
                        }
                    }
                    else if (item.Contains("FT"))
                    {
                        FT.PublicEditMethod(item, dic);

                        string sql = string.Format(" Update FEE_NOTICEBILL set PAYCOMPANYCODE='{0}' where BIllno='{1}' ", code, item);
                        DbContext.Database.ExecuteSqlCommand(sql);

                        DbContext.SaveChanges();
                    }
                    else if (item.Contains("JS"))
                    {
                        JS.PublicEditMethod(item, dic);

                        string sql = string.Format(" Update FEE_BORROWBILL set PAYCOMPANYCODE='{0}' where BIllno='{1}' ", code, item);
                        DbContext.Database.ExecuteSqlCommand(sql);

                        DbContext.SaveChanges();
                    }
                    else
                    {
                        RB.PublicEditMethod(item, dic);

                        string sql = string.Format(" Update FEE_FEEREFUNDBILL set PAYCOMPANYCODE='{0}' where BIllno='{1}' ", code, item);
                        DbContext.Database.ExecuteSqlCommand(sql);

                        DbContext.SaveChanges();
                    }
                }
            }
            catch (Exception)
            {
                error = "1";
                msg   = "系统错误";
                return(Public.JsonSerializeHelper.SerializeToJson(new { error = error, msg = msg }));
            }
            error = "0";
            msg   = "更新成功";
            return(Public.JsonSerializeHelper.SerializeToJson(new { error = error, msg = msg }));
        }
Пример #13
0
        public string GetEditPayCodeList(string BillNo)
        {
            BillNo = BillNo.ToUpper().Replace(",", "").Replace(" ", "").Replace("/", "").Replace("F", ",F").Replace("J", ",J").Replace("H", ",H");
            var list = BillNo.Split(',').ToList();

            list.Remove("");

            var FB = new FeeBill();
            var FT = new NoticeBill();
            var JS = new BorrowBill();
            var RB = new RefundBill();

            List <PublicClass> ReturnModel = new List <PublicClass>();

            foreach (var item in list)
            {
                PublicClass model = new PublicClass();
                if (item.Contains("FB"))
                {
                    var isFee = FB.GetBillModel(item);
                    if (isFee != null)
                    {
                        model.c1 = isFee.BillNo;
                        model.c2 = "费用报销单";
                        model.c3 = AjaxGetName(isFee.Creator);
                        model.c4 = isFee.Owner;
                        model.c5 = isFee.CreateTime.ToString("yyyy-mm-dd");
                        model.c6 = isFee.ApprovalTime;
                        model.c7 = ReturnPayCode(isFee.PaymentCompanyCode, isFee.PersonInfo.CostCenter, isFee.PersonInfo.IsHeadOffice);
                        model.c8 = isFee.Remark;
                    }
                    else
                    {
                        var IsRB = RB.GetBillModel(BillNo);
                        if (IsRB != null)
                        {
                            model.c1 = IsRB.BillNo;
                            model.c2 = "费用还款单";
                            model.c3 = AjaxGetName(IsRB.Creator);
                            model.c4 = IsRB.Owner;
                            model.c5 = IsRB.CreateTime.ToString("yyyy-mm-dd");
                            model.c6 = IsRB.ApprovalTime;
                            model.c7 = ReturnPayCode(IsRB.PaymentCompanyCode, IsRB.PersonInfo.CostCenter, IsRB.PersonInfo.IsHeadOffice);
                            model.c8 = IsRB.Remark;
                        }
                    }
                }
                else if (item.Contains("FT"))
                {
                    var isFT = FT.GetBillModel(BillNo);
                    if (isFT != null)
                    {
                        model.c1 = isFT.BillNo;
                        model.c2 = "付款通知书";
                        model.c3 = AjaxGetName(isFT.Creator);
                        model.c4 = isFT.Owner;
                        model.c5 = isFT.CreateTime.ToString("yyyy-mm-dd");
                        model.c6 = isFT.ApprovalTime;
                        model.c8 = isFT.Remark;
                    }
                }
                else if (item.Contains("JS"))
                {
                    var isJS = JS.GetBillModel(BillNo);
                    if (isJS != null)
                    {
                        model.c1 = isJS.BillNo;
                        model.c2 = "借款单";
                        model.c3 = AjaxGetName(isJS.Creator);
                        model.c4 = isJS.Owner;
                        model.c5 = isJS.CreateTime.ToString("yyyy-mm-dd");
                        model.c6 = isJS.ApprovalTime;
                        model.c7 = ReturnPayCode(isJS.PaymentCompanyCode, isJS.PersonInfo.CostCenter, isJS.PersonInfo.IsHeadOffice);
                        model.c8 = isJS.Remark;
                    }
                }
                if (!string.IsNullOrEmpty(model.c1))
                {
                    ReturnModel.Add(model);
                }
            }
            return(Public.JsonSerializeHelper.SerializeToJson(ReturnModel));
        }
Пример #14
0
        private FeeBillModelRef ConvertData(string wkID)
        {
            FeeBillModelRef model = new FeeBillModelRef();

            var FeeModel = new FeeBill().GetModelFromWorkFlowID(wkID);

            if (FeeModel != null)
            {
                model          = FeeModel.MapTo <FeeBillModel, FeeBillModelRef>();
                model.PageName = "FeeBill";
                return(model);
            }
            var NotcieModel = new NoticeBill().GetModelFromWorkFlowID(wkID);

            if (NotcieModel != null)
            {
                model.BillNo                 = NotcieModel.BillNo;
                model.PersonInfo             = NotcieModel.PersonInfo;
                model.TotalMoney             = NotcieModel.TotalMoney;
                model.CreateTime             = NotcieModel.CreateTime;
                model.TransactionDate        = NotcieModel.TransactionDate;
                model.ApprovalTime           = NotcieModel.ApprovalTime;
                model.ApprovalStatus         = NotcieModel.ApprovalStatus;
                model.ApprovalPost           = NotcieModel.ApprovalPost;
                model.Remark                 = NotcieModel.Remark;
                model.ProviderName           = NotcieModel.ProviderInfo.ProviderName;
                model.Owner                  = NotcieModel.Owner;
                model.Creator                = NotcieModel.Creator;
                model.SpecialAttribute       = new SpecialAttribute();
                model.SpecialAttribute.Funds = NotcieModel.SpecialAttribute.Funds;
                model.SpecialAttribute.Agent = NotcieModel.SpecialAttribute.Agent;
                model.SpecialAttribute.Check = NotcieModel.SpecialAttribute.Check;
                model.Items                  = NotcieModel.Items;
                model.Currency               = NotcieModel.Currency;
                model.WorkNumber             = NotcieModel.WorkNumber;
                model.ProviderCode           = NotcieModel.ProviderInfo.ProviderCode;
                model.Owner                  = NotcieModel.Owner;
                model.MissBill               = NotcieModel.MissBill;
                model.WorkFlowID             = NotcieModel.WorkFlowID;
                model.CountTime              = new CountTime();
                model.Status                 = NotcieModel.Status;
                model.PageName               = "NoticeBill";
                return(model);
            }
            var BorrowModel = new BorrowBill().GetModelFromWorkFlowID(wkID);

            if (BorrowModel != null)
            {
                model.BillNo           = BorrowModel.BillNo;
                model.PageName         = "BorrowBill";
                model.PersonInfo       = BorrowModel.PersonInfo;
                model.TotalMoney       = BorrowModel.TotalMoney;
                model.CreateTime       = BorrowModel.CreateTime;
                model.TransactionDate  = BorrowModel.TransactionDate;
                model.ApprovalTime     = BorrowModel.ApprovalTime;
                model.ApprovalStatus   = BorrowModel.ApprovalStatus;
                model.ApprovalPost     = BorrowModel.ApprovalPost;
                model.Remark           = BorrowModel.Remark;
                model.Owner            = BorrowModel.Owner;
                model.Creator          = BorrowModel.Creator;
                model.SpecialAttribute = BorrowModel.SpecialAttribute;
                model.Items            = BorrowModel.Items;
                model.Currency         = BorrowModel.Currency;
                model.WorkNumber       = BorrowModel.WorkNumber;
                model.Owner            = BorrowModel.Owner;
                model.WorkFlowID       = BorrowModel.WorkFlowID;
                model.CollectionInfo   = BorrowModel.CollectionInfo;
                model.CountTime        = new CountTime();
                model.Status           = BorrowModel.Status;
                return(model);
            }
            var RefundModel = new RefundBill().GetModelFromWorkFlowID(wkID);

            if (RefundModel != null)
            {
                model          = RefundModel.MapTo <RefundBillModel, FeeBillModelRef>();
                model.PageName = "RefundBill";
                return(model);
            }
            return(model);
        }
Пример #15
0
        public string GetRelationBill(string itemName, string DepartmentCode, string ShopCode, DateTime CreateTime, string ProviderName, int IsHeadOffice, string BillNo)
        {
            if (string.IsNullOrEmpty(ShopCode) || ShopCode == "null")
            {
                ShopCode = null;
            }

            int FindDadaType = 0;

            if (BillNo.ToUpper().Contains("FT"))
            {
                FindDadaType = 1;
            }
            else if (BillNo.ToUpper().Contains("JS"))
            {
                FindDadaType = 2;
            }

            //取CreateTime时间,然后往前推三个月
            CreateTime = CreateTime.AddMonths(-3);
            List <FeeBillModelRef> DataList = new List <FeeBillModelRef>();

            if (FindDadaType == 0)
            {
                var FeeModel = new FeeBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime);
                if (FeeModel.Count > 0)
                {
                    foreach (var item in FeeModel)
                    {
                        try
                        {
                            FeeBillModelRef model = new FeeBillModelRef()
                            {
                                BillNo = item.BillNo, BillsType = "FeeBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo {
                                    Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop
                                }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner
                            };
                            DataList.Add(model);
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }
                }
            }

            if (FindDadaType == 0 || FindDadaType == 1)
            {
                var NoticeModel = new NoticeBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime, ProviderName, IsHeadOffice, FindDadaType);
                if (NoticeModel.Count > 0)
                {
                    foreach (var item in NoticeModel)
                    {
                        try
                        {
                            FeeBillModelRef model = new FeeBillModelRef()
                            {
                                BillNo = item.BillNo, BillsType = "NoticeBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo {
                                    Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop
                                }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner
                            };
                            DataList.Add(model);
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }
                }
            }

            if (FindDadaType == 0 || FindDadaType == 2)
            {
                var BorrowModel = new BorrowBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime);
                if (BorrowModel.Count > 0)
                {
                    foreach (var item in BorrowModel)
                    {
                        try
                        {
                            FeeBillModelRef model = new FeeBillModelRef()
                            {
                                BillNo = item.BillNo, BillsType = "BorrowBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo {
                                    Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop
                                }, Items = item.Items, TotalMoney = item.TotalMoney, Creator = item.Creator, Owner = item.Owner
                            };
                            DataList.Add(model);
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }
                }
            }

            if (FindDadaType == 0)
            {
                var RefundModel = new RefundBill().GetRelationBillList(itemName, DepartmentCode, ShopCode, CreateTime);
                if (RefundModel.Count > 0)
                {
                    foreach (var item in RefundModel)
                    {
                        try
                        {
                            FeeBillModelRef model = new FeeBillModelRef()
                            {
                                BillNo = item.BillNo, BillsType = "RefundBill", CreateTime = item.CreateTime, TransactionDate = item.TransactionDate, Remark = item.Remark, ApprovalPost = item.ApprovalPost, ApprovalStatus = item.ApprovalStatus, PersonInfo = new PersonInfo {
                                    Brand = item.PersonInfo.Brand, Department = item.PersonInfo.Department, Shop = item.PersonInfo.Shop
                                }, Items = item.Items, TotalMoney = item.RealRefundMoney, Creator = item.Creator, Owner = item.Owner
                            };
                            DataList.Add(model);
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }
                }
            }

            if (DataList.Count > 0)
            {
                DataList = DataList.OrderByDescending(c => c.CreateTime).ToList();
            }
            return(Public.JsonSerializeHelper.SerializeToJson(DataList));
        }
Пример #16
0
        public string EditFeeBillContent(FeeBillModel postFeeBill)
        {
            this.Request.Url.AbsoluteUri.ToString();

            string result = "Fail";

            //检查
            if (string.IsNullOrEmpty(postFeeBill.COST_ACCOUNT))
            {
                result = "成本中心为空";
                return(result);
            }

            if (postFeeBill.Items == null || postFeeBill.Items.Count < 1)
            {
                result = "缺少报销项";
                return(result);
            }
            else
            {
                postFeeBill.TotalMoney = postFeeBill.Items.Sum(all => all.money) + postFeeBill.Items.Sum(all => all.taxmoney);
            }
            if (postFeeBill.Photos == null || postFeeBill.Photos.Count < 1)
            {
                result = "缺少发票照片";
                return(result);
            }
            if (postFeeBill.SpecialAttribute.MarketDebt != 1 && postFeeBill.SpecialAttribute.BankDebt != 1 && postFeeBill.SpecialAttribute.Cash != 1)
            {
                if (postFeeBill.CollectionInfo == null || string.IsNullOrEmpty(postFeeBill.CollectionInfo.CardCode) || string.IsNullOrEmpty(postFeeBill.CollectionInfo.Name) || string.IsNullOrEmpty(postFeeBill.CollectionInfo.SubbranchBank) || string.IsNullOrEmpty(postFeeBill.CollectionInfo.SubbranchBankCode))
                {
                    result = "收款信息缺失";
                    return(result);
                }
            }
            else
            {
                postFeeBill.CollectionInfo = new CollectionInfo();
            }


            var obj = PublicGetCosterCenter(postFeeBill.PersonInfo.IsHeadOffice, postFeeBill.PersonInfo.CostCenter);

            if (postFeeBill.PersonInfo.IsHeadOffice == 0)
            {
                var DicModel = DbContext.FEE_ACCOUNT_DICTIONARY.Where(c => c.CODE == postFeeBill.BillsType && c.BRAND == obj.NAME).FirstOrDefault();
                if (DicModel != null)
                {
                    if (DicModel.PARTBRAND == 1)  //分品牌
                    {
                        if (postFeeBill.PersonInfo.Brand == null || postFeeBill.PersonInfo.Brand.Count < 1)
                        {
                            result = "记账品牌至少选择一项!";
                            return(result);
                        }
                        int brandcount = 0;
                        foreach (var item in postFeeBill.PersonInfo.Brand)
                        {
                            if (DicModel.BRANDLIST.Contains(item))
                            {
                                brandcount++;
                            }
                        }
                        if (brandcount >= 2)
                        {
                            result = DicModel.BRANDLIST + "只能选择一项!";
                            return(result);
                        }
                    }
                }
            }
            try
            {
                var lable = PublicDemand(postFeeBill.PersonInfo.IsHeadOffice, postFeeBill.BillsType, postFeeBill.PersonInfo.DepartmentCode, obj, postFeeBill.Items, postFeeBill.SpecialAttribute, postFeeBill.DepartmentName);

                Dictionary <string, string> dic = new Dictionary <string, string>();

                string dicString = Public.JsonSerializeHelper.SerializeToJson(dic);

                var oldModel = new FeeBill().GetBillModel(postFeeBill.BillNo);
                WorkFlowProxy.WorkFlowProxy proxy = new WorkFlowProxy.WorkFlowProxy();
                string objectID = proxy.NewWorkFlowInstance(lable.CODE, postFeeBill.Creator, oldModel.BillNo, dicString);

                postFeeBill.BillNo         = oldModel.BillNo;
                postFeeBill.Id             = oldModel.Id;
                postFeeBill.WorkFlowID     = objectID;
                postFeeBill.CreateTime     = oldModel.CreateTime;
                postFeeBill.Status         = oldModel.Status;
                postFeeBill.ApprovalPost   = oldModel.ApprovalPost;
                postFeeBill.ApprovalStatus = oldModel.ApprovalStatus;
                postFeeBill.ApprovalTime   = oldModel.ApprovalTime;
                postFeeBill.BillsItems     = postFeeBill.Items;


                string status = new FeeBill().EditFeeBill(postFeeBill);
                if (status != "Success")
                {
                    result = "编辑失败";
                    return(result);
                }
                result = "Success";
            }
            catch
            {
                result = "Fail";
            }


            return(result);
        }
Пример #17
0
        /// <summary>
        /// 获取未办结单据
        /// </summary>
        /// <param name="?"></param>
        /// <returns></returns>
        public List <FeeBillModelRef> GetNotFinishBill(string EmployeeNo)
        {
            List <FeeBillModelRef> Temp = new List <FeeBillModelRef>();
            var FeeModel = new FeeBill().GetNotFinishBill(EmployeeNo);

            if (FeeModel != null && FeeModel.Count > 0)
            {
                foreach (var item in FeeModel)
                {
                    var model = new FeeBillModelRef()
                    {
                        BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner
                    };
                    model.PageName = "费用报销单";
                    Temp.Add(model);
                }
            }
            var NoticeModel = new NoticeBill().GetNotFinishBill(EmployeeNo);

            if (NoticeModel != null && NoticeModel.Count > 0)
            {
                foreach (var item in NoticeModel)
                {
                    var model = new FeeBillModelRef()
                    {
                        BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner
                    };
                    model.PageName = "付款通知书";
                    Temp.Add(model);
                }
            }
            var BorrowModel = new BorrowBill().GetNotFinishBill(EmployeeNo);

            if (BorrowModel != null && BorrowModel.Count > 0)
            {
                foreach (var item in BorrowModel)
                {
                    var model = new FeeBillModelRef()
                    {
                        BillNo = item.BillNo, TotalMoney = item.TotalMoney, Owner = item.Owner
                    };
                    model.PageName = "借款单";
                    Temp.Add(model);
                }
            }
            var RefundModel = new RefundBill().GetNotFinishBill(EmployeeNo);

            if (RefundModel != null && RefundModel.Count > 0)
            {
                foreach (var item in RefundModel)
                {
                    var model = new FeeBillModelRef()
                    {
                        BillNo = item.BillNo, TotalMoney = item.RealRefundMoney, Owner = item.Owner
                    };
                    model.PageName = "还款单";
                    Temp.Add(model);
                }
            }
            return(Temp);
        }
Пример #18
0
        public string GetReportData(int billType, int Time, int departmentID, string operation, string StartTime = "", string EndTime = "")
        {
            var employee = Marisfrolg.Public.Common.GetEmployeeInfo();

            //我搁置的单
            if (operation == "1")
            {
                List <FeeBillModelRef> AllModel = new List <FeeBillModelRef>();
                var Temp1 = new FeeBill().ReturnShelveNo(employee.EmployeeName);
                var Temp2 = new NoticeBill().ReturnShelveNo(employee.EmployeeNo);
                var Temp3 = new BorrowBill().ReturnShelveNo(employee.EmployeeNo);
                var Temp4 = new RefundBill().ReturnShelveNo(employee.EmployeeNo);

                foreach (var item1 in Temp1)
                {
                    FeeBillModelRef TempModel = new FeeBillModelRef()
                    {
                        BillNo = item1.BillNo, PageName = "费用报销单", Creator = item1.Creator, Owner = item1.Owner, TotalMoney = item1.TotalMoney, StringTime = item1.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item1.CreateTime, PersonInfo = new PersonInfo()
                        {
                            DepartmentCode = item1.PersonInfo.DepartmentCode, Department = item1.PersonInfo.Department
                        }
                    };
                    AllModel.Add(TempModel);
                }
                foreach (var item2 in Temp2)
                {
                    FeeBillModelRef TempModel = new FeeBillModelRef()
                    {
                        BillNo = item2.BillNo, PageName = "付款通知书", Creator = item2.Creator, Owner = item2.Owner, TotalMoney = item2.TotalMoney, StringTime = item2.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item2.CreateTime, PersonInfo = new PersonInfo()
                        {
                            DepartmentCode = item2.PersonInfo.DepartmentCode, Department = item2.PersonInfo.Department
                        }
                    };
                    AllModel.Add(TempModel);
                }
                foreach (var item3 in Temp3)
                {
                    FeeBillModelRef TempModel = new FeeBillModelRef()
                    {
                        BillNo = item3.BillNo, PageName = "借款单", Creator = item3.Creator, Owner = item3.Owner, TotalMoney = item3.TotalMoney, StringTime = item3.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item3.CreateTime, PersonInfo = new PersonInfo()
                        {
                            DepartmentCode = item3.PersonInfo.DepartmentCode, Department = item3.PersonInfo.Department
                        }
                    };
                    AllModel.Add(TempModel);
                }
                foreach (var item4 in Temp4)
                {
                    FeeBillModelRef TempModel = new FeeBillModelRef()
                    {
                        BillNo = item4.BillNo, PageName = item4.RefundType.ToUpper() == "CASH" ? "现金还款" : "费用单还款", Creator = item4.Creator, Owner = item4.Owner, TotalMoney = item4.RealRefundMoney, StringTime = item4.CreateTime.ToString("yyyy-MM-dd"), CreateTime = item4.CreateTime, PersonInfo = new PersonInfo()
                        {
                            DepartmentCode = item4.PersonInfo.DepartmentCode, Department = item4.PersonInfo.Department
                        }
                    };
                    AllModel.Add(TempModel);
                }

                switch (billType)
                {
                case 0:
                    break;

                case 1:
                    AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("借款") || c.PageName.Contains("还款"));
                    break;

                case 2:
                    AllModel.RemoveAll(c => c.PageName.Contains("费用报销") || c.PageName.Contains("借款") || c.PageName.Contains("还款"));
                    break;

                case 3:
                    AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("费用报销") || c.PageName.Contains("还款"));
                    break;

                case 4:
                    AllModel.RemoveAll(c => c.PageName.Contains("付款") || c.PageName.Contains("借款") || c.PageName.Contains("费用报销"));
                    break;

                default:
                    break;
                }
                if (AllModel.Count > 0)
                {
                    var temp = TransformData(AllModel, 0);

                    MemoryCachingClient M = new MemoryCachingClient();
                    M.Remove(employee.EmployeeNo);
                    M.Add(employee.EmployeeNo, temp);

                    return(JsonSerializeHelper.SerializeToJson(temp));
                }
                return("{}");
            }

            object data = GetApprovalData(billType, Time, employee.EmployeeNo, departmentID.ToString(), StartTime, EndTime);

            if (data != null)
            {
                var temp = TransformData(data, billType);

                MemoryCachingClient M = new MemoryCachingClient();
                M.Remove(employee.EmployeeNo);
                M.Add(employee.EmployeeNo, temp);

                return(JsonSerializeHelper.SerializeToJson(temp));
            }
            return("{}");
            //ReportHelper helper = new ReportHelper();
            //DataTable dt = helper.GetDataTable(@"select ID,NO,NAME,SHOPCODE,CREATOR,CHANGER,AVAILABLE,LEAVE,PASSWORD,DEPID from Employee where (DEPID=" + departmentID + " or 0=" + departmentID + ") and length(NO)>4 and ROWNUM<100");
            //foreach (DataColumn item in dt.Columns)
            //{
            //    if (item.ColumnName == "NAME")
            //    {
            //        item.ColumnName = "姓名";
            //    }
            //    if (item.ColumnName == "NO")
            //    {
            //        item.ColumnName = "工号";
            //    }
            //}
            //var temp = ReportHelper.ConvertDataTable(dt);
            //return JsonSerializeHelper.SerializeToJson(temp);
        }
Пример #19
0
        public string CreateRefundBill(RefundBillModel postRefundBill)
        {
            this.Request.Url.AbsoluteUri.ToString();
            string result = "Fail";
            //费用报销单还款

            var obj = GetBrandFromCosterCenterNew(postRefundBill.PersonInfo.CostCenter);

            if (postRefundBill.RefundType.ToUpper() == "FEEBILL")
            {
                //检查
                if (string.IsNullOrEmpty(postRefundBill.COST_ACCOUNT))
                {
                    result = "成本中心为空";
                    return(result);
                }

                if (postRefundBill.Items == null || postRefundBill.Items.Count < 1)
                {
                    result = "缺少报销项";
                    return(result);
                }
                else
                {
                    postRefundBill.RealRefundMoney = postRefundBill.Items.Sum(all => all.money) + postRefundBill.Items.Sum(all => all.taxmoney);
                }
                if (postRefundBill.Photos == null || postRefundBill.Photos.Count < 1)
                {
                    result = "缺少发票照片";
                    return(result);
                }

                foreach (var item in postRefundBill.Items)
                {
                    var value = DbContext.FEE_ACCOUNT.Where(c => c.NAME == item.name || c.OLDNAME == item.name).Select(c => c.IS_MARKET).FirstOrDefault();
                    if (value == null)
                    {
                        item.IsMarket = 0;
                    }
                    else
                    {
                        item.IsMarket = Convert.ToInt32(item.IsMarket);
                    }
                }

                if (postRefundBill.PersonInfo.IsHeadOffice == 0)
                {
                    var DicModel = DbContext.FEE_ACCOUNT_DICTIONARY.Where(c => c.CODE == postRefundBill.BillsType && c.BRAND == obj.NAME).FirstOrDefault();
                    if (DicModel != null)
                    {
                        if (DicModel.PARTBRAND == 1)
                        {
                            if (postRefundBill.PersonInfo.Brand == null || postRefundBill.PersonInfo.Brand.Count < 1)
                            {
                                result = "记账品牌至少选择一项!";
                                return(result);
                            }
                            int brandcount = 0;
                            foreach (var item in postRefundBill.PersonInfo.Brand)
                            {
                                if (DicModel.BRANDLIST.Contains(item))
                                {
                                    brandcount++;
                                }
                            }
                            if (brandcount >= 2)
                            {
                                result = DicModel.BRANDLIST + "只能选择一项!";
                                return(result);
                            }
                        }
                    }

                    //增加店柜品牌属性
                    if (!string.IsNullOrEmpty(postRefundBill.PersonInfo.ShopCode))
                    {
                        postRefundBill.ShopLogo = DbContext.SHOP.Where(c => c.CODE == postRefundBill.PersonInfo.ShopCode).Select(x => x.SHOPLOGO).FirstOrDefault();
                    }
                }
            }
            //现金还款
            else
            {
                if (postRefundBill.RealRefundMoney < 0)
                {
                    result = "还款金额错误";
                    return(result);
                }
            }
            try
            {
                var BorrowModel = new BorrowBill().GetBillModel(postRefundBill.BorrowBillNo);
                //费用还款可以还款超出欠款额度,只须拆成两单
                if (postRefundBill.RealRefundMoney > BorrowModel.SurplusMoney && postRefundBill.RefundType.ToUpper() != "FEEBILL")
                {
                    result = "还款金额超出";
                    return(result);
                }
                WorkFlowProxy.WorkFlowProxy proxy = new WorkFlowProxy.WorkFlowProxy();

                string MaxNumber = string.Empty;

                if (postRefundBill.RefundType.ToUpper() == "CASH")
                {
                    postRefundBill.BillsType = "HK1";
                    MaxNumber = new RefundBill().GenerateMaxBillNo();
                }
                else
                {
                    MaxNumber = new FeeBill().GenerateMaxBillNo();
                }

                var lable = PublicDemand(postRefundBill.PersonInfo.IsHeadOffice, postRefundBill.BillsType, postRefundBill.PersonInfo.DepartmentCode, obj, postRefundBill.Items, postRefundBill.SpecialAttribute, postRefundBill.DepartmentName);

                //PackClass PackString = new PackClass() { Creator = postRefundBill.Creator, BillsType = postRefundBill.BillsType, Brand = postRefundBill.PersonInfo.Brand, CompanyCode = postRefundBill.PersonInfo.CompanyCode, CostCenter = postRefundBill.PersonInfo.CostCenter, Department = postRefundBill.PersonInfo.Department, DepartmentCode = postRefundBill.PersonInfo.DepartmentCode, IsHeadOffice = postRefundBill.PersonInfo.IsHeadOffice, Items = postRefundBill.Items == null ? null : postRefundBill.Items.Select(x => x.name).ToList() };

                //Dictionary<string, string> dic = new Dictionary<string, string>();

                //string pack = Public.JsonSerializeHelper.SerializeToJson(PackString);

                //dic.Add("pack", pack);

                //string dicString = Public.JsonSerializeHelper.SerializeToJson(dic);

                Dictionary <string, string> dic = new Dictionary <string, string>();
                string dicString = Public.JsonSerializeHelper.SerializeToJson(dic);

                try
                {
                    string sql = " insert into FEE_BILLNO (BILLNO) values('" + MaxNumber + "')";
                    int    num = DbContext.Database.ExecuteSqlCommand(sql);
                    if (num < 1)
                    {
                        DeleteInvalidBillNo(MaxNumber);
                        result = "服务器繁忙!请重新提交";
                        return(result);
                    }
                }
                catch
                {
                    result = "服务器繁忙!请重新提交";
                    return(result);
                }

                string objectID = string.Empty;

                try
                {
                    objectID = proxy.NewWorkFlowInstance(lable.CODE, postRefundBill.Creator, MaxNumber, dicString);
                }
                catch
                {
                    DeleteInvalidBillNo(MaxNumber);
                    result = "服务内部出错,请联系数控中心";
                    return(result);
                }

                postRefundBill.CreateTime = DateTime.Now;
                postRefundBill.Status     = 0;
                postRefundBill.WorkFlowID = objectID;
                postRefundBill.BillsItems = postRefundBill.Items;
                postRefundBill.BillNo     = MaxNumber;

                new RefundBill().CreateRefundBill(postRefundBill);

                result = MaxNumber;
            }
            catch
            {
                result = "Fail";
            }


            return(result);
        }
Пример #20
0
        /// <summary>
        /// 保存单据修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string SaveBillChange(EditBillModel model)
        {
            try
            {
                var           employee      = Marisfrolg.Public.Common.GetEmployeeInfo();
                EditBillModel OriginalModel = new EditBillModel();
                EditLog       Editform      = new EditLog();
                string        result        = "";
                switch (model.BillsType)
                {
                //费用单
                case "1":
                    var list1 = new FeeBill().GetBillModel(model.BillNo);
                    OriginalModel            = list1.MapTo <FeeBillModel, EditBillModel>();
                    OriginalModel.Brand      = list1.PersonInfo.Brand;
                    OriginalModel.CostCenter = list1.PersonInfo.CostCenter;
                    var obj1 = GetCompanyInfo(list1.PersonInfo.IsHeadOffice, model.CostCenter);
                    model.E_Company     = obj1.NAME;
                    model.E_CompanyCode = obj1.CODE;
                    result = new FeeBill().SaveFeeBillChange(model);
                    break;

                //付款单
                case "2":
                    var list2 = new NoticeBill().GetBillModel(model.BillNo);
                    OriginalModel.BillNo           = list2.BillNo;
                    OriginalModel.BillsType        = list2.BillsType;
                    OriginalModel.BillsItems       = list2.BillsItems;
                    OriginalModel.Brand            = list2.PersonInfo.Brand;
                    OriginalModel.CostCenter       = list2.PersonInfo.CostCenter;
                    OriginalModel.Currency         = list2.Currency;
                    OriginalModel.Items            = list2.Items;
                    OriginalModel.MissBill         = list2.MissBill;
                    OriginalModel.SpecialAttribute = new SpecialAttribute()
                    {
                        Agent = list2.SpecialAttribute.Agent, Funds = list2.SpecialAttribute.Funds, Check = list2.SpecialAttribute.Check, BankDebt = 0, MarketDebt = 0, Cash = 0
                    };

                    OriginalModel.MissBill = list2.MissBill;
                    OriginalModel.Photos   = list2.Photos;
                    var obj2 = GetCompanyInfo(list2.PersonInfo.IsHeadOffice, model.CostCenter);
                    model.E_Company     = obj2.NAME;
                    model.E_CompanyCode = obj2.CODE;
                    result = new NoticeBill().SaveNoticeBillChange(model);
                    break;

                //借款单
                case "3":
                    var list3 = new BorrowBill().GetBillModel(model.BillNo);
                    OriginalModel = list3.MapTo <BorrowBillModel, EditBillModel>();
                    OriginalModel.SpecialAttribute = list3.SpecialAttribute;
                    OriginalModel.Brand            = list3.PersonInfo.Brand;
                    OriginalModel.CostCenter       = list3.PersonInfo.CostCenter;
                    var obj3 = GetCompanyInfo(list3.PersonInfo.IsHeadOffice, model.CostCenter);
                    model.E_Company     = obj3.NAME;
                    model.E_CompanyCode = obj3.CODE;
                    result = new BorrowBill().SaveBorrowBillChange(model);
                    break;

                //费用还款单
                case "4":
                    var list4 = new RefundBill().GetBillModel(model.BillNo);
                    OriginalModel            = list4.MapTo <RefundBillModel, EditBillModel>();
                    OriginalModel.Brand      = list4.PersonInfo.Brand;
                    OriginalModel.CostCenter = list4.PersonInfo.CostCenter;
                    var obj4 = GetCompanyInfo(list4.PersonInfo.IsHeadOffice, model.CostCenter);
                    model.E_Company     = obj4.NAME;
                    model.E_CompanyCode = obj4.CODE;
                    result = new RefundBill().SaveRefundBillChange(model);
                    break;

                default:
                    break;
                }
                Editform.BillNo       = model.BillNo;
                Editform.CreateTime   = DateTime.Now;
                Editform.Creator      = employee.EmployeeNo;
                Editform.OriginalData = OriginalModel;
                Editform.ModifiedData = model;
                new EditLogForm().CreateEditRecord(Editform);
                return(result);
            }
            catch (Exception ex)
            {
                Logger.Write("保存单据失败:" + ex.ToString() + "," + System.Reflection.MethodBase.GetCurrentMethod().Name);
                return("");
            }
        }