//更新到正式表
        public void UpdateToFormalTable()
        {
            if (另一人录入的记录 == null || this.内容不同的字段.Count > 0)
            {
                return;
            }

            RembursementSalary m = RembursementSalary.AddRembursementSalary(this.员工编号, this.开始时间);

            this.CopyWatchMember(m);

            m.创建人  = this.录入人;
            m.创建时间 = DateTime.Now;
            m.Save();

            //更新生效标记
            if (!this.已生效)
            {
                this.生效时间 = DateTime.Now;
                this.Save();

                RembursementSalaryEntry opposite = 另一人录入的记录;
                opposite.生效时间 = DateTime.Now;
                opposite.Save();
            }
        }
Exemplo n.º 2
0
        protected override void OnSaving()
        {
            RembursementSalary found = GetRembursementSalary(this.员工编号, this.开始时间);

            if (found != null && found.标识 != this.标识)
            {
                throw new Exception("已存在该员工的相同借款记录,不能重复创建。");
            }
            else
            {
                base.OnSaving();
            }

            REMBURSEMENT_SALARY_CACHE.Set(CacheKey, this, TimeSpan.FromHours(1));
        }
Exemplo n.º 3
0
        public static RembursementSalary AddRembursementSalary(string emplid, DateTime effDate)
        {
            RembursementSalary item = GetRembursementSalary(emplid, effDate);

            if (item == null)
            {
                item      = new RembursementSalary();
                item.标识   = Guid.NewGuid();
                item.员工编号 = emplid;
                item.开始时间 = effDate;
                item.创建人  = AccessController.CurrentUser.姓名;
                item.创建时间 = DateTime.Now;
                item.Save();
            }
            return(item);
        }
Exemplo n.º 4
0
        public static RembursementSalary GetRembursementSalary(Guid id)
        {
            RembursementSalary obj = (RembursementSalary)Session.DefaultSession.GetObjectByKey(typeof(RembursementSalary), id);

            return(obj);
        }
        public EmployeeSalaryStructure(EmployeeInfo empInfo)
        {
            DateTime 期间开始 = DateTime.Today;

            员工信息 = empInfo;

            薪酬结构 = SalaryStructure.GetEffective(empInfo.员工编号, 期间开始);
            借款工资 = WageLoan.GetEffective(empInfo.员工编号, 期间开始);
            报账工资 = RembursementSalary.GetEffective(empInfo.员工编号, 期间开始);
            月薪标准 = MonthlySalary.GetEffective(empInfo.员工编号, 期间开始);

            //处理,获取相关数据
            this.员工编号 = empInfo.员工编号;
            this.姓名   = empInfo.姓名;
            this.性别   = empInfo.性别;
            this.职务   = empInfo.职务名称;
            this.公司   = empInfo.公司;
            this.部门   = empInfo.部门名称;
            this.职等   = empInfo.职等;

            if (月薪标准 != null)
            {
                this.开始执行日期  = 月薪标准.开始执行日期;
                this.年薪_12个月 = 月薪标准.执行_月薪 * 12;
                this.年薪_合计   = 月薪标准.执行_月薪 * 12;
                this.月薪项目_小计 = 月薪标准.执行_月薪;
            }
            if (薪酬结构 != null)
            {
                this.结构类型    = 薪酬结构.类型;
                this.年薪_奖励   = 薪酬结构.年薪_奖励;
                this.年薪_绩效工资 = 薪酬结构.年薪_绩效工资;
                this.年薪_12个月 = 薪酬结构.年薪_12个月;
                this.年薪_合计   = 薪酬结构.年薪_合计;

                this.月薪项目_月工资    = 薪酬结构.月薪项目_月工资;
                this.月薪项目_年休假    = 薪酬结构.月薪项目_年休假;
                this.月薪项目_满勤奖    = 薪酬结构.月薪项目_满勤奖;
                this.月薪项目_交通餐饮补贴 = 薪酬结构.月薪项目_交通餐饮补贴;
                this.月薪项目_小计     = 薪酬结构.月薪项目_小计;

                this.月薪项目_减项_绩效工资 = 薪酬结构.月薪项目_减项_绩效工资;
                this.开始执行日期       = 薪酬结构.开始执行日期;
            }
            else
            {
                this.结构类型  = "标准";
                this.年薪_奖励 = 0;

                this.月薪项目_交通餐饮补贴 = PsHelper.GetTrafficSubsidies(员工编号, 期间开始);
                this.月薪项目_满勤奖    = PsHelper.GetFullAttendancePayFromCache(empInfo.薪资体系, empInfo.薪等, 期间开始);
                this.月薪项目_年休假    = PsHelper.GetVacPayFromCache(empInfo.薪资体系, empInfo.薪等, 期间开始);
                this.月薪项目_月工资    = 月薪项目_小计 - 月薪项目_满勤奖 - 月薪项目_年休假 - 月薪项目_交通餐饮补贴;
            }
            if (借款工资 != null)
            {
                月薪项目_减项_工资借款 = 借款工资.月借款额度;
            }
            if (报账工资 != null)
            {
                月薪项目_减项_报账工资 = 报账工资.月度可报账标准_税前;
            }
        }