|
@@ -558,6 +558,14 @@ namespace OASystem.API.OAMethodLib
|
|
|
string endTime = string.Empty;
|
|
|
string startTime1 = string.Empty;
|
|
|
string endTime1 = string.Empty;
|
|
|
+ Slice_info slice_info = new Slice_info();
|
|
|
+
|
|
|
+ if (leaveTypeId == 2 || leaveTypeId ==3)
|
|
|
+ {
|
|
|
+ slice_info = vacation.attendance.slice_info;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
decimal new_duration = 0.00M;
|
|
|
if (date_Range.type == "halfday")
|
|
@@ -566,10 +574,24 @@ namespace OASystem.API.OAMethodLib
|
|
|
unit = "天";
|
|
|
startTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 09:00";
|
|
|
endTime = date_Range.new_begin_dt.ToString("yyyy-MM-dd") + " 18:00";
|
|
|
- if (new_duration == 1)
|
|
|
+
|
|
|
+ if (new_duration >= 0.50M)
|
|
|
{
|
|
|
- startTime1 = "09:00:00";
|
|
|
- endTime1 = "18:00:00";
|
|
|
+ if (slice_info != null)
|
|
|
+ {
|
|
|
+ decimal qjLongTime = slice_info.duration / 3600.00M;
|
|
|
+ if (qjLongTime == 4.50M)
|
|
|
+ {
|
|
|
+ startTime1 = "12:00";
|
|
|
+ endTime1 = "18:00:00";
|
|
|
+ }
|
|
|
+ else if (qjLongTime == 3.00M)
|
|
|
+ {
|
|
|
+ startTime1 = "09:00";
|
|
|
+ endTime1 = "12:00:00";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -596,7 +618,7 @@ namespace OASystem.API.OAMethodLib
|
|
|
DtType = date_Range.type,
|
|
|
Unit = unit,
|
|
|
New_Duration = new_duration,
|
|
|
- ApplyDt = Convert.ToDateTime(sp_item.apply_time_dt.ToString("yyyy-MM-dd HH:mm:ss"))
|
|
|
+ SliceInfo = slice_info
|
|
|
};
|
|
|
leaveDetails.Add(leaveDetails1);
|
|
|
}
|
|
@@ -644,13 +666,13 @@ namespace OASystem.API.OAMethodLib
|
|
|
#region 累计类型扣款
|
|
|
|
|
|
|
|
|
- if (leaveType == 2)
|
|
|
+ if (leaveType == 2)
|
|
|
{
|
|
|
personalLeaveTotal += thisTypeDeduction;
|
|
|
}
|
|
|
else if (leaveType == 3)
|
|
|
{
|
|
|
- sickLeaveTotal = thisTypeDeduction;
|
|
|
+ sickLeaveTotal += thisTypeDeduction;
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -1248,7 +1270,38 @@ namespace OASystem.API.OAMethodLib
|
|
|
if (date_Range_type == "halfday")
|
|
|
{
|
|
|
mealDeduction = 10.00M * Math.Ceiling(duration);
|
|
|
- typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day * duration);
|
|
|
+ if (duration % 1 == 0)
|
|
|
+ {
|
|
|
+ typeDeduction = ConvertToDecimal(personalkLeave_dailywage_day * duration);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ decimal sj_wholeDay = Math.Floor(duration);
|
|
|
+ decimal sj_halfDay = duration % 1;
|
|
|
+ typeDeduction = personalkLeave_dailywage_day * sj_wholeDay;
|
|
|
+
|
|
|
+ if (sj_halfDay > 0)
|
|
|
+ {
|
|
|
+ LeaveDetails sjDetails = leaveDetails.Where(it => it.StartDt == startTime && it.EndDt == endTime).FirstOrDefault();
|
|
|
+
|
|
|
+ decimal sjPrice = 0.00M;
|
|
|
+ if (sjDetails != null)
|
|
|
+ {
|
|
|
+ Slice_info sj_slice_Info = sjDetails.SliceInfo;
|
|
|
+ decimal sjLongTime = sj_slice_Info.duration / 3600.00M;
|
|
|
+ if (sjLongTime == 3.00M)
|
|
|
+ {
|
|
|
+ typeDeduction += personalkLeave_dailywage_day / 7.50M * 3.50M;
|
|
|
+ }
|
|
|
+ else if (sjLongTime == 4.50M)
|
|
|
+ {
|
|
|
+ typeDeduction += personalkLeave_dailywage_day / 7.50M * 4.50M;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ typeDeduction = ConvertToDecimal(typeDeduction);
|
|
|
+ }
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|
|
|
{
|
|
@@ -1294,14 +1347,50 @@ namespace OASystem.API.OAMethodLib
|
|
|
|
|
|
break;
|
|
|
case 3:
|
|
|
-
|
|
|
+
|
|
|
|
|
|
- decimal chengDuMinimumWage_halrHour = _chengDuMinimumWage / work_days / 7.50M;
|
|
|
+ decimal chengDuMinimumWage_Day = _chengDuMinimumWage / work_days;
|
|
|
+ decimal chengDuMinimumWage_halrHour = chengDuMinimumWage_Day / 7.50M;
|
|
|
decimal sickLeave_dailywage_halfhour_deduction1 = (personalkLeave_dailywage_day / 7.50M) - chengDuMinimumWage_halrHour;
|
|
|
|
|
|
if (date_Range_type == "halfday")
|
|
|
{
|
|
|
- mealDeduction = 10.00M * duration;
|
|
|
+ mealDeduction = 10.00M * Math.Ceiling(duration);
|
|
|
+
|
|
|
+ decimal pl_dailywage_day = personalkLeave_dailywage_day - chengDuMinimumWage_Day;
|
|
|
+ if (duration % 1 == 0)
|
|
|
+ {
|
|
|
+ typeDeduction = ConvertToDecimal(pl_dailywage_day * duration);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ decimal bj_wholeDay = Math.Floor(duration);
|
|
|
+ decimal bj_halfDay = duration % 1;
|
|
|
+ typeDeduction = pl_dailywage_day * bj_wholeDay;
|
|
|
+
|
|
|
+ if (bj_halfDay > 0)
|
|
|
+ {
|
|
|
+ LeaveDetails bjDetails = leaveDetails.Where(it => it.StartDt == startTime && it.EndDt == endTime).FirstOrDefault();
|
|
|
+
|
|
|
+ decimal bjPrice = 0.00M;
|
|
|
+ if (bjDetails != null)
|
|
|
+ {
|
|
|
+ Slice_info bj_slice_Info = bjDetails.SliceInfo;
|
|
|
+ decimal bjLongTime = bj_slice_Info.duration / 3600.00M;
|
|
|
+ if (bjLongTime == 3.00M)
|
|
|
+ {
|
|
|
+ typeDeduction += pl_dailywage_day / 7.50M * 3.50M;
|
|
|
+ }
|
|
|
+ else if (bjLongTime == 4.50M)
|
|
|
+ {
|
|
|
+ typeDeduction += pl_dailywage_day / 7.50M * 4.50M;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ typeDeduction = ConvertToDecimal(typeDeduction);
|
|
|
+ }
|
|
|
+
|
|
|
typeDeduction = ConvertToDecimal( sickLeave_dailywage_halfhour_deduction1 * halfHour);
|
|
|
}
|
|
|
else if (date_Range_type == "hour")
|