checkout complex chang - rotatingShiftReport change - add new Description to contract print

This commit is contained in:
SamSys
2025-05-14 18:49:44 +03:30
parent 75da32167e
commit 5a8bccb98f
11 changed files with 101 additions and 31 deletions

View File

@@ -24,6 +24,15 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
List<LateToWorkEarlyExistSpannig> LateToWorkEarlyExit(List<GroupedRollCalls> groupedRollCall,
ICollection<CustomizeWorkshopEmployeeSettingsShift> shiftSettings, List<LeaveViewModel> leavList);
/// <summary>
/// گزارش نوبت کاری حضور غیاب
/// </summary>
/// <param name="workshopId"></param>
/// <param name="employeeId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <param name="shiftwork"></param>
/// <returns></returns>
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
DateTime contractEnd, string shiftwork);
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
}

View File

@@ -20,5 +20,5 @@ public interface IRollCallMandatoryApplication
/// <param name="shiftwork"></param>
/// <returns></returns>
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
DateTime contractEnd, string shiftwork);
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking);
}

View File

@@ -27,8 +27,8 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
}
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
string shiftwork)
string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
{
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork);
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork,hasRollCall, command, holidayWorking);
}
}

View File

@@ -89,6 +89,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
int TotalDaysNoFriday = TotalContractDays - fridays;
int mandatorDays = TotalContractDays - (fridays + holiday);
if (command.ShiftWork != "4" && isStaticCheckout)
mandatorDays = TotalDaysNoFriday;
//if (holidayWorking)
// mandatorDays = TotalContractDays - fridays;
//***********************************//
@@ -720,32 +722,55 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
return res;
}
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork)
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
{
List<RollCallViewModel> rollCallResult = await _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
List<GroupedRollCalls> groupedRollCall = new List<GroupedRollCalls>();
if (hasRollCall)
{
rollCallResult = await _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
CreationDate = x.ShiftDate,
}).ToListAsync();
List<GroupedRollCalls> groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
}).OrderBy(x => x.CreationDate).ToList();
}
else
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
command.WorkshopId = workshopId;
command.EmployeeId = employeeId;
command.ContractStartGr = contractStart;
command.ContractEndGr = contractEnd;
rollCallResult = ConvertStaticHoursToRollCall(command, holidayWorking);
groupedRollCall = rollCallResult.GroupBy(x => x.ShiftDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))
}).OrderBy(x => x.CreationDate).ToList();
}
}).OrderBy(x => x.CreationDate).ToList();
//****** نوبت کاری و شب کاری ****
#region RotatingShiftCheckAndNightWorkOver22
//****** نوبت کاری و شب کاری ****
#region RotatingShiftCheckAndNightWorkOver22
string shiftPayValue = "0";
string shiftPayValue = "0";
List<RotatingShiftViewModel> rotatingResultList = RotatingShiftCheck(groupedRollCall);
int moriningCount = 0;
int eveningCount = 0;
@@ -856,6 +881,10 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
#endregion
}
//public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
//{
// if (breakTime.BreakTimeType != BreakTimeType.WithTime)
@@ -1529,6 +1558,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
end = new DateTime(currentDateGr.Year, currentDateGr.Month, currentDateGr.Day, end.Hour, end.Minute, 0);
if (start.Date == end.Date && start.TimeOfDay > end.TimeOfDay)
end = end.AddDays(1);
if ((command.ShiftWork is "6" or "8") && start == end)
end = end.AddDays(1);
}
var startComplex = new DateTime(start.Year, start.Month, start.Day, start.Hour, start.Minute,

View File

@@ -125,8 +125,8 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
EmployeeId = x.EmployeeId,
CreationDate = x.CreationDate.ToFarsi(),
Id = x.id,
MonthFa = pc.GetMonth(x.SalaryAidDateTime).ToFarsiMonthByIntNumber(),
YearFa = pc.GetYear(x.SalaryAidDateTime).ToString(),
MonthFa = pc.GetMonth(x.CalculationDate).ToFarsiMonthByIntNumber(),
YearFa = pc.GetYear(x.CalculationDate).ToString(),
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime,

View File

@@ -124,6 +124,9 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
////اگر حضورغیاب داشت
//if (hasRollCall)
var MandatoryDays = TotalDays - fridayStartToEnd - officialholiday;
if (!hasRollCall && weeklyWorkingTime !="4")
MandatoryDays = TotalDays - fridayStartToEnd;
//بدست آوردن ساعت موظفی این ماه
var TotalMandatoryHours = MandatoryDays * 7.33;//ساعت موظفی این ماه

View File

@@ -160,7 +160,7 @@ public class IndexModel : PageModel
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
if (checkout.HasRollCall)
{
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId,checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId,checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork,true,workingHours,false);
result.HasRollCall = true;
}
else
@@ -181,9 +181,10 @@ public class IndexModel : PageModel
workingHours.WorkshopId = contract.WorkshopIds;
workingHours.EmployeeId = contract.EmployeeId;
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
//result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
}
@@ -201,7 +202,7 @@ public class IndexModel : PageModel
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
if (checkout.HasRollCall)
{
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, true, workingHours, false);
result.HasRollCall = true;
}
else
@@ -222,7 +223,8 @@ public class IndexModel : PageModel
workingHours.WorkshopId = contract.WorkshopIds;
workingHours.EmployeeId = contract.EmployeeId;
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
//result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);

View File

@@ -22,11 +22,11 @@
}
.modal-body2 {
background-color: #f2fbfb;
width: 100%;
height: 674px;
border-radius: 25px;
position: absolute;
background-color: #f2fbfb;
width: 100%;
height: 720px;
border-radius: 25px;
position: absolute;
}
.rotateHead {
@@ -168,7 +168,7 @@
</div>
</div>
<div class="row">
<div class="row" style="margin-top: 50px;">
<div class="col-md-9"></div>
<div class="modal2-btns col-md-3">
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>

View File

@@ -507,6 +507,14 @@
بر اساس ماده 190 قانون کار جمهوری اسلامی ایران ، پرسنل اقرار مینماید کلیه مبالغ پیش بینی شده در قانون کار را وفق قرارداد منعقده دریافت مینماید. این مبالغ قسمتی بصورت مستقیم از سوی کارفرما و قسمتی بر اساس شرایط کارگاه از محل درآمد حاصله از مشتری اخذ میگردد . با توجه به شرایط کارگاه کلیه مبالغ بصورت واریز به حساب و وجه نقد رایج کشور ، تواما به پرسنل پرداخت میگردد. امضا تصفیه حساب دارای مبالغ ، توسط پرسنل نشانگر تصفیه قطعی ایشان میباشد.
</p>
</div>
break;
case 683 or 687:
<div class="row m-t-5" style="padding: 0px 24px 10px">
<p style="text-align: justify;">
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
</div>
break;
default:

View File

@@ -450,6 +450,14 @@
</div>
break;
case 683 or 687:
<div class="row m-t-5" style="padding: 0px 24px 10px">
<p style="text-align: justify;">
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
</div>
break;
default:
<textarea class="form-control"></textarea>
break;

View File

@@ -447,6 +447,14 @@
بر اساس ماده 190 قانون کار جمهوری اسلامی ایران ، پرسنل اقرار مینماید کلیه مبالغ پیش بینی شده در قانون کار را وفق قرارداد منعقده دریافت مینماید. این مبالغ قسمتی بصورت مستقیم از سوی کارفرما و قسمتی بر اساس شرایط کارگاه از محل درآمد حاصله از مشتری اخذ میگردد . با توجه به شرایط کارگاه کلیه مبالغ بصورت واریز به حساب و وجه نقد رایج کشور ، تواما به پرسنل پرداخت میگردد. امضا تصفیه حساب دارای مبالغ ، توسط پرسنل نشانگر تصفیه قطعی ایشان میباشد.
</p>
</div>
break;
case 683 or 687:
<div class="row m-t-5" style="padding: 0px 24px 10px">
<p style="text-align: justify;">
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
</div>
break;
default: