Compare commits
100 Commits
Feature/In
...
Feature/Ex
| Author | SHA1 | Date | |
|---|---|---|---|
| 25120ff9c7 | |||
|
|
e0129b089b | ||
|
|
fd2522e507 | ||
| ca55ee9aef | |||
|
|
16c00cbd0e | ||
|
|
f4ec4f43c6 | ||
|
|
e8f7f6b778 | ||
|
|
b0b8680125 | ||
|
|
2714732750 | ||
|
|
2a78a9dc1a | ||
|
|
95b09278aa | ||
|
|
f2b3a26471 | ||
|
|
33e3efeef5 | ||
| 38171581d3 | |||
|
|
0d66a79d49 | ||
|
|
0ed24dff45 | ||
|
|
53061f29b7 | ||
|
|
861efc48e0 | ||
|
|
eb16bda0ae | ||
|
|
3285be107e | ||
|
|
4818fa32f4 | ||
|
|
79e5d98ac6 | ||
|
|
73732cfe67 | ||
|
|
f2580c8e28 | ||
|
|
5c5f3eefa6 | ||
|
|
b99c503b58 | ||
|
|
2fd1878126 | ||
|
|
a8c449c101 | ||
|
|
80c0ec28d5 | ||
|
|
b133aa67d2 | ||
|
|
8122c9d841 | ||
|
|
75e2a3c558 | ||
|
|
3fa027dfd1 | ||
|
|
6942e55823 | ||
|
|
2314fd456c | ||
|
|
4415cb8128 | ||
|
|
f0547828a6 | ||
|
|
b5afc9eef0 | ||
|
|
83a17a7e86 | ||
|
|
8e3a5b46da | ||
|
|
b15c34373b | ||
|
|
8284ec199f | ||
|
|
fcfe7c7e58 | ||
|
|
9b28c63317 | ||
|
|
a861f9f21c | ||
|
|
8fd51f4e42 | ||
|
|
146ab74524 | ||
|
|
1d38420ddf | ||
|
|
fcad12d3ef | ||
|
|
285e56ce03 | ||
| b2cb3ae173 | |||
| 8afdf13863 | |||
| 524086129a | |||
| 53d44700b8 | |||
|
|
84ff2bc8f1 | ||
| 3a84c65ce1 | |||
| a6c25ec8e8 | |||
|
|
c69cc41c93 | ||
| 423f14a348 | |||
| 1bb0f1f1b2 | |||
| 7b2eefa954 | |||
|
|
c80a5dbab7 | ||
|
|
256717c6f8 | ||
|
|
0d18d9aa1a | ||
|
|
14fbf309a7 | ||
|
|
e379727606 | ||
| 3303d4b54a | |||
| dba28b4d89 | |||
|
|
41ec3fb9cf | ||
|
|
7f98cf8f12 | ||
|
|
6c8385061e | ||
|
|
a49467ee44 | ||
| e9907650e9 | |||
| fb1db062f3 | |||
|
|
0e66c5e1a0 | ||
|
|
27a92f5796 | ||
| 6e5788074c | |||
| 831b426f9f | |||
| b29b1335d3 | |||
|
|
befcc70d46 | ||
|
|
f249df5b49 | ||
| 24d41ffc68 | |||
|
|
c6d4d7d473 | ||
| c594cbf523 | |||
| 996adec188 | |||
| 6f47948e40 | |||
|
|
d135eb73ea | ||
|
|
86143a044c | ||
| 8a6d4e0af6 | |||
| 3b2fd137e4 | |||
| 52976d8965 | |||
| ec97274d5e | |||
|
|
c4d21be4aa | ||
|
|
e9386708dc | ||
|
|
d70abb60d7 | ||
| 2098e843a5 | |||
| f6b6dfa046 | |||
| 9271cb5c66 | |||
| aee7e5ce82 | |||
| 97b4c7dc66 |
@@ -880,7 +880,15 @@ public static class Tools
|
||||
}
|
||||
}
|
||||
|
||||
numbers = Convert.ToInt32(num);
|
||||
try
|
||||
{
|
||||
numbers = Convert.ToInt32(num);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return numbers;
|
||||
}
|
||||
public static string ToFarsiMonthByNumber(this string value)
|
||||
@@ -1396,6 +1404,73 @@ public static class Tools
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که در دو شیفت استاتیک تداخل زمانی وجود دارد یا خیر
|
||||
/// چک میکند که آیا ساعات وارد شده ولید هستند یا خیر
|
||||
/// </summary>
|
||||
/// <param name="start1"></param>
|
||||
/// <param name="end1"></param>
|
||||
/// <param name="start2"></param>
|
||||
/// <param name="end2"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InterferenceTime(string start1, string end1, string start2, string end2)
|
||||
{
|
||||
if (!CheckValidHm(start1))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(end1))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(start2))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(end2))
|
||||
return true;
|
||||
|
||||
//اگه دو شیفت نبود
|
||||
if (string.IsNullOrWhiteSpace(start1) || string.IsNullOrWhiteSpace(start2))
|
||||
return false;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var start1Gr = Convert.ToDateTime(start1);
|
||||
var end1Gr = Convert.ToDateTime(end1);
|
||||
|
||||
if (end1Gr < start1Gr)
|
||||
end1Gr = end1Gr.AddDays(1);
|
||||
|
||||
var start2Gr = Convert.ToDateTime(start2);
|
||||
var end2Gr = Convert.ToDateTime(end2);
|
||||
|
||||
|
||||
start2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, start2Gr.Hour, start2Gr.Minute,
|
||||
start2Gr.Second);
|
||||
|
||||
|
||||
end2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, end2Gr.Hour, end2Gr.Minute,
|
||||
end2Gr.Second);
|
||||
if (end2Gr < start2Gr)
|
||||
end2Gr = end2Gr.AddDays(1);
|
||||
|
||||
var diff = (end1Gr - start1Gr).Add((end2Gr - start2Gr));
|
||||
if (diff > new TimeSpan(24,0,0))
|
||||
return true;
|
||||
|
||||
if (start2Gr <= end1Gr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static DateTime FindFirstDayOfMonthGr(this DateTime date)
|
||||
{
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
@@ -10,67 +10,70 @@ namespace _0_Framework.Application.UID;
|
||||
|
||||
public class UidService : IUidService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private const string BaseUrl= "https://json-api.uid.ir/api/inquiry/";
|
||||
private readonly HttpClient _httpClient;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
|
||||
|
||||
public UidService()
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
}
|
||||
public UidService()
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
BirthDate = birthDate ,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
BirthDate = birthDate,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
try
|
||||
{
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return new PersonalInfoResponse(new UidBasicInformation(),
|
||||
new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
|
||||
new ResponseContext(new UidStatus(14, "")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
MobileNumber = phoneNumber,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
MobileNumber = phoneNumber,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Microsoft.EntityFrameworkCore.Design.Internal;
|
||||
@@ -12,8 +14,7 @@ public class BaseCustomizeEntity : EntityBase
|
||||
}
|
||||
public BaseCustomizeEntity(FridayPay fridayPay, OverTimePay overTimePay,
|
||||
BaseYearsPay baseYearsPay, BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||
FridayWork fridayWork, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays)
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
|
||||
FridayPay = fridayPay;
|
||||
@@ -29,10 +30,10 @@ public class BaseCustomizeEntity : EntityBase
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
BreakTime = breakTime;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
WeeklyOffDays = weeklyOffDays.Select(x=> new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -117,4 +118,28 @@ public class BaseCustomizeEntity : EntityBase
|
||||
|
||||
|
||||
public BreakTime BreakTime { get; protected set; }
|
||||
|
||||
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
|
||||
|
||||
public void FridayWorkToWeeklyDayOfWeek()
|
||||
{
|
||||
if (FridayWork == FridayWork.Default && !WeeklyOffDays.Any(x => x.DayOfWeek == DayOfWeek.Friday))
|
||||
{
|
||||
WeeklyOffDays.Add(new WeeklyOffDay(DayOfWeek.Friday));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class WeeklyOffDay
|
||||
{
|
||||
public WeeklyOffDay(DayOfWeek dayOfWeek)
|
||||
{
|
||||
DayOfWeek = dayOfWeek;
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
public DayOfWeek DayOfWeek { get; set; }
|
||||
public long ParentId { get; set; }
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AccountManagement.Domain.TaskMessageAgg;
|
||||
|
||||
namespace AccountManagement.Domain.AssignAgg;
|
||||
@@ -158,4 +159,24 @@ public class Assign : EntityBase
|
||||
IsDoneRequest=isDoneRequest;
|
||||
DoneDescription=doneDescription;
|
||||
}
|
||||
|
||||
public void ChangeAssignedId(long assignedId)
|
||||
{
|
||||
AssignedId = assignedId;
|
||||
}
|
||||
|
||||
public void SetAssignerId(long assignerId)
|
||||
{
|
||||
AssignerId = assignerId;
|
||||
}
|
||||
|
||||
public void ChangeSender(long senderId)
|
||||
{
|
||||
Task.SetSender(senderId);
|
||||
var taskMessageItemsEnumerable =TaskMessageList.SelectMany(m => m.TaskMessageItemsList);
|
||||
foreach (var taskMessageItems in taskMessageItemsEnumerable)
|
||||
{
|
||||
taskMessageItems.SetSenderId(senderId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Domain.AssignAgg;
|
||||
using AccountManagement.Domain.TaskMediaAgg;
|
||||
using AccountManagement.Domain.TaskScheduleAgg;
|
||||
using OfficeOpenXml.Style;
|
||||
|
||||
namespace AccountManagement.Domain.TaskAgg;
|
||||
|
||||
@@ -80,4 +82,40 @@ public class Tasks : EntityBase
|
||||
TaskScheduleId = taskScheduleId;
|
||||
}
|
||||
|
||||
public void ChangeSender(long senderId)
|
||||
{
|
||||
var prevSender = SenderId;
|
||||
|
||||
var assigners = Assigns.Where(x => x.AssignerId == prevSender).ToList();
|
||||
|
||||
foreach (var assigner in assigners)
|
||||
{
|
||||
assigner.SetAssignerId(senderId);
|
||||
}
|
||||
|
||||
var senderMessageItem = Assigns
|
||||
.SelectMany(x=>x.TaskMessageList
|
||||
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.SenderAccountId == prevSender).ToList();
|
||||
|
||||
var receiverMessageItem = Assigns.SelectMany(x=>x.TaskMessageList
|
||||
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.ReceiverAccountId == prevSender).ToList();
|
||||
|
||||
|
||||
SenderId = senderId;
|
||||
|
||||
foreach (var taskMessageItems in senderMessageItem)
|
||||
{
|
||||
taskMessageItems.SetSenderId(senderId);
|
||||
}
|
||||
foreach (var taskMessageItems in receiverMessageItem)
|
||||
{
|
||||
taskMessageItems.SetReceiver(senderId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetSender(long senderId)
|
||||
{
|
||||
SenderId = senderId;
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,13 @@ public class TaskMessageItems:EntityBase
|
||||
public TaskMessage TaskMessage { get; set; }
|
||||
|
||||
|
||||
public void SetSenderId(long senderId)
|
||||
{
|
||||
SenderAccountId = senderId;
|
||||
}
|
||||
|
||||
public void SetReceiver(long receiverId)
|
||||
{
|
||||
ReceiverAccountId = receiverId;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.CheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
@@ -29,7 +30,7 @@ public class Checkout : EntityBase
|
||||
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
||||
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||
ICollection<CheckoutSalaryAid> salaryAids)
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
FathersName = fathersName;
|
||||
@@ -88,6 +89,7 @@ public class Checkout : EntityBase
|
||||
TotalDayOfBunosesCompute = totalDayOfBunosesCompute;
|
||||
LoanInstallments = loanInstallments;
|
||||
SalaryAids = salaryAids;
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
|
||||
public string EmployeeFullName { get; private set; }
|
||||
@@ -196,7 +198,8 @@ public class Checkout : EntityBase
|
||||
|
||||
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
||||
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
|
||||
#endregion
|
||||
public CheckoutRollCall CheckoutRollCall { get; private set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public Workshop Workshop { get; set; }
|
||||
@@ -308,4 +311,149 @@ public class Checkout : EntityBase
|
||||
LoanInstallments = lonaInstallments;
|
||||
InstallmentDeduction = installmentsAmount;
|
||||
}
|
||||
|
||||
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
|
||||
{
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckoutRollCall
|
||||
{
|
||||
private CheckoutRollCall(){}
|
||||
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
|
||||
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
|
||||
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
|
||||
{
|
||||
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
|
||||
TotalPresentTimeSpan = totalPresentTimeSpan;
|
||||
TotalBreakTimeSpan = totalBreakTimeSpan;
|
||||
TotalWorkingTimeSpan = totalWorkingTimeSpan;
|
||||
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
|
||||
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
|
||||
RollCallDaysCollection = rollCallDaysCollection;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت موظفی
|
||||
/// </summary>
|
||||
public TimeSpan TotalMandatoryTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت حضور
|
||||
/// </summary>
|
||||
public TimeSpan TotalPresentTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan TotalBreakTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan TotalWorkingTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public TimeSpan TotalPaidLeaveTmeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استعلاجی
|
||||
/// </summary>
|
||||
public TimeSpan TotalSickLeaveTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// روز های حضور غیاب
|
||||
/// </summary>
|
||||
public ICollection<CheckoutRollCallDay> RollCallDaysCollection { get; private set; }
|
||||
}
|
||||
|
||||
public class CheckoutRollCallDay
|
||||
{
|
||||
private CheckoutRollCallDay(){}
|
||||
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
|
||||
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
|
||||
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
|
||||
bool isHoliday, string leaveType)
|
||||
{
|
||||
Date = date;
|
||||
FirstStartDate = firstStartDate;
|
||||
FirstEndDate = firstEndDate;
|
||||
SecondStartDate = secondStartDate;
|
||||
SecondEndDate = secondEndDate;
|
||||
BreakTimeSpan = breakTimeSpan;
|
||||
IsSliced = isSliced;
|
||||
WorkingTimeSpan = workingTimeSpan;
|
||||
IsAbsent = isAbsent;
|
||||
IsFriday = isFriday;
|
||||
IsHoliday = isHoliday;
|
||||
LeaveType = leaveType;
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ
|
||||
/// </summary>
|
||||
public DateTime Date { get; private set; }
|
||||
/// <summary>
|
||||
/// ورود اول
|
||||
/// </summary>
|
||||
public string FirstStartDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج اول
|
||||
/// </summary>
|
||||
public string FirstEndDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ورود دوم
|
||||
/// </summary>
|
||||
public string SecondStartDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج دوم
|
||||
/// </summary>
|
||||
public string SecondEndDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan BreakTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار زمان کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan WorkingTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا منقطع است؟
|
||||
/// </summary>
|
||||
public bool IsSliced { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا غیبت است
|
||||
/// </summary>
|
||||
public bool IsAbsent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه است
|
||||
/// </summary>
|
||||
public bool IsFriday { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا تعطیل رسمی است
|
||||
/// </summary>
|
||||
public bool IsHoliday { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
|
||||
/// </summary>
|
||||
public string LeaveType { get; private set; }
|
||||
|
||||
public long CheckoutId { get; set; }
|
||||
|
||||
}
|
||||
@@ -59,6 +59,16 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
OperationResult DeleteAllCheckouts(List<long> ids);
|
||||
OperationResult DeleteCheckout(long id);
|
||||
List<long> CheckHasSignature(List<long> ids);
|
||||
|
||||
/// <summary>
|
||||
/// لیست تصفیه حساب
|
||||
/// جدید
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel);
|
||||
|
||||
Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel);
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -27,12 +27,13 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, long employeeId,
|
||||
long workshopId, double salary, long customizeWorkshopGroupSettingId,
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> customizeWorkshopEmployeeSettingsShifts,
|
||||
FridayWork fridayWork,
|
||||
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
|
||||
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime,
|
||||
int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts
|
||||
, List<WeeklyOffDay> weeklyOffDays) :
|
||||
base(fridayPay, overTimePay,
|
||||
baseYearsPay, bonusesPay, nightWorkPay,
|
||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
|
||||
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
|
||||
{
|
||||
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
|
||||
IsSettingChanged = false;
|
||||
@@ -82,7 +83,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
/// <param name="fineAbsenceDeduction">جریمه غیبت</param>
|
||||
/// <param name="lateToWork">تاخیر در ورود</param>
|
||||
/// <param name="earlyExit">تعجیل درخروج</param>
|
||||
/// <param name="fridayWork">آیا در روز های جمعه موظف به کار است</param>
|
||||
/// <param name="holidayWork">آیا در تعطیلات رسمی موظف به کار است</param>
|
||||
/// <param name="workshopIrregularShifts">نوع شیفت کاری </param>
|
||||
/// <param name="workshopShiftStatus">آیا شیفت منظم است یا نا منظم</param>
|
||||
@@ -91,7 +91,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||
FridayWork fridayWork, HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
|
||||
HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
|
||||
{
|
||||
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
||||
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
||||
@@ -99,7 +99,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
Salary = salary;
|
||||
IsSettingChanged = isSettingChange;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
}
|
||||
@@ -112,8 +111,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
public void SimpleEdit(
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> employeeSettingsShift,
|
||||
IrregularShift irregularShift,
|
||||
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork,
|
||||
ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork,
|
||||
ICollection<CustomizeRotatingShift> rotatingShifts,List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||
IsShiftChanged = isShiftChange;
|
||||
@@ -126,9 +125,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
WeeklyOffDays = weeklyOffDays;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,4 +267,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
IsShiftChanged = isShiftChange;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -17,340 +17,344 @@ namespace Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities;
|
||||
|
||||
public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
|
||||
{
|
||||
public CustomizeWorkshopGroupSettings()
|
||||
{
|
||||
public CustomizeWorkshopGroupSettings()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public CustomizeWorkshopGroupSettings(string groupName, double salary,
|
||||
long customizeWorkshopSettingId, ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
||||
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork,
|
||||
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
|
||||
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
CustomizeWorkshopSettingId = customizeWorkshopSettingId;
|
||||
GuardGroupShifts(customizeWorkshopGroupSettingsShifts);
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
public CustomizeWorkshopGroupSettings(string groupName, double salary,
|
||||
long customizeWorkshopSettingId, ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
||||
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays,
|
||||
ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays) :
|
||||
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||
earlyExit, holidayWork, breakTime, leavePermittedDays, weeklyOffDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
CustomizeWorkshopSettingId = customizeWorkshopSettingId;
|
||||
GuardGroupShifts(customizeWorkshopGroupSettingsShifts);
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
}
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
}
|
||||
|
||||
private void GuardGroupShifts(ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts)
|
||||
{
|
||||
if (customizeWorkshopGroupSettingsShifts.Count >= 4)
|
||||
{
|
||||
throw new InvalidDataException("شما نمیتوانید بیشتر از سه ساعت کاری در کارگاه بگذارید");
|
||||
}
|
||||
}
|
||||
private void GuardGroupShifts(ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts)
|
||||
{
|
||||
if (customizeWorkshopGroupSettingsShifts.Count >= 4)
|
||||
{
|
||||
throw new InvalidDataException("شما نمیتوانید بیشتر از سه ساعت کاری در کارگاه بگذارید");
|
||||
}
|
||||
}
|
||||
|
||||
public string GroupName { get; private set; }
|
||||
public double Salary { get; private set; }
|
||||
public long CustomizeWorkshopSettingId { get; private set; }
|
||||
public WorkshopShiftStatus WorkshopShiftStatus { get; private set; }
|
||||
public bool MainGroup { get; private set; }
|
||||
public bool IsShiftChange { get; private set; }
|
||||
public bool IsSettingChange { get; private set; }
|
||||
public IrregularShift IrregularShift { get; set; }
|
||||
public ICollection<CustomizeWorkshopGroupSettingsShift> CustomizeWorkshopGroupSettingsShifts { get; set; }
|
||||
public ICollection<CustomizeWorkshopEmployeeSettings> CustomizeWorkshopEmployeeSettingsCollection { get; set; }
|
||||
public ICollection<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
||||
public CustomizeWorkshopSettings CustomizeWorkshopSettings { get; set; }
|
||||
public string GroupName { get; private set; }
|
||||
public double Salary { get; private set; }
|
||||
public long CustomizeWorkshopSettingId { get; private set; }
|
||||
public WorkshopShiftStatus WorkshopShiftStatus { get; private set; }
|
||||
public bool MainGroup { get; private set; }
|
||||
public bool IsShiftChange { get; private set; }
|
||||
public bool IsSettingChange { get; private set; }
|
||||
public IrregularShift IrregularShift { get; set; }
|
||||
public ICollection<CustomizeWorkshopGroupSettingsShift> CustomizeWorkshopGroupSettingsShifts { get; set; }
|
||||
public ICollection<CustomizeWorkshopEmployeeSettings> CustomizeWorkshopEmployeeSettingsCollection { get; set; }
|
||||
public ICollection<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
||||
public CustomizeWorkshopSettings CustomizeWorkshopSettings { get; set; }
|
||||
|
||||
|
||||
|
||||
public CustomizeWorkshopGroupSettings CreateMainGroup(FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, FridayWork fridayWork,
|
||||
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
|
||||
{
|
||||
GuardGroupShifts(customizeWorkshopGroupSettingsShifts);
|
||||
GroupName = "اصلی";
|
||||
Salary = 0;
|
||||
FridayPay = fridayPay;
|
||||
OverTimePay = overTimePay;
|
||||
BaseYearsPay = baseYearsPay;
|
||||
BonusesPay = bonusesPay;
|
||||
NightWorkPay = nightWorkPay;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
ShiftPay = shiftPay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
LeavePay = leavePay;
|
||||
InsuranceDeduction = insuranceDeduction;
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
public CustomizeWorkshopGroupSettings CreateMainGroup(FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
|
||||
{
|
||||
GuardGroupShifts(customizeWorkshopGroupSettingsShifts);
|
||||
GroupName = "اصلی";
|
||||
Salary = 0;
|
||||
FridayPay = fridayPay;
|
||||
OverTimePay = overTimePay;
|
||||
BaseYearsPay = baseYearsPay;
|
||||
BonusesPay = bonusesPay;
|
||||
NightWorkPay = nightWorkPay;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
ShiftPay = shiftPay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
LeavePay = leavePay;
|
||||
InsuranceDeduction = insuranceDeduction;
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
HolidayWork = holidayWork;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
CustomizeWorkshopSettingId = customizeWorkshopSettingId;
|
||||
MainGroup = true;
|
||||
BreakTime = breakTime;
|
||||
CustomizeWorkshopEmployeeSettingsCollection = [];
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
CustomizeWorkshopSettingId = customizeWorkshopSettingId;
|
||||
MainGroup = true;
|
||||
BreakTime = breakTime;
|
||||
CustomizeWorkshopEmployeeSettingsCollection = [];
|
||||
|
||||
return this;
|
||||
return this;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void EditAndOverwriteOnEmployees(string groupName, double salary, IEnumerable<long> employeeIds,
|
||||
FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
FridayPay = fridayPay;
|
||||
OverTimePay = overTimePay;
|
||||
BaseYearsPay = baseYearsPay;
|
||||
BonusesPay = bonusesPay;
|
||||
NightWorkPay = nightWorkPay;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
ShiftPay = shiftPay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
LeavePay = leavePay;
|
||||
InsuranceDeduction = insuranceDeduction;
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
IsSettingChange = isSettingChange;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
public void EditAndOverwriteOnEmployees(string groupName, double salary, IEnumerable<long> employeeIds,
|
||||
FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
FridayPay = fridayPay;
|
||||
OverTimePay = overTimePay;
|
||||
BaseYearsPay = baseYearsPay;
|
||||
BonusesPay = bonusesPay;
|
||||
NightWorkPay = nightWorkPay;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
ShiftPay = shiftPay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
LeavePay = leavePay;
|
||||
InsuranceDeduction = insuranceDeduction;
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
HolidayWork = holidayWork;
|
||||
IsSettingChange = isSettingChange;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
|
||||
|
||||
var employeeSettingsShift = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
var employeeSettingsShift = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
var permittedToOverWrite = CustomizeWorkshopEmployeeSettingsCollection.Where(x => employeeIds.Contains(x.EmployeeId));
|
||||
foreach (var item in permittedToOverWrite)
|
||||
{
|
||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||
}
|
||||
}
|
||||
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
|
||||
FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||
{
|
||||
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
||||
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
||||
lateToWork, earlyExit);
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
IsSettingChange = isSettingChange;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
var permittedToOverWrite = CustomizeWorkshopEmployeeSettingsCollection.Where(x => employeeIds.Contains(x.EmployeeId));
|
||||
foreach (var item in permittedToOverWrite)
|
||||
{
|
||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||
}
|
||||
}
|
||||
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
|
||||
FridayPay fridayPay,
|
||||
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
|
||||
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
|
||||
{
|
||||
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
|
||||
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
|
||||
lateToWork, earlyExit);
|
||||
GroupName = groupName;
|
||||
Salary = salary;
|
||||
HolidayWork = holidayWork;
|
||||
IsSettingChange = isSettingChange;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
|
||||
|
||||
var employeeSettingsShift = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
var employeeSettingsShift = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
foreach (var item in CustomizeWorkshopEmployeeSettingsCollection)
|
||||
{
|
||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||
}
|
||||
}
|
||||
foreach (var item in CustomizeWorkshopEmployeeSettingsCollection)
|
||||
{
|
||||
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
|
||||
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
|
||||
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveEmployeeFromGroup(long employeeId)
|
||||
{
|
||||
var currentItem = CustomizeWorkshopEmployeeSettingsCollection.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
if (currentItem != null)
|
||||
CustomizeWorkshopEmployeeSettingsCollection.Remove(currentItem);
|
||||
}
|
||||
public void RemoveEmployeeFromGroup(long employeeId)
|
||||
{
|
||||
var currentItem = CustomizeWorkshopEmployeeSettingsCollection.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
if (currentItem != null)
|
||||
CustomizeWorkshopEmployeeSettingsCollection.Remove(currentItem);
|
||||
}
|
||||
|
||||
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
|
||||
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
{
|
||||
GroupName = groupName;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
|
||||
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
|
||||
|
||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||
IsShiftChange = isShiftChange;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||
IsShiftChange = isShiftChange;
|
||||
|
||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
if (isShiftChange)
|
||||
{
|
||||
HolidayWork = holidayWork;
|
||||
|
||||
}
|
||||
WeeklyOffDays = weeklyOffDays;
|
||||
|
||||
var permittedToOverWrite = CustomizeWorkshopEmployeeSettingsCollection.Where(x => employeeIds.Contains(x.EmployeeId));
|
||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
if (isShiftChange)
|
||||
{
|
||||
|
||||
foreach (var item in permittedToOverWrite)
|
||||
{
|
||||
var newRotatingShifts = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime))
|
||||
.ToList();
|
||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||
IrregularShift, WorkshopShiftStatus, BreakTime, false, FridayWork, HolidayWork, newRotatingShifts);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
var permittedToOverWrite = CustomizeWorkshopEmployeeSettingsCollection.Where(x => employeeIds.Contains(x.EmployeeId));
|
||||
|
||||
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
|
||||
FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
{
|
||||
GroupName = groupName;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
foreach (var item in permittedToOverWrite)
|
||||
{
|
||||
var employeeWeeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
var newRotatingShifts = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime))
|
||||
.ToList();
|
||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||
IrregularShift, WorkshopShiftStatus, BreakTime, false, HolidayWork, newRotatingShifts, employeeWeeklyOffDays);
|
||||
}
|
||||
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
}
|
||||
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
|
||||
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
|
||||
HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
GroupName = groupName;
|
||||
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
|
||||
IrregularShift = workshopShiftStatus == WorkshopShiftStatus.Regular ?
|
||||
new IrregularShift(new TimeOnly(), new TimeOnly(), WorkshopIrregularShifts.None)
|
||||
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
|
||||
|
||||
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
|
||||
|
||||
|
||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||
IsShiftChange = isShiftChange;
|
||||
HolidayWork = holidayWork;
|
||||
FridayWork = fridayWork;
|
||||
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
|
||||
IsShiftChange = isShiftChange;
|
||||
HolidayWork = holidayWork;
|
||||
|
||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
foreach (var item in CustomizeWorkshopEmployeeSettingsCollection)
|
||||
{
|
||||
var newRotatingShifts = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime))
|
||||
.ToList();
|
||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||
irregularShift, workshopShiftStatus, breakTime, false, FridayWork, HolidayWork, newRotatingShifts);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddEmployeeSettingToGroupWithGroupData(long employeeId, long workshopId)
|
||||
{
|
||||
var shifts = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
FridayPay fridayPay = new(FridayPay.FridayPayType, FridayPay.Value);
|
||||
OverTimePay overTimePay = new(OverTimePay.OverTimePayType, OverTimePay.Value);
|
||||
BaseYearsPay baseYearsPay = new(BaseYearsPay.BaseYearsPayType, BaseYearsPay.Value, BaseYearsPay.PaymentType);
|
||||
BonusesPay bonusesPay = new(BonusesPay.BonusesPayType, BonusesPay.Value, BonusesPay.PaymentType);
|
||||
NightWorkPay nightWorkPay = new(NightWorkPay.NightWorkingType, NightWorkPay.Value);
|
||||
MarriedAllowance marriedAllowance = new(MarriedAllowance.MarriedAllowanceType, MarriedAllowance.Value);
|
||||
ShiftPay shiftPay = new(ShiftType.None, ShiftPayType.None, 0);
|
||||
FamilyAllowance familyAllowance = new(FamilyAllowance.FamilyAllowanceType, FamilyAllowance.Value);
|
||||
LeavePay leavePay = new(LeavePay.LeavePayType, LeavePay.Value);
|
||||
InsuranceDeduction insuranceDeduction = new(InsuranceDeduction.InsuranceDeductionType, InsuranceDeduction.Value);
|
||||
FineAbsenceDeduction fineAbsenceDeduction = new(
|
||||
FineAbsenceDeduction.FineAbsenceDeductionType, FineAbsenceDeduction.Value,
|
||||
FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeek(x.DayOfWeek)).ToList()
|
||||
);
|
||||
LateToWork lateToWork = new(
|
||||
LateToWork.LateToWorkType,
|
||||
LateToWork.LateToWorkTimeFines.Select(x => new LateToWorkTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), LateToWork.Value
|
||||
);
|
||||
EarlyExit earlyExit = new(EarlyExit.EarlyExitType,
|
||||
EarlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), EarlyExit.Value);
|
||||
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
|
||||
IrregularShift.WorkshopIrregularShifts);
|
||||
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
|
||||
|
||||
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
|
||||
|
||||
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||
earlyExit, employeeId, workshopId, Salary, id, shifts, FridayWork, HolidayWork, irregularShift,
|
||||
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift);
|
||||
|
||||
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
|
||||
}
|
||||
WeeklyOffDays = weeklyOffDays;
|
||||
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
|
||||
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
|
||||
private void SetValueObjects(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
||||
BonusesPay bonusesPay
|
||||
, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit)
|
||||
{
|
||||
FridayPay = new(fridayPay.FridayPayType, fridayPay.Value);
|
||||
OverTimePay = new(overTimePay.OverTimePayType, overTimePay.Value);
|
||||
BaseYearsPay = new(baseYearsPay.BaseYearsPayType, baseYearsPay.Value, baseYearsPay.PaymentType);
|
||||
BonusesPay = new(bonusesPay.BonusesPayType, bonusesPay.Value, bonusesPay.PaymentType);
|
||||
NightWorkPay = new(nightWorkPay.NightWorkingType, nightWorkPay.Value);
|
||||
MarriedAllowance = new(marriedAllowance.MarriedAllowanceType, marriedAllowance.Value);
|
||||
ShiftPay = new(shiftPay.ShiftType, shiftPay.ShiftPayType, shiftPay.Value);
|
||||
FamilyAllowance = new(familyAllowance.FamilyAllowanceType, familyAllowance.Value);
|
||||
LeavePay = new(leavePay.LeavePayType, leavePay.Value);
|
||||
InsuranceDeduction = new(insuranceDeduction.InsuranceDeductionType, insuranceDeduction.Value);
|
||||
FineAbsenceDeduction = new(
|
||||
fineAbsenceDeduction.FineAbsenceDeductionType, fineAbsenceDeduction.Value,
|
||||
fineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeek(x.DayOfWeek)).ToList()
|
||||
);
|
||||
LateToWork = new(
|
||||
lateToWork.LateToWorkType,
|
||||
lateToWork.LateToWorkTimeFines.Select(x => new LateToWorkTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), lateToWork.Value
|
||||
);
|
||||
EarlyExit = new(earlyExit.EarlyExitType,
|
||||
earlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), earlyExit.Value);
|
||||
}
|
||||
foreach (var item in CustomizeWorkshopEmployeeSettingsCollection)
|
||||
{
|
||||
var employeeWeeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
var newRotatingShifts = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime))
|
||||
.ToList();
|
||||
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
|
||||
irregularShift, workshopShiftStatus, breakTime, false, HolidayWork, newRotatingShifts, employeeWeeklyOffDays);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddEmployeeSettingToGroupWithGroupData(long employeeId, long workshopId)
|
||||
{
|
||||
var shifts = CustomizeWorkshopGroupSettingsShifts
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
FridayPay fridayPay = new(FridayPay.FridayPayType, FridayPay.Value);
|
||||
OverTimePay overTimePay = new(OverTimePay.OverTimePayType, OverTimePay.Value);
|
||||
BaseYearsPay baseYearsPay = new(BaseYearsPay.BaseYearsPayType, BaseYearsPay.Value, BaseYearsPay.PaymentType);
|
||||
BonusesPay bonusesPay = new(BonusesPay.BonusesPayType, BonusesPay.Value, BonusesPay.PaymentType);
|
||||
NightWorkPay nightWorkPay = new(NightWorkPay.NightWorkingType, NightWorkPay.Value);
|
||||
MarriedAllowance marriedAllowance = new(MarriedAllowance.MarriedAllowanceType, MarriedAllowance.Value);
|
||||
ShiftPay shiftPay = new(ShiftType.None, ShiftPayType.None, 0);
|
||||
FamilyAllowance familyAllowance = new(FamilyAllowance.FamilyAllowanceType, FamilyAllowance.Value);
|
||||
LeavePay leavePay = new(LeavePay.LeavePayType, LeavePay.Value);
|
||||
InsuranceDeduction insuranceDeduction = new(InsuranceDeduction.InsuranceDeductionType, InsuranceDeduction.Value);
|
||||
FineAbsenceDeduction fineAbsenceDeduction = new(
|
||||
FineAbsenceDeduction.FineAbsenceDeductionType, FineAbsenceDeduction.Value,
|
||||
FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeek(x.DayOfWeek)).ToList()
|
||||
);
|
||||
LateToWork lateToWork = new(
|
||||
LateToWork.LateToWorkType,
|
||||
LateToWork.LateToWorkTimeFines.Select(x => new LateToWorkTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), LateToWork.Value
|
||||
);
|
||||
EarlyExit earlyExit = new(EarlyExit.EarlyExitType,
|
||||
EarlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), EarlyExit.Value);
|
||||
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
|
||||
IrregularShift.WorkshopIrregularShifts);
|
||||
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
|
||||
List<WeeklyOffDay> weeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
|
||||
|
||||
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
|
||||
|
||||
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
|
||||
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
|
||||
earlyExit, employeeId, workshopId, Salary, id, shifts, HolidayWork, irregularShift,
|
||||
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift, weeklyOffDays);
|
||||
|
||||
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
|
||||
}
|
||||
|
||||
|
||||
//public void OverWriteEmployeesShiftAndSalary(IEnumerable<long> ids,ICollection<RollCallWorkshopEmployeeSettingsShift> employeeSettingsShifts,double salary)
|
||||
//{
|
||||
// var permittedToOverWrite= RollCallWorkshopEmployeeSettingsCollection.Where(x => ids.Contains(x.id));
|
||||
// foreach (var item in permittedToOverWrite)
|
||||
// {
|
||||
// item.OverWriteSalaryAndShift(employeeSettingsShifts, salary);
|
||||
// }
|
||||
//}
|
||||
private void SetValueObjects(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
|
||||
BonusesPay bonusesPay
|
||||
, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction,
|
||||
LateToWork lateToWork, EarlyExit earlyExit)
|
||||
{
|
||||
FridayPay = new(fridayPay.FridayPayType, fridayPay.Value);
|
||||
OverTimePay = new(overTimePay.OverTimePayType, overTimePay.Value);
|
||||
BaseYearsPay = new(baseYearsPay.BaseYearsPayType, baseYearsPay.Value, baseYearsPay.PaymentType);
|
||||
BonusesPay = new(bonusesPay.BonusesPayType, bonusesPay.Value, bonusesPay.PaymentType);
|
||||
NightWorkPay = new(nightWorkPay.NightWorkingType, nightWorkPay.Value);
|
||||
MarriedAllowance = new(marriedAllowance.MarriedAllowanceType, marriedAllowance.Value);
|
||||
ShiftPay = new(shiftPay.ShiftType, shiftPay.ShiftPayType, shiftPay.Value);
|
||||
FamilyAllowance = new(familyAllowance.FamilyAllowanceType, familyAllowance.Value);
|
||||
LeavePay = new(leavePay.LeavePayType, leavePay.Value);
|
||||
InsuranceDeduction = new(insuranceDeduction.InsuranceDeductionType, insuranceDeduction.Value);
|
||||
FineAbsenceDeduction = new(
|
||||
fineAbsenceDeduction.FineAbsenceDeductionType, fineAbsenceDeduction.Value,
|
||||
fineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeek(x.DayOfWeek)).ToList()
|
||||
);
|
||||
LateToWork = new(
|
||||
lateToWork.LateToWorkType,
|
||||
lateToWork.LateToWorkTimeFines.Select(x => new LateToWorkTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), lateToWork.Value
|
||||
);
|
||||
EarlyExit = new(earlyExit.EarlyExitType,
|
||||
earlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), earlyExit.Value);
|
||||
}
|
||||
|
||||
|
||||
//public void OverWriteEmployeesShiftAndSalary(IEnumerable<long> ids,ICollection<RollCallWorkshopEmployeeSettingsShift> employeeSettingsShifts,double salary)
|
||||
//{
|
||||
// var permittedToOverWrite= RollCallWorkshopEmployeeSettingsCollection.Where(x => ids.Contains(x.id));
|
||||
// foreach (var item in permittedToOverWrite)
|
||||
// {
|
||||
// item.OverWriteSalaryAndShift(employeeSettingsShifts, salary);
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
|
||||
public CustomizeWorkshopSettings(long workshopId,
|
||||
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
|
||||
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
||||
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
FridayPay = new FridayPay(FridayPayType.None, 0);
|
||||
OverTimePay = new OverTimePay(OverTimePayType.None, 0);
|
||||
@@ -38,11 +38,10 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
OverTimeThresholdMinute = 0;
|
||||
Currency = Currency.Rial;
|
||||
MaxMonthDays = MaxMonthDays.Default;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
BonusesPaysInEndOfMonth = BonusesPaysInEndOfYear.EndOfYear;
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
|
||||
WeeklyOffDays = weeklyOffDays;
|
||||
HolidayWork = holidayWork;
|
||||
if (workshopShiftStatus == WorkshopShiftStatus.Irregular)
|
||||
return;
|
||||
|
||||
@@ -92,8 +91,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
public void Edit(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay,
|
||||
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
|
||||
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
|
||||
FridayWork fridayWork, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
|
||||
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
|
||||
int leavePermittedDays, BaseYearsPayInEndOfYear baseYearsPayInEndOfYear, int overTimeThresholdMinute)
|
||||
{
|
||||
FridayPay = fridayPay;
|
||||
@@ -109,7 +107,6 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
FineAbsenceDeduction = fineAbsenceDeduction;
|
||||
LateToWork = lateToWork;
|
||||
EarlyExit = earlyExit;
|
||||
FridayWork = fridayWork;
|
||||
HolidayWork = holidayWork;
|
||||
BonusesPaysInEndOfMonth = bonusesPaysInEndOfYear;
|
||||
LeavePermittedDays = leavePermittedDays;
|
||||
@@ -127,19 +124,18 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
|
||||
}
|
||||
|
||||
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
|
||||
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
|
||||
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
|
||||
{
|
||||
WorkshopShiftStatus = workshopShiftStatus;
|
||||
HolidayWork = holidayWork;
|
||||
FridayWork = fridayWork;
|
||||
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
|
||||
WeeklyOffDays = weeklyOffDays;
|
||||
|
||||
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
|
||||
{
|
||||
var date = new DateOnly();
|
||||
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
|
||||
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
|
||||
|
||||
|
||||
if (lastEndShift > firstStartShift)
|
||||
firstStartShift = firstStartShift.AddDays(1);
|
||||
var offSet = (firstStartShift - lastEndShift).Divide(2);
|
||||
|
||||
@@ -3,36 +3,110 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeComputeOptionsAgg
|
||||
{
|
||||
public class EmployeeComputeOptions : EntityBase
|
||||
{
|
||||
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
}
|
||||
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions,
|
||||
bool createContract, bool signContract, bool createCheckout, bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
|
||||
public long WorkshopId { get; private set;}
|
||||
public long EmployeeId { get; private set;}
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
|
||||
//نحوه محاسبه مزد مرخصی
|
||||
public string ComputeOptions { get; private set; }
|
||||
//نحوه محاسبه عیدی
|
||||
public string BonusesOptions { get; private set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; private set; }
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
//نحوه محاسبه مزد مرخصی
|
||||
public string ComputeOptions { get; private set; }
|
||||
//نحوه محاسبه عیدی
|
||||
public string BonusesOptions { get; private set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; private set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; private set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; private set; }
|
||||
|
||||
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SetContractAndCheckoutOptions(bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout)
|
||||
{
|
||||
CreateContract = createContract;
|
||||
if (createContract)
|
||||
{
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
if (createCheckout)
|
||||
{
|
||||
SignCheckout = signCheckout;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignCheckout = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SignContract = false;
|
||||
CreateCheckout = false;
|
||||
SignCheckout = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
#region Mahan
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId,int month,int year);
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
namespace Company.Domain.LeftWorkAgg;
|
||||
|
||||
@@ -46,4 +47,11 @@ public interface ILeftWorkRepository : IRepository<long, LeftWork>
|
||||
|
||||
Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId);
|
||||
List<LeftWorkViewModel> SearchCreateContract(LeftWorkSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات کارگاه و پرسنل برای ایجاد قرارداد
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
AutoExtensionDto AutoExtentionEmployees(long workshopId);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Company.Domain.RollCallAgg;
|
||||
|
||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
{
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
@@ -76,23 +77,13 @@ public class Workshop : EntityBase
|
||||
ClientEmployeeWorkshopList = new List<ClientEmployeeWorkshop>();
|
||||
}
|
||||
|
||||
|
||||
//public Workshop()
|
||||
//{
|
||||
// Contracts2 = new List<Contract>();
|
||||
// WorkshopEmployers = new List<WorkshopEmployer>();
|
||||
// LeftWorks = new List<LeftWork>();
|
||||
// LeftWorkInsurances = new List<LeftWorkInsurance>();
|
||||
// EmployersList = new List<Employer>();
|
||||
// WorkshopEmployers = new List<WorkshopEmployer>();
|
||||
// EmployersList = new List<Employer>();
|
||||
// PersonnelCodeList = new List<PersonnelCodeDomain>();
|
||||
//}
|
||||
|
||||
|
||||
public Workshop(string workshopName,string workshopSureName, string insuranceCode, string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
|
||||
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -136,6 +127,13 @@ public class Workshop : EntityBase
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
CreateContract = createContract;
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
SignCheckout = signCheckout;
|
||||
CutContractEndOfYear = cutContractEndOfYear;
|
||||
RotatingShiftCompute = rotatingShiftCompute;
|
||||
IsStaticCheckout = isStaticCheckout;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,9 +208,32 @@ public class Workshop : EntityBase
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; private set; }
|
||||
|
||||
public bool CreateContract { get; private set; }
|
||||
public bool SignContract { get; private set; }
|
||||
public bool CreateCheckout { get; private set; }
|
||||
public bool SignCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; private set; }
|
||||
//public Employer Employer { get; private set; }
|
||||
|
||||
public Workshop()
|
||||
/// <summary>
|
||||
/// محاسبه نوبت کاری در فیش حقوقی
|
||||
/// </summary>
|
||||
public bool RotatingShiftCompute { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; private set; }
|
||||
|
||||
public Workshop()
|
||||
{
|
||||
RollCallServicesList = new List<RollCallService>();
|
||||
CustomizeCheckouts = new List<CustomizeCheckout>();
|
||||
@@ -243,7 +264,7 @@ public class Workshop : EntityBase
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population, long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay,
|
||||
bool totalPaymentHide, bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear, bool rotatingShiftCompute, bool isStaticCheckout)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -284,6 +305,13 @@ public class Workshop : EntityBase
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
CreateContract = createContract;
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
SignCheckout = signCheckout;
|
||||
CutContractEndOfYear = cutContractEndOfYear;
|
||||
RotatingShiftCompute = rotatingShiftCompute;
|
||||
IsStaticCheckout = isStaticCheckout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagement.Infrastructure.Excel.CWS;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Style;
|
||||
using System.Drawing;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Excel.InstitutionContract;
|
||||
|
||||
public class InstitutionContractExcelGenerator
|
||||
{
|
||||
|
||||
public static byte[] GenerateExcel(List<InstitutionContractViewModel> institutionContractViewModels)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
using var package = new ExcelPackage();
|
||||
var allWorksheet = package.Workbook.Worksheets.Add("همه");
|
||||
|
||||
var blueWorksheet = package.Workbook.Worksheets.Add("آبی");
|
||||
blueWorksheet.TabColor = Color.LightBlue;
|
||||
|
||||
var grayWorksheet = package.Workbook.Worksheets.Add("خاکستری");
|
||||
grayWorksheet.TabColor = Color.LightGray;
|
||||
|
||||
var redWorksheet = package.Workbook.Worksheets.Add("قرمز");
|
||||
redWorksheet.TabColor = Color.LightCoral;
|
||||
|
||||
var purpleWorksheet = package.Workbook.Worksheets.Add("بنفش");
|
||||
purpleWorksheet.TabColor = Color.MediumPurple;
|
||||
|
||||
var blackWorksheet = package.Workbook.Worksheets.Add("مشکی");
|
||||
blackWorksheet.TabColor = Color.DimGray;
|
||||
|
||||
var yellowWorksheet = package.Workbook.Worksheets.Add("زرد");
|
||||
yellowWorksheet.TabColor = Color.Yellow;
|
||||
|
||||
var whiteWorksheet = package.Workbook.Worksheets.Add("سفید");
|
||||
whiteWorksheet.TabColor = Color.White;
|
||||
|
||||
|
||||
CreateExcelSheet(institutionContractViewModels, allWorksheet);
|
||||
|
||||
var blueContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "blue").ToList();
|
||||
CreateExcelSheet(blueContracts, blueWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(blueContracts).ToList();
|
||||
|
||||
var grayContracts = institutionContractViewModels.Where(x => x.IsContractingPartyBlock == "true").ToList();
|
||||
CreateExcelSheet(grayContracts, grayWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(grayContracts).ToList();
|
||||
|
||||
var redContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "red").ToList();
|
||||
CreateExcelSheet(redContracts, redWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(redContracts).ToList();
|
||||
|
||||
var purpleContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "purple").ToList();
|
||||
CreateExcelSheet(purpleContracts, purpleWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(purpleContracts).ToList();
|
||||
|
||||
var blackContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "black").ToList();
|
||||
CreateExcelSheet(blackContracts, blackWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(blackContracts).ToList();
|
||||
|
||||
var yellowContracts = institutionContractViewModels
|
||||
.Where(x => string.IsNullOrWhiteSpace(x.ExpireColor) && x.WorkshopCount == "0").ToList();
|
||||
CreateExcelSheet(yellowContracts, yellowWorksheet);
|
||||
institutionContractViewModels = institutionContractViewModels.Except(yellowContracts).ToList();
|
||||
|
||||
var otherContracts = institutionContractViewModels;
|
||||
CreateExcelSheet(otherContracts, whiteWorksheet);
|
||||
|
||||
return package.GetAsByteArray();
|
||||
}
|
||||
|
||||
private static void CreateExcelSheet(List<InstitutionContractViewModel> institutionContractViewModels, ExcelWorksheet worksheet)
|
||||
{
|
||||
// Headers
|
||||
worksheet.Cells[1, 1].Value = "شماره قرارداد";
|
||||
worksheet.Cells[1, 2].Value = "طرف حساب";
|
||||
worksheet.Cells[1, 3].Value = "شماره کارفرما";
|
||||
worksheet.Cells[1, 4].Value = "کارفرما ها";
|
||||
worksheet.Cells[1, 5].Value = "کارگاه ها";
|
||||
worksheet.Cells[1, 6].Value = "مجبوع پرسنل";
|
||||
worksheet.Cells[1, 7].Value = "شروع قرارداد";
|
||||
worksheet.Cells[1, 8].Value = "پایان قرارداد";
|
||||
worksheet.Cells[1, 9].Value = "مبلغ قرارداد (بدون کارگاه)";
|
||||
worksheet.Cells[1, 10].Value = "مبلغ قرارداد";
|
||||
worksheet.Cells[1, 11].Value = "وضعیت مالی";
|
||||
|
||||
using (var range = worksheet.Cells[1, 1, 1, 11])
|
||||
{
|
||||
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
range.Style.Font.Bold = true;
|
||||
range.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
range.Style.Fill.BackgroundColor.SetColor(Color.LightGray); // رنگ پس زمینه خاکستری
|
||||
|
||||
// اعمال بوردر به همه خطوط
|
||||
range.Style.Border.Top.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Left.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Right.Style = ExcelBorderStyle.Thin;
|
||||
|
||||
// اعمال رنگ مشکی برای بوردرها
|
||||
range.Style.Border.Top.Color.SetColor(Color.Black);
|
||||
range.Style.Border.Bottom.Color.SetColor(Color.Black);
|
||||
range.Style.Border.Left.Color.SetColor(Color.Black);
|
||||
range.Style.Border.Right.Color.SetColor(Color.Black);
|
||||
}
|
||||
|
||||
int row = 2;
|
||||
|
||||
for (int i = 0; i < institutionContractViewModels.Count; i++)
|
||||
{
|
||||
var contract = institutionContractViewModels[i];
|
||||
var employers = contract.EmployerViewModels?.ToList() ?? new();
|
||||
var workshops = contract.WorkshopViewModels?.ToList() ?? new();
|
||||
|
||||
int maxRows = Math.Max(employers.Count, workshops.Count);
|
||||
maxRows = Math.Max(1, maxRows);
|
||||
|
||||
int startRow = row;
|
||||
int endRow = row + maxRows - 1;
|
||||
|
||||
// 🎨 دریافت رنگ پسزمینه از مقدار رنگ موجود در داده
|
||||
string colorName = contract.ExpireColor.ToLower();
|
||||
var fillColor = GetColorByName(colorName, contract.WorkshopCount, contract.IsContractingPartyBlock);
|
||||
|
||||
for (int j = 0; j < maxRows; j++)
|
||||
{
|
||||
int currentRow = row + j;
|
||||
|
||||
worksheet.Cells[currentRow, 4].Value = j < employers.Count ? employers[j].FullName : null;
|
||||
worksheet.Cells[currentRow, 5].Value = j < workshops.Count ? workshops[j].WorkshopFullName : null;
|
||||
|
||||
for (int col = 1; col <= 11; col++)
|
||||
{
|
||||
var cell = worksheet.Cells[currentRow, col];
|
||||
|
||||
// 📏 بوردرهای داخلی نازک / نقطهچین
|
||||
cell.Style.Border.Top.Style = ExcelBorderStyle.Dotted;
|
||||
cell.Style.Border.Bottom.Style = ExcelBorderStyle.Dotted;
|
||||
cell.Style.Border.Left.Style = ExcelBorderStyle.Thin;
|
||||
cell.Style.Border.Right.Style = ExcelBorderStyle.Thin;
|
||||
|
||||
// 🎯 تراز متن
|
||||
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
|
||||
// 🎨 اعمال رنگ پسزمینه
|
||||
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
cell.Style.Fill.BackgroundColor.SetColor(fillColor);
|
||||
}
|
||||
}
|
||||
|
||||
// 🧱 مرج و مقداردهی ستونهای اصلی
|
||||
worksheet.Cells[startRow, 1, endRow, 1].Merge = true;
|
||||
worksheet.Cells[startRow, 1].Value = contract.ContractNo;
|
||||
|
||||
worksheet.Cells[startRow, 2, endRow, 2].Merge = true;
|
||||
worksheet.Cells[startRow, 2].Value = contract.ContractingPartyName;
|
||||
|
||||
worksheet.Cells[startRow, 3, endRow, 3].Merge = true;
|
||||
worksheet.Cells[startRow, 3].Value = contract.ArchiveCode;
|
||||
|
||||
worksheet.Cells[startRow, 6, endRow, 6].Merge = true;
|
||||
worksheet.Cells[startRow, 6].Value = contract.EmployeeCount;
|
||||
|
||||
worksheet.Cells[startRow, 7, endRow, 7].Merge = true;
|
||||
worksheet.Cells[startRow, 7].Value = contract.ContractStartFa;
|
||||
|
||||
worksheet.Cells[startRow, 8, endRow, 8].Merge = true;
|
||||
worksheet.Cells[startRow, 8].Value = contract.ContractEndFa;
|
||||
|
||||
worksheet.Cells[startRow, 9, endRow, 9].Merge = true;
|
||||
var contractWithoutWorkshopAmountCell = worksheet.Cells[startRow, 9];
|
||||
contractWithoutWorkshopAmountCell.Value = contract.WorkshopCount == "0" ? MoneyToDouble(contract.ContractAmount) : "";
|
||||
contractWithoutWorkshopAmountCell.Style.Numberformat.Format = "#,##0";
|
||||
|
||||
|
||||
worksheet.Cells[startRow, 10, endRow, 10].Merge = true;
|
||||
var contractAmountCell = worksheet.Cells[startRow, 10];
|
||||
contractAmountCell.Value = contract.WorkshopCount != "0" ? MoneyToDouble(contract.ContractAmount) : "";
|
||||
contractAmountCell.Style.Numberformat.Format = "#,##0";
|
||||
|
||||
|
||||
worksheet.Cells[startRow, 11, endRow, 11].Merge = true;
|
||||
var balance = MoneyToDouble(contract.BalanceStr);
|
||||
var balanceCell = worksheet.Cells[startRow, 11];
|
||||
balanceCell.Value = balance;
|
||||
balanceCell.Style.Numberformat.Format = "#,##0";
|
||||
|
||||
if (balance > 0)
|
||||
balanceCell.Style.Font.Color.SetColor(Color.Red);
|
||||
else if (balance < 0)
|
||||
balanceCell.Style.Font.Color.SetColor(Color.Green);
|
||||
|
||||
// 📦 بوردر ضخیم خارجی برای هر سطر
|
||||
var boldRange = worksheet.Cells[startRow, 1, endRow, 11];
|
||||
boldRange.Style.Border.BorderAround(ExcelBorderStyle.Medium);
|
||||
|
||||
row += maxRows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
|
||||
worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
|
||||
worksheet.PrinterSettings.FitToPage = true;
|
||||
worksheet.PrinterSettings.FitToWidth = 1;
|
||||
worksheet.PrinterSettings.FitToHeight = 0;
|
||||
worksheet.PrinterSettings.Scale = 85;
|
||||
int contractNoCol = 1;
|
||||
int contractingPartyNameCol = 2;
|
||||
int archiveNoCol = 3;
|
||||
int employersCol = 4;
|
||||
int workshopsCol = 5;
|
||||
int employeeCountCol = 6;
|
||||
int startContractCol = 7;
|
||||
int endContractCol = 8;
|
||||
int contractWithoutWorkshopAmountCol = 9;
|
||||
int contractAmountCol = 10;
|
||||
int balanceCol = 11;
|
||||
worksheet.Columns[contractNoCol].Width = 17;
|
||||
worksheet.Columns[contractingPartyNameCol].Width = 40;
|
||||
worksheet.Columns[archiveNoCol].Width = 10;
|
||||
worksheet.Columns[employersCol].Width = 40;
|
||||
worksheet.Columns[workshopsCol].Width = 45;
|
||||
worksheet.Columns[employeeCountCol].Width = 12;
|
||||
worksheet.Columns[startContractCol].Width = 12;
|
||||
worksheet.Columns[endContractCol].Width = 12;
|
||||
worksheet.Columns[contractWithoutWorkshopAmountCol].Width = 18;
|
||||
worksheet.Columns[contractAmountCol].Width = 12;
|
||||
worksheet.Columns[balanceCol].Width = 12;
|
||||
worksheet.View.RightToLeft = true; // فارسی
|
||||
//worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
|
||||
}
|
||||
|
||||
private static double MoneyToDouble(string value)
|
||||
{
|
||||
Console.WriteLine(value);
|
||||
var min = value.Length > 1 ? value.Substring(0, 2) : "";
|
||||
var test = min == "\u200e\u2212" ? value.MoneyToDouble() * -1 : value.MoneyToDouble();
|
||||
|
||||
Console.WriteLine(test);
|
||||
return test;
|
||||
}
|
||||
private static Color GetColorByName(string name, string workshopCount, string IsContractingPartyBlock)
|
||||
{
|
||||
return name switch
|
||||
{
|
||||
"blue" => Color.LightBlue,
|
||||
_ when IsContractingPartyBlock == "true" => Color.LightGray,
|
||||
"red" => Color.LightCoral,
|
||||
"purple" => Color.MediumPurple,
|
||||
"black" => Color.DimGray,
|
||||
var n when string.IsNullOrWhiteSpace(n) && workshopCount == "0" => Color.Yellow,
|
||||
_ => Color.White
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Style;
|
||||
using System.Drawing;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Excel.Temp;
|
||||
|
||||
public class GetAllContractingPartyExcelGenerator
|
||||
{
|
||||
public static byte[] GenerateExcel(List<DataExcelResult> dataList)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
using var package = new ExcelPackage();
|
||||
var archive99Sheet = package.Workbook.Worksheets.Add("کارگاه های 99");
|
||||
|
||||
var rollCallSheet = package.Workbook.Worksheets.Add("حضورغیابی");
|
||||
|
||||
var archive99Data = dataList.Where(x => x.Workshops.Any(a => a.ArchiveCode == "99")).ToList();
|
||||
CreateSheet(archive99Data, archive99Sheet);
|
||||
|
||||
CreateSheet(dataList.Where(x=>x.Workshops.Any(w=>w.HasRollCall)).ToList(), rollCallSheet);
|
||||
|
||||
|
||||
|
||||
return package.GetAsByteArray();
|
||||
}
|
||||
|
||||
private static void CreateSheet(List<DataExcelResult> dataList, ExcelWorksheet ws)
|
||||
{
|
||||
string[] headers = new[]
|
||||
{
|
||||
"ContractingPartyId", "نام طرف حساب", "EmployerId", "نام کارفرما", "WorkshopId", "کد کارگاه", "نام کارگاه",
|
||||
"خدمات قرارداد", "خدمات قرارداد حضوری", "خدمات بیمه", "خدمات بیمه حضوری",
|
||||
"خدمات حضورغیاب", "فیش حقوقی غیر رسمی", "تعداد استند", "تعداد ماه های بدهی قبلی برای حضورغیاب"
|
||||
};
|
||||
|
||||
for (int i = 0; i < headers.Length; i++)
|
||||
{
|
||||
var cell = ws.Cells[1, i + 1];
|
||||
cell.Value = headers[i];
|
||||
cell.Style.Font.Bold = true;
|
||||
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
cell.Style.Fill.BackgroundColor.SetColor(Color.LightGray);
|
||||
cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
|
||||
}
|
||||
|
||||
int row = 2;
|
||||
|
||||
foreach (var data in dataList)
|
||||
{
|
||||
int partyStartRow = row;
|
||||
|
||||
foreach (var workshop in data.Workshops)
|
||||
{
|
||||
int workshopStartRow = row;
|
||||
|
||||
var employers = workshop.Employers.Any()
|
||||
? workshop.Employers
|
||||
: new List<EmployerExcelResultData> { new() };
|
||||
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
ws.Cells[row, 1].Value = data.ContractingPartyId;
|
||||
ws.Cells[row, 2].Value = data.ContractingPartyName;
|
||||
ws.Cells[row, 3].Value = employer?.Id;
|
||||
ws.Cells[row, 4].Value = employer?.EmployerName;
|
||||
ws.Cells[row, 5].Value = workshop.Id;
|
||||
ws.Cells[row, 6].Value = workshop.ArchiveCode;
|
||||
ws.Cells[row, 7].Value = workshop.WorkshopName;
|
||||
ws.Cells[row, 8].Value = Convert.ToInt32(workshop.HasContract);
|
||||
ws.Cells[row, 9].Value = 0; // فرضی
|
||||
ws.Cells[row, 10].Value = Convert.ToInt32(workshop.HasInsurance);
|
||||
ws.Cells[row, 11].Value = 0; // فرضی
|
||||
ws.Cells[row, 12].Value = Convert.ToInt32(workshop.HasRollCall);
|
||||
ws.Cells[row, 13].Value = Convert.ToInt32(workshop.HasCustomizeCheckout);
|
||||
ws.Cells[row, 14].Value = 0;
|
||||
ws.Cells[row, 15].Value = workshop.DebtRollCallMonth;
|
||||
|
||||
// 🌿 رنگ سبز برای سلولهایی که مقدارشان 1 است (True)
|
||||
int[] boolCols = new[] { 8, 10, 12, 13, 14, 15 };
|
||||
foreach (var col in boolCols)
|
||||
{
|
||||
var cell = ws.Cells[row, col];
|
||||
if (Convert.ToInt32(cell.Value) > 0)
|
||||
{
|
||||
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
cell.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(198, 239, 206)); // سبز اکسل
|
||||
}
|
||||
}
|
||||
|
||||
// Style: وسطچین + بوردر نازک برای همه سلولها
|
||||
for (int col = 1; col <= 15; col++)
|
||||
{
|
||||
var cell = ws.Cells[row, col];
|
||||
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
cell.Style.Border.Top.Style = ExcelBorderStyle.Thin;
|
||||
cell.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
|
||||
cell.Style.Border.Left.Style = ExcelBorderStyle.Thin;
|
||||
cell.Style.Border.Right.Style = ExcelBorderStyle.Thin;
|
||||
}
|
||||
|
||||
row++;
|
||||
}
|
||||
|
||||
// Merge Workshop Columns
|
||||
if (employers.Count > 1)
|
||||
{
|
||||
for (int col = 5; col <= 15; col++)
|
||||
{
|
||||
ws.Cells[workshopStartRow, col, row - 1, col].Merge = true;
|
||||
var merged = ws.Cells[workshopStartRow, col, row - 1, col];
|
||||
merged.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
merged.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge Contracting Party Columns
|
||||
if (row - partyStartRow > 1)
|
||||
{
|
||||
for (int col = 1; col <= 2; col++)
|
||||
{
|
||||
ws.Cells[partyStartRow, col, row - 1, col].Merge = true;
|
||||
var merged = ws.Cells[partyStartRow, col, row - 1, col];
|
||||
merged.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
merged.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
}
|
||||
}
|
||||
|
||||
// میتونی در صورت نیاز خط بالا و پایین ضخیم برای گروهها رو هم فعال کنی اینجا
|
||||
// for (int col = 1; col <= 15; col++)
|
||||
// {
|
||||
// ws.Cells[partyStartRow, col].Style.Border.Top.Style = ExcelBorderStyle.Medium;
|
||||
// ws.Cells[row - 1, col].Style.Border.Bottom.Style = ExcelBorderStyle.Medium;
|
||||
// }
|
||||
}
|
||||
|
||||
ws.Cells.AutoFitColumns();
|
||||
ws.View.RightToLeft = true;
|
||||
}
|
||||
}
|
||||
|
||||
public class DataExcelResult
|
||||
{
|
||||
public long ContractingPartyId { get; set; }
|
||||
public string ContractingPartyName { get; set; }
|
||||
public List<WorkshopExcelResultData> Workshops { get; set; }
|
||||
}
|
||||
|
||||
public class EmployerExcelResultData
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string EmployerName { get; set; }
|
||||
}
|
||||
|
||||
public class WorkshopExcelResultData
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public bool HasContract { get; set; }
|
||||
public bool HasInsurance { get; set; }
|
||||
public bool HasRollCall { get; set; }
|
||||
public bool HasCustomizeCheckout { get; set; }
|
||||
public List<EmployerExcelResultData> Employers { get; set; }
|
||||
public int DebtRollCallMonth { get; set; }
|
||||
public string ArchiveCode { get; set; }
|
||||
}
|
||||
@@ -133,8 +133,117 @@ public class CheckoutViewModel
|
||||
/// </summary>
|
||||
public string TotalPaidLeave { get; set; }
|
||||
|
||||
|
||||
public bool HasSignCheckout { get; set; }
|
||||
|
||||
public TimeSpan TotalHourlyLeave { get; set; }
|
||||
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
|
||||
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
||||
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
|
||||
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class CheckoutRollCallViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// مجموع ساعت موظفی
|
||||
/// </summary>
|
||||
public TimeSpan TotalMandatoryTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت حضور
|
||||
/// </summary>
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public TimeSpan TotalPaidLeaveTmeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استعلاجی
|
||||
/// </summary>
|
||||
public TimeSpan TotalSickLeaveTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// روز های حضور غیاب
|
||||
/// </summary>
|
||||
public ICollection<CheckoutRollCallDayViewModel> RollCallDaysCollection { get; set; }
|
||||
}
|
||||
|
||||
public class CheckoutRollCallDayViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ
|
||||
/// </summary>
|
||||
public DateTime Date { get; set; }
|
||||
/// <summary>
|
||||
/// ورود اول
|
||||
/// </summary>
|
||||
public string FirstStartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج اول
|
||||
/// </summary>
|
||||
public string FirstEndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ورود دوم
|
||||
/// </summary>
|
||||
public string SecondStartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج دوم
|
||||
/// </summary>
|
||||
public string SecondEndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan BreakTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار زمان کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan WorkingTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا منقطع است؟
|
||||
/// </summary>
|
||||
public bool IsSliced { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا غیبت است
|
||||
/// </summary>
|
||||
public bool IsAbsent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه است
|
||||
/// </summary>
|
||||
public bool IsFriday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا تعطیل رسمی است
|
||||
/// </summary>
|
||||
public bool IsHoliday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
|
||||
/// </summary>
|
||||
public string LeaveType { get; set; }
|
||||
|
||||
public long CheckoutId { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
@@ -138,4 +139,20 @@ public class CreateCheckout
|
||||
|
||||
public string ShiftWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار در بیمه
|
||||
/// </summary>
|
||||
public bool HasInsuranceChekoutOverTime {get; set; }
|
||||
|
||||
|
||||
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
|
||||
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
}
|
||||
@@ -39,7 +39,11 @@ public class CreateCheckoutListViewModel
|
||||
|
||||
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// آیا پرسنل اجازه ایجاد قرارداد دارد
|
||||
/// </summary>
|
||||
public bool EmployeeHasCreateCheckout { get; set; }
|
||||
|
||||
|
||||
public bool HasWorkFlow { get; set; }
|
||||
public List<CreateCheckoutListViewModel> CreateCheckoutList { get; set; }
|
||||
}
|
||||
@@ -27,6 +27,14 @@ public interface ICheckoutApplication
|
||||
Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year,
|
||||
string month,
|
||||
string contractStart, string contractEnd);
|
||||
/// <summary>
|
||||
/// لیست تصفیه حساب
|
||||
/// جدید
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel);
|
||||
Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> PrintAll(List<long> id);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
|
||||
@@ -45,6 +46,15 @@ public class ComputingViewModel
|
||||
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
|
||||
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -63,6 +63,10 @@ public class ContractViweModel
|
||||
public string EmployeeLName { get; set; }
|
||||
|
||||
public string IsBlockCantracingParty { get; set; }
|
||||
/// <summary>
|
||||
/// آیا مجاز به امضاء قرادا می باشد
|
||||
/// </summary>
|
||||
public bool HasSignContract { get; set; }
|
||||
public IQueryable<WorkshopEmployerViewModel> WorkshopEmployerList { get; set; }
|
||||
public List<EmployerViewModel> Employers { get; set; }
|
||||
public List<WorkshopViewModel> Workshops { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
@@ -16,8 +17,9 @@ public class CreateCustomizeWorkshopGroupSettings
|
||||
public IrregularShift IrregularShift { get; set; }
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public int LeavePermittedDays { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
//public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public List<DayOfWeek> OffDayOfWeeks { get; set; }
|
||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using System;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
@@ -20,16 +21,18 @@ public class CreateCustomizeWorkshopSettings
|
||||
public BreakTime BreakTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه کار میکند یا نه
|
||||
/// </summary>
|
||||
public FridayWork FridayWork { get; set; }
|
||||
///// <summary>
|
||||
///// آیا جمعه کار میکند یا نه
|
||||
///// </summary>
|
||||
//public FridayWork FridayWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا در روز های تعطیل کار میکند
|
||||
/// </summary>
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
|
||||
public List<DayOfWeek> OffDays { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using System;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -20,7 +21,8 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
|
||||
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
//public FridayWork FridayWork { get; set; }
|
||||
public int LeavePermittedDays { get; set; }
|
||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
|
||||
public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
|
||||
@@ -18,4 +20,5 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public List<DayOfWeek> OffDayOfWeeks { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using System;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
@@ -72,17 +73,19 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
|
||||
/// </summary>
|
||||
public EarlyExitViewModel EarlyExit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه کار میکند یا نه
|
||||
/// </summary>
|
||||
public FridayWork FridayWork { get; set; }
|
||||
///// <summary>
|
||||
///// آیا جمعه کار میکند یا نه
|
||||
///// </summary>
|
||||
//public FridayWork FridayWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا در روز های تعطیل کار میکند
|
||||
/// </summary>
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
public string Salary { get; set; }
|
||||
public string NameGroup { get; set; }
|
||||
public string EmployeeFullName { get; set; }
|
||||
@@ -91,4 +94,5 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
|
||||
public IEnumerable<CustomizeWorkshopShiftViewModel> ShiftViewModel { get; set; }
|
||||
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShifts{ get; set; }
|
||||
public BreakTime BreakTime { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using System;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
|
||||
@@ -75,16 +77,18 @@ public class EditCustomizeWorkshopGroupSettings : CreateCustomizeWorkshopGroupSe
|
||||
/// </summary>
|
||||
public EarlyExitViewModel EarlyExit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه کار میکند یا نه
|
||||
/// </summary>
|
||||
public FridayWork FridayWork { get; set; }
|
||||
///// <summary>
|
||||
///// آیا جمعه کار میکند یا نه
|
||||
///// </summary>
|
||||
//public FridayWork FridayWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا در روز های تعطیل کار میکند
|
||||
/// </summary>
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
|
||||
//public List<DayOfWeek> WeeklyOffDays { get; set; }
|
||||
|
||||
public bool IsShiftChanged { get; set; }
|
||||
public bool IsSettingChanged { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
@@ -51,11 +52,14 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
/// </summary>
|
||||
/// <param name="shiftViewModels">شیفت هت</param>
|
||||
/// <param name="customizeWorkshopSettingsId">آیدی تنظیمات کارگاه</param>
|
||||
/// <param name="replaceChangedGroups"></param>
|
||||
/// <param name="workshopShiftStatus"></param>
|
||||
/// <param name="holidayWork"></param>
|
||||
/// <param name="weeklyOffDays"></param>
|
||||
/// <param name="replaceChangedGroups"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
|
||||
long customizeWorkshopSettingsId,WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork);
|
||||
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,
|
||||
HolidayWork holidayWork, List<DayOfWeek> weeklyOffDays);
|
||||
|
||||
// It will Get the Workshop Settings with its groups and the employees of groups.
|
||||
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);
|
||||
|
||||
@@ -28,6 +28,8 @@ public class CreateEmployeeByClient
|
||||
public List<AddEmployeeDocumentItem> EmployeeDocumentItems { get; set; }
|
||||
public bool HasEmployeeDocument { get; set; }
|
||||
public bool HasRollCallService { get; set; }
|
||||
public bool CanceledAuthorize { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public record EmployeeByNationalCodeInWorkshopViewModel
|
||||
public long PersonnelCode { get; set; }
|
||||
public List<EmployeeByNationalCodeEmployeeBankInfoViewModel> EmployeeBankInfos { get; set; }
|
||||
public EmployeeByNationalCodeEmployeeDocumentViewModel EmployeeDocument { get; set; }
|
||||
public bool AuthorizedCanceled { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ public class EmployeeDataFromApiViewModel
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public bool AuthorizedCanceled { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -17,5 +18,35 @@ namespace CompanyManagment.App.Contracts.EmployeeComputeOptions
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
|
||||
public class EmployeeComputeOptionsViewModel
|
||||
{
|
||||
@@ -12,4 +14,34 @@ public class EmployeeComputeOptionsViewModel
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public interface IInsuranceListApplication
|
||||
Task<OperationResult> ConfirmInsuranceOperation(InsuranceListConfirmOperation command);
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year);
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
@@ -32,6 +33,11 @@ public class InsuranceListViewModel
|
||||
public bool InspectionDone { get; set; }
|
||||
/// <summary>وضعیت بدهی</summary>
|
||||
public bool DebtDone { get; set; }
|
||||
/// <summary>وضعیت تاییدیه کارفرما</summary>
|
||||
/// <summary>تاییدیه کارفرما</summary>
|
||||
public bool EmployerApproved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع تاییدیه کارفرما
|
||||
/// </summary>
|
||||
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -30,4 +31,10 @@ public interface ILeftWorkApplication
|
||||
OperationResult CreateLeftWorkByLeftWorkGroups(string employeeFullName, long commandEmployeeId, List<PersonnelCodeViewModel> commandPersonnelCode, List<LeftWorkGroup> leftWorkGroups);
|
||||
OperationResult CheckDeleteLeftWork(long workshopId, long employeeId, string date, int type);
|
||||
OperationResult CheckEditLeftWork(long workshopId, long employeeId, string date, int type);
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات کارگاه و پرسنل برای ایجاد قرارداد
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
AutoExtensionDto AutoExtentionEmployees(long workshopId);
|
||||
}
|
||||
@@ -13,6 +13,10 @@ public class GroupedRollCalls
|
||||
public TimeSpan BreakTime { get; set; }
|
||||
public DateTime ShiftDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ های جمع کاری
|
||||
/// </summary>
|
||||
public DateTime? Fridays { get; set; }
|
||||
/// <summary>
|
||||
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
|
||||
/// </summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace CompanyManagment.App.Contracts.RollCall;
|
||||
public interface IRollCallMandatoryApplication
|
||||
{
|
||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
|
||||
@@ -6,10 +6,12 @@ public class ShiftList
|
||||
{
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime End { get; set; }
|
||||
/// <summary>
|
||||
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
|
||||
/// </summary>
|
||||
public TimeSpan LateEntryDuration { get; set; }
|
||||
|
||||
public DateTime EndWithOutResTime { get; set; }
|
||||
/// <summary>
|
||||
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
|
||||
/// </summary>
|
||||
public TimeSpan LateEntryDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعجیل در ورود (مدت زمانی که کارمند زودتر از زمان مشخص وارد شده است)
|
||||
|
||||
@@ -35,4 +35,6 @@ public class RollCallEmployeeViewModel : EditRollCallEmployee
|
||||
public string EmployeeFName { get; set; }
|
||||
public long RollCallEmployeeId { get; set; }
|
||||
public bool CreatedByClient { get; set; }
|
||||
public string RollCallEmployeeName { get; set; }
|
||||
public bool HasChangedName { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -26,4 +27,34 @@ public class ConnectedPersonnelViewModel
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.InsuranceJob;
|
||||
@@ -116,4 +117,39 @@ public class CreateWorkshop
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء قراداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجات تصفیه حساب
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء تصفیه حساب
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه نوبت کاری در فیش حقوقی
|
||||
/// </summary>
|
||||
public bool RotatingShiftCompute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تصفیه حساب بصورت استاتیک محاصبه شود
|
||||
/// </summary>
|
||||
public bool IsStaticCheckout { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AutoExtensionDto
|
||||
{
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا کارفرما خطای اطلاعات هویتی دارد
|
||||
/// </summary>
|
||||
public bool EmployerWarning { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پیام خطاهای کارفرما
|
||||
/// </summary>
|
||||
public string EmployerWarningMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا کارگاه پرسنل دارد
|
||||
/// </summary>
|
||||
public bool HavingPersonel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد بایگانی کارگاه
|
||||
/// </summary>
|
||||
public string ArchiveCode { get; set; }
|
||||
/// <summary>
|
||||
/// آدرس کارگاه
|
||||
/// </summary>
|
||||
public string WAddress1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی کارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست پرسنل
|
||||
/// </summary>
|
||||
public SelectList EmployeeSelectList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست پرسنل
|
||||
/// </summary>
|
||||
public List<AutoExtensionEmployeeListDto> EmployeeList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا مجاز به ایجاد قراداد است؟
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AutoExtensionEmployeeListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی پرسنل
|
||||
/// </summary>
|
||||
public long EmployeeId { get; set; }
|
||||
/// <summary>
|
||||
/// نام کامل پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد پرسنلی
|
||||
/// </summary>
|
||||
public long PersonnelCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سمت
|
||||
/// </summary>
|
||||
public string JobType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی شغل
|
||||
/// </summary>
|
||||
public long JobTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا پرسنل اجازه ایجاد قرارداد دارد
|
||||
/// </summary>
|
||||
public bool EmployeeHasCreateContract { get; set; }
|
||||
|
||||
|
||||
public string ContarctStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -80,5 +81,31 @@ public class WorkshopViewModel
|
||||
|
||||
public string HasRollCallFreeVip { get; set; }
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء قراداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجات تصفیه حساب
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء تصفیه حساب
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -14,6 +14,15 @@ using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using System.Globalization;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -27,11 +36,13 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
private readonly ILeaveApplication _leaveApplication;
|
||||
private readonly IMandatoryHoursApplication _mandatoryHoursApplication;
|
||||
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
|
||||
|
||||
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
|
||||
ILeftWorkRepository leftWorkRepository,
|
||||
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository)
|
||||
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication)
|
||||
{
|
||||
_checkoutRepository = checkoutRepository;
|
||||
_yearlySalaryRepository = yearlySalaryRepository;
|
||||
@@ -41,6 +52,8 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
_leaveApplication = leaveApplication;
|
||||
_mandatoryHoursApplication = mandatoryHoursApplication;
|
||||
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
|
||||
@@ -156,10 +169,16 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
//فوق العاده جمعه کاری
|
||||
command.FridayPay = fridayPercent * command.friday;
|
||||
}
|
||||
//حق بیمه سهم کارگر
|
||||
var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance) * 7 / 100;
|
||||
//حق بیمه سهم کارگر
|
||||
#region InsuranceDeduction
|
||||
|
||||
if (command.OvertimePay > 0 && command.AbsenceDeduction > 0)
|
||||
var insuranceOverTime = command.HasInsuranceChekoutOverTime ? command.OvertimePay : 0;
|
||||
var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + insuranceOverTime) * 7 / 100;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
if (command.OvertimePay > 0 && command.AbsenceDeduction > 0)
|
||||
{
|
||||
if (command.AbsenceDeduction >= command.OvertimePay)
|
||||
{
|
||||
@@ -189,6 +208,125 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
|
||||
|
||||
|
||||
|
||||
|
||||
var firstDayOfMonth = $"{command.ContractStart.Substring(0, 8)}01".ToGeorgianDateTime();
|
||||
var firstDayOfCurrentMonth = new DateTime(syear, smonth, 1, new PersianCalendar());
|
||||
|
||||
LeaveSearchModel sickLeaveSearch = new LeaveSearchModel()
|
||||
{
|
||||
EmployeeId = command.EmployeeId,
|
||||
WorkshopId = command.WorkshopId,
|
||||
StartLeaveGr = command.ContractStartGr,
|
||||
EndLeaveGr = command.ContractEndGr,
|
||||
IsAccepted = true,
|
||||
};
|
||||
var leaves = _leaveApplication.search(sickLeaveSearch);
|
||||
|
||||
firstDayOfMonth.AddMonthsFa(1, out var lastDayOfCurrentMonth);
|
||||
|
||||
lastDayOfCurrentMonth = lastDayOfCurrentMonth.AddDays(-1);
|
||||
|
||||
int dateRange = (int)(lastDayOfCurrentMonth - firstDayOfCurrentMonth).TotalDays + 1;
|
||||
|
||||
var holidays = _holidayItemApplication.Search(new HolidayItemSearchModel()
|
||||
{
|
||||
HolidayYear = command.ContractStartGr.ToFarsiYear()
|
||||
});
|
||||
//all the dates from start to end, to be compared with present days to get absent dates
|
||||
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => firstDayOfCurrentMonth.AddDays(offset).Date).ToList();
|
||||
|
||||
var absentRecords = completeDaysList
|
||||
.ExceptBy(command.GroupedRollCalls.Select(x => x.CreationDate.Date), y => y.Date)
|
||||
.Select(x =>
|
||||
{
|
||||
var leave = leaves.FirstOrDefault(y =>
|
||||
y.EmployeeId == command.EmployeeId && y.EndLeaveGr.Date >= x.Date && y.StartLeaveGr.Date <= x.Date);
|
||||
var isHoliday = holidays.Any(y => y.HolidaydateGr == x.Date);
|
||||
var isFriday = x.Date.DayOfWeek == DayOfWeek.Friday;
|
||||
var isNormalWorkingDay = isHoliday == false && isFriday == false;
|
||||
return new CheckoutDailyRollCallViewModel()
|
||||
{
|
||||
StartDate1 = null,
|
||||
EndDate1 = null,
|
||||
DateTimeGr = x.Date,
|
||||
DayOfWeek = x.Date.DayOfWeek.ToString(),
|
||||
RollCallDateFa = x.Date.ToFarsi(),
|
||||
LeaveType = leave != null ? leave.LeaveType : "",
|
||||
IsAbsent = leave == null && isNormalWorkingDay
|
||||
};
|
||||
});
|
||||
|
||||
var presentDays = command.GroupedRollCalls.Select(x =>
|
||||
{
|
||||
|
||||
var orderedRollcalls = x.ShiftList.OrderBy(y => y.Start);
|
||||
|
||||
var rollCallTimeSpanPerDay = x.SumOneDaySpan;
|
||||
TimeSpan breakTimePerDay = x.BreakTime;
|
||||
|
||||
return new CheckoutDailyRollCallViewModel()
|
||||
{
|
||||
StartDate1 = orderedRollcalls.FirstOrDefault().Start.ToString("HH:mm"),
|
||||
EndDate1 = orderedRollcalls.FirstOrDefault().EndWithOutResTime.ToString("HH:mm"),
|
||||
|
||||
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.Start.ToString("HH:mm") ?? "",
|
||||
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndWithOutResTime.ToString("HH:mm") ?? "",
|
||||
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay,
|
||||
|
||||
BreakTimeTimeSpan = breakTimePerDay,
|
||||
|
||||
DayOfWeek = x.CreationDate.DayOfWeek.DayOfWeeKToPersian(),
|
||||
RollCallDateFa = x.CreationDate.Date.ToFarsi(),
|
||||
DateTimeGr = x.CreationDate.Date,
|
||||
IsSliced = x.ShiftList.Count() > 2,
|
||||
IsAbsent = false
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel
|
||||
{
|
||||
StartDate1 = x.StartDate1,
|
||||
EndDate1 = x.EndDate1,
|
||||
EndDate2 = x.EndDate2,
|
||||
StartDate2 = x.StartDate2,
|
||||
TotalWorkingHours = $"{(int)(x.TotalhourseSpan.TotalHours)}:{x.TotalhourseSpan.Minutes:00}",
|
||||
BreakTimeString = $"{(int)(x.BreakTimeTimeSpan.TotalHours)}:{x.BreakTimeTimeSpan.Minutes:00}",
|
||||
TotalhourseSpan = x.TotalhourseSpan,
|
||||
BreakTimeTimeSpan = x.BreakTimeTimeSpan,
|
||||
DayOfWeek = x.DayOfWeek,
|
||||
RollCallDateFa = x.RollCallDateFa,
|
||||
DateTimeGr = x.DateTimeGr,
|
||||
IsSliced = x.IsSliced,
|
||||
IsAbsent = false
|
||||
});
|
||||
|
||||
var result = presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList();
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.IsHoliday = holidays.Any(y => x.DateTimeGr.Date == y.HolidaydateGr.Date);
|
||||
x.IsFriday = x.DateTimeGr.DayOfWeek == DayOfWeek.Friday;
|
||||
});
|
||||
|
||||
var checkoutRollCallDays = result.Select(x => new CheckoutRollCallDay(x.DateTimeGr,
|
||||
x.StartDate1, x.EndDate1, x.StartDate2, x.EndDate2,
|
||||
x.BreakTimeTimeSpan, x.IsSliced, x.TotalhourseSpan, x.IsAbsent, x.IsFriday, x.IsHoliday, x.LeaveType))
|
||||
.ToList();
|
||||
|
||||
|
||||
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(syear, smonth);
|
||||
int mandatoryWholeHours = (int)mandatoryHours;
|
||||
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
|
||||
|
||||
var totalMandatoryHours = TimeSpan.FromHours(mandatoryWholeHours).Add(TimeSpan.FromMinutes(mandatoryMinutes));
|
||||
var checkoutRollCall = new CheckoutRollCall(totalMandatoryHours, command.TotalPresentTimeSpan, command.TotalBreakTimeSpan,
|
||||
command.TotalWorkingTimeSpan, command.TotalPaidLeave, command.TotalSickLeave, checkoutRollCallDays);
|
||||
|
||||
|
||||
|
||||
|
||||
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
|
||||
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
|
||||
var totalClaims = totalClaimsDouble.ToMoney();
|
||||
@@ -215,7 +353,9 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
|
||||
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
|
||||
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
|
||||
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids);
|
||||
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
|
||||
loanInstallments, salaryAids,checkoutRollCall);
|
||||
|
||||
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
||||
//_checkoutRepository.SaveChanges();
|
||||
|
||||
@@ -246,9 +386,17 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
contractEnd);
|
||||
|
||||
}
|
||||
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
|
||||
{
|
||||
var result = new List<CheckoutViewModel>();
|
||||
|
||||
public Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel)
|
||||
{
|
||||
return _checkoutRepository.SearchCheckoutOptimized(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
watch.Start();
|
||||
var result = new List<CheckoutViewModel>();
|
||||
var query = await _checkoutRepository.SearchForMainCheckout(searchModel);
|
||||
query = query.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
@@ -275,22 +423,22 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
EmployerName = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.EmployerFullName,
|
||||
IsBlockCantracingParty = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.IsBlockContractingParty,
|
||||
}).ToList();
|
||||
//foreach (var items in query)
|
||||
//{
|
||||
// var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId);
|
||||
// if (s != null)
|
||||
// {
|
||||
// items.EmployerName = s.FirstOrDefault().EmployerFullName;
|
||||
// }
|
||||
// result.Add(items);
|
||||
// //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId)
|
||||
// // .Select(x => x.EmployerId).FirstOrDefault();
|
||||
// //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName;
|
||||
// // = employerName;
|
||||
//foreach (var items in query)
|
||||
//{
|
||||
// var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId);
|
||||
// if (s != null)
|
||||
// {
|
||||
// items.EmployerName = s.FirstOrDefault().EmployerFullName;
|
||||
// }
|
||||
// result.Add(items);
|
||||
// //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId)
|
||||
// // .Select(x => x.EmployerId).FirstOrDefault();
|
||||
// //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName;
|
||||
// // = employerName;
|
||||
|
||||
//}
|
||||
|
||||
return query;
|
||||
//}
|
||||
Console.WriteLine("old : " + watch.Elapsed);
|
||||
return query;
|
||||
|
||||
}
|
||||
|
||||
@@ -326,26 +474,32 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks));
|
||||
var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks));
|
||||
TimeSpan totalPresent = totalWorking + totalBreakTime;
|
||||
|
||||
if (x.HasRollCall)
|
||||
if (x.CheckoutRollCall == null)
|
||||
{
|
||||
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - x.TotalHourlyLeave;
|
||||
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
|
||||
totalPresent = totalWorking + totalBreakTime ;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
|
||||
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
|
||||
totalWorking = totalPresent - totalBreakTime;
|
||||
}
|
||||
|
||||
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
|
||||
x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
|
||||
x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
|
||||
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
|
||||
if (x.HasRollCall)
|
||||
{
|
||||
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) -
|
||||
x.TotalHourlyLeave;
|
||||
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
|
||||
totalPresent = totalWorking + totalBreakTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
|
||||
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
|
||||
totalWorking = totalPresent - totalBreakTime;
|
||||
}
|
||||
|
||||
x.TotalWorkingTimeStr =
|
||||
Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
|
||||
x.TotalBreakTimeStr =
|
||||
Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
|
||||
x.TotalPresentTimeStr =
|
||||
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
|
||||
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -375,7 +529,7 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
{
|
||||
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - result.TotalHourlyLeave;
|
||||
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
|
||||
totalPresent = totalWorking + totalBreakTime ;
|
||||
totalPresent = totalWorking + totalBreakTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ using Company.Domain.YearlySalaryAgg;
|
||||
using Company.Domain.YearlySalaryItemsAgg;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -39,6 +40,7 @@ public class ContractApplication : IContractApplication
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApp;
|
||||
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
|
||||
|
||||
public List<EmployerViewModel> EmpList;
|
||||
|
||||
@@ -54,7 +56,7 @@ public class ContractApplication : IContractApplication
|
||||
IYearlySalaryRepository yearlySalaryRepository,
|
||||
IYearlySalaryItemRepository yearlySalaryItemRepository
|
||||
, IEmployeeApplication employeeApplication, IEmployerApplication employerApplication, IWorkshopApplication workshopApplication, IEmployerRepository employerRepository,
|
||||
IWorkingHoursApplication workingHoursApplication, IWorkingHoursItemsApplication workingHoursItemsApplication, ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository, IWorkingHoursTempApplication workingHoursTempApplication, IPersonalContractingPartyApp contractingPartyApp)
|
||||
IWorkingHoursApplication workingHoursApplication, IWorkingHoursItemsApplication workingHoursItemsApplication, ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository, IWorkingHoursTempApplication workingHoursTempApplication, IPersonalContractingPartyApp contractingPartyApp, IEmployeeComputeOptionsApplication employeeComputeOptionsApplication)
|
||||
{
|
||||
_contractRepository = contractRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
@@ -70,6 +72,7 @@ public class ContractApplication : IContractApplication
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_workingHoursTempApplication = workingHoursTempApplication;
|
||||
_contractingPartyApp = contractingPartyApp;
|
||||
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
|
||||
|
||||
//_leftWorkApplication = leftWorkApplication;
|
||||
}
|
||||
@@ -3155,7 +3158,7 @@ public class ContractApplication : IContractApplication
|
||||
EmployeeFName = x.EmployeeFName,
|
||||
EmployeeLName = x.EmployeeLName,
|
||||
IsBlockCantracingParty = _contractingPartyApp.IsBlockByEmployerId(x.EmployerId),
|
||||
|
||||
HasSignContract = _employeeComputeOptionsApplication.GetEmployeeOptions(x.WorkshopIds,x.EmployeeId).SignContract
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -197,6 +197,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -995,10 +996,24 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
//{
|
||||
// return op.Failed("این پرسنل قبلا افزوده شده است و در انتظار تایید میباشد");
|
||||
//}
|
||||
|
||||
|
||||
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(command.NationalCode);
|
||||
|
||||
var workshop = _WorkShopRepository.GetDetails(command.WorkshopId);
|
||||
if (employee == null)
|
||||
|
||||
if (employee == null && command.CanceledAuthorize)
|
||||
{
|
||||
var birthDate = command.BirthDate.ToGeorgianDateTime();
|
||||
var dateOfIssue = new DateTime(1922, 1, 1);
|
||||
|
||||
employee = new Employee(command.FirstName, command.LastName, null, birthDate,
|
||||
dateOfIssue, null, command.NationalCode, null, command.Gender, "ایرانی", null, null);
|
||||
_EmployeeRepository.Create(employee);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
}
|
||||
if (employee == null)
|
||||
{
|
||||
return op.Failed("خطای سیستمی. لطفا دوباره تلاش کنید . درصورت تکرار این مشکل با تیم پشتیبان تماس بگیرید");
|
||||
}
|
||||
@@ -1241,6 +1256,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
if (employee == null)
|
||||
{
|
||||
var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (personalInfo.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید",new EmployeeByNationalCodeInWorkshopViewModel(){AuthorizedCanceled = true});
|
||||
}
|
||||
if (personalInfo.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
@@ -1539,7 +1559,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
if (apiResult.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||
|
||||
}
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
@@ -1595,7 +1619,16 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
if (apiResult.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true });
|
||||
|
||||
}
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code == 3)
|
||||
{
|
||||
return op.Failed("کد ملی نامعتبر است");
|
||||
}
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
|
||||
@@ -21,41 +21,54 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
|
||||
|
||||
public OperationResult Create(CreateEmployeeComputeOptions command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
|
||||
var opration = new OperationResult();
|
||||
if (command.CreateContract && command.ContractTerm != "1" && command.CutContractEndOfYear == IsActive.None)
|
||||
return opration.Failed("لطفا تعیین کنید که قراداد منتهی به پایان سال یاشد یا نباشد");
|
||||
|
||||
if (command.ContractTerm == "1")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
if (_employeeComputeOptionsRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
|
||||
{
|
||||
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
|
||||
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
|
||||
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
|
||||
_employeeComputeOptionsRepository.Create(createOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
}
|
||||
catch (Exception a)
|
||||
{
|
||||
return opration.Failed("ثبت با خطا مواجه شد");
|
||||
}
|
||||
|
||||
{
|
||||
if (_employeeComputeOptionsRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
|
||||
{
|
||||
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
|
||||
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
|
||||
|
||||
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions, command.CreateContract,
|
||||
command.SignContract, command.CreateCheckout, command.SignCheckout, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_employeeComputeOptionsRepository.Create(createOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
}
|
||||
catch (Exception a)
|
||||
{
|
||||
return opration.Failed("ثبت با خطا مواجه شد");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public EmployeeComputeOptionsViewModel GetEmployeeOptions(long workshopId, long employeeId)
|
||||
{
|
||||
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
|
||||
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
|
||||
}
|
||||
|
||||
public List<EmployeeComputeOptionsViewModel> GetAllByWorkshopId(long workshopId)
|
||||
{
|
||||
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
|
||||
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
|
||||
}
|
||||
}
|
||||
@@ -512,13 +512,13 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
monthlyBenefits = GetRoundValue(monthlyBenefits += overTimePay);
|
||||
}
|
||||
|
||||
//سرای ملک
|
||||
// نوشین خالی
|
||||
// 39692467
|
||||
//if (employee.EmployeeId == 45280)
|
||||
// monthlyBenefits += 39692467;
|
||||
//سرای ملک
|
||||
// نرجس خالی
|
||||
// 39692467
|
||||
if (employee.EmployeeId == 45280)
|
||||
monthlyBenefits += 39692467;
|
||||
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
workingDays.countWorkingDays, yearlysaleries.MarriedAllowance, endOfMonth);
|
||||
//محاسبه جمع مزایای مشمول و دستمزد ماهانه
|
||||
var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
|
||||
@@ -2341,9 +2341,9 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
return _insuranceListRepositpry.GetInsuranceOperationDetails(id);
|
||||
}
|
||||
|
||||
public Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year)
|
||||
public Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
return _insuranceListRepositpry.GetTabCounts(accountId, month, year);
|
||||
return _insuranceListRepositpry.GetTabCounts(searchModel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -15,6 +15,7 @@ using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.WorkingHours;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursItems;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using PersianTools.Core;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -600,6 +601,11 @@ public class LeftWorkApplication : ILeftWorkApplication
|
||||
return _leftWorkRepository.CheckEditLeftWork(workshopId, employeeId, date.ToGeorgianDateTime(), type);
|
||||
}
|
||||
|
||||
public AutoExtensionDto AutoExtentionEmployees(long workshopId)
|
||||
{
|
||||
return _leftWorkRepository.AutoExtentionEmployees(workshopId);
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
//این متد ترک کار های کارمند را با فعالیت حضور غیاب یکپارچه می کند
|
||||
private void IfEmployeeHasNewLeftWorkDateAddEndDateToRollCallStatus(long employeeId)
|
||||
|
||||
@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.ReportClient;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using OperationResult = _0_Framework.Application.OperationResult;
|
||||
using Tools = _0_Framework.Application.Tools;
|
||||
|
||||
@@ -174,8 +175,19 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
|
||||
await _leftWorkRepository.CreateAsync(newLeftWork);
|
||||
_leftWorkTempRepository.Remove(leftWorkTemp);
|
||||
var rollCallEmployee = _rollCallEmployeeRepository.GetBy(leftWorkTemp.EmployeeId, leftWorkTemp.WorkshopId);
|
||||
|
||||
var rollCallStatus = rollCallEmployee?.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
|
||||
if (rollCallStatus != null)
|
||||
{
|
||||
var startWork = newLeftWork.StartWorkDate;
|
||||
rollCallStatus.Edit(startWork, rollCallStatus.EndDate);
|
||||
|
||||
}
|
||||
await _leftWorkRepository.SaveChangesAsync();
|
||||
await _leftWorkTempRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
||||
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
||||
}
|
||||
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout)
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute)
|
||||
{
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout);
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute);
|
||||
}
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
||||
|
||||
@@ -73,10 +73,28 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
@@ -130,6 +148,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
var account = new AccountViewModel();
|
||||
var institutionContract = new InstitutionContract();
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
institutionContract = _institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
@@ -138,14 +157,18 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
account = _personalContractingPartyRepository.GetAccountByPersonalContractingParty(institutionContract.ContractingPartyId);
|
||||
if(account == null || account.ClientAreaPermission != "true")
|
||||
return operation.Failed("بدلیل نداشتن حساب کاربری کلاینت نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
|
||||
|
||||
}
|
||||
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,
|
||||
command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber
|
||||
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,
|
||||
command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,
|
||||
command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract, command.SignContract,
|
||||
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear,command.RotatingShiftCompute, command.IsStaticCheckout);
|
||||
_workshopRepository.Create(workshop);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
@@ -211,10 +234,28 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
@@ -241,9 +282,11 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
}
|
||||
var account = new AccountViewModel();
|
||||
var institutionContract = new InstitutionContract();
|
||||
|
||||
|
||||
if (command.HasRollCallFreeVip == "true")
|
||||
{
|
||||
|
||||
|
||||
institutionContract = _institutionContractRepository.InstitutionContractByEmployerId(employer.FirstOrDefault());
|
||||
if (institutionContract == null)
|
||||
return operation.Failed("بدلیل نداشتن قرار داد مالی نمیتوانید سرویس حضور غیاب را فعال کنید");
|
||||
@@ -315,7 +358,10 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified, command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified,
|
||||
command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip,
|
||||
command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear,command.RotatingShiftCompute, command.IsStaticCheckout);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
_workshopRepository.RemoveOldRelation(command.Id);
|
||||
@@ -535,159 +581,169 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
return _workshopRepository.SearchForClient(searchModel);
|
||||
}
|
||||
|
||||
public OperationResult CreateForClient(CreateWorkshop command)
|
||||
{
|
||||
|
||||
var accountIds = new List<long>();
|
||||
var operation = new OperationResult();
|
||||
//if (command.EmployerIdList == null)
|
||||
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
if (command.AccountIdsList != null)
|
||||
{
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
|
||||
{
|
||||
if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
}
|
||||
|
||||
if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
|
||||
return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
|
||||
if (command.City == "0" || command.City == "شهرستان")
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (string.IsNullOrEmpty(command.Address))
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
|
||||
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
|
||||
command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
|
||||
command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
|
||||
command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
_workshopRepository.Create(workshop);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
foreach (var e in employer)
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
|
||||
|
||||
_workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public OperationResult EditForClient(EditWorkshop command)
|
||||
{
|
||||
var leftSearch = new LeftWorkSearchModel()
|
||||
{
|
||||
WorkshopId = command.Id
|
||||
};
|
||||
var leftWork = _leftWorkRepository.search(leftSearch);
|
||||
var accountIds = new List<long>();
|
||||
var operation = new OperationResult();
|
||||
var workshop = _workshopRepository.Get(command.Id);
|
||||
if (command.AccountIdsList != null)
|
||||
{
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
if (workshop == null)
|
||||
operation.Failed("رکورد مورد نظر وجود ندارد");
|
||||
if (command.EmployerIdList == null)
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" رکورد مورد نظر تکراری است ");
|
||||
if (_workshopRepository.Exists(x =>
|
||||
x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
{
|
||||
if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
}
|
||||
|
||||
if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
|
||||
return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
if (command.State == null)
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
if ((command.City == "0" || command.City == "شهرستان"))
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
if (command.Address == null)
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
//_workshopRepository.RemoveOldRelation(command.Id);
|
||||
_workshopRepository.RemoveEmployerWorkshop(command.Id);
|
||||
foreach (var e in employer)
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
// _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
|
||||
foreach (var item in leftWork)
|
||||
{
|
||||
var editLeft = _leftWorkRepository.Get(item.Id);
|
||||
|
||||
editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
|
||||
_leftWorkRepository.SaveChanges();
|
||||
}
|
||||
return operation.Succcedded();
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
//public OperationResult CreateForClient(CreateWorkshop command)
|
||||
//{
|
||||
|
||||
// var accountIds = new List<long>();
|
||||
// var operation = new OperationResult();
|
||||
// //if (command.EmployerIdList == null)
|
||||
// // return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
// var employer = command.EmployerIdList.ToList();
|
||||
// if (command.AccountIdsList != null)
|
||||
// {
|
||||
// accountIds = command.AccountIdsList.ToList();
|
||||
// }
|
||||
|
||||
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
// return operation.Failed("موارد اجباری را پر کنید");
|
||||
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// // return operation.Failed("نام کارگاه تکراری است");
|
||||
// if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
|
||||
// {
|
||||
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
|
||||
// return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
// }
|
||||
|
||||
// if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
|
||||
// return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
// if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
|
||||
// if (command.City == "0" || command.City == "شهرستان")
|
||||
// return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
// if (string.IsNullOrEmpty(command.Address))
|
||||
// return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
// if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
// if (command.FixedSalary)
|
||||
// {
|
||||
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
// return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
// if (string.IsNullOrWhiteSpace(command.Population))
|
||||
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
// }
|
||||
|
||||
// //if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// // return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
|
||||
// var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
|
||||
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
|
||||
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
|
||||
// command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
|
||||
// command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
|
||||
// command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
// command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
// _workshopRepository.Create(workshop);
|
||||
// _workshopRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
// foreach (var e in employer)
|
||||
// {
|
||||
// _workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
// }
|
||||
|
||||
|
||||
// _workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
// return operation.Succcedded();
|
||||
|
||||
|
||||
//}
|
||||
|
||||
//public OperationResult EditForClient(EditWorkshop command)
|
||||
//{
|
||||
// var leftSearch = new LeftWorkSearchModel()
|
||||
// {
|
||||
// WorkshopId = command.Id
|
||||
// };
|
||||
// var leftWork = _leftWorkRepository.search(leftSearch);
|
||||
// var accountIds = new List<long>();
|
||||
// var operation = new OperationResult();
|
||||
// var workshop = _workshopRepository.Get(command.Id);
|
||||
// if (command.AccountIdsList != null)
|
||||
// {
|
||||
// accountIds = command.AccountIdsList.ToList();
|
||||
// }
|
||||
// if (workshop == null)
|
||||
// operation.Failed("رکورد مورد نظر وجود ندارد");
|
||||
// if (command.EmployerIdList == null)
|
||||
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
// var employer = command.EmployerIdList.ToList();
|
||||
|
||||
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
// return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// // return operation.Failed(" رکورد مورد نظر تکراری است ");
|
||||
// if (_workshopRepository.Exists(x =>
|
||||
// x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
// {
|
||||
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
|
||||
// return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
// }
|
||||
|
||||
// if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
|
||||
// return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
// if (command.State == null)
|
||||
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
// if ((command.City == "0" || command.City == "شهرستان"))
|
||||
// return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
// if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
|
||||
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
// if (command.Address == null)
|
||||
// return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
// if (command.FixedSalary)
|
||||
// {
|
||||
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
// return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
// if (string.IsNullOrWhiteSpace(command.Population))
|
||||
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
// }
|
||||
|
||||
// workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
// command.Address,
|
||||
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
// , command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
// command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
|
||||
// command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
// command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
// _workshopRepository.SaveChanges();
|
||||
|
||||
// //_workshopRepository.RemoveOldRelation(command.Id);
|
||||
// _workshopRepository.RemoveEmployerWorkshop(command.Id);
|
||||
// foreach (var e in employer)
|
||||
// {
|
||||
// _workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
// }
|
||||
// // _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
|
||||
// foreach (var item in leftWork)
|
||||
// {
|
||||
// var editLeft = _leftWorkRepository.Get(item.Id);
|
||||
|
||||
// editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
|
||||
// _leftWorkRepository.SaveChanges();
|
||||
// }
|
||||
// return operation.Succcedded();
|
||||
|
||||
//}
|
||||
|
||||
public bool GetWorkshopAccountByAcountID(long acountID)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
@@ -73,5 +74,28 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
||||
salaryAid.Property(x => x.Amount).HasMaxLength(25);
|
||||
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
||||
});
|
||||
|
||||
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
|
||||
{
|
||||
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalBreakTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalWorkingTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalPaidLeaveTmeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalSickLeaveTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalMandatoryTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.OwnsMany(x => x.RollCallDaysCollection, rollCallDay =>
|
||||
{
|
||||
rollCallDay.HasKey(x => x.Id);
|
||||
rollCallDay.WithOwner().HasForeignKey(x => x.CheckoutId);
|
||||
|
||||
rollCallDay.Property(x => x.WorkingTimeSpan).HasTimeSpanConversion();
|
||||
rollCallDay.Property(x => x.BreakTimeSpan).HasTimeSpanConversion();
|
||||
rollCallDay.Property(x => x.FirstStartDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.FirstEndDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.SecondStartDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.SecondEndDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.LeaveType).HasMaxLength(18);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,14 @@ public class CustomizeWorkshopEmployeeSettingsMapping : IEntityTypeConfiguration
|
||||
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,15 @@ public class CustomizeWorkshopGroupSettingsMapping : IEntityTypeConfiguration<Cu
|
||||
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeRotatingShifts);
|
||||
|
||||
|
||||
builder.HasOne(x => x.CustomizeWorkshopSettings).WithMany(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
|
||||
@@ -221,6 +221,12 @@ public class CustomizeWorkshopSettingsMapping:IEntityTypeConfiguration<Customize
|
||||
|
||||
|
||||
});
|
||||
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
|
||||
{
|
||||
offDay.HasKey(x => x.Id);
|
||||
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
|
||||
offDay.WithOwner().HasForeignKey(x => x.ParentId);
|
||||
});
|
||||
|
||||
|
||||
builder.HasMany(x => x.CustomizeWorkshopGroupSettingsCollection).WithOne(x => x.CustomizeWorkshopSettings)
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
@@ -16,6 +18,9 @@ public class EmployeeComputeOptionsMapping : IEntityTypeConfiguration<EmployeeCo
|
||||
builder.Property(x => x.ComputeOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.YearsOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.BonusesOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.ContractTerm).HasMaxLength(10);
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.InsurancWorkshopInfoAgg;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.InsurancWorkshopInfoAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
@@ -38,10 +40,13 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
|
||||
builder.Property(x => x.IsOldContract);
|
||||
builder.Property(x => x.HasRollCallFreeVip).HasMaxLength(5);
|
||||
builder.Property(x => x.WorkshopHolidayWorking);
|
||||
//builder.HasOne(x => x.Employer)
|
||||
// .WithMany(x => x.Workshops)
|
||||
// .HasForeignKey(x => x.EmployerId);
|
||||
builder.HasMany(x => x.LeftWorks)
|
||||
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
//builder.HasOne(x => x.Employer)
|
||||
// .WithMany(x => x.Workshops)
|
||||
// .HasForeignKey(x => x.EmployerId);
|
||||
builder.HasMany(x => x.LeftWorks)
|
||||
.WithOne(x => x.Workshop)
|
||||
.HasForeignKey(x => x.WorkshopId);
|
||||
|
||||
|
||||
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
9744
CompanyManagment.EFCore/Migrations/20250602161025_add offDays to cws.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addoffDaystocws : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_CustomizeWorkshopEmployeeSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopEmployeeSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopGroupSettings_WeeklyOffDays_CustomizeWorkshopGroupSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopGroupSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
ParentId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CustomizeWorkshopSettings_WeeklyOffDays", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CustomizeWorkshopSettings_WeeklyOffDays_CustomizeWorkshopSettings_ParentId",
|
||||
column: x => x.ParentId,
|
||||
principalTable: "CustomizeWorkshopSettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopGroupSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CustomizeWorkshopSettings_WeeklyOffDays_ParentId",
|
||||
table: "CustomizeWorkshopSettings_WeeklyOffDays",
|
||||
column: "ParentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CustomizeWorkshopSettings_WeeklyOffDays");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
9832
CompanyManagment.EFCore/Migrations/20250611105314_add rollcall in checkout.Designer.cs
generated
Normal file
9832
CompanyManagment.EFCore/Migrations/20250611105314_add rollcall in checkout.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addrollcallincheckout : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalBreakTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalPresentTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalWorkingTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CheckoutRollCallDay",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FirstStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
FirstEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
SecondStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
SecondEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
BreakTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
WorkingTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
IsSliced = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsAbsent = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsFriday = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsHoliday = table.Column<bool>(type: "bit", nullable: false),
|
||||
LeaveType = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
CheckoutId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId",
|
||||
column: x => x.CheckoutId,
|
||||
principalTable: "Checkouts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CheckoutRollCallDay_CheckoutId",
|
||||
table: "CheckoutRollCallDay",
|
||||
column: "CheckoutId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CheckoutRollCallDay");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalBreakTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalPresentTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalWorkingTimeSpan",
|
||||
table: "Checkouts");
|
||||
}
|
||||
}
|
||||
}
|
||||
9736
CompanyManagment.EFCore/Migrations/20250611160351_add workshop create contract settings.Designer.cs
generated
Normal file
9736
CompanyManagment.EFCore/Migrations/20250611160351_add workshop create contract settings.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addworkshopcreatecontractsettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateCheckout",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateContract",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "Workshops",
|
||||
type: "nvarchar(5)",
|
||||
maxLength: 5,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignCheckout",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignContract",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateCheckout",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateContract",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignCheckout",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignContract",
|
||||
table: "Workshops");
|
||||
}
|
||||
}
|
||||
}
|
||||
9748
CompanyManagment.EFCore/Migrations/20250611172746_add settings for employee compute options.Designer.cs
generated
Normal file
9748
CompanyManagment.EFCore/Migrations/20250611172746_add settings for employee compute options.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsettingsforemployeecomputeoptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateCheckout",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateContract",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignCheckout",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignContract",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateCheckout",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateContract",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignCheckout",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignContract",
|
||||
table: "EmployeeComputeOptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ContractTermAndCutOptionToEmployeeOptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(5)",
|
||||
maxLength: 5,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
9960
CompanyManagment.EFCore/Migrations/20250701193647_NewOptionsToWorkshop.Designer.cs
generated
Normal file
9960
CompanyManagment.EFCore/Migrations/20250701193647_NewOptionsToWorkshop.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class NewOptionsToWorkshop : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsStaticCheckout",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "RotatingShiftCompute",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsStaticCheckout",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RotatingShiftCompute",
|
||||
table: "Workshops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1809,12 +1809,33 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("ContractTerm")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -5646,9 +5667,20 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("FixedSalary")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -5682,10 +5714,22 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool>("IsOldContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsStaticCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Population")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<bool>("RotatingShiftCompute")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -6168,6 +6212,117 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("TotalBreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalMandatoryTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPaidLeaveTmeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPresentTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalSickLeaveTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalWorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.HasKey("Checkoutid");
|
||||
|
||||
b1.ToTable("Checkouts");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
|
||||
b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 =>
|
||||
{
|
||||
b2.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property<long>("Id"));
|
||||
|
||||
b2.Property<string>("BreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.Property<long>("CheckoutId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b2.Property<DateTime>("Date")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b2.Property<string>("FirstEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("FirstStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<bool>("IsAbsent")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsFriday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsHoliday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsSliced")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<string>("LeaveType")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("WorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.HasKey("Id");
|
||||
|
||||
b2.HasIndex("CheckoutId");
|
||||
|
||||
b2.ToTable("CheckoutRollCallDay");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("CheckoutId");
|
||||
});
|
||||
|
||||
b1.Navigation("RollCallDaysCollection");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
@@ -6255,6 +6410,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.Navigation("CheckoutRollCall");
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
@@ -7492,6 +7649,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -7527,6 +7710,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("OverTimePay");
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
|
||||
@@ -8050,6 +8235,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -8085,6 +8296,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("OverTimePay");
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
|
||||
@@ -8535,6 +8748,32 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("CustomizeWorkshopSettingsid");
|
||||
});
|
||||
|
||||
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
|
||||
{
|
||||
b1.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
|
||||
|
||||
b1.Property<string>("DayOfWeek")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("ParentId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("ParentId");
|
||||
|
||||
b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ParentId");
|
||||
});
|
||||
|
||||
b.Navigation("BaseYearsPay");
|
||||
|
||||
b.Navigation("BonusesPay");
|
||||
@@ -8563,6 +8802,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.Navigation("ShiftPay");
|
||||
|
||||
b.Navigation("WeeklyOffDays");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
|
||||
@@ -18,332 +18,449 @@ namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false)
|
||||
return [];
|
||||
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false)
|
||||
return [];
|
||||
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth);
|
||||
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime();
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth);
|
||||
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
|
||||
.Select(c => c.ContractingPartyId);
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
|
||||
var workshopAccounts = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId).ToList();
|
||||
var workshopAccounts = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId).ToList();
|
||||
|
||||
|
||||
|
||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|
||||
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|
||||
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||
|
||||
|
||||
|
||||
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
var workshopsWithContractingParty = await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
var workshopsWithContractingParty = await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate,targetEndDate, nextFirstMonth,nextEndMonth);
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate, targetEndDate, nextFirstMonth, nextEndMonth);
|
||||
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
|
||||
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
|
||||
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
|
||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= targetStartDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= nextFirstMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
|
||||
var now = DateTime.Today;
|
||||
//پرسنل ادمین اجرایی
|
||||
var operatorAdminAccounts = _accountContext.AccountLeftWorks
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
|
||||
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
|
||||
.Join(_accountContext.Accounts,
|
||||
x => x.AccountId,
|
||||
account => account.id, (x, account) => new
|
||||
{
|
||||
x.WorkshopId,
|
||||
account.Fullname
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = operatorAccount?.Fullname ?? "",
|
||||
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
|
||||
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetStartDate,DateTime targetEndDate, DateTime nextStartMonth,DateTime nextEndMonth)
|
||||
{
|
||||
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
|
||||
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Join(
|
||||
_companyContext.Contracts.AsNoTracking(),
|
||||
leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
(leftWork, contract) => new { leftWork, contract }
|
||||
)
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
x.contract.ContarctStart <= targetEndDate &&
|
||||
x.contract.ContractEnd >= targetStartDate &&
|
||||
!vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||
!_companyContext.EmployeeClientTemps
|
||||
.Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||
)
|
||||
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||
|
||||
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||
!vipGroup.Contains(x.EmployeeId) &&
|
||||
!_companyContext.EmployeeClientTemps
|
||||
.Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId)
|
||||
).Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds))
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
|
||||
var list = workingContractEmployeeIds.ToList().Where(x=>!contractSet.Any(a=>a.EmployeeId== x.EmployeeId&&a.WorkshopIds == x.WorkshopId)).ToList();
|
||||
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
// .Where(g => g.Any(emp =>
|
||||
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .Select(g => g.Key)
|
||||
// .ToList();
|
||||
|
||||
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
|
||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= targetStartDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= nextFirstMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
|
||||
var now = DateTime.Today;
|
||||
//پرسنل ادمین اجرایی
|
||||
var operatorAdminAccounts = _accountContext.AccountLeftWorks
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
|
||||
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
|
||||
.Join(_accountContext.Accounts,
|
||||
x => x.AccountId,
|
||||
account => account.id, (x, account) => new
|
||||
{
|
||||
x.WorkshopId,
|
||||
account.Fullname
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = operatorAccount?.Fullname ?? "",
|
||||
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
|
||||
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetStartDate, DateTime targetEndDate, DateTime nextStartMonth, DateTime nextEndMonth)
|
||||
{
|
||||
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToHashSet();
|
||||
|
||||
|
||||
var workingCheckoutEmployeeIds = GetWorkingCheckoutEmployeeIds(workshopIds, targetStartDate, targetEndDate, vipGroup);
|
||||
//var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
// .Join(
|
||||
// _companyContext.Contracts.AsNoTracking(),
|
||||
// leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
// contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
// (leftWork, contract) => new { leftWork, contract }
|
||||
// )
|
||||
// .Where(x =>
|
||||
// workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
// x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
// x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
// x.contract.ContarctStart <= targetEndDate &&
|
||||
// x.contract.ContractEnd >= targetStartDate &&
|
||||
// !vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||
// !_companyContext.EmployeeClientTemps
|
||||
// .Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||
// )
|
||||
// .Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||
|
||||
|
||||
|
||||
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||
!vipGroup.Contains(x.EmployeeId) &&
|
||||
!_companyContext.EmployeeClientTemps
|
||||
.Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId))
|
||||
.GroupJoin(_companyContext.EmployeeComputeOptionsSet.Where(o => workshopIds.Contains(o.WorkshopId)),
|
||||
x => new { x.EmployeeId, x.WorkshopId },
|
||||
option => new { option.EmployeeId, option.WorkshopId },
|
||||
(x, options) => new { LeftWork = x, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.LeftWork, option })
|
||||
.Where(x => x.option != null ? x.option.CreateContract
|
||||
: x.LeftWork.Workshop.CreateContract)
|
||||
.Select(x => new { x.LeftWork.WorkshopId, x.LeftWork.EmployeeId });
|
||||
|
||||
|
||||
//var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
// .Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||
// !vipGroup.Contains(x.EmployeeId) &&
|
||||
// !_companyContext.EmployeeClientTemps
|
||||
// .Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId)
|
||||
// ).Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds))
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
|
||||
var list = workingContractEmployeeIds.ToList().Where(x => !contractSet.Any(a => a.EmployeeId == x.EmployeeId && a.WorkshopIds == x.WorkshopId)).ToList();
|
||||
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
// .Where(g => g.Any(emp =>
|
||||
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .Select(g => g.Key)
|
||||
// .ToList();
|
||||
|
||||
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
private List<(long WorkshopId,long EmployeeId)> GetWorkingCheckoutEmployeeIds(List<long> workshopIds, DateTime targetStartDate, DateTime targetEndDate,
|
||||
HashSet<long> vipGroup)
|
||||
{
|
||||
//var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
// .Join(
|
||||
// _companyContext.Contracts.AsNoTracking(),
|
||||
// leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
// contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
// (leftWork, contract) => new { leftWork, contract }
|
||||
// ).GroupJoin(_companyContext.EmployeeComputeOptionsSet.Where(o => workshopIds.Contains(o.WorkshopId)),
|
||||
// x => new { x.leftWork.EmployeeId, x.leftWork.WorkshopId },
|
||||
// option => new { option.EmployeeId, option.WorkshopId },
|
||||
// (x, options) => new { x.leftWork, x.contract, options })
|
||||
// .SelectMany(
|
||||
// x => x.options.DefaultIfEmpty(),
|
||||
// (x, option) => new { x.leftWork, x.contract, option })
|
||||
// .Where(x =>
|
||||
// workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
// x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
// x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
// x.contract.ContarctStart <= targetEndDate &&
|
||||
// x.contract.ContractEnd >= targetStartDate &&
|
||||
// !vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||
// !_companyContext.EmployeeClientTemps
|
||||
// .Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId) &&
|
||||
// x.option != null
|
||||
// ? x.option.CreateCheckout
|
||||
// : x.leftWork.Workshop.CreateCheckout
|
||||
// )
|
||||
// .Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId }).AsEnumerable()
|
||||
// .Select(x=>(x.WorkshopId,x.EmployeeId)).ToList();
|
||||
|
||||
|
||||
var chcekoutLeftWorks = _companyContext.LeftWorkList
|
||||
.AsNoTracking()
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.WorkshopId) &&
|
||||
x.StartWorkDate <= targetEndDate &&
|
||||
x.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
!vipGroup.Contains(x.EmployeeId))
|
||||
.Select(x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
x.WorkshopId,
|
||||
x.StartWorkDate,
|
||||
x.LeftWorkDate,
|
||||
x.Workshop.CreateCheckout
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var checkoutContracts = _companyContext.Contracts
|
||||
.AsNoTracking()
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.WorkshopIds) &&
|
||||
x.ContarctStart <= targetEndDate &&
|
||||
x.ContractEnd >= targetStartDate)
|
||||
.Select(x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
WorkshopId = x.WorkshopIds,
|
||||
x.ContarctStart,
|
||||
x.ContractEnd
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var computeOptionsDict = _companyContext.EmployeeComputeOptionsSet
|
||||
.AsNoTracking()
|
||||
.Where(o => workshopIds.Contains(o.WorkshopId))
|
||||
.ToDictionary(
|
||||
o => (o.EmployeeId, o.WorkshopId),
|
||||
o => o.CreateCheckout
|
||||
);
|
||||
|
||||
var clientTemps = _companyContext.EmployeeClientTemps
|
||||
.AsNoTracking().AsEnumerable()
|
||||
.Select(x => (x.EmployeeId, x.WorkshopId))
|
||||
.ToHashSet();
|
||||
|
||||
var workingCheckoutEmployeeIds = chcekoutLeftWorks
|
||||
.Join(
|
||||
checkoutContracts,
|
||||
left => new { left.EmployeeId, left.WorkshopId },
|
||||
contract => new { contract.EmployeeId, contract.WorkshopId },
|
||||
(left, contract) => new { left, contract })
|
||||
.Where(x =>
|
||||
!clientTemps.Contains((x.left.EmployeeId, x.left.WorkshopId)) &&
|
||||
(computeOptionsDict.TryGetValue((x.left.EmployeeId, x.left.WorkshopId), out var createCheckout)
|
||||
? createCheckout
|
||||
: x.left.CreateCheckout))
|
||||
.Select(x => (
|
||||
x.left.WorkshopId,
|
||||
x.left.EmployeeId
|
||||
)).ToList();
|
||||
return workingCheckoutEmployeeIds;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.WorkshopEmployerAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
@@ -30,6 +31,7 @@ using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PersianTools.Core;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -217,6 +219,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
checkout => checkout.ContractId,
|
||||
(contractWorkshopEmployeeleftWorkPersonnelCode, checkout) =>
|
||||
new { contractWorkshopEmployeeleftWorkPersonnelCode, checkout })
|
||||
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
x => x.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork.leftwork.EmployeeId,
|
||||
option => option.EmployeeId,
|
||||
(x, options) => new { x.checkout, x.contractWorkshopEmployeeleftWorkPersonnelCode, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.checkout, x.contractWorkshopEmployeeleftWorkPersonnelCode, option })
|
||||
.ToList();
|
||||
Console.WriteLine("query : " + timer.Elapsed);
|
||||
timer.Reset();
|
||||
@@ -234,7 +244,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
if (chekoutCreated != null)
|
||||
{
|
||||
|
||||
|
||||
return new CreateCheckoutListViewModel
|
||||
{
|
||||
Id = chekoutCreated.ContractId,
|
||||
@@ -249,7 +259,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
LaterThanEnd = false,
|
||||
Extension = false,
|
||||
Description = "دارای فیش حقوقی",
|
||||
HasCheckout = true
|
||||
HasCheckout = true,
|
||||
EmployeeHasCreateCheckout = true
|
||||
};
|
||||
}
|
||||
var employeeJoin = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
@@ -264,7 +275,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
bool extension = true;
|
||||
bool laterThanEnd = false;
|
||||
string description = "";
|
||||
string leftWorkDate="";
|
||||
string leftWorkDate = "";
|
||||
string contractStart = "";
|
||||
string contractEnd = "";
|
||||
|
||||
@@ -276,7 +287,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
if (hasRollCall)
|
||||
{
|
||||
|
||||
|
||||
// اگر ترک کار کرده بود
|
||||
// اگر ترک کارش در بازه انتخاب شده بود
|
||||
if (leftWork.HasLeft && leftWork.LeftWorkDate > startSreach && leftWork.LeftWorkDate <= endSearch)
|
||||
@@ -353,7 +364,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
else if (!leftWork.HasLeft && startSreach < currentStart)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
@@ -401,7 +412,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
description = "به دلیل ترک کار پیش از تاریخ انتخاب شده مجاز به ایجاد فیش نمی باشید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
}
|
||||
else if(leftWork.LeftWorkDate > endSearch)
|
||||
else if (leftWork.LeftWorkDate > endSearch)
|
||||
{
|
||||
extension = true;
|
||||
|
||||
@@ -424,7 +435,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
else
|
||||
{
|
||||
extension = true;
|
||||
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
laterThanEnd = true;
|
||||
@@ -440,7 +451,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -469,10 +480,12 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
Description = description,
|
||||
ContractStart = contractStart,
|
||||
ContractEnd = contractEnd,
|
||||
LeftWorkDate = leftWorkDate
|
||||
LeftWorkDate = leftWorkDate,
|
||||
EmployeeHasCreateCheckout = result.option != null ? result.option.CreateCheckout : result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork.contractWorkshopEmployee.contractWorkshop.workshop.CreateCheckout
|
||||
|
||||
};
|
||||
|
||||
}).OrderByDescending(x=>x.Extension).ToList();
|
||||
}).Where(x => x.EmployeeHasCreateCheckout).OrderByDescending(x => x.Extension).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -501,6 +514,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
||||
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
@@ -935,7 +949,33 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||
}).ToList(),
|
||||
CheckoutRollCall = x.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
||||
{
|
||||
TotalPresentTimeSpan = x.CheckoutRollCall.TotalPresentTimeSpan,
|
||||
TotalBreakTimeSpan = x.CheckoutRollCall.TotalBreakTimeSpan,
|
||||
TotalWorkingTimeSpan = x.CheckoutRollCall.TotalWorkingTimeSpan,
|
||||
TotalPaidLeaveTmeSpan = x.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
||||
TotalMandatoryTimeSpan = x.CheckoutRollCall.TotalMandatoryTimeSpan,
|
||||
TotalSickLeaveTimeSpan = x.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
||||
RollCallDaysCollection = x.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
||||
{
|
||||
WorkingTimeSpan = d.WorkingTimeSpan,
|
||||
BreakTimeSpan = d.BreakTimeSpan,
|
||||
IsSliced = d.IsSliced,
|
||||
IsAbsent = d.IsAbsent,
|
||||
IsFriday = d.IsFriday,
|
||||
IsHoliday = d.IsHoliday,
|
||||
LeaveType = d.LeaveType,
|
||||
CheckoutId = d.CheckoutId,
|
||||
Date = d.Date,
|
||||
FirstEndDate = d.FirstEndDate,
|
||||
FirstStartDate = d.FirstStartDate,
|
||||
Id = d.Id,
|
||||
SecondEndDate = d.SecondEndDate,
|
||||
SecondStartDate = d.SecondStartDate
|
||||
}).ToList()
|
||||
|
||||
} : null,
|
||||
}).SingleOrDefault(x => x.Id == item);
|
||||
var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId);
|
||||
ch.WorkshopName = workshopName.WorkshopName;
|
||||
@@ -1059,7 +1099,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
|
||||
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
|
||||
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
|
||||
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
|
||||
|
||||
|
||||
|
||||
@@ -1072,17 +1112,51 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
ch.TotalDeductions = "";
|
||||
ch.TotalPayment = "";
|
||||
}
|
||||
if (ch.HasRollCall)
|
||||
ch.MonthlyRollCall = _rollCallRepository.GetEmployeeRollCallsForMonth(ch.EmployeeId, ch.WorkshopId, ch.ContractStartGr, ch.ContractEndGr);
|
||||
|
||||
if (ch.CheckoutRollCall != null)
|
||||
{
|
||||
ch.TotalWorkingTimeStr = ch.CheckoutRollCall.TotalWorkingTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalBreakTimeStr = ch.CheckoutRollCall.TotalBreakTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalPresentTimeStr = ch.CheckoutRollCall.TotalPresentTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalMandatoryTimeStr = ch.CheckoutRollCall.TotalMandatoryTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
|
||||
ch.MonthlyRollCall = ch.CheckoutRollCall.RollCallDaysCollection
|
||||
.Select(x => new CheckoutDailyRollCallViewModel
|
||||
{
|
||||
DayOfWeek = x.Date.DayOfWeek.DayOfWeeKToPersian(),
|
||||
StartDate1 = x.FirstStartDate,
|
||||
EndDate1 = x.FirstEndDate,
|
||||
StartDate2 = x.SecondStartDate,
|
||||
EndDate2 = x.SecondEndDate,
|
||||
TotalhourseSpan = x.WorkingTimeSpan,
|
||||
IsSliced = x.IsSliced,
|
||||
BreakTimeTimeSpan = x.BreakTimeSpan,
|
||||
LeaveType = x.LeaveType,
|
||||
IsAbsent = x.IsAbsent,
|
||||
IsFriday = x.IsFriday,
|
||||
IsHoliday = x.IsHoliday,
|
||||
DateTimeGr = x.Date,
|
||||
TotalWorkingHours = $"{(int)(x.WorkingTimeSpan.TotalHours)}:{x.WorkingTimeSpan.Minutes:00}",
|
||||
BreakTimeString = $"{(int)(x.BreakTimeSpan.TotalHours)}:{x.BreakTimeSpan.Minutes:00}",
|
||||
RollCallDateFa = x.Date.ToFarsi()
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ch.CreateWorkingHoursTemp.ContractStartGr = ch.ContractStartGr;
|
||||
ch.CreateWorkingHoursTemp.ContractEndGr = ch.ContractEndGr;
|
||||
ch.CreateWorkingHoursTemp.ContarctStart = ch.ContractStartGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.ContractEnd = ch.ContractEndGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.EmployeeId = ch.EmployeeId;
|
||||
ch.CreateWorkingHoursTemp.WorkshopId = ch.WorkshopId;
|
||||
ch.MonthlyRollCall = ConvertStaticToRollCall(ch.CreateWorkingHoursTemp, workshopName.WorkshopHolidayWorking);
|
||||
|
||||
if (ch.HasRollCall)
|
||||
ch.MonthlyRollCall = _rollCallRepository.GetEmployeeRollCallsForMonth(ch.EmployeeId, ch.WorkshopId, ch.ContractStartGr, ch.ContractEndGr);
|
||||
else
|
||||
{
|
||||
ch.CreateWorkingHoursTemp.ContractStartGr = ch.ContractStartGr;
|
||||
ch.CreateWorkingHoursTemp.ContractEndGr = ch.ContractEndGr;
|
||||
ch.CreateWorkingHoursTemp.ContarctStart = ch.ContractStartGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.ContractEnd = ch.ContractEndGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.EmployeeId = ch.EmployeeId;
|
||||
ch.CreateWorkingHoursTemp.WorkshopId = ch.WorkshopId;
|
||||
ch.MonthlyRollCall = ConvertStaticToRollCall(ch.CreateWorkingHoursTemp, workshopName.WorkshopHolidayWorking);
|
||||
}
|
||||
}
|
||||
query.Add(ch);
|
||||
}
|
||||
@@ -1526,7 +1600,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
StartDate2 = secondRollCall?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate2 = secondRCEndDate?.ToString("HH:mm") ?? "",
|
||||
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay,
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
|
||||
|
||||
BreakTimeTimeSpan = breakTimePerDay,
|
||||
|
||||
@@ -1849,9 +1923,482 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
return notRemoveList;
|
||||
}
|
||||
|
||||
public async Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel)
|
||||
{
|
||||
bool hasSearch = false;
|
||||
bool hasEmployeeOrWorkshpSearch = false;
|
||||
|
||||
//bool noHasSearch = searchModel.WorkshopId == 0 && searchModel.EmployerId == 0
|
||||
// && searchModel.EmployeeId == 0
|
||||
// && string.IsNullOrWhiteSpace(searchModel.EmployeeName)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.Year)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.Month)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractStart)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractEnd)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractNo);
|
||||
var acountID = _authHelper.CurrentAccountId();
|
||||
var workshopAcounts = _context.WorkshopAccounts.Where(x => x.AccountId == acountID)
|
||||
.Select(x => x.WorkshopId);
|
||||
|
||||
//var checkouts =
|
||||
// _context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
// .Join(_context.Workshops.AsSplitQuery(),
|
||||
// ch => ch.WorkshopId,
|
||||
// workshop => workshop.id,
|
||||
// (ch, workshop) => new { ch, workshop })
|
||||
// .GroupJoin(_context.EmployeeComputeOptionsSet.AsSplitQuery(),
|
||||
// x => x.workshop.id,
|
||||
// option => option.WorkshopId,
|
||||
// (x, options) => new { x.ch, x.workshop, options })
|
||||
// .SelectMany(
|
||||
// x => x.options.DefaultIfEmpty(),
|
||||
// (x, option) => new { x.ch, x.workshop, option })
|
||||
// .GroupJoin(_context.WorkshopEmployers.AsSplitQuery().Include(we => we.Employer),
|
||||
// result => result.workshop.id,
|
||||
// workshopEmployer => workshopEmployer.WorkshopId,
|
||||
// (result, workshopEmployer) => new { result.ch, result.workshop, result.option, workshopEmployer })
|
||||
// .SelectMany(
|
||||
// y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
// (y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
// .GroupJoin(
|
||||
// _context.PersonalContractingParties.Include(p => p.Employers),
|
||||
// secondResult => secondResult.workshopEmployer.Employer.id,
|
||||
// contractingParty => contractingParty.Employers.FirstOrDefault().id, // یا راه بهتر پایین
|
||||
// (secondResult, contractingParties) => new { secondResult, contractingParties }
|
||||
// )
|
||||
// .SelectMany(
|
||||
// x => x.contractingParties.DefaultIfEmpty(),
|
||||
// (x, contractingParty) => new
|
||||
// {
|
||||
// x.secondResult.workshopEmployer,
|
||||
// x.secondResult.workshop,
|
||||
// x.secondResult.option,
|
||||
// x.secondResult.ch,
|
||||
// contractingParty
|
||||
// }
|
||||
// );
|
||||
|
||||
var checkouts =
|
||||
_context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.AsSplitQuery(),
|
||||
ch => ch.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
(ch, workshop) => new { ch, workshop })
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.AsSplitQuery(),
|
||||
x => x.workshop.id,
|
||||
option => option.WorkshopId,
|
||||
(x, options) => new { x.ch, x.workshop, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.ch, x.workshop, option })
|
||||
.GroupJoin(_context.WorkshopEmployers.AsSplitQuery().Include(we => we.Employer),
|
||||
result => result.workshop.id,
|
||||
workshopEmployer => workshopEmployer.WorkshopId,
|
||||
(result, workshopEmployer) => new { result.ch, result.workshop, result.option, workshopEmployer })
|
||||
.SelectMany(
|
||||
y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
(y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
.Select(res => new
|
||||
{
|
||||
res.ch,
|
||||
res.workshop,
|
||||
option = _context.EmployeeComputeOptionsSet.FirstOrDefault(x=>x.WorkshopId == res.ch.WorkshopId &&x.EmployeeId == res.ch.EmployeeId),
|
||||
res.workshopEmployer,
|
||||
contractingParty = _context.PersonalContractingParties
|
||||
.Include(p => p.Employers)
|
||||
.FirstOrDefault(p => p.Employers.Any(e => e.id == res.workshopEmployer.Employer.id))
|
||||
});
|
||||
|
||||
#region SercheModel
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo) && searchModel.ContractId != 0)
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractNo == searchModel.ContractNo && x.ch.ContractId == searchModel.ContractId);
|
||||
if (searchModel.WorkshopId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
if (searchModel.EmployeeId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.EmployeeId == searchModel.EmployeeId);
|
||||
}
|
||||
if (searchModel.EmployerId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.contractingParty.Employers.Select(c => c.id).Contains(searchModel.EmployerId));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo))
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.ContractNo == searchModel.ContractNo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if (searchModel.IsActiveString == null)
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "true");
|
||||
//}
|
||||
|
||||
//if (searchModel.IsActiveString == "false")
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "false");
|
||||
//}
|
||||
//else if (searchModel.IsActiveString == "both")
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "false" || x.ch.IsActiveString == "true");
|
||||
//}
|
||||
|
||||
|
||||
//سرچ سال
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month) &&
|
||||
(string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)))
|
||||
{
|
||||
hasSearch = true;
|
||||
var startYear = searchModel.Year + "/01/01";
|
||||
var startyearGr = startYear.ToGeorgianDateTime();
|
||||
var endYear = $"{searchModel.Year}/12/01".FindeEndOfMonth();
|
||||
var endYearGr = endYear.ToGeorgianDateTime();
|
||||
|
||||
|
||||
checkouts = checkouts.Where(x => x.ch.ContractStart >= startyearGr && x.ch.ContractEnd <= endYearGr);
|
||||
if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
checkouts = checkouts.OrderByDescending(x => x.ch.ContractEnd);
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.Year) && !string.IsNullOrWhiteSpace(searchModel.Month) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd))
|
||||
{
|
||||
hasSearch = true;
|
||||
//سرچ سال و ماه
|
||||
string y1 = $"{searchModel.Year}/{searchModel.Month}/01";
|
||||
var startDate = y1.ToGeorgianDateTime();
|
||||
string y2 = string.Empty;
|
||||
int month = Convert.ToInt32(searchModel.Month);
|
||||
int year = Convert.ToInt32(searchModel.Year);
|
||||
|
||||
if (month <= 6)
|
||||
{
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/31";
|
||||
}
|
||||
else if (month > 6 && month < 12)
|
||||
{
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
}
|
||||
else if (month == 12)
|
||||
{
|
||||
switch (year)
|
||||
{
|
||||
case 1346:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1350:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1354:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1358:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1362:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1366:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1370:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1375:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1379:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1383:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1387:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1391:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1395:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1399:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1403:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1408:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1412:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1416:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1420:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1424:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1428:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1432:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1436:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1441:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1445:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
|
||||
default:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/29";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var endDate = y2.ToGeorgianDateTime();
|
||||
|
||||
//checkouts = checkouts.Where(x => x.ContractEndGr >= start && x.ContractEndGr <= end).ToList();
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractStart >= startDate && x.ch.ContractStart < endDate && x.ch.ContractEnd > startDate &&
|
||||
x.ch.ContractEnd <= endDate ||
|
||||
x.ch.ContractStart <= startDate && x.ch.ContractEnd >= endDate ||
|
||||
startDate <= x.ch.ContractStart && endDate > x.ch.ContractStart ||
|
||||
endDate >= x.ch.ContractEnd && startDate < x.ch.ContractEnd);
|
||||
//if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
// checkouts = checkouts.OrderBy(x => x.ch.PersonnelCodeInt);
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractEnd) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
hasSearch = true;
|
||||
//سرچ تاریخ
|
||||
var start = searchModel.ContractStart.ToGeorgianDateTime();
|
||||
var endd = searchModel.ContractEnd.ToGeorgianDateTime();
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractStart >= start && x.ch.ContractStart <= endd);
|
||||
|
||||
//if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
// checkouts = checkouts.OrderByDescending(x => x.ch.ContractEnd).ThenBy(x => x.ch.PersonnelCodeInt);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployeeName))
|
||||
{
|
||||
hasSearch = true;
|
||||
var employeeList = _context.Employees.Where(x => (!string.IsNullOrEmpty(x.FName) && x.FName.StartsWith(searchModel.EmployeeName)) ||
|
||||
(!string.IsNullOrEmpty(x.LName) && x.LName.StartsWith(searchModel.EmployeeName))).Select(x => x.id).ToList();
|
||||
checkouts = checkouts.Where(x => employeeList.Contains(x.ch.EmployeeId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
if (!hasSearch && !hasEmployeeOrWorkshpSearch)
|
||||
{
|
||||
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
|
||||
}).OrderByDescending(x => x.Id).ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).Take(200)
|
||||
.GroupBy(x => x.Id)
|
||||
.Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.Id).ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).Take(50).ToList();
|
||||
}
|
||||
else if (hasSearch && !hasEmployeeOrWorkshpSearch)
|
||||
{
|
||||
|
||||
var result = checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).OrderByDescending(x => x.Id)
|
||||
.GroupBy(x => x.Id)
|
||||
.Select(x => x.First());
|
||||
|
||||
|
||||
|
||||
if ((string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
//اگر فقط سال رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else if ((string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)) && !string.IsNullOrWhiteSpace(searchModel.Month) && !string.IsNullOrWhiteSpace(searchModel.Year))
|
||||
{
|
||||
//اگر فقط سال و ماه رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractEnd))
|
||||
{
|
||||
//اگر فقط سال و ماه رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
|
||||
return result.ToList().OrderByDescending(x => x.Id)
|
||||
.ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).ToList();
|
||||
|
||||
}
|
||||
else if (hasEmployeeOrWorkshpSearch && !hasSearch)
|
||||
{
|
||||
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).GroupBy(x => x.Id).Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).GroupBy(x => x.Id)
|
||||
.Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.Id)
|
||||
.ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
bool hasSearch = false;
|
||||
bool hasEmployeeOrWorkshpSearch = false;
|
||||
//List<CheckoutViewModel> query = null;
|
||||
@@ -1868,11 +2415,12 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
var emp2 = _context.WorkshopEmployers.Where(x => x.EmployerId == searchModel.EmployerId)
|
||||
.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
|
||||
|
||||
var query = _context.CheckoutSet.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.id,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
//var start = ;
|
||||
@@ -1900,7 +2448,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
});
|
||||
|
||||
|
||||
Console.WriteLine("storedProc" + watch.Elapsed);
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo) && searchModel.ContractId != 0)
|
||||
query = query.Where(x =>
|
||||
|
||||
@@ -26,7 +26,6 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
return new();
|
||||
return new EditCustomizeEmployeeSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
|
||||
@@ -265,7 +265,7 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
||||
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
|
||||
return new EditCustomizeWorkshopGroupSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
//FridayWork = entity.FridayWork,
|
||||
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
@@ -338,8 +338,8 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
}).ToList(),
|
||||
OffDayOfWeeks = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -159,7 +159,6 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
return new();
|
||||
var viewModel = new EditCustomizeWorkshopSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
@@ -234,7 +233,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||
|
||||
};
|
||||
return viewModel;
|
||||
@@ -261,8 +261,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
HolidayWork = entity.HolidayWork,
|
||||
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||
|
||||
};
|
||||
}
|
||||
@@ -318,7 +318,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
{
|
||||
EndTime = r.EndTime.ToString("HH:mm"),
|
||||
StartTime = r.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
}).ToList(),
|
||||
OffDayOfWeeks = g.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
|
||||
|
||||
}).ToList(),
|
||||
|
||||
|
||||
@@ -30,8 +30,14 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
ComputeOptions = x.ComputeOptions,
|
||||
YearsOptions = x.YearsOptions,
|
||||
BonusesOptions = x.BonusesOptions,
|
||||
SignCheckout = x.SignCheckout,
|
||||
CreateCheckout = x.CreateCheckout,
|
||||
CreateContract = x.CreateContract,
|
||||
SignContract = x.SignContract,
|
||||
ContractTerm = x.ContractTerm,
|
||||
CutContractEndOfYear = x.CutContractEndOfYear
|
||||
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@@ -45,7 +51,13 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
ComputeOptions = getFromWorkshop.ComputeOptions,
|
||||
YearsOptions = getFromWorkshop.YearsOptions,
|
||||
BonusesOptions= getFromWorkshop.BonusesOptions,
|
||||
};
|
||||
CreateCheckout = getFromWorkshop.CreateCheckout,
|
||||
CreateContract = getFromWorkshop.CreateContract,
|
||||
SignCheckout = getFromWorkshop.SignCheckout,
|
||||
SignContract = getFromWorkshop.SignContract,
|
||||
ContractTerm = getFromWorkshop.ContractTerm,
|
||||
CutContractEndOfYear = getFromWorkshop.CutContractEndOfYear
|
||||
};
|
||||
|
||||
result = fromWorkshop;
|
||||
|
||||
|
||||
@@ -415,8 +415,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
InspectionDone = result.insurance.Inspection.IsDone,
|
||||
EmployerApprovalStatus = result.insurance.EmployerApproval.Status
|
||||
});
|
||||
|
||||
query = searchModel.Status switch
|
||||
{
|
||||
@@ -1492,33 +1493,108 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year)
|
||||
{
|
||||
var workshopIds = _context.WorkshopAccounts
|
||||
.Where(a => a.AccountId == accountId)
|
||||
.Select(a => a.WorkshopId);
|
||||
var res = await _context.InsuranceListSet
|
||||
.Where(x =>
|
||||
x.Year == year.ToString("0000") &&
|
||||
x.Month == month.ToString("00") &&
|
||||
workshopIds.Contains(x.WorkshopId)
|
||||
)
|
||||
.GroupBy(x => 1)
|
||||
.Select(g => new InsuranceListTabsCountViewModel
|
||||
{
|
||||
NotStarted = g.Count(x =>
|
||||
!x.Debt.IsDone && !x.EmployerApproval.IsDone && !x.Inspection.IsDone && !x.ConfirmSentlist),
|
||||
InProgress = g.Count(x =>
|
||||
(x.Debt.IsDone || x.EmployerApproval.IsDone || x.Inspection.IsDone)&& !(x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone) && !x.ConfirmSentlist),
|
||||
ReadyToSendList = g.Count(x =>
|
||||
x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone && !x.ConfirmSentlist),
|
||||
Done = g.Count(x => x.ConfirmSentlist)
|
||||
})
|
||||
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
|
||||
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
|
||||
return res;
|
||||
var workshopIds = _context.WorkshopAccounts
|
||||
.Where(a => a.AccountId == acountId)
|
||||
.Select(a => a.WorkshopId);
|
||||
var query = _context.InsuranceListSet
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
|
||||
insurance => insurance.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
(insurance, workshop) => new { insurance, workshop })
|
||||
.GroupJoin(_context.WorkshopEmployers,
|
||||
result => result.workshop.id,
|
||||
employer => employer.WorkshopId,
|
||||
(result, employer) => new { result.insurance, result.workshop, employer })
|
||||
.Select(result => new InsuranceListViewModel
|
||||
{
|
||||
Id = result.insurance.id,
|
||||
Year = result.insurance.Year,
|
||||
Month = result.insurance.Month,
|
||||
WorkShopId = result.insurance.WorkshopId,
|
||||
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
|
||||
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
|
||||
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
|
||||
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
|
||||
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
|
||||
FixedSalary = result.workshop.FixedSalary,
|
||||
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
|
||||
ConfirmSentlist = result.insurance.ConfirmSentlist,
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Month == searchModel.Month);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year);
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
|
||||
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
|
||||
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
|
||||
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
|
||||
|
||||
query = query.Where(x => x.WorkShopName.Contains(workshopName));
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
|
||||
query = query.Where(x => x.EmployerName.Contains(employerName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployerName))
|
||||
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
|
||||
|
||||
|
||||
if (searchModel.FixedSalary != null)
|
||||
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
|
||||
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
|
||||
query = query.Where(x => x.City == searchModel.City);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Branch))
|
||||
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
|
||||
|
||||
|
||||
|
||||
var res = await query.GroupBy(x => 1)
|
||||
.Select(g => new InsuranceListTabsCountViewModel
|
||||
{
|
||||
NotStarted = g.Count(x =>
|
||||
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
|
||||
InProgress = g.Count(x =>
|
||||
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
|
||||
ReadyToSendList = g.Count(x =>
|
||||
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
|
||||
Done = g.Count(x => x.ConfirmSentlist)
|
||||
})
|
||||
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -6,8 +6,11 @@ using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -23,18 +26,18 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
public EditLeftWork GetDetails(long id)
|
||||
{
|
||||
return _context.LeftWorkList.Select(x => new EditLeftWork()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
@@ -92,10 +95,10 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
JobId = x.JobId,
|
||||
|
||||
|
||||
|
||||
}).Where(x=>x.WorkshopId == workshopId);
|
||||
|
||||
}).Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
return query.ToList();
|
||||
}
|
||||
@@ -103,7 +106,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public List<LeftWorkViewModel> search(LeftWorkSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -135,24 +138,24 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
public LeftWorkViewModel CheckoutleftWorkCheck(DateTime contractStart, long workshopId, long employeeId)
|
||||
{
|
||||
return _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
StartWorkDateGr = x.StartWorkDate,
|
||||
LeftWorkDateGr = x.LeftWorkDate,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
AddBonusesPay = x.AddBonusesPay,
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
StartWorkDateGr = x.StartWorkDate,
|
||||
LeftWorkDateGr = x.LeftWorkDate,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
AddBonusesPay = x.AddBonusesPay,
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
|
||||
|
||||
})
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId
|
||||
|
||||
})
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId
|
||||
&& contractStart >= x.StartWorkDateGr && contractStart <= x.LeftWorkDateGr);
|
||||
}
|
||||
|
||||
@@ -163,7 +166,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
if (item != null)
|
||||
{
|
||||
|
||||
|
||||
|
||||
_context.LeftWorkList.Remove(item);
|
||||
_context.SaveChanges();
|
||||
if (!_context.LeftWorkList.Any(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId && item.id != x.id) && HasActiveRollCallStatus(item.WorkshopId, item.EmployeeId))
|
||||
@@ -179,31 +182,31 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public LeftWorkViewModel GetByDateAndWorkshopIdAndEmployeeId(long workshopId, long employeeId, DateTime dateTime)
|
||||
{
|
||||
var entity = _context.LeftWorkList.FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId &&
|
||||
(x.StartWorkDate <= dateTime && x.LeftWorkDate >= dateTime));
|
||||
if (entity == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
LeftWorkDate = entity.LeftWorkDate.ToFarsi(),
|
||||
HasLeft = entity.HasLeft,
|
||||
LeftWorkDateGr = entity.LeftWorkDate,
|
||||
StartWorkDateGr = entity.StartWorkDate,
|
||||
Id = entity.id
|
||||
var entity = _context.LeftWorkList.FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId &&
|
||||
(x.StartWorkDate <= dateTime && x.LeftWorkDate >= dateTime));
|
||||
if (entity == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
LeftWorkDate = entity.LeftWorkDate.ToFarsi(),
|
||||
HasLeft = entity.HasLeft,
|
||||
LeftWorkDateGr = entity.LeftWorkDate,
|
||||
StartWorkDateGr = entity.StartWorkDate,
|
||||
Id = entity.id
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
public List<long> GetAllEmployeeIdsInWorkshop(long workshopId)
|
||||
{
|
||||
var leftWorks = _context.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
var leftWorks = _context.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
var insuranceLeftWork = _context.LeftWorkInsuranceList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
@@ -267,7 +270,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
RemoveEmployeeRollCallStatus(workshopId, employeeId);
|
||||
if (hasLeftWorkInsurance)
|
||||
return
|
||||
op.Succcedded(1, "حذف با موفقیت انجام شد."); //+ "<br/>" + "<span class='text-danger'>" + "کد پرسنلی این شخص به دلیل استفاده در ترک کار بیمه قابل حذف نمی باشد. " + "</span>");
|
||||
op.Succcedded(1, "حذف با موفقیت انجام شد."); //+ "<br/>" + "<span class='text-danger'>" + "کد پرسنلی این شخص به دلیل استفاده در ترک کار بیمه قابل حذف نمی باشد. " + "</span>");
|
||||
else
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -369,7 +372,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
_context.LeftWorkList.RemoveRange(LeftWork);
|
||||
DateTime left = item2.LeftWorkDate.ToGeorgianDateTime();
|
||||
var start = item2.StartWorkDate.ToGeorgianDateTime();
|
||||
var leftwork = new LeftWork(left, start, item2.WorkshopId, item2.EmployeeId, command.EmployeeFullName, item2.WorkshopName, item2.JobId, item2.IncludeStatus,item2.AddBonusesPay,item2.AddYearsPay,item2.AddLeavePay, workshopComputeOptions, workshopBonusesOptions);
|
||||
var leftwork = new LeftWork(left, start, item2.WorkshopId, item2.EmployeeId, command.EmployeeFullName, item2.WorkshopName, item2.JobId, item2.IncludeStatus, item2.AddBonusesPay, item2.AddYearsPay, item2.AddLeavePay, workshopComputeOptions, workshopBonusesOptions);
|
||||
Create(leftwork);
|
||||
}
|
||||
}
|
||||
@@ -393,7 +396,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
foreach (var item in leftWorkGroups)
|
||||
{
|
||||
#region PersonelCode
|
||||
@@ -401,7 +404,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
if (commandPersonnelCode != null && commandPersonnelCode.Count > 0)
|
||||
{
|
||||
var personelcode = commandPersonnelCode.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).FirstOrDefault();
|
||||
if (personelcode != null && personelcode.HasPersonelCode==false)
|
||||
if (personelcode != null && personelcode.HasPersonelCode == false)
|
||||
{
|
||||
if (_context.PersonnelCodeSet.Any(x => x.WorkshopId == item.WorkshopId && x.PersonnelCode == personelcode.PersonnelCode))
|
||||
{
|
||||
@@ -416,18 +419,18 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
_context.PersonnelCodeSet.Add(new PersonnelCodeDomain(item.WorkshopId, commandEmployeeId, personelcode.PersonnelCode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
if (item.LeftWorkViewModels != null && item.LeftWorkViewModels.Count > 0)
|
||||
{
|
||||
bool checkRegister = false;
|
||||
|
||||
|
||||
|
||||
var LeftWorkList = _context.LeftWorkList.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).ToList();
|
||||
|
||||
var removeList = new List<LeftWork>();
|
||||
|
||||
|
||||
foreach (var removeItem in LeftWorkList)
|
||||
{
|
||||
if (!item.LeftWorkViewModels.Any(x => x.Id == removeItem.id))
|
||||
@@ -463,7 +466,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
{
|
||||
_context.LeftWorkList.RemoveRange(removeList);
|
||||
}
|
||||
|
||||
|
||||
//foreach (var item2 in item.LeftWorkViewModels)
|
||||
//{
|
||||
// var LeftWork = _context.LeftWorkList.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).ToList();
|
||||
@@ -480,7 +483,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
_context.SaveChanges();
|
||||
transaction.Commit();
|
||||
op.Succcedded(-1, " ثبت با موفقیت انجام شد. ");
|
||||
op.Succcedded(-1, " ثبت با موفقیت انجام شد. ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -497,8 +500,8 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
var op = new OperationResult();
|
||||
bool hasContracts = false;
|
||||
var endDateSend = date.Date.AddDays(-1);
|
||||
if (type==1)
|
||||
hasContracts= _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= endDateSend) && x.IsActiveString == "true");
|
||||
if (type == 1)
|
||||
hasContracts = _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= endDateSend) && x.IsActiveString == "true");
|
||||
else
|
||||
{
|
||||
endDateSend = date.Date;
|
||||
@@ -514,23 +517,23 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
return op.Failed("در این تاریخ تصفیه حساب ثبت شده است.برای حذف تاریخ ترک کار، ابتدا تصفیه حساب های مربوطه را حذف کنید");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult CheckEditLeftWork(long workshopId, long employeeId, DateTime date, int type)
|
||||
}
|
||||
public OperationResult CheckEditLeftWork(long workshopId, long employeeId, DateTime date, int type)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
bool hasContracts = false;
|
||||
|
||||
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
hasContracts= _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date>= date) && x.IsActiveString == "true");
|
||||
if(hasContracts)
|
||||
hasContracts = _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= date) && x.IsActiveString == "true");
|
||||
if (hasContracts)
|
||||
return op.Failed("لطفا ابتدا تصفیه حساب های آتی را حذف نمایید");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var LeftDay = date.Date;
|
||||
@@ -553,16 +556,16 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
var LastDayContract = _context.CheckoutSet.Any(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.IsActiveString == "true" &&
|
||||
x.ContractEnd.Date > lastDay.Date);
|
||||
if(LastDayContract)
|
||||
if (LastDayContract)
|
||||
return op.Failed("AfterContracts");
|
||||
// var contract = _context.Contracts.Where(x => x.EmployeeId == employeeId && x.WorkshopIds == workshopId && x.IsActiveString == "true").OrderByDescending(x=>x.ContarctStart).FirstOrDefault();
|
||||
// var contract = _context.Contracts.Where(x => x.EmployeeId == employeeId && x.WorkshopIds == workshopId && x.IsActiveString == "true").OrderByDescending(x=>x.ContarctStart).FirstOrDefault();
|
||||
|
||||
//if (contract != null)
|
||||
//{
|
||||
|
||||
|
||||
// if ((contract.ContarctStart.Date <= endDateSend.Date && contract.ContractEnd.Date >= endDateSend.Date))
|
||||
// {
|
||||
|
||||
|
||||
// var checkout = _context.CheckoutSet.Where(x =>
|
||||
// x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
|
||||
// (x.ContractStart.Date <= date.Date && x.ContractEnd.Date >= date.Date)).FirstOrDefault();
|
||||
@@ -591,7 +594,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
// //}
|
||||
//}
|
||||
return op.Succcedded();
|
||||
|
||||
|
||||
}
|
||||
|
||||
return op.Succcedded();
|
||||
@@ -644,7 +647,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public async Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId)
|
||||
{
|
||||
var leftWork =await _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
var leftWork = await _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
.OrderByDescending(x => x.StartWorkDate).FirstOrDefaultAsync();
|
||||
return leftWork;
|
||||
}
|
||||
@@ -655,9 +658,9 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
var clientTemps = _context.EmployeeClientTemps.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Select(x => x.EmployeeId);
|
||||
.Select(x => x.EmployeeId);
|
||||
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
@@ -675,7 +678,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName
|
||||
|
||||
|
||||
}).Where(x=> !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||
}).Where(x => !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
||||
@@ -695,7 +698,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
}
|
||||
private void RemoveEmployeeRollCallStatus(long workshopId, long employeeId)
|
||||
{
|
||||
var entity = _context.RollCallEmployees.Include(x=>x.EmployeesStatus).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
var entity = _context.RollCallEmployees.Include(x => x.EmployeesStatus).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
@@ -724,8 +727,167 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
}
|
||||
//_context.RollCallEmployees.Remove(entity);
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region AutoExtentionEmployees
|
||||
|
||||
public AutoExtensionDto AutoExtentionEmployees(long workshopId)
|
||||
{
|
||||
if (workshopId == 0)
|
||||
return new AutoExtensionDto();
|
||||
var query = _context.LeftWorkList
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Workshop)
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
|
||||
// Left Join با PersonnelCodeSet
|
||||
.GroupJoin(_context.PersonnelCodeSet.Where(p => p.WorkshopId == workshopId),
|
||||
leftList => leftList.EmployeeId,
|
||||
personnelCode => personnelCode.EmployeeId,
|
||||
(leftList, personnelCodes) => new { leftList, personnelCodes })
|
||||
.SelectMany(
|
||||
x => x.personnelCodes.DefaultIfEmpty(),
|
||||
(x, personnelCode) => new { x.leftList, personnelCode })
|
||||
|
||||
// Left Join با Jobs
|
||||
.GroupJoin(_context.Jobs,
|
||||
x => x.leftList.JobId,
|
||||
job => job.id,
|
||||
(x, jobs) => new { x.leftList, x.personnelCode, jobs })
|
||||
.SelectMany(
|
||||
x => x.jobs.DefaultIfEmpty(),
|
||||
(x, job) => new { x.leftList, x.personnelCode, job })
|
||||
|
||||
// Left Join با EmployeeComputeOptionsSet
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
x => x.leftList.EmployeeId,
|
||||
option => option.EmployeeId,
|
||||
(x, options) => new { x.leftList, x.personnelCode, x.job, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.leftList, x.personnelCode, x.job, option })
|
||||
|
||||
.Select(result => new AutoExtensionEmployeeListDto
|
||||
{
|
||||
EmployeeId = result.leftList.EmployeeId,
|
||||
EmployeeName = result.leftList.EmployeeFullName,
|
||||
PersonnelCode = result.personnelCode != null ? result.personnelCode.PersonnelCode : 0,
|
||||
JobType = result.job != null ? result.job.JobName : "نامشخص",
|
||||
JobTypeId = result.job != null ? result.job.id : 0,
|
||||
EmployeeHasCreateContract = result.option != null
|
||||
? result.option.CreateContract
|
||||
: result.leftList.Workshop.CreateContract
|
||||
}).GroupBy(x => x.EmployeeId)
|
||||
.Select(g => g.First())
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
//var query = _context.LeftWorkList.Include(x => x.Employee).Include(w => w.Workshop)
|
||||
// .Where(x => x.WorkshopId == workshopId)
|
||||
// .Join(_context.PersonnelCodeSet.AsSplitQuery().Where(p => p.WorkshopId == workshopId),
|
||||
// leftList => leftList.EmployeeId,
|
||||
// personnelCode => personnelCode.EmployeeId,
|
||||
// (leftList, personnelCode) =>
|
||||
// new { leftList, personnelCode })
|
||||
// .Join(_context.Jobs,
|
||||
// left => left.leftList.JobId,
|
||||
// job => job.id,
|
||||
// (left, job) => new { left, job })
|
||||
// .Join(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
// leftResult => leftResult.left.leftList.EmployeeId,
|
||||
// options => options.EmployeeId,
|
||||
// (leftResult, options) => new { leftResult, options })
|
||||
// .Select(result => new AutoExtensionEmployeeListDto()
|
||||
// {
|
||||
|
||||
|
||||
// EmployeeId = result.leftResult.left.leftList.EmployeeId,
|
||||
// EmployeeName = result.leftResult.left.leftList.EmployeeFullName,
|
||||
// PersonnelCode = result.leftResult.left.personnelCode == null ? 0 : result.leftResult.left.personnelCode.PersonnelCode,
|
||||
|
||||
// JobType = result.leftResult.job.JobName,
|
||||
// JobTypeId = result.leftResult.job.id,
|
||||
// EmployeeHasCreateContract = result.options == null ? result.leftResult.left.leftList.Workshop.CreateContract : result.options.CreateContract
|
||||
|
||||
|
||||
// }).ToList();
|
||||
var result = new AutoExtensionDto();
|
||||
var workshop = _context.Workshops.FirstOrDefault(x => x.id == workshopId);
|
||||
var employerId = _context.WorkshopEmployers.FirstOrDefault(x => x.WorkshopId == workshopId)!.EmployerId;
|
||||
|
||||
var employer = _context.Employers.FirstOrDefault(x => x.id == employerId);
|
||||
var employerWarning = false;
|
||||
var employerWarningMessage = "";
|
||||
|
||||
|
||||
if (employer != null && employer.IsLegal == "حقوقی")
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(employer.NationalId) || string.IsNullOrWhiteSpace(employer.RegisterId))
|
||||
{
|
||||
employerWarning = true;
|
||||
employerWarningMessage = "شناسه ملی ، شماره ثبت کارفرمای این کارگاه را بررسی کنید";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(employer.Nationalcode) || string.IsNullOrWhiteSpace(employer.Gender))
|
||||
{
|
||||
employerWarning = true;
|
||||
employerWarningMessage = "کد ملی ، جنسیت کارفرمای این کارگاه را بررسی گنید";
|
||||
}
|
||||
}
|
||||
if (query.Any() && workshop != null)
|
||||
{
|
||||
|
||||
result = new AutoExtensionDto()
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
HavingPersonel = true,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
WAddress1 = workshop.Address,
|
||||
CreateContract = workshop.CreateContract,
|
||||
EmployerId = employerId,
|
||||
EmployerWarning = employerWarning,
|
||||
EmployerWarningMessage = employerWarningMessage,
|
||||
EmployeeList = query.Select(x => new AutoExtensionEmployeeListDto()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeName = x.EmployeeName,
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
JobType = x.JobType,
|
||||
JobTypeId = x.JobTypeId,
|
||||
EmployeeHasCreateContract = x.EmployeeHasCreateContract
|
||||
|
||||
}).ToList(),
|
||||
EmployeeSelectList = new SelectList(query.Where(x => x.EmployeeHasCreateContract), "EmployeeId", "EmployeeName ")
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new AutoExtensionDto()
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
HavingPersonel = false,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
WAddress1 = workshop.Address,
|
||||
CreateContract = workshop.CreateContract
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -2089,6 +2089,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
int contractSignedPercent = 0;
|
||||
@@ -2103,9 +2104,12 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
if (contractSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
|
||||
var contractEmployeeIds = workshop.Contracts2.Where(x => x.Signature == "0")
|
||||
.Select(x => x.EmployeeId).ToList();
|
||||
var lefts = workshop.LeftWorks.Select(x => x.EmployeeId).Distinct().ToList();
|
||||
var contractNotNullEmployeeId = lefts.Where(x => contractEmployeeIds.Contains(x)).ToList();
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
workshop.Contracts2.Where(x => x.Signature == "0" && contractNotNullEmployeeId.Contains(x.EmployeeId)).Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
@@ -58,7 +58,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
}
|
||||
else
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 585 or 610;
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 610;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
WorkshopId = command.WorkshopId,
|
||||
EmployeeId = employee.Id,
|
||||
Id = joinedRollCall == null ? 0 : joinedRollCall.id,
|
||||
EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName,
|
||||
EmployeeFullName = employee.FullName,
|
||||
NationalCode = employee.NationalCode,
|
||||
IsActiveString =
|
||||
joinedRollCall.EmployeesStatus.Any(y =>
|
||||
@@ -217,7 +217,9 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
? "true"
|
||||
: "false",
|
||||
HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage,
|
||||
CreatedByClient = clientTemp != null || (employee.workshopTemp != null && employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork)
|
||||
CreatedByClient = clientTemp != null || (employee.workshopTemp != null && employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork),
|
||||
RollCallEmployeeName = joinedRollCall == null ? null : joinedRollCall.EmployeeFullName,
|
||||
HasChangedName = joinedRollCall != null && joinedRollCall.HasChangedName
|
||||
};
|
||||
|
||||
|
||||
@@ -350,8 +352,8 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
|
||||
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId
|
||||
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow)
|
||||
&& x.HasUploadedImage == "true" &&leftWork.Any(l=>l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId));
|
||||
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow)
|
||||
&& x.HasUploadedImage == "true" && leftWork.Any(l => l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId));
|
||||
|
||||
|
||||
var personnel =
|
||||
@@ -476,7 +478,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
|
||||
public RollCallEmployee GetBy(long employeeId, long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
return _context.RollCallEmployees.Include(x => x.EmployeesStatus).FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -969,7 +969,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
var activatedEmployeesList = activeEmployeesQuery.ToList();
|
||||
var leavesList = leavesQuery.ToList();
|
||||
|
||||
//start search year may be in another year
|
||||
//start of search year may be different to end of search year
|
||||
var holidays1 = _holidayItemApplication.Search(new HolidayItemSearchModel()
|
||||
{
|
||||
HolidayYear = startSearch.ToFarsiYear()
|
||||
@@ -984,33 +984,46 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
List<RollCallsByDateViewModel> result = new();
|
||||
foreach (var day in days)
|
||||
{
|
||||
|
||||
List<RollCallEmployee> activatedEmployeesListInDay = new();
|
||||
bool isHoliday = totalHolidays.Any(x => x.HolidaydateGr == day);
|
||||
|
||||
//in working days everyone should be present
|
||||
if (day.DayOfWeek != DayOfWeek.Friday && !isHoliday)
|
||||
List<RollCallEmployee> activatedEmployeesListInDay = new();
|
||||
|
||||
activatedEmployeesListInDay = activatedEmployeesList
|
||||
.Join(employeeSettingsList.Where(x => x.WeeklyOffDays == null || !x.WeeklyOffDays.Select(w => w.DayOfWeek).Contains(day.DayOfWeek))
|
||||
, x => x.EmployeeId, y => y.EmployeeId,
|
||||
(x, _) => x).ToList();
|
||||
|
||||
if (isHoliday)
|
||||
{
|
||||
activatedEmployeesListInDay = activatedEmployeesList;
|
||||
activatedEmployeesListInDay = activatedEmployeesListInDay
|
||||
.Join(employeeSettingsList.Where(x => x.WeeklyOffDays == null || x.HolidayWork != HolidayWork.Default)
|
||||
, x => x.EmployeeId, y => y.EmployeeId,
|
||||
(x, _) => x).ToList();
|
||||
}
|
||||
|
||||
//in fridays, friday workers should be present
|
||||
else if (day.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
activatedEmployeesListInDay = activatedEmployeesList
|
||||
.Join(employeeSettingsList.Where(x => x.FridayWork != FridayWork.Default)
|
||||
, x => x.EmployeeId, y => y.EmployeeId,
|
||||
(x, y) => x).ToList();
|
||||
}
|
||||
////in working days everyone should be present
|
||||
//if (day.DayOfWeek != DayOfWeek.Friday && isHoliday == false)
|
||||
//{
|
||||
// activatedEmployeesListInDay = activatedEmployeesList;
|
||||
//}
|
||||
|
||||
//in holidays holiday worksers should be present
|
||||
else
|
||||
{
|
||||
activatedEmployeesListInDay = activatedEmployeesList
|
||||
.Join(employeeSettingsList.Where(x => x.HolidayWork != HolidayWork.Default)
|
||||
, x => x.EmployeeId, y => y.EmployeeId,
|
||||
(x, y) => x).ToList();
|
||||
}
|
||||
////in fridays, friday workers should be present
|
||||
//else if (day.DayOfWeek == DayOfWeek.Friday)
|
||||
//{
|
||||
// activatedEmployeesListInDay = activatedEmployeesList
|
||||
// .Join(employeeSettingsList.Where(x => x.FridayWork != FridayWork.Default)
|
||||
// , x => x.EmployeeId, y => y.EmployeeId,
|
||||
// (x, y) => x).ToList();
|
||||
//}
|
||||
|
||||
////in holidays holiday workers should be present
|
||||
//else
|
||||
//{
|
||||
// activatedEmployeesListInDay = activatedEmployeesList
|
||||
// .Join(employeeSettingsList.Where(x => x.HolidayWork != HolidayWork.Default)
|
||||
// , x => x.EmployeeId, y => y.EmployeeId,
|
||||
// (x, y) => x).ToList();
|
||||
//}
|
||||
var item = new RollCallsByDateViewModel()
|
||||
{
|
||||
DateGr = day,
|
||||
@@ -1037,6 +1050,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
}
|
||||
|
||||
|
||||
|
||||
//گزارش آنلاین حضور غیاب کارگاه
|
||||
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
|
||||
{
|
||||
|
||||
@@ -197,9 +197,16 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
HasRollCallFreeVip = x.HasRollCallFreeVip,
|
||||
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
|
||||
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
|
||||
InsuranceCheckoutFamilyAllowance = x.InsuranceCheckoutFamilyAllowance
|
||||
InsuranceCheckoutFamilyAllowance = x.InsuranceCheckoutFamilyAllowance,
|
||||
CutContractEndOfYear = x.CutContractEndOfYear,
|
||||
CreateContract = x.CreateContract,
|
||||
SignContract = x.SignContract,
|
||||
CreateCheckout = x.CreateCheckout,
|
||||
SignCheckout = x.SignCheckout,
|
||||
RotatingShiftCompute = x.RotatingShiftCompute,
|
||||
IsStaticCheckout = x.IsStaticCheckout,
|
||||
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
public List<long> GetRelation(long workshopid)
|
||||
|
||||
@@ -2739,6 +2739,9 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
else
|
||||
{
|
||||
periodOfAbsence = usedLeaves - canToLeave;
|
||||
if (workingHoursePerDay >= 7.33)
|
||||
periodOfAbsence = 0;
|
||||
|
||||
|
||||
#region AbsenceItemsCompute
|
||||
|
||||
@@ -3314,9 +3317,10 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
|
||||
periodOfAbsence = usedLeaves;
|
||||
|
||||
#endregion
|
||||
|
||||
contactCanToleaveList.Add(new ContractsCanToLeave()
|
||||
#endregion
|
||||
|
||||
contactCanToleaveList.Add(new ContractsCanToLeave()
|
||||
{
|
||||
ContractCounter = contractCounter,
|
||||
WorkingPerDayHourses = workingHoursePerDay,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Govermentlist/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -1,4 +1,5 @@
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@using Microsoft.CodeAnalysis.CSharp.Syntax
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@{
|
||||
var i = 1;
|
||||
var b = 0;
|
||||
@@ -14,7 +15,7 @@
|
||||
|
||||
|
||||
|
||||
@if (Model.CreateCheckoutList.Count > 0)
|
||||
@if (Model.CreateCheckoutList.Count > 0 && !Model.HasWorkFlow)
|
||||
{
|
||||
@foreach (var item in Model.CreateCheckoutList)
|
||||
{
|
||||
@@ -151,6 +152,22 @@
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (@Model.HasWorkFlow)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="3"></div>
|
||||
<div class="6">
|
||||
<h4 style="color: red">این کارگاه به دلیل داشتن کارپوشه مجاز به ایجاد تصفیه حساب نمی باشد</h4>
|
||||
</div>
|
||||
<div class="3"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
@@ -743,7 +743,7 @@
|
||||
<th style="width: 12%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> مقطع اول کار </th>
|
||||
<th style="width: 12%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> مقطع دوم کار </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> استراحت </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; font-size: 10px"> جمع </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; font-size: 10px"> کارکرد </th>
|
||||
</tr>
|
||||
@for (int i = 0; i < 16; i++)
|
||||
{
|
||||
@@ -849,18 +849,18 @@
|
||||
|
||||
|
||||
<tr style="height: 20px; border-bottom: 1px solid; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی <span>:</span> @Model.TotalPaidLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی <span>:</span> @Model.TotalSickLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="10" style="padding: 0;">
|
||||
<table style="width: 100%; table-layout: fixed;">
|
||||
<tr style="height: 20px; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year <span>:</span> @Model.TotalMandatoryTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور <span>:</span> @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت <span>:</span> @Model.TotalBreakTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی <span>:</span> @Model.TotalWorkingTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -170,21 +170,33 @@
|
||||
@item.PersonnelCode
|
||||
</td>
|
||||
<td class="hidden-xs" id="td_@item.Id" class="signSize" style="font-size: 12px !important; text-align: center;">
|
||||
@if (item.Signature == "1")
|
||||
@if (item.HasSignCheckout)
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
@if (item.Signature == "1")
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed" />
|
||||
</a>
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed"/>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20216" class="myLinkSign " name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned"/>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20216" class="myLinkSign " name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned" />
|
||||
<a class="myLinkSign" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #37baf6"></i>
|
||||
|
||||
</a>
|
||||
}
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row m-t-20">
|
||||
<div class="row " style="margin-top: 8px;">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
@@ -386,7 +386,7 @@
|
||||
</div>
|
||||
|
||||
<div style="">
|
||||
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="margin-top: 4px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@@ -557,24 +557,30 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<table style="width:100%; background-color: #575656 !important;border-radius: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr
|
||||
</th>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -513,18 +513,19 @@
|
||||
|
||||
|
||||
<tr style="height: 20px; border-bottom: 1px solid; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی <span>:</span> @Model.TotalPaidLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی <span>:</span> @Model.TotalSickLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="10" style="padding: 0;">
|
||||
<table style="width: 100%; table-layout: fixed;">
|
||||
<tr style="height: 20px; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year <span>:</span> @Model.TotalMandatoryTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور <span>:</span> @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت <span>:</span> @Model.TotalBreakTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی <span>:</span> @Model.TotalWorkingTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-t-20">
|
||||
<div class="row " style="margin-top: 8px;">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
@@ -368,7 +368,7 @@
|
||||
</div>
|
||||
|
||||
<div style="">
|
||||
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="margin-top: 4px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@@ -538,23 +538,28 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<table style="width:100%; background-color: #575656 !important;border-radius: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr
|
||||
</th>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,621 +1,231 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel
|
||||
|
||||
@{
|
||||
Layout = "Shared/_AdminLayout";
|
||||
ViewData["title"] = "لیست پرسنلهای " + Model.WorkshopFullName;
|
||||
|
||||
var i = 1;
|
||||
|
||||
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td, th {
|
||||
border-bottom: 1px solid #cfe5e0;
|
||||
font-size: 1rem;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
th {
|
||||
padding: 1.5rem 1rem;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
tbody tr.selected td {
|
||||
background: #e0eeeb;
|
||||
}
|
||||
|
||||
tbody tr:hover:not(.selected) td,
|
||||
tbody tr.hover:not(.selected) td {
|
||||
background: #f0f7f5;
|
||||
}
|
||||
|
||||
.table-footer, .table-header {
|
||||
font-size: .875rem;
|
||||
}
|
||||
|
||||
.table-footer {
|
||||
margin: -1.5rem 0 0;
|
||||
}
|
||||
|
||||
.table-header {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
.table-footer.grid,
|
||||
.table-header.grid {
|
||||
align-items: center;
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.border-index {
|
||||
background: #dbeafe;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 6px;
|
||||
color: #3f3f46;
|
||||
}
|
||||
|
||||
.black {
|
||||
background: #00000070
|
||||
}
|
||||
|
||||
button:disabled,
|
||||
button[disabled] {
|
||||
border: 1px solid #999999 !important;
|
||||
background-color: #cccccc !important;
|
||||
color: #666666 !important;
|
||||
}
|
||||
|
||||
.top-information,
|
||||
.bottom-information {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
|
||||
background-color: #29cc97;
|
||||
top: 14px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
border: 0;
|
||||
font-weight: bold;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
|
||||
background-color: fec400;
|
||||
}
|
||||
|
||||
.dataTables_wrapper {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.dataTables_length {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_filter {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#DataTables_Table_0_last {
|
||||
-moz-border-radius-bottomright: 0px;
|
||||
-webkit-border-bottom-right-radius: 0px;
|
||||
-khtml-border-bottom-right-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
-moz-border-radius-topright: 0px;
|
||||
-webkit-border-top-right-radius: 0px;
|
||||
-khtml-border-top-right-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
-moz-border-radius-bottomleft: 6px;
|
||||
-webkit-border-bottom-left-radius: 6px;
|
||||
-khtml-border-bottom-left-radius: 6px;
|
||||
border-bottom-left-radius: 6px;
|
||||
-moz-border-radius-topleft: 6px;
|
||||
-webkit-border-top-left-radius: 6px;
|
||||
-khtml-border-top-left-radius: 6px;
|
||||
border-top-left-radius: 6px;
|
||||
}
|
||||
|
||||
#DataTables_Table_0_first {
|
||||
-moz-border-radius-bottomright: 6px;
|
||||
-webkit-border-bottom-right-radius: 6px;
|
||||
-khtml-border-bottom-right-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
-moz-border-radius-topright: 6px;
|
||||
-webkit-border-top-right-radius: 6px;
|
||||
-khtml-border-top-right-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
-moz-border-radius-bottomleft: 0px;
|
||||
-webkit-border-bottom-left-radius: 0px;
|
||||
-khtml-border-bottom-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
-moz-border-radius-topleft: 0px;
|
||||
-webkit-border-top-left-radius: 0px;
|
||||
-khtml-border-top-left-radius: 0px;
|
||||
border-top-left-radius: 0px;
|
||||
}
|
||||
|
||||
.dataTables_info {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
Layout = "Shared/_AdminLayout";
|
||||
ViewData["title"] = "لیست پرسنلهای " + @Model.WorkshopFullName;
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
int i = 1;
|
||||
}
|
||||
|
||||
@section Styles
|
||||
{
|
||||
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet"/>
|
||||
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet"/>
|
||||
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet"/>
|
||||
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet" />
|
||||
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
|
||||
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet" />
|
||||
<link href="~/assetsadmin/page/connectedpersonnels/css/index.css?ver=@adminVersion" rel="stylesheet" />
|
||||
<style>
|
||||
.table > tbody > tr > td{
|
||||
padding: 3px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId"/>
|
||||
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div permission="10312" class="panel panel-default">
|
||||
<div class="panel-heading" style="background-color: #465149">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنلهای @Model.WorkshopFullName</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ردیف</th>
|
||||
<th>نام و نام خانوادگی</th>
|
||||
<th>کد پرسنلی</th>
|
||||
<th>دارای قرارداد</th>
|
||||
<th>دارای بیمه</th>
|
||||
<th>انتخاب نوع محاسبه طلب مرخصی</th>
|
||||
<th>انتخاب نوع محاسبه سنوات</th>
|
||||
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
|
||||
<th>عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.PersonnelList.ConnectedPersonnelViewModels)
|
||||
{
|
||||
<tr class="tableFindBtn @(item.Black ? "black" : "")">
|
||||
<td class="text-center">
|
||||
<div class="border-index">@i</div>
|
||||
</td>
|
||||
@{
|
||||
i++;
|
||||
}
|
||||
<td>
|
||||
<h6>@item.PersonName</h6>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<h6>@item.PersonelCode</h6>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (item.ContractPerson && !item.ContractLeft)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (item.InsurancePerson && !item.InsurancetLeft)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
|
||||
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 230px;font-size: 12px;">
|
||||
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 230px;font-size: 12px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 230px;font-size: 12px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (item.ContractPerson)
|
||||
{
|
||||
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
|
||||
}
|
||||
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
|
||||
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId })">
|
||||
<i class="ion-information-circled ionSize"></i>
|
||||
</a>
|
||||
</td>
|
||||
<div class="col-sm-12">
|
||||
<div permission="10312" class="panel panel-default">
|
||||
<div class="panel-heading" style="background-color: #465149">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنلهای @Model.WorkshopFullName</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ردیف</th>
|
||||
<th>نام و نام خانوادگی</th>
|
||||
<th>کد پرسنلی</th>
|
||||
<th>مدت قراداد</th>
|
||||
<th> منتهی به پایان سال</th>
|
||||
<th> طلب مرخصی</th>
|
||||
<th> سنوات</th>
|
||||
<th> عیدی و پاداش</th>
|
||||
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th>ایجاد قرارداد</th>
|
||||
<th>ایجاد تصفیه حساب</th>
|
||||
|
||||
|
||||
<th>عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in @Model.PersonnelList.ConnectedPersonnelViewModels)
|
||||
{
|
||||
<tr class="tableFindBtn @(item.Black ? "black" : "")">
|
||||
<td class="text-center">
|
||||
<div class="border-index">@i</div>
|
||||
</td>
|
||||
@{
|
||||
i++;
|
||||
}
|
||||
<td>
|
||||
<span style="font-size:10px">@item.PersonName</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span style="font-size:10px">@item.PersonelCode</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ContractTerm="@item.EmployeeId" asp-for="@item.ContractTerm" style="width: 75px;font-size: 10px;">
|
||||
<option value="1"> <span>1 ماهه</span> </option>
|
||||
<option value="2"> <span>2 ماهه</span> </option>
|
||||
<option value="3"> <span>3 ماهه</span> </option>
|
||||
<option value="6"> <span>6 ماهه</span> </option>
|
||||
<option value="12"> <span>1 ساله</span> </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select class="form-control" data-CutContractEndOfYear="@item.EmployeeId" asp-for="@item.CutContractEndOfYear" style="width: 100px;font-size: 10px;">
|
||||
<option value="@IsActive.None"> <span></span> </option>
|
||||
<option value="@IsActive.True"> <span>منتهی باشد</span> </option>
|
||||
<option value="@IsActive.False"> <span>منتهی نباشد</span> </option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
@* <td class="text-center">
|
||||
@if (@item.ContractPerson && !@item.ContractLeft)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#BEF264" />
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
||||
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
||||
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (@item.InsurancePerson && !@item.InsurancetLeft)
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#BEF264" />
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
||||
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
|
||||
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
||||
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
</td> *@
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 140px;font-size: 10px;">
|
||||
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
|
||||
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
|
||||
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td style="user-select: none">
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<div>
|
||||
<label for="FailureCreateContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
|
||||
<input class="real-checkbox" type="checkbox" data-employeeId="@item.EmployeeId" id="FailureCreateContract_@item.EmployeeId" @(item.CreateContract ? "checked" : "") />
|
||||
ایجاد قرارداد
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="FailureSignContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
|
||||
<input class="real-checkbox" data-employeeId="@item.EmployeeId" type="checkbox" id="FailureSignContract_@item.EmployeeId" @(item.SignContract ? "checked" : "") />
|
||||
امضا قرارداد
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td style="user-select: none">
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<div>
|
||||
<label for="FailureCreateCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
|
||||
<input class="real-checkbox" data-employeeId="@item.EmployeeId" type="checkbox" id="FailureCreateCheckout_@item.EmployeeId" @(item.CreateCheckout ? "checked" : "") />
|
||||
ایجاد تصفیه حساب
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="FailureSignCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
|
||||
<input class="real-checkbox" data-employeeId="@item.EmployeeId" type="checkbox" id="FailureSignCheckout_@item.EmployeeId" @(item.SignCheckout ? "checked" : "") />
|
||||
امضا تصفیه حساب
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<button onclick="save(@item.EmployeeId)" style="font-size:8px" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
|
||||
}
|
||||
@* <a class="btn btn-success pull-left rad" style="margin-left: 5px"
|
||||
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId})">
|
||||
<i class="ion-information-circled ionSize"></i>
|
||||
</a> *@
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@section Script {
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
|
||||
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
|
||||
|
||||
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script> *@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#responsive-data-table').DataTable({
|
||||
"alengthMenu": [["All", 10, 50, 100, -1], ["All", 10, 50, 100, "All"]],
|
||||
"order": [[0, 'asc']],
|
||||
"dom": '<"row justify-content-between top-information"lf>rt<"row justify-content-between bottom-information"ip><"clear">',
|
||||
"language": {
|
||||
"emptyTable": "هیچ دادهای در جدول وجود ندارد",
|
||||
"info": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
|
||||
"infoEmpty": "نمایش 0 تا 0 از 0 ردیف",
|
||||
"infoFiltered": "(فیلتر شده از _MAX_ ردیف)",
|
||||
"infoThousands": ",",
|
||||
"lengthMenu": "نمایش _MENU_ ردیف",
|
||||
"processing": "در حال پردازش...",
|
||||
"search": "جستجو:",
|
||||
"zeroRecords": "رکوردی با این مشخصات پیدا نشد",
|
||||
"paginate": {
|
||||
"next": "بعدی",
|
||||
"previous": "قبلی",
|
||||
"first": "ابتدا",
|
||||
"last": "انتها"
|
||||
},
|
||||
"aria": {
|
||||
"sortAscending": ": فعال سازی نمایش به صورت صعودی",
|
||||
"sortDescending": ": فعال سازی نمایش به صورت نزولی"
|
||||
},
|
||||
"autoFill": {
|
||||
"cancel": "انصراف",
|
||||
"fill": "پر کردن همه سلول ها با ساختار سیستم",
|
||||
"fillHorizontal": "پر کردن سلول به صورت افقی",
|
||||
"fillVertical": "پرکردن سلول به صورت عمودی"
|
||||
},
|
||||
"buttons": {
|
||||
"collection": "مجموعه",
|
||||
"colvis": "قابلیت نمایش ستون",
|
||||
"colvisRestore": "بازنشانی قابلیت نمایش",
|
||||
"copy": "کپی",
|
||||
"copySuccess": {
|
||||
"1": "یک ردیف داخل حافظه کپی شد",
|
||||
"_": "%ds ردیف داخل حافظه کپی شد"
|
||||
},
|
||||
"copyTitle": "کپی در حافظه",
|
||||
"pageLength": {
|
||||
"-1": "نمایش همه ردیفها",
|
||||
"_": "نمایش %d ردیف",
|
||||
"1": "نمایش 1 ردیف"
|
||||
},
|
||||
"print": "چاپ",
|
||||
"copyKeys": "برای کپی داده جدول در حافظه سیستم کلید های ctrl یا ⌘ + C را فشار دهید",
|
||||
"csv": "فایل CSV",
|
||||
"pdf": "فایل PDF",
|
||||
"renameState": "تغییر نام",
|
||||
"updateState": "به روز رسانی",
|
||||
"excel": "فایل اکسل",
|
||||
"createState": "ایجاد وضعیت جدول",
|
||||
"removeAllStates": "حذف همه وضعیت ها",
|
||||
"removeState": "حذف",
|
||||
"savedStates": "وضعیت های ذخیره شده",
|
||||
"stateRestore": "بازگشت به وضعیت %d"
|
||||
},
|
||||
"searchBuilder": {
|
||||
"add": "افزودن شرط",
|
||||
"button": {
|
||||
"0": "جستجو ساز",
|
||||
"_": "جستجوساز (%d)"
|
||||
},
|
||||
"clearAll": "خالی کردن همه",
|
||||
"condition": "شرط",
|
||||
"conditions": {
|
||||
"date": {
|
||||
"after": "بعد از",
|
||||
"before": "بعد از",
|
||||
"between": "میان",
|
||||
"empty": "خالی",
|
||||
"not": "نباشد",
|
||||
"notBetween": "میان نباشد",
|
||||
"notEmpty": "خالی نباشد",
|
||||
"equals": "برابر باشد با"
|
||||
},
|
||||
"number": {
|
||||
"between": "میان",
|
||||
"empty": "خالی",
|
||||
"gt": "بزرگتر از",
|
||||
"gte": "برابر یا بزرگتر از",
|
||||
"lt": "کمتر از",
|
||||
"lte": "برابر یا کمتر از",
|
||||
"not": "نباشد",
|
||||
"notBetween": "میان نباشد",
|
||||
"notEmpty": "خالی نباشد",
|
||||
"equals": "برابر باشد با"
|
||||
},
|
||||
"string": {
|
||||
"contains": "حاوی",
|
||||
"empty": "خالی",
|
||||
"endsWith": "به پایان می رسد با",
|
||||
"not": "نباشد",
|
||||
"notEmpty": "خالی نباشد",
|
||||
"startsWith": "شروع شود با",
|
||||
"notContains": "نباشد حاوی",
|
||||
"notEndsWith": "پایان نیابد با",
|
||||
"notStartsWith": "شروع نشود با",
|
||||
"equals": "برابر باشد با"
|
||||
},
|
||||
"array": {
|
||||
"empty": "خالی",
|
||||
"contains": "حاوی",
|
||||
"not": "نباشد",
|
||||
"notEmpty": "خالی نباشد",
|
||||
"without": "بدون",
|
||||
"equals": "برابر باشد با"
|
||||
}
|
||||
},
|
||||
"data": "اطلاعات",
|
||||
"logicAnd": "و",
|
||||
"logicOr": "یا",
|
||||
"title": {
|
||||
"0": "جستجو ساز",
|
||||
"_": "جستجوساز (%d)"
|
||||
},
|
||||
"value": "مقدار",
|
||||
"deleteTitle": "حذف شرط فیلتر",
|
||||
"leftTitle": "شرط بیرونی",
|
||||
"rightTitle": "شرط فرورفتگی"
|
||||
},
|
||||
"select": {
|
||||
"cells": {
|
||||
"1": "1 سلول انتخاب شد",
|
||||
"_": "%d سلول انتخاب شد"
|
||||
},
|
||||
"columns": {
|
||||
"1": "یک ستون انتخاب شد",
|
||||
"_": "%d ستون انتخاب شد"
|
||||
},
|
||||
"rows": {
|
||||
"1": "1ردیف انتخاب شد",
|
||||
"_": "%d انتخاب شد"
|
||||
}
|
||||
},
|
||||
"thousands": ",",
|
||||
"searchPanes": {
|
||||
"clearMessage": "همه را پاک کن",
|
||||
"collapse": {
|
||||
"0": "صفحه جستجو",
|
||||
"_": "صفحه جستجو (٪ d)"
|
||||
},
|
||||
"count": "{total}",
|
||||
"countFiltered": "{shown} ({total})",
|
||||
"emptyPanes": "صفحه جستجو وجود ندارد",
|
||||
"loadMessage": "در حال بارگیری صفحات جستجو ...",
|
||||
"title": "فیلترهای فعال - %d",
|
||||
"showMessage": "نمایش همه",
|
||||
"collapseMessage": "بستن همه"
|
||||
},
|
||||
"loadingRecords": "در حال بارگذاری...",
|
||||
"datetime": {
|
||||
"previous": "قبلی",
|
||||
"next": "بعدی",
|
||||
"hours": "ساعت",
|
||||
"minutes": "دقیقه",
|
||||
"seconds": "ثانیه",
|
||||
"amPm": [
|
||||
"صبح",
|
||||
"عصر"
|
||||
],
|
||||
"months": {
|
||||
"0": "ژانویه",
|
||||
"1": "فوریه",
|
||||
"10": "نوامبر",
|
||||
"4": "می",
|
||||
"8": "سپتامبر",
|
||||
"11": "دسامبر",
|
||||
"3": "آوریل",
|
||||
"9": "اکتبر",
|
||||
"7": "اوت",
|
||||
"2": "مارس",
|
||||
"5": "ژوئن",
|
||||
"6": "ژوئیه"
|
||||
},
|
||||
"unknown": "-",
|
||||
"weekdays": [
|
||||
"یکشنبه",
|
||||
"دوشنبه",
|
||||
"سهشنبه",
|
||||
"چهارشنبه",
|
||||
"پنجشنبه",
|
||||
"جمعه",
|
||||
"شنبه"
|
||||
]
|
||||
},
|
||||
"editor": {
|
||||
"close": "بستن",
|
||||
"create": {
|
||||
"button": "جدید",
|
||||
"title": "ثبت جدید",
|
||||
"submit": "ایجــاد"
|
||||
},
|
||||
"edit": {
|
||||
"button": "ویرایش",
|
||||
"title": "ویرایش",
|
||||
"submit": "به روز رسانی"
|
||||
},
|
||||
"remove": {
|
||||
"button": "حذف",
|
||||
"title": "حذف",
|
||||
"submit": "حذف",
|
||||
"confirm": {
|
||||
"_": "آیا از حذف %d خط اطمینان دارید؟",
|
||||
"1": "آیا از حذف یک خط اطمینان دارید؟"
|
||||
}
|
||||
},
|
||||
"multi": {
|
||||
"restore": "واگرد",
|
||||
"noMulti": "این ورودی را می توان به صورت جداگانه ویرایش کرد، اما نه بخشی از یک گروه",
|
||||
"title": "مقادیر متعدد",
|
||||
"info": "مقادیر متعدد"
|
||||
},
|
||||
"error": {
|
||||
"system": "خطایی رخ داده (اطلاعات بیشتر)"
|
||||
}
|
||||
},
|
||||
"decimal": ".",
|
||||
"stateRestore": {
|
||||
"creationModal": {
|
||||
"button": "ایجاد",
|
||||
"columns": {
|
||||
"search": "جستجوی ستون",
|
||||
"visible": "وضعیت نمایش ستون"
|
||||
},
|
||||
"name": "نام:",
|
||||
"order": "مرتب سازی",
|
||||
"paging": "صفحه بندی",
|
||||
"search": "جستجو",
|
||||
"select": "انتخاب",
|
||||
"title": "ایجاد وضعیت جدید",
|
||||
"toggleLabel": "شامل:",
|
||||
"scroller": "موقعیت جدول (اسکرول)",
|
||||
"searchBuilder": "صفحه جستجو"
|
||||
},
|
||||
"emptyError": "نام نمیتواند خالی باشد.",
|
||||
"removeConfirm": "آیا از حذف %s مطمئنید؟",
|
||||
"removeJoiner": "و",
|
||||
"renameButton": "تغییر نام",
|
||||
"renameLabel": "نام جدید برای $s :",
|
||||
"duplicateError": "وضعیتی با این نام از پیش ذخیره شده.",
|
||||
"emptyStates": "هیچ وضعیتی ذخیره نشده",
|
||||
"removeError": "حذف با خطا موماجه شد",
|
||||
"removeSubmit": "حذف وضعیت",
|
||||
"removeTitle": "حذف وضعیت جدول",
|
||||
"renameTitle": "تغییر نام وضعیت"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change',
|
||||
'.tableFindBtn',
|
||||
function() {
|
||||
$(this).find(".save").prop("disabled", false);
|
||||
});
|
||||
});
|
||||
|
||||
function save(EmployeeId) {
|
||||
var command = {};
|
||||
command.WorkshopId = Number($("#workshopId").val());
|
||||
command.EmployeeId = Number(EmployeeId);
|
||||
command.ComputeOptions = $(`[data-ComputeOptions="${EmployeeId}"]`).val();
|
||||
command.BonusesOptions = $(`[data-BonusesOptions="${EmployeeId}"]`).val();
|
||||
command.YearsOptions = $(`[data-YearsOptions="${EmployeeId}"]`).val();
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "Create")',
|
||||
data: command,
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
success: function(response) {
|
||||
if (response.isSuccedded) {
|
||||
command = {};
|
||||
console.log();
|
||||
$(`[data-save="${EmployeeId}"]`).prop("disabled", true);
|
||||
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
|
||||
|
||||
} else {
|
||||
command = {};
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||||
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
<script>
|
||||
var AntiForgeryToken = $('@Html.AntiForgeryToken()').val();
|
||||
var saveCreateUrl = `@Url.Page("./Index", "Create")`;
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/ConnectedPersonnels/js/Index.js?ver=@adminVersion"></script>
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user