public AdjustMonthlySalaryForm(string salary_plan, string group, int year, SemiannualType st, bool isCheck) : this() { this.salary_plan = salary_plan; this.group = group; this.year = year; this.sntype = st; this.isCheck = isCheck; this.period = year * 10 + (byte)st; //获取公司代码 company_code = PsHelper.GetCompanyCode(salary_plan); //获取职等(默认自动为每个职等建立一个群组) jobgrade = JobGrade.GetJobGrade(salary_plan, group); //通过薪等编号获取员工名单 emp_list = GetEmployeeList(); //设置标记, 标记有异动的人员 foreach (EmployeeInfo emp in emp_list) { MonthlySalary effectiveMonthlySalary = MonthlySalary.GetEffective(emp.员工编号, DateTime.Today); if (effectiveMonthlySalary == null) { emp.标记 = true; } } }
private static void SumKpi(List <KpiItem> items, string empLid, int year, int month) { if (string.IsNullOrEmpty(empLid)) { return; } List <KpiItem> list = items.FindAll(a => a.员工编号 == empLid && a.年 == year && a.月 == month); decimal 个人执行绩效 = list.Sum(a => a.个人绩效标准); decimal 个人绩效实得 = list.Sum(a => a.个人绩效实得); decimal 公司奖励实得 = list.Sum(a => a.公司奖励实得); decimal 实得绩效工资 = 个人绩效实得 + 公司奖励实得; EffectivePerformanceSalary 绩效考核 = EffectivePerformanceSalary.AddEffectivePerformanceSalary(empLid, year, month); if (绩效考核 != null) { 绩效考核.姓名 = PsHelper.GetEmplName(empLid); 绩效考核.绩效工资 = 个人执行绩效; 绩效考核.实得工资 = 实得绩效工资; 绩效考核.录入人 = "系统同步获取"; 绩效考核.录入时间 = DateTime.Now; 绩效考核.Save(); } }
public SelectJobGradeForm(string company, string cmd) { this.company = company; this.command = cmd; this.salary_plan = company; //获取公司代码 company_code = PsHelper.GetCompanyCode(salary_plan); InitializeComponent(); if (cmd == "录入职级及职级工资" || cmd == "查看各职等职级月薪执行标准" || cmd == "调整各职等月薪执行标准") { this.Text = "请选择年度"; listBoxControl职级.Visible = false; this.Size = new Size(this.Size.Width, this.Size.Height - 480); btn确定.Location = new Point(btn确定.Location.X, btn确定.Location.Y - 480); btn取消.Location = new Point(btn取消.Location.X, btn取消.Location.Y - 480); } if (cmd == "录入异动人员薪酬执行明细" || cmd == "查看各职等人员薪酬发放明细表" || cmd == "查看各职等管理人员薪酬执行明细" || cmd == "查看各职等人员薪酬结构明细表") { this.Text = "请选择职等"; spin年度.Visible = false; cbSemiannual.Visible = false; listBoxControl职级.Location = new Point(spin年度.Location.X, spin年度.Location.Y); listBoxControl职级.Size = new Size(listBoxControl职级.Size.Width, listBoxControl职级.Size.Height + spin年度.Size.Height); } }
public IndividualAdjustMonthlySalaryForm(string salary_plan, string group, bool isCheck) : this() { this.salary_plan = salary_plan; this.group = group; this.isCheck = isCheck; //获取公司代码 company_code = PsHelper.GetCompanyCode(salary_plan); //获取职等(默认自动为每个职等建立一个群组) jobgrade = JobGrade.GetJobGrade(salary_plan, group); //获取期号 int lastestPeriodNonYear = MonthlySalary.GetLastestPeriodNonYear(salary_plan, group); period = lastestPeriodNonYear == -1 ? 100001 : lastestPeriodNonYear + 1; //通过薪等编号获取员工名单 emp_list = GetEmployeeList(); //设置标记, 标记有异动的人员 foreach (EmployeeInfo emp in emp_list) { MonthlySalary effectiveMonthlySalary = MonthlySalary.GetEffective(emp.员工编号, DateTime.Today); if (effectiveMonthlySalary == null) { emp.标记 = true; } } }
protected override void OnSaving() { if (string.IsNullOrEmpty(this.员工编号)) { throw new Exception("员工编号不能为空。"); } if (PsHelper.GetEmplName(this.员工编号) == "") { throw new Exception("找不到指定员工编号的员工。"); } if (string.IsNullOrEmpty(编号)) { if (this.生效日期 == DateTime.MinValue) { throw new Exception("生效日期不能为空。"); } if (this.标识 == Guid.Empty) { this.标识 = Guid.NewGuid(); } this.编号 = GetNewNumber(); //如果是新编号,更新编号信息的当前序号 this.NumberInfo.UpdateCurrentSN(); PerformanceSalaryInput found = Get(this.编号, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("同一编号【{0}】不能重复创建,请稍后重试。", this.编号)); } found = GetEditing(this.员工编号, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("该员工【{0}】已经有一条绩效工资正在录入,不能重复。", this.员工编号)); } } if (另一人录入的记录 != null) { TimeSpan ts = DateTime.Now - 另一人录入的记录.录入时间; if (ts.TotalMilliseconds > 10000 && 另一人录入的记录.录入人 == AccessController.CurrentUser.姓名) { throw new Exception("两次录入不能是同一个人。"); } } if (string.IsNullOrEmpty(this.录入人) || (DateTime.Now - this.录入时间).TotalMilliseconds > 10000) { this.录入人 = AccessController.CurrentUser.姓名; this.录入时间 = DateTime.Now; } if (this.双人录入结果 == null) { this.双人录入结果 = ""; } base.OnSaving(); }
private void Init() { 个税起征点 = PsHelper.GetPersonTaxPoint(期间_开始); 标准职级工资表 = StepPayRate.GetEffectives(期间_开始); 个人职级工资表 = PersonPayRate.GetEffectives(期间_开始); 表工资表 = SalaryResult.GetSalaryResults(薪资组, 日历组); 其它奖扣项 = OtherMoney.GetOtherMoneyList(年, 月); 工资系数表 = EmpPayRate.GetEmpPayRateList(年, 月); }
protected override void OnLoaded() { if (string.IsNullOrEmpty(this.职务名称)) { this.职务名称 = PsHelper.GetValue(PsHelper.职务代码, this.基础工资表.职务代码); this.Save(); } salaryResult = SalaryResult.GetFromCache(this.员工编号, this.年度, this.月份); base.OnLoaded(); }
public MonthlySalaryForm(string salary_plan, string group) : this() { this.salary_plan = salary_plan; this.group = group; //获取公司代码 company_code = PsHelper.GetCompanyCode(salary_plan); //获取职等(默认自动为每个职等建立一个群组) jobgrade = JobGrade.GetJobGrade(salary_plan, group); }
public ActionResult Image() { var random = new JRandom(); Session[c_code] = random.Next(); MemoryStream stream = new MemoryStream(); PsHelper.Text2Image(stream, random.Content); return(File(stream.ToArray(), "image/jpeg")); }
List <EmployeeSalaryStructure> all_rows = new List <EmployeeSalaryStructure>(); //所有记录 public SalaryDetailListForm(string salary_plan, string group) { // This call is required by the Windows Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.salary_plan = salary_plan; this.group = group; //获取公司代码 company_code = PsHelper.GetCompanyCode(salary_plan); //获取职等(默认自动为每个职等建立一个群组) jobgrade = JobGrade.GetJobGrade(salary_plan, group); }
public static string GetSupvLvlId(string emplid, int year, int month) { DateTime period_begin = new DateTime(year, month, 1); DateTime period_begin_next_month = period_begin.AddMonths(1); string supvLvlId = PsHelper.GetEmployeeSupvLvl(emplid, year, month); //如果是本月15号后入职的,取下月15号前职务等级 if (supvLvlId == null) { supvLvlId = PsHelper.GetEmployeeSupvLvl(emplid, period_begin_next_month.Year, period_begin_next_month.Month); } return(supvLvlId); }
public EmployeeSalary(SalaryResult sr, PrivateSalary ps) { 表工资 = sr; 封闭工资 = ps; //处理,获取相关数据 this.员工编号 = sr.员工编号; this.姓名 = sr.姓名; this.职务 = PsHelper.GetValue(PsHelper.职务代码, 表工资.职务代码); this.年度 = sr.年度.ToString() + " 年"; this.月份 = sr.月份.ToString() + " 月"; this.季度 = (Convert.ToInt32(sr.月份 / 3) + 1).ToString() + " 季度"; //this.金额 = 封闭工资 == null ? 上表工资.上表工资 : 封闭工资.职级工资; this.金额 = 封闭工资 == null ? 表工资.表工资总额 : 封闭工资.工资发放总额; this.职等 = sr.职等; this.发放单位 = sr.财务公司; DeptInfo dept = DeptInfo.Get(sr.机构编号); if (dept != null) { this.本部 = dept.本部; this.体系 = dept.体系; this.公司 = dept.公司.部门名称; if (dept.部门 != null) { this.部门 = dept.部门.部门名称; } if (dept.区域 != null) { this.区域 = dept.区域.部门名称; } if (dept.省办 != null) { this.省办 = dept.省办.部门名称.Replace("省办", ""); } if (dept.城市 != null) { this.城市 = dept.城市.部门名称.Replace("市办", ""); } } else { CompanyInfo company = CompanyInfo.Get(sr.公司编号); if (company != null) { this.公司 = company.公司简称; } } }
void Init() { DateTime prevMonth = DateTime.Today.AddMonths(-1); year.Value = prevMonth.Year; month.EditValue = prevMonth.Month; ccb发放单位.Properties.Items.Clear(); foreach (string company in PsHelper.GetCompanyList()) { ImageComboBoxItem item = new ImageComboBoxItem((string)company, (string)company); ccb发放单位.Properties.Items.Add(item); } }
private void InitListBox() { if (this.CurrentRole != null) { if (checkedListBoxControl1.Items.Count == 0) { //初始化职务等级列表 职务等级 管培生, 副总经理以上; 管培生.编码 = "管培生"; 管培生.称 = "管培生"; 副总经理以上.编码 = "副总经理以上"; 副总经理以上.称 = "副总经理以上"; List <职务等级> lvlList = new List <职务等级>(); lvlList.Add(管培生); lvlList.Add(副总经理以上); foreach (DictionaryEntry entry in PsHelper.GetSupvLvls()) { 职务等级 lvl = new 职务等级 { 编码 = (string)entry.Value, 称 = (string)entry.Key }; lvlList.Add(lvl); } lvlList = lvlList.OrderBy(a => a.编码).ToList(); foreach (职务等级 lvl in lvlList) { CheckedListBoxItem item = new CheckedListBoxItem(lvl, false); checkedListBoxControl1.Items.Add(item); } } checkedListBoxControl1.BeginUpdate(); if (CurrentCompany != null) { List <RoleLevel> groups = RoleLevel.GetRoleLevels(this.CurrentRole.Name).FindAll(a => a.公司编码 == CurrentCompany.公司编码); foreach (CheckedListBoxItem item in checkedListBoxControl1.Items) { 职务等级 grade = (职务等级)item.Value; bool isChecked = groups.Find(a => a.职务等级 == grade.编码) != null; item.CheckState = isChecked ? CheckState.Checked : CheckState.Unchecked; } } checkedListBoxControl1.EndUpdate(); } }
void Init() { myPayGroupList.Clear(); myCalRunList.Clear(); DateTime end = DateTime.Today; DateTime start = end.AddMonths(-MyHelper.LatestMonths); //最近三个月 foreach (CalRunInfo cal in CalRunInfo.GetList(start, end)) { foreach (string groupId in cal.薪资组列表) { bool enabled = AccessController.CheckPayGroup(groupId); if (enabled) { PayGroup pg = PayGroup.Get(groupId); if (pg != null) { if (myPayGroupList.Find(a => a.英文名 == pg.英文名) == null) { myPayGroupList.Add(pg); } if (myCalRunList.Find(a => a.日历组编号 == cal.日历组编号) == null) { myCalRunList.Add(cal); } } } } } ccb发放单位.Properties.Items.Clear(); foreach (DictionaryEntry entry in PsHelper.GetCompanyTable()) { ImageComboBoxItem item = new ImageComboBoxItem((string)entry.Key, (string)entry.Key); ccb发放单位.Properties.Items.Add(item); } ccb所属公司.Properties.Items.Clear(); foreach (DictionaryEntry entry in PsHelper.GetCompanyTable()) { ImageComboBoxItem item = new ImageComboBoxItem((string)entry.Key, (string)entry.Key); ccb所属公司.Properties.Items.Add(item); } }
public PersonalTax(SalaryResult salary) { 表工资 = salary; 封闭工资 = PrivateSalary.GetPrivateSalary(salary.员工编号, salary.年度, salary.月份); CalRunInfo cal = CalRunInfo.Get(salary.日历组); 年 = cal.年度; 月 = cal.月份; 期间_开始 = cal.开始日期; 期间_结束 = cal.结束日期; 期间 = String.Format("{0}年{1}", 年, 月) + "月"; 发放单位 = salary.财务公司; 员工编号 = salary.员工编号; 姓名 = salary.姓名; 身份证号 = salary.身份证号; 养老保险个人缴纳金额 = salary.养老保险个人缴纳; 医疗保险个人缴纳金额 = salary.基本医疗个人缴纳 + salary.大病医疗个人缴纳金额; 失业保险个人缴纳金额 = salary.失业保险个人缴纳; 住房公积金个人缴纳金额 = salary.住房公积金个人缴纳; 应税工资额 = 表工资.应税工资额; 个人所得税 = 封闭工资 == null ? 表工资.个人所得税金额 : 封闭工资.个人所得税; 工资发放总额 = 表工资.表工资总额 + 表工资.未休年休假工资; //如果有封闭工资 if (封闭工资 != null) { 应税工资额 = 封闭工资.总应税工资; 工资发放总额 = 封闭工资.工资发放总额; } 个税起征点 = PsHelper.GetPersonTaxPoint(期间_开始); decimal taxIncome = 应税工资额 - 个税起征点; if (taxIncome > 0) { TaxInfo tax = TaxInfo.Get(taxIncome); 税率 = tax.税率; 速算扣除数 = tax.速算扣除数; } }
private void Init() { //初始化公司列表 repositoryItemCompany.Items.Clear(); foreach (CompanyInfo c in CompanyInfo.GetAll()) { ImageComboBoxItem item = new ImageComboBoxItem(c.公司简称, c.公司编码); repositoryItemCompany.Items.Add(item); } //初始化职务等级列表 repositoryItemGrade.Items.Clear(); repositoryItemGrade.Items.Add(new ImageComboBoxItem("管培生", "管培生")); repositoryItemGrade.Items.Add(new ImageComboBoxItem("副总经理以上", "副总经理以上")); List <职务等级> lvlList = new List <职务等级>(); foreach (DictionaryEntry entry in PsHelper.GetSupvLvls()) { 职务等级 lvl = new 职务等级 { 编码 = (string)entry.Value, 称 = (string)entry.Key }; lvlList.Add(lvl); } lvlList = lvlList.OrderBy(a => a.编码).ToList(); foreach (职务等级 lvl in lvlList) { ImageComboBoxItem item = new ImageComboBoxItem(lvl.称, lvl.编码); repositoryItemGrade.Items.Add(item); } //初始化角色列表 List <Role> allRoles = Role.GetAll(); foreach (Role role in allRoles) { repositoryItemRole.Items.Add(role.Name); } //只显示当前薪等表里的权限,历史记录隐藏 impowerList.Clear(); foreach (RoleLevel rg in RoleLevel.GetAll()) { impowerList.Add(rg); } gridControl1.DataSource = impowerList; }
public static void Reset() { List <LevelInfo> oldList = GetAll(); List <LevelInfo> newList = new List <LevelInfo>(); //新增的 foreach (DictionaryEntry entry in PsHelper.GetSupvLvls()) { LevelInfo level = LevelInfo.AddLevelInfo((string)entry.Value, (string)entry.Key); newList.Add(level); } //清理被删除的级别 foreach (LevelInfo lv in oldList) { LevelInfo find = newList.Find(a => a.编码 == lv.编码); if (find == null) { lv.Delete(); } } }
//获取值列表 public static List <MonitorLevel> GetAll() { List <MonitorLevel> list = new List <MonitorLevel>(); OleDbConnection conn = new OleDbConnection(MyHelper.GetPsConnectionString()); using (conn) { OleDbDataReader rs = null; try { conn.Open(); using (OleDbCommand cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT COMPANY, DEPTID, JOBCODE, C_MONITOR_LVL FROM SYSADM.PS_C_MNT_LVL_TBL A WHERE A.EFFDT=(SELECT MAX(B.EFFDT) FROM SYSADM.PS_C_MNT_LVL_TBL B WHERE A.COMPANY=B.COMPANY AND A.DEPTID=B.DEPTID AND A.JOBCODE=B.JOBCODE AND B.EFFDT<=SYSDATE )AND A.C_SIGN_TIMES=2"; rs = cmd.ExecuteReader(); while (rs.Read()) { MonitorLevel dept = new MonitorLevel(); dept.公司编号 = (string)rs["COMPANY"]; dept.部门编号 = (string)rs["DEPTID"]; dept.职务代码 = (string)rs["JOBCODE"]; dept.级别编号 = (string)rs["C_MONITOR_LVL"]; dept.级别名称 = PsHelper.GetMonitorLevelName(dept.级别编号); list.Add(dept); } rs.Close(); } } finally { if (rs != null) { rs.Close(); } conn.Close(); } } return(list); }
//获取值列表 public static List <DeptFunctionType> GetAll() { List <DeptFunctionType> list = new List <DeptFunctionType>(); OleDbConnection conn = new OleDbConnection(MyHelper.GetPsConnectionString()); using (conn) { OleDbDataReader rs = null; try { conn.Open(); using (OleDbCommand cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT COMPANY, DEPTID, C_HR_AREA FROM SYSADM.PS_C_DEPT_AREA_TBL A WHERE A.EFFDT=(SELECT MAX(B.EFFDT) FROM SYSADM.PS_C_DEPT_AREA_TBL B WHERE A.COMPANY=B.COMPANY AND A.DEPTID=B.DEPTID AND B.EFFDT<=SYSDATE)AND A.C_SIGN_TIMES=2"; rs = cmd.ExecuteReader(); while (rs.Read()) { DeptFunctionType dept = new DeptFunctionType(); dept.公司编号 = (string)rs["COMPANY"]; dept.部门编号 = (string)rs["DEPTID"]; dept.类型编号 = (string)rs["C_HR_AREA"]; dept.类型名称 = PsHelper.GetDeptFunctionType(dept.类型编号); list.Add(dept); } rs.Close(); } } finally { if (rs != null) { rs.Close(); } conn.Close(); } } return(list); }
protected override void OnSaving() { if (string.IsNullOrEmpty(this.员工编号)) { throw new Exception("员工编号不能为空。"); } if (PsHelper.GetEmplName(this.员工编号) == "") { throw new Exception("找不到指定员工编号的员工。"); } if (string.IsNullOrEmpty(编号)) { if (this.标识 == Guid.Empty) { this.标识 = Guid.NewGuid(); } this.编号 = GetNewNumber(); //如果是新编号,更新编号信息的当前序号 this.NumberInfo.UpdateCurrentSN(); EffectivePerformanceSalaryInput found = Get(this.编号, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("同一编号【{0}】不能重复创建,请稍后重试。", this.编号)); } found = GetEditing(this.员工编号, this.年, this.月, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("该员工【{0}】已经有一条执行的绩效工资记录正在录入,不能重复。", this.员工编号)); } } if (this.双人录入结果 == null) { this.双人录入结果 = ""; } base.OnSaving(); }
public EmployeePayData(EmployeeInfo employee, DateTime date, bool realtime) { this.employeeInfo = employee; this.isRealtime = realtime; 公司序号 = employee.公司序号; 职务 = employee.职务名称; 职级名称 = PsHelper.GetSupvsrLvDescr(employee.职务等级); 工龄 = employee.工龄 / (decimal)12.0; 华劲工龄 = employee.华劲工龄; 任职时间 = employee.任职时间; 是主管 = employee.职务名称 != null && (employee.职务名称.IndexOf("部门主管") != -1 || employee.职务名称.IndexOf("厂长") != -1 || employee.职务名称.IndexOf("场长") != -1); LevelInfo level = LevelInfo.职务等级表.Find(a => a.编码 == employee.职务等级); if (level != null) { 职等 = level.级别; } 年 = date.Year; 月 = date.Month; 期间_开始 = new DateTime(年, 月, 1); if (isRealtime) { 期间_开始 = 期间_开始.AddMonths(-1); } 期间_结束 = 期间_开始.AddMonths(1).AddDays(-1); if (标准职务工资表 == null) { 标准职务工资表 = StepPayRate.GetEffectives(期间_开始); } if (个人职务工资表 == null) { 个人职务工资表 = PersonPayRate.GetEffectives(期间_开始); } }
public static void SychEmployeeInfo() { foreach (EmpInfo emp in EmpInfo.GetAll()) { EmployeeInfo empInfo = AddEmployeeInfo(emp.员工编号); empInfo.姓名 = emp.姓名; empInfo.出生日期 = emp.出生日期; empInfo.性别 = emp.性别; empInfo.身份证号 = emp.身份证号; empInfo.公司 = emp.公司; empInfo.部门 = emp.部门; empInfo.状态 = emp.状态; empInfo.职位代码 = emp.职位代码; empInfo.职务代码 = emp.职务代码; empInfo.职务等级 = emp.职务等级; empInfo.集合 = emp.集合; empInfo.薪资体系 = emp.薪资体系; empInfo.薪等 = emp.薪等; empInfo.薪级 = emp.薪级; empInfo.薪资组 = emp.薪资组; empInfo.个月薪资组 = emp.个月薪资组; empInfo.银行账号 = emp.银行账号; empInfo.帐户名称 = emp.帐户名称; empInfo.财务公司 = emp.财务公司; empInfo.财务部门 = emp.财务部门; empInfo.财务部门序号 = emp.财务部门序号; empInfo.员工序号 = emp.员工序号; empInfo.职等 = GetGrade(empInfo); empInfo.是管培生 = PsHelper.CheckIsGuanPeiSheng(emp.员工编号); empInfo.离职时间 = emp.离职时间; empInfo.次同步时间 = DateTime.Now; empInfo.Save(); } }
private void Init() { //初始化职务等级列表 repositoryItemImageComboBox.Items.Clear(); List <职务等级> lvlList = new List <职务等级>(); foreach (DictionaryEntry entry in PsHelper.GetSupvLvls()) { 职务等级 lvl = new 职务等级 { 编码 = (string)entry.Value, 称 = (string)entry.Key }; lvlList.Add(lvl); } lvlList = lvlList.OrderBy(a => a.编码).ToList(); foreach (职务等级 lvl in lvlList) { ImageComboBoxItem item = new ImageComboBoxItem(lvl.称, lvl.编码); repositoryItemImageComboBox.Items.Add(item); } LoadData(); }
private void EditEmployeeQueryPowerForm_Load(object sender, EventArgs e) { this.Text = "查询权限录入 - " + (this.是验证录入 ? "验证录入" : "初次录入"); repositoryItemImageComboBox1.Items.Clear(); foreach (DictionaryEntry entry in PsHelper.GetCompanyTable()) { ImageComboBoxItem item = new ImageComboBoxItem(); item.Description = (string)entry.Key; item.Value = (string)entry.Value; repositoryItemImageComboBox1.Items.Add(item); } repositoryItemImageComboBox2.Items.Clear(); foreach (DictionaryEntry entry in PsHelper.GetSupvLvls()) { ImageComboBoxItem item = new ImageComboBoxItem(); item.Description = (string)entry.Key; item.Value = (string)entry.Value; repositoryItemImageComboBox2.Items.Add(item); } LoadData(); }
private void EditSalaryStructureForm_Load(object sender, EventArgs e) { this.Text = "员工薪酬结构录入 - " + currSalaryStructureEntry.员工编号 + " - " + (currSalaryStructureEntry.是验证录入 ? "验证录入" : "初次录入"); emp = currSalaryStructureEntry.员工信息; ms = MonthlySalary.GetEffective(emp.员工编号, DateTime.Today); if (ms == null) { MessageBox.Show("找不到该员工的执行月薪标准,请录入标准后再试"); Close(); } 满勤奖标准 = PsHelper.GetFullAttendancePayFromCache(emp.薪资体系, emp.薪等, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1)); 未休年休假工资 = PsHelper.GetVacPayFromCache(emp.薪资体系, emp.薪等, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1)); 交通餐饮补助标准 = PsHelper.GetTrafficSubsidies(emp.员工编号, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1)); lbl用户.Text = currSalaryStructureEntry.员工信息.姓名; lbl员工编号.Text = currSalaryStructureEntry.员工编号; comboBoxEdit结构类型.EditValue = currSalaryStructureEntry.类型; LoadData(); }
string GetLvDescr(string lv) { string s = PsHelper.GetSupvsrLvDescr(lv); return(s); }
//根据日历组获取所有工资项 public static List <SalResult> GetList(string calRunId, string payGroup) { List <SalResult> list = new List <SalResult>(); CalRunInfo calRun = CalRunInfo.Get(calRunId); if (calRun == null) { return(list); } OleDbConnection conn = new OleDbConnection(MyHelper.GetPsConnectionString()); using (conn) { OleDbDataReader rs = null; try { conn.Open(); using (OleDbCommand cmd = conn.CreateCommand()) { string payGroupCondition = ""; if (string.IsNullOrEmpty(payGroup) == false) { payGroupCondition = String.Format(" AND GP_PAYGROUP = '{0}'", payGroup); } cmd.CommandText = String.Format("SELECT B.NAME,A.* FROM SYSADM.PS_C_WA_PAY_RSLT A LEFT JOIN PS_PERSONAL_DATA B ON A.EMPLID=B.EMPLID WHERE CAL_RUN_ID='{0}' {1} ORDER BY A.EMPLID", calRunId, payGroupCondition); rs = cmd.ExecuteReader(); while (rs.Read()) { SalResult item = new SalResult(); #region 日历信息 item.日历组 = calRunId; item.期间 = calRun.期间; item.年度 = calRun.年度; item.月份 = calRun.月份; #endregion #region 员工信息 item.姓名 = MyHelper.RemoveNumber((string)rs["NAME"]); item.员工编号 = (string)rs["EMPLID"]; item.员工类型 = (string)rs["C_CHR027"]; EmpInfo empInfo = EmpInfo.员工表.Find(a => a.员工编号 == item.员工编号); if (empInfo != null) { item.身份证号 = empInfo.身份证号; item.财务公司 = empInfo.财务公司; item.财务部门 = empInfo.财务部门; item.财务部门序号 = empInfo.财务部门序号; item.员工序号 = empInfo.员工序号; item.银行账号 = empInfo.银行账号; item.帐户名称 = empInfo.帐户名称; } #endregion #region 所属机构 item.公司编号 = (string)rs["COMPANY"]; item.机构编号 = (string)rs["DEPTID"]; CompanyInfo company = CompanyInfo.Get(item.公司编号); if (company != null) { item.公司名称 = company.公司名称; } DeptInfo dept = DeptInfo.Get(item.机构编号); if (dept != null && dept.所在部门 != null) { item.部门编号 = dept.所在部门.部门编号; item.部门名称 = dept.所在部门.部门名称; } #endregion #region 薪酬体系 item.薪资组 = (string)rs["GP_PAYGROUP"]; item.薪资集合 = (string)rs["SETID_SALARY"]; item.薪酬体系编号 = (string)rs["SAL_ADMIN_PLAN"]; item.薪等编号 = (string)rs["GRADE"]; item.薪级编号 = Convert.ToString(rs["STEP"]); #endregion #region 职务数据 item.职务代码 = (string)rs["JOBCODE"]; //2018-9-10 职务等级以15号为界 //item.职务等级 = (string)rs["SUPV_LVL_ID"]; item.职务等级 = GetSupvLvlId(item.员工编号, item.年度, item.月份); item.职位编号 = (string)rs["POSITION_NBR"]; item.班别 = (string)rs["SHIFT"]; #endregion #region 出勤情况 item.企业排班天数 = Convert.ToDecimal(rs["C_AMT202"]); item.法定工作日天数 = Convert.ToDecimal(rs["C_AMT243"]); item.实际出勤天数 = Convert.ToDecimal(rs["C_AMT198"]); item.法定工作日出勤天数 = Convert.ToDecimal(rs["C_AMT199"]); item.法定节假日出勤天数 = Convert.ToDecimal(rs["C_AMT201"]); item.休息日出勤天数 = Convert.ToDecimal(rs["C_AMT203"]); item.月综合出勤天数 = Convert.ToDecimal(rs["C_AMT204"]); item.工作日延长出勤小时数 = Convert.ToDecimal(rs["C_AMT205"]); #endregion #region 出勤工资 item.法定工作日出勤工资 = Convert.ToDecimal(rs["C_AMT005"]); item.法定节假日出勤工资 = Convert.ToDecimal(rs["C_AMT006"]); item.休息日出勤工资 = Convert.ToDecimal(rs["C_AMT007"]); item.月综合出勤工资 = Convert.ToDecimal(rs["C_AMT009"]); item.工作日延长工作出勤工资 = Convert.ToDecimal(rs["C_AMT010"]); #endregion item.未休年休假工资 = Convert.ToDecimal(rs["C_AMT134"]); #region 社保缴纳 item.养老保险个人缴纳金额 = Convert.ToDecimal(rs["C_AMT170"]); item.医疗保险个人缴纳金额 = Convert.ToDecimal(rs["C_AMT171"]); item.失业保险个人缴纳金额 = Convert.ToDecimal(rs["C_AMT172"]); item.住房公积金个人缴纳金额 = Convert.ToDecimal(rs["C_AMT173"]); item.大病医疗个人缴纳金额 = Convert.ToDecimal(rs["C_AMT292"]); //社保合计 item.社保个人缴纳金额 = Convert.ToDecimal(rs["C_AMT258"]); item.社保公司缴纳金额 = Convert.ToDecimal(rs["C_AMT259"]); //补缴 2015.9.14 item.养老保险个人补缴金额 = Convert.ToDecimal(rs["C_AMT174"]); item.医疗保险个人补缴金额 = Convert.ToDecimal(rs["C_AMT175"]); item.失业保险个人补缴金额 = Convert.ToDecimal(rs["C_AMT176"]); item.住房公积金个人补缴金额 = Convert.ToDecimal(rs["C_AMT177"]); #endregion item.个人所得税金额 = Convert.ToDecimal(rs["C_AMT178"]); //C_AMT265 总的个税(含封闭工资) item.代垫费用 = Convert.ToDecimal(rs["C_AMT262"]); item.挂钩效益工资 = Convert.ToDecimal(rs["C_AMT136"]); item.其他所得 = Convert.ToDecimal(rs["C_AMT138"]); item.其他扣款 = Convert.ToDecimal(rs["C_AMT196"]); item.预留风险金 = Convert.ToDecimal(rs["C_AMT241"]); item.出勤工资 = Convert.ToDecimal(rs["C_AMT252"]); item.实得满勤奖 = Convert.ToDecimal(rs["C_AMT017"]); item.应得满勤奖 = Convert.ToDecimal(rs["C_AMT232"]); item.表工资 = Convert.ToDecimal(rs["C_AMT002"]); item.设定工资 = Convert.ToDecimal(rs["C_AMT003"]); item.基准工资 = Convert.ToDecimal(rs["C_AMT004"]); item.特殊社保的基准工资 = Convert.ToDecimal(rs["C_AMT278"]); item.基数等级与基准工资差额 = Convert.ToDecimal(rs["C_AMT011"]); //item.工资降级 = Convert.ToDecimal(rs["C_AMT008"]) - item.上表工资; //2015.5.20 封闭上表工资 - 上表工资 //2017.7.10 直接读取工资降级数据 item.工资降级 = PsHelper.GetPayDegrade(item.员工编号, calRun.开始日期); if (item.工资降级 < 0) { item.工资降级 = 0; //2015.9.24 } #region 累加器 item.出勤工资 = Convert.ToDecimal(rs["C_AMT252"]); item.津贴补助 = Convert.ToDecimal(rs["C_AMT253"]); item.综合考核工资 = Convert.ToDecimal(rs["C_AMT254"]); item.奖项 = Convert.ToDecimal(rs["C_AMT255"]); item.扣项 = Convert.ToDecimal(rs["C_AMT256"]); #endregion item.交通餐饮补助 = Convert.ToDecimal(rs["C_AMT248"]); item.应税工资额 = Convert.ToDecimal(rs["C_AMT260"]); //含年休假工资(260是不含年休假的工资总额) //即:合计应税工资额 = 应税工资额 + 年休假工资 item.合计应税工资额 = Convert.ToDecimal(rs["C_AMT261"]); item.表工资总额 = Convert.ToDecimal(rs["C_AMT257"]); item.实发工资总额 = Convert.ToDecimal(rs["C_AMT263"]); list.Add(item); } } } finally { if (rs != null) { rs.Close(); } conn.Close(); } } return(list); }
public void Calculate() { decimal 标准职务工资, 个人职务工资; 是标准职务工资 = true; 满勤奖_显示 = "—"; 年休假_显示 = "—"; 津贴补助_显示 = "—"; //获取薪酬信息 GetPayInfo(); //获取上表工资标准 SalaryBaseInfo sbi = PsHelper.GetSalaryGrade(员工编号, 期间_开始); if (sbi != null) { 表工资标准 = sbi.表工资标准; 年休假工资 = sbi.年休假工资; 满勤奖金额 = sbi.满勤奖金额; 满勤奖_显示 = 满勤奖金额 > 0 ? 满勤奖金额.ToString("#0.##") : "—"; 年休假_显示 = 年休假工资 > 0 ? 年休假工资.ToString("#0.##") : "—";; } #region 计算职务工资 StepPayRate stepPayRate = null; List <StepPayRate> rates = 标准职务工资表.FindAll(a => a.薪级标识 == 薪级_月初).OrderByDescending(a => a.执行日期).ToList(); if (rates.Count > 0) { stepPayRate = rates[0]; 开始执行日期 = 开始执行日期_月初; } //月底职级 List <StepPayRate> rates_月底 = 标准职务工资表.FindAll(a => a.薪级标识 == 薪级_月底).OrderByDescending(a => a.执行日期).ToList(); if (rates.Count > 0) { StepPayRate stepPayRate_月底 = rates[0]; //如果月底职级改变,去工资低的 if (stepPayRate_月底.标识 != stepPayRate.标识) { stepPayRate = stepPayRate.工资额 < stepPayRate_月底.工资额 ? stepPayRate : stepPayRate_月底; 开始执行日期 = 开始执行日期_月底; } } PersonPayRate personPayRate = null; List <PersonPayRate> pRates = 个人职务工资表.FindAll(a => a.生效日期 == 期间_开始 && a.员工编号 == this.员工编号).OrderByDescending(a => a.生效日期).ToList(); if (isRealtime) { pRates = 个人职务工资表.FindAll(a => a.效 && a.员工编号 == this.员工编号).OrderByDescending(a => a.生效日期).ToList(); } if (pRates.Count > 0) { personPayRate = pRates[0]; 开始执行日期 = personPayRate.生效日期; //津贴补助 津贴补助 = personPayRate.津贴1金额 + personPayRate.津贴2金额; 津贴补助_显示 = 津贴补助 > 0 ? 津贴补助.ToString("#0.##") : "—"; } 标准职务工资 = stepPayRate == null ? 0 : stepPayRate.工资额; 个人职务工资 = personPayRate == null ? 0 : personPayRate.月薪; 职务工资 = 个人职务工资 == 0 ? 标准职务工资 : 个人职务工资; 是标准职务工资 = 个人职务工资 == 0; //2017-7-23 加上年休假工资 职级工资 = 职务工资 + 年休假工资; //重新计算有效的薪等薪级 工资职级 = " - "; if (stepPayRate != null && 是标准职务工资) { 封闭薪等 = stepPayRate.薪等标识; 封闭薪级 = stepPayRate.薪级标识; SalaryNode grade = SalaryNode.工资等级表.Find(a => a.标识 == 封闭薪等); if (grade != null) { 薪等 = grade.称; } grade = SalaryNode.工资等级表.Find(a => a.标识 == 封闭薪级); if (grade != null) { 薪级 = grade.称; } 工资职级 = 薪等 + 薪级; } #endregion SalaryResult sr = SalaryResult.GetFromCache(员工编号, 年, 月); 公司编码 = sr == null ? employeeInfo.公司 : sr.公司编号; 职务等级 = sr == null ? employeeInfo.职务等级 : sr.职务等级; 职级 = PsHelper.GetSupvsrLvDescr(职务等级); }
protected override void OnSaving() { if (string.IsNullOrEmpty(this.员工编号)) { throw new Exception("员工编号不能为空。"); } if (PsHelper.GetEmplName(this.员工编号) == "") { throw new Exception("找不到指定员工编号的员工。"); } if (string.IsNullOrEmpty(this.项目)) { throw new Exception("项目不能为空。"); } //获取报销标准 ReimbursementStandard reimbursementStandard = ReimbursementStandard.GetEffective(this.员工编号, this.项目, new DateTime(this.年, this.月, 1)); if (reimbursementStandard == null) { throw new Exception("找不到该员工的 " + this.项目 + " 报销标准,不能录入。"); } else { if (this.报销金额 > reimbursementStandard.报销金额) { throw new Exception("报销金额不能大于报销标准。"); } } if (string.IsNullOrEmpty(编号)) { if (this.标识 == Guid.Empty) { this.标识 = Guid.NewGuid(); } PersonReimbursementInput other = GetEditing(this.员工编号, this.年, this.月, this.项目, !this.是验证录入); this.编号 = other == null?GetNewNumber() : other.编号; //如果是新编号,更新编号信息的当前序号 this.NumberInfo.UpdateCurrentSN(); PersonReimbursementInput found = Get(this.编号, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("同一编号【{0}】不能重复创建,请稍后重试。", this.编号)); } found = GetEditing(this.员工编号, this.年, this.月, this.项目, this.是验证录入); if (found != null && found.标识 != this.标识) { throw new Exception(String.Format("该员工【{0}】已经有一条{1}报销记录正在录入,不能重复。", this.员工编号, this.项目)); } } if (另一人录入的记录 != null) { TimeSpan ts = DateTime.Now - 另一人录入的记录.录入时间; if (ts.TotalMilliseconds > 10000 && 另一人录入的记录.录入人 == AccessController.CurrentUser.姓名) { throw new Exception("两次录入不能是同一个人。"); } } if (string.IsNullOrEmpty(this.录入人) || (DateTime.Now - this.录入时间).TotalMilliseconds > 10000) { this.录入人 = AccessController.CurrentUser.姓名; this.录入时间 = DateTime.Now; } if (this.双人录入结果 == null) { this.双人录入结果 = ""; } base.OnSaving(); }