Browse Source

计算工资
修改 打卡类型迟到,矿工

leiy 1 year ago
parent
commit
6d9df6cb91
1 changed files with 58 additions and 6 deletions
  1. 58 6
      OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

+ 58 - 6
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -295,12 +295,14 @@ namespace OASystem.API.OAMethodLib
                                         day_deduction = ConvertToDecimal(day_miner_unit * 6); //3小时
                                         meal_deduction += 10.00M;  //餐补扣款
                                         absenteeism_deduction += day_deduction; //矿工半日
+                                        beLate_belate_ex.Reason = thisDtStr + " 下午(09:00)缺卡/未打卡视为下午旷工(3小时)";
                                     }
                                     else
                                     {
                                         day_deduction = ConvertToDecimal(dailyWage);
                                         absenteeism_deduction += day_deduction; //矿工一日
                                         meal_deduction += 10.00M;
+                                        beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
                                     }
 
                                     beLate_belate_ex.Deduction = day_deduction;
@@ -359,12 +361,62 @@ namespace OASystem.API.OAMethodLib
                                 {
                                     if (root.exception_infos.Count == 2)
                                     {
-                                        day_deduction = dailyWage;
-                                        meal_deduction += 10.00M;
-                                        absenteeism_deduction += day_deduction;
-                                        beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
-                                        beLate_belate_ex.Deduction = day_deduction;
-                                        ex_reissuecard_Items.Add(beLate_belate_ex);
+                                        if (ex_reissuecard_Items.Where(it => it.StartTimeDt.ToString("yyyy-MM-dd").Equals(thisDtStr)).Count() > 0)
+                                        {
+                                            if (earliest_time == lastest_time)
+                                            {
+                                                DateTime thisDt1 = Convert.ToDateTime(thisDtStr + " 12:00");
+
+
+                                                if (thisDt >= thisDt1)  //旷工 下午
+                                                {
+                                                    day_deduction = ConvertToDecimal(day_miner_unit * 9); //4.5小时
+                                                    meal_deduction += 10.00M;
+
+                                                    beLate_belate_ex.Duration = 270;
+                                                    absenteeism_deduction += day_deduction; //矿工半日
+                                                    beLate_belate_ex.Reason = thisDtStr + " 下午(18:00)缺卡/未打卡视为下午旷工(4.5小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+                                                else if (thisDt <= thisDt1) //旷工 上午
+                                                {
+                                                    day_deduction = ConvertToDecimal(day_miner_unit * 6); //3小时
+                                                    meal_deduction += 10.00M;
+                                                    absenteeism_deduction += day_deduction; //矿工半日
+                                                    beLate_belate_ex.Duration = 180;
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)缺卡/未打卡视为上午旷工(3小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+                                                else //矿工一日
+                                                {
+
+                                                    day_deduction = ConvertToDecimal(dailyWage);
+                                                    meal_deduction += 10.00M;
+                                                    absenteeism_deduction += day_deduction;
+                                                    beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
+
+                                                    beLate_belate_ex.Deduction = day_deduction;
+                                                    ex_reissuecard_Items.Add(beLate_belate_ex);
+                                                }
+
+
+                                            }
+                                        }
+                                        else
+                                        {
+                                            day_deduction = dailyWage;
+                                            meal_deduction += 10.00M;
+                                            absenteeism_deduction += day_deduction;
+                                            beLate_belate_ex.Reason = "上午-下午 缺卡/未打卡为旷工 一天";
+                                            beLate_belate_ex.Deduction = day_deduction;
+                                            ex_reissuecard_Items.Add(beLate_belate_ex);
+                                        }
+
+                                        
 
                                     }
                                     else if (root.exception_infos.Count == 1)