|
@@ -1,4 +1,5 @@
|
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
+using NPOI.HPSF;
|
|
|
using NPOI.OpenXmlFormats.Spreadsheet;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
using OASystem.API.OAMethodLib.QiYeWeChatAPI;
|
|
@@ -825,10 +826,10 @@ namespace OASystem.API.OAMethodLib
|
|
|
decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.InformationSecurityFee + pm_wsInfo.OtherSubsidies;
|
|
|
|
|
|
|
|
|
- decimal dailyWage = ConvertToDecimal(amountPayable / work_days);
|
|
|
+ decimal dailyWage = amountPayable / work_days;
|
|
|
|
|
|
|
|
|
- decimal sickLeave_dailywage = ConvertToDecimal(_chengDuMinimumWage / work_days);
|
|
|
+ decimal sickLeave_dailywage = _chengDuMinimumWage / work_days;
|
|
|
|
|
|
|
|
|
sickLeave_deduction = dailyWage - sickLeave_dailywage;
|
|
@@ -880,7 +881,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
decimal user_probationary_bk_decimal = pm_wsInfo.Floats;
|
|
|
|
|
|
- #region 迟到 早退 矿工
|
|
|
+ #region 迟到 早退 旷工
|
|
|
|
|
|
int user_cd_zt_num = 0;
|
|
|
foreach (var root in userRoots)
|
|
@@ -901,7 +902,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
if (timelength == 9) timelength = 7.50M;
|
|
|
|
|
|
int exception = exception_info.exception;
|
|
|
- decimal day_miner_unit = ConvertToDecimal(dailyWage / 15);
|
|
|
+ decimal day_miner_unit = dailyWage / 15;
|
|
|
|
|
|
|
|
|
|
|
@@ -961,13 +962,13 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else if (timelength > 60 && timelength <= 180)
|
|
|
{
|
|
|
- day_deduction = day_miner_unit * 6;
|
|
|
+ day_deduction = ConvertToDecimal(day_miner_unit * 6);
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- day_deduction = dailyWage;
|
|
|
+ day_deduction = ConvertToDecimal(dailyWage);
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
meal_deduction += 10.00M;
|
|
|
}
|
|
@@ -1009,13 +1010,13 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else if (timelength > 60 && timelength <= 180)
|
|
|
{
|
|
|
- day_deduction = day_miner_unit * 6;
|
|
|
+ day_deduction = ConvertToDecimal(day_miner_unit * 6);
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- day_deduction = dailyWage;
|
|
|
+ day_deduction = ConvertToDecimal(dailyWage);
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
|
}
|
|
@@ -1082,7 +1083,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
if (timelength > 60 && timelength <= 180)
|
|
|
{
|
|
|
- day_deduction = day_miner_unit * 6;
|
|
|
+ day_deduction = ConvertToDecimal(day_miner_unit * 6);
|
|
|
beLate_belate_ex.Reason = thisDtStr + " 缺卡/未打视为旷工上午(3小时)";
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
@@ -1090,7 +1091,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- day_deduction = dailyWage;
|
|
|
+ day_deduction = ConvertToDecimal(dailyWage);
|
|
|
beLate_belate_ex.Reason = thisDtStr + " 上午(09:00)-下午(18:00) 缺卡/未打视为旷工一天(7.5小时)";
|
|
|
meal_deduction += 10.00M;
|
|
|
absenteeism_deduction += day_deduction;
|
|
@@ -1255,9 +1256,9 @@ namespace OASystem.API.OAMethodLib
|
|
|
var punch_correction = content_Vacation.value.punch_correction;
|
|
|
|
|
|
DateTime bukaDt = punch_correction.time_dt;
|
|
|
-
|
|
|
+ DateTime bukaDtJudge = Convert.ToDateTime(bukaDt.ToString("yyyy-MM-dd"));
|
|
|
|
|
|
- if (startDt >= bukaDt || bukaDt > endDt)
|
|
|
+ if (startDt >= bukaDtJudge || bukaDtJudge > endDt)
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
@@ -1302,7 +1303,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
if (ex_reissuecard_Items.Count > 0)
|
|
|
{
|
|
|
ex_Items_dk.Ex_ItemInfo = ex_reissuecard_Items;
|
|
|
- ex_Items_dk.Ex_ItemInfo = ex_reissuecard_Items.OrderBy(it => it.SubTypeId).ThenBy(it => it.StartTimeDt).ToList();
|
|
|
+
|
|
|
ex_Items.Add(ex_Items_dk);
|
|
|
}
|
|
|
|
|
@@ -1396,9 +1397,10 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
|
|
|
|
|
|
- public static decimal ConvertToDecimal(decimal number)
|
|
|
+ public static decimal ConvertToDecimal(decimal myDecimal)
|
|
|
{
|
|
|
- return Convert.ToDecimal(number.ToString("0.00"));
|
|
|
+ var subDecimal = Math.Floor(myDecimal * 100) / 100;
|
|
|
+ return subDecimal;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1460,7 +1462,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
string am_starttime = "08:59";
|
|
|
string am_endtime = "13:01";
|
|
|
|
|
|
- decimal personalkLeave_dailywage_day = ConvertToDecimal( amountPayable / work_days);
|
|
|
+ decimal personalkLeave_dailywage_day = amountPayable / work_days;
|
|
|
|
|
|
|
|
|
decimal halfHour = Convert.ToDecimal(7.5) / Convert.ToDecimal(0.5);
|
|
@@ -1472,38 +1474,28 @@ namespace OASystem.API.OAMethodLib
|
|
|
break;
|
|
|
case 2:
|
|
|
|
|
|
- decimal personalkLeave_dailywage_halfhour = ConvertToDecimal( personalkLeave_dailywage_day / halfHour);
|
|
|
+ decimal personalkLeave_dailywage_halfhour = personalkLeave_dailywage_day / halfHour;
|
|
|
|
|
|
if (date_Range_type == "halfday")
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
- typeDeduction = personalkLeave_dailywage_day;
|
|
|
+ typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day);
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|
|
|
+
|
|
|
decimal leave_halfHour = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
|
|
|
- typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour;
|
|
|
- if (duration >= 3 && duration <= 7.5M)
|
|
|
+ typeDeduction = ConvertToDecimal( personalkLeave_dailywage_halfhour * leave_halfHour);
|
|
|
+
|
|
|
+ if (duration >= 3 && duration < 7.5M)
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
|
|
|
- #region 上午请假超三小时 扣款
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
}
|
|
|
- else if (duration > 7.5M)
|
|
|
+ else if (duration >= 7.5M)
|
|
|
{
|
|
|
decimal leave_halfHour1 = Convert.ToDecimal(duration) / Convert.ToDecimal(0.5);
|
|
|
- typeDeduction = personalkLeave_dailywage_halfhour * leave_halfHour1;
|
|
|
+ typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day);
|
|
|
|
|
|
decimal leaveDays = duration / 7.5M;
|
|
|
if (leaveDays % 1 == 0)
|
|
@@ -1512,17 +1504,19 @@ namespace OASystem.API.OAMethodLib
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ typeDeduction = personalkLeave_dailywage_day * Convert.ToInt32(leaveDays);
|
|
|
+ decimal sy_shijiaunit = leave_halfHour1 - Convert.ToDecimal (15.00M * Convert.ToInt32(leaveDays));
|
|
|
+ if (sy_shijiaunit > 0)
|
|
|
+ {
|
|
|
+ typeDeduction += ConvertToDecimal(personalkLeave_dailywage_halfhour * sy_shijiaunit);
|
|
|
+ }
|
|
|
mealDeduction = 10 * Convert.ToInt32(leaveDays);
|
|
|
|
|
|
|
|
|
int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
|
|
|
if (lastHours >= 3)
|
|
|
{
|
|
|
-
|
|
|
- if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
- {
|
|
|
- mealDeduction += 10;
|
|
|
- }
|
|
|
+ mealDeduction += 10;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1532,41 +1526,29 @@ namespace OASystem.API.OAMethodLib
|
|
|
case 3:
|
|
|
|
|
|
|
|
|
- decimal chengDuMinimumWage_halrHour = ConvertToDecimal( _chengDuMinimumWage / work_days) / halfHour;
|
|
|
+ decimal chengDuMinimumWage_halrHour = _chengDuMinimumWage / work_days / halfHour;
|
|
|
decimal sickLeave_dailywage_halfhour_deduction = personalkLeave_dailywage_day - chengDuMinimumWage_halrHour;
|
|
|
|
|
|
if (date_Range_type == "halfday")
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
- typeDeduction = sickLeave_dailywage_halfhour_deduction * halfHour;
|
|
|
+ typeDeduction = ConvertToDecimal( sickLeave_dailywage_halfhour_deduction * halfHour);
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|
|
|
decimal sickLeave_halfHour = duration / 0.5M;
|
|
|
- typeDeduction = sickLeave_dailywage_halfhour_deduction *sickLeave_halfHour ;
|
|
|
- if (duration >= 3 && duration <= 7.5M)
|
|
|
+ typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day); ;
|
|
|
+ if (duration >= 3 && duration < 7.5M)
|
|
|
{
|
|
|
mealDeduction = 10;
|
|
|
-
|
|
|
- #region 上午请假超三小时扣款
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- #endregion
|
|
|
-
|
|
|
}
|
|
|
- else if (duration > 7.5M)
|
|
|
+ else if (duration >= 7.5M)
|
|
|
{
|
|
|
decimal sickLeave_halfHour1 = duration / 0.5M;
|
|
|
- typeDeduction = sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1;
|
|
|
|
|
|
decimal leaveDays = Convert.ToDecimal(duration / 7.5M);
|
|
|
+
|
|
|
+ typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * sickLeave_halfHour1);
|
|
|
if (leaveDays % 1 == 0)
|
|
|
{
|
|
|
mealDeduction = 10 * leaveDays;
|
|
@@ -1575,15 +1557,21 @@ namespace OASystem.API.OAMethodLib
|
|
|
{
|
|
|
mealDeduction = 10 * Convert.ToInt32(leaveDays);
|
|
|
|
|
|
+ typeDeduction = ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * Convert.ToInt32(leaveDays));
|
|
|
+
|
|
|
+ decimal sy_bingjiaunit = sickLeave_halfHour1 - Convert.ToDecimal(15.00M * Convert.ToInt32(leaveDays));
|
|
|
+ if (sy_bingjiaunit > 0)
|
|
|
+ {
|
|
|
+ typeDeduction += ConvertToDecimal(sickLeave_dailywage_halfhour_deduction * sy_bingjiaunit);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
int lastHours = (Convert.ToDateTime(endTime) - Convert.ToDateTime("09:00")).Hours;
|
|
|
if (lastHours >= 3)
|
|
|
{
|
|
|
-
|
|
|
- if (endTime.CompareTo(am_starttime) > 0 && endTime.CompareTo(am_endtime) < 0)
|
|
|
- {
|
|
|
- mealDeduction += 10;
|
|
|
- }
|
|
|
+
|
|
|
+ mealDeduction += 10;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|