Browse Source

计算工资 5.6

leiy 1 year ago
parent
commit
a00a13a2e6

+ 37 - 26
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -93,7 +93,7 @@ namespace OASystem.API.OAMethodLib
                             unprinted_deduction = 0.00M,      // 未打卡 扣款金额 *计算方式:
                                                               // 试用期员工每月有 2 次 补卡机会,超过 2 次不足 5 次的部分,按 10 元 / 次处罚,5 次及以上的漏卡,按 50 元 / 次处罚;
                                                               // 正式员工每月 3 次以内的补卡,按 10 元 / 次处罚,3 次及以上的漏卡,按 50 元 / 次处罚。
-                            sickLeave_deduction = 0.00M,
+                            sickLeave_deduction = 0.00M,      // 病假
                             other_deduction = 0.00M;          // 其他 扣款金额
 
                     decimal meal_deduction = 0.00M;           // 餐补 扣款金额
@@ -298,7 +298,7 @@ namespace OASystem.API.OAMethodLib
                                 reissuecard_deduction += 50;
                             }
                         }
-
+                        unprinted_deduction += reissuecard_deduction;  //补卡次数 放在未打卡里面
                         Ex_Item ex_reissueCard = new Ex_Item()
                         {
                             SubTypeId = 7,
@@ -415,7 +415,7 @@ namespace OASystem.API.OAMethodLib
                                     };
 
 
-                                    decimal day_beLate_deduction = 0.00M;
+                                    decimal day_deduction = 0.00M;
                                     //1 - 迟到;2 - 早退;3 - 缺卡;4 - 旷工;5 - 地点异常;6 - 设备异常
                                     if (exception == 1)   //迟到
                                     {
@@ -427,28 +427,31 @@ namespace OASystem.API.OAMethodLib
 
                                             if (reissueCardNum >= 3)
                                             {
-                                                day_beLate_deduction = 50.00M;
+                                                day_deduction = 50.00M;
+                                                beLate_deduction += day_deduction; //迟到扣款 总额
                                             }
                                         }
                                         else if (timelength >= 10 && timelength <= 60)
                                         {
-                                            day_beLate_deduction = 50.00M;
+                                            day_deduction = 50.00M;
+                                            beLate_deduction += day_deduction; //迟到扣款 总额
                                             beLate_belate_ex.SubTypeId = 1;
                                             beLate_belate_ex.SubType = "迟到";
                                         }
                                         else if (timelength > 60 && timelength <= 180)
                                         {
-                                            day_beLate_deduction = day_miner_unit * 6; //3小时
-
+                                            day_deduction = day_miner_unit * 6; //3小时
+                                            meal_deduction += 10.00M;  //餐补扣款
+                                            absenteeism_deduction += day_deduction; //矿工半日
                                         }
                                         else
                                         {
-                                            day_beLate_deduction = dailyWage;
+                                            day_deduction = dailyWage;
+                                            absenteeism_deduction += day_deduction; //矿工一日
                                             meal_deduction += 10.00M;
                                         }
 
-                                        beLate_deduction += day_beLate_deduction;
-                                        beLate_belate_ex.Deduction = day_beLate_deduction;
+                                        beLate_belate_ex.Deduction = day_deduction;
                                         ex_reissuecard_Items.Add(beLate_belate_ex);
                                     }
                                     else if (exception == 2)  //早退
@@ -461,29 +464,32 @@ namespace OASystem.API.OAMethodLib
 
                                             if (reissueCardNum >= 3)
                                             {
-                                                day_beLate_deduction = 50.00M;
+                                                day_deduction = 50.00M;
+                                                early_deduction += day_deduction;  //早退扣款 总计
                                             }
 
                                         }
                                         else if (timelength >= 10 && timelength <= 60)
                                         {
-                                            day_beLate_deduction = 50.00M;
+                                            day_deduction = 50.00M;
+                                            early_deduction += day_deduction;  //早退扣款 总计
                                             beLate_belate_ex.SubTypeId = 2;
                                             beLate_belate_ex.SubType = "早退";
                                         }
                                         else if (timelength > 60 && timelength <= 180)
                                         {
-                                            day_beLate_deduction = day_miner_unit * 6; //3小时
+                                            day_deduction = day_miner_unit * 6; //3小时
+                                            absenteeism_deduction += day_deduction; //矿工半日
 
                                         }
                                         else
                                         {
-                                            day_beLate_deduction = dailyWage;
+                                            day_deduction = dailyWage;
                                             meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction; //矿工一日
                                         }
 
-                                        beLate_deduction += day_beLate_deduction;
-                                        beLate_belate_ex.Deduction = day_beLate_deduction;
+                                        beLate_belate_ex.Deduction = day_deduction;
                                         ex_reissuecard_Items.Add(beLate_belate_ex);
                                     }
                                     else if (exception == 3) //缺卡
@@ -496,46 +502,51 @@ namespace OASystem.API.OAMethodLib
 
                                             if (reissueCardNum >= 3)
                                             {
-                                                day_beLate_deduction = 50.00M;
+                                                day_deduction = 50.00M;
+                                                unprinted_deduction += day_deduction; //缺卡/未打卡 总额
                                             }
 
                                         }
                                         else if (timelength >= 10 && timelength <= 60)
                                         {
-                                            day_beLate_deduction = 50.00M;
+                                            day_deduction = 50.00M;
+                                            unprinted_deduction += day_deduction; //缺卡/未打卡 总额
                                             beLate_belate_ex.SubTypeId = 3;
                                             beLate_belate_ex.SubType = "缺卡";
                                         }
                                         else if (timelength > 60 && timelength <= 180)
                                         {
-                                            day_beLate_deduction = day_miner_unit * 6; //3小时
+                                            day_deduction = day_miner_unit * 6; //3小时
+                                            absenteeism_deduction += day_deduction; //矿工半日
 
                                         }
                                         else
                                         {
-                                            day_beLate_deduction = dailyWage;
+                                            day_deduction = dailyWage;
                                             meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction; //矿工一日
                                         }
 
-                                        beLate_deduction += day_beLate_deduction;
-                                        beLate_belate_ex.Deduction = day_beLate_deduction;
+                                        beLate_belate_ex.Deduction = day_deduction;
                                         ex_reissuecard_Items.Add(beLate_belate_ex);
                                     }
                                     else if (exception == 4) //旷工
                                     {
                                         if (timelength > 60 && timelength <= 180)
                                         {
-                                            day_beLate_deduction = day_miner_unit * 6; //3小时
+                                            day_deduction = day_miner_unit * 6; //3小时
+                                            meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction; //矿工半日
 
                                         }
                                         else
                                         {
-                                            day_beLate_deduction = dailyWage;
+                                            day_deduction = dailyWage;
                                             meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction; //矿工一日
                                         }
 
-                                        beLate_deduction += day_beLate_deduction;
-                                        beLate_belate_ex.Deduction = day_beLate_deduction;
+                                        beLate_belate_ex.Deduction = day_deduction;
                                         ex_reissuecard_Items.Add(beLate_belate_ex);
                                     }
 

+ 8 - 8
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/WageSheetRepository.cs

@@ -115,14 +115,14 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
 
             if (dto.Status == 1) //添加
             {
-                var select = await _sqlSugar.Queryable<Pm_WageSheet>().
-                    Where(it => it.IsDel == 0 && it.UserId == pm_WageSheet.UserId && it.YearMonth == pm_WageSheet.YearMonth).
-                    FirstAsync();
-                if (select != null) 
-                {
-                    _result.Msg = "该用户 "+ pm_WageSheet.YearMonth + " 工资信息已存在,请前往修改!";
-                    return _result;
-                }
+                //var select = await _sqlSugar.Queryable<Pm_WageSheet>().
+                //    Where(it => it.IsDel == 0 && it.UserId == pm_WageSheet.UserId && it.YearMonth == pm_WageSheet.YearMonth).
+                //    FirstAsync();
+                //if (select != null) 
+                //{
+                //    _result.Msg = "该用户 "+ pm_WageSheet.YearMonth + " 工资信息已存在,请前往修改!";
+                //    return _result;
+                //}
 
                 int add = await _sqlSugar.Insertable(pm_WageSheet).ExecuteReturnIdentityAsync();
                 if (add <= 0)