diff --git a/0_Framework/Application/Tools.cs b/0_Framework/Application/Tools.cs
index f103d0ec..fbe8b825 100644
--- a/0_Framework/Application/Tools.cs
+++ b/0_Framework/Application/Tools.cs
@@ -33,11 +33,80 @@ public static class Tools
public static string[] DayNamesG = { "یکشنبه", "دو شنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه", "شنبه" };
///
- /// محاسبه سن
+ /// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
+ /// با کمک شروع بکار و ترک کار
///
+ ///
+ ///
///
///
+ ///
///
+ public static (int countWorkingDays,DateTime startWork,DateTime endWork,bool hasStartWorkInMonth,bool hasLeftWorkInMonth) GetEmployeeInsuranceWorkingDays(DateTime startWork,DateTime? leftWork,DateTime startDate,
+ DateTime endDate,long employeeId)
+ {
+ DateTime start = startDate;
+ DateTime end = endDate;
+ bool startWorkInMonth = false;
+ bool endWorkInMonth = false;
+
+ //اگر شروع بکار پرسنل در ماه مشخص شده لیست بیمه بود
+ if (startWork >= startDate)
+ {
+ start = startWork;
+ startWorkInMonth = true;
+ }
+
+ if(leftWork == null)
+ leftWork = DateTime.MinValue;
+ //اگر ترک کار پرسنل در ماه مشخص شده لیست بیمه بود
+ if (leftWork != DateTime.MinValue && leftWork.Value <= endDate)
+ {
+ end = leftWork.Value;
+ endWorkInMonth = true;
+ }
+
+ int countDays = (int)(end - start).TotalDays +1;
+
+
+ //روزهای کارکرد پرسنل با آی دی های زیر دستی تعریف شد
+ switch (employeeId)
+ {
+
+ //case 3812://ثابت- کسری حاجی پور
+ // countWorkingDays = 15;
+ // break;
+ case 40463://ثابت
+ countDays = 10;
+ break;
+ case 40469://ثابت
+ countDays = 7;
+ break;
+ case 9950://ثابت
+ countDays = 15;
+ break;
+ case 9640://ثابت
+ countDays = 15;
+ break;
+ case 40998://ثابت
+ countDays = 15;
+ break;
+ case 6219://ثابت
+ countDays = 15;
+ break;
+ //case 7897://ثابت
+ // countWorkingDays = 15;
+ }
+
+
+ return (countDays,start,end,startWorkInMonth,endWorkInMonth);
+ }
+ ///
+ /// محاسبه سن
+ ///
+ ///
+ ///
+ ///
public static (int yearCount, int monthCount, int dayCount) GetAge(DateTime startDate, DateTime endDate)
{
diff --git a/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs b/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
index 9800796b..0ba87c2d 100644
--- a/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
+++ b/Company.Domain/ContarctingPartyAgg/IPersonalContractingPartyRepository.cs
@@ -36,6 +36,12 @@ public interface IPersonalContractingPartyRepository :IRepository
+ /// تعداد روز های کارکرد پرسنل
+ /// DSW_DD
+ ///
public int WorkingDays { get; private set; }
- // دستمزد روزانه
+
+ ///
+ /// دستمزد روزانه پرسنل double
+ /// DSW_ROOZ
+ ///
public double DailyWage { get; private set; }
- //دستمزد ماهانه
+
+ ///
+ /// دستمزد ماهانه پرسنل double
+ /// DSW_MAH
+ ///
public double MonthlySalary{ get; private set; }
-
- //مزایای ماهانه
+
+ ///
+ /// مزایای ماهانه
+ /// DSW_MAZ
+ ///
public double MonthlyBenefits { get; private set; }
- //دستمزد و مزایای ماهانه مشمول
+
+ ///
+ /// جمع دستمزد و مزایای ماهانه مشمول
+ /// DSW_MASH
+ ///
public double MonthlyBenefitsIncluded { get; private set; }
// مزایای مشمول مستمر
public double BenefitsIncludedContinuous { get; private set; }
//مزایای مشمول غیر مستمر
public double BenefitsIncludedNonContinuous { get; private set; }
- //سهم بیمه حق کارگر
+
+ ///
+ /// حق بیمه سهم بیمه شده
+ /// DSW_BIME
+ ///
public double InsuranceShare { get; private set; }
- // تاریخ شروع به کار
+
+ ///
+ /// تایخ شروع بکار میلادی
+ /// DSW_SDATE
+ ///
public DateTime StartWorkDate { get; private set; }
- //تاریخ ترک کار
+
+ ///
+ /// تاریخ ترک کار میلادی
+ /// DSW_EDATE
+ ///
public DateTime? LeftWorkDate { get; private set; }
// آی دی شغل
public long JobId { get; private set; }
-
+
public bool IncludeStatus { get; private set; }
+ ///
+ /// پایه سنواتی
+ /// DSW_INC
+ ///
+ public double BaseYears { get; private set; }
- public void Edit(int workingDays, double dailyWage, double monthlySalary, double monthlyBenefits, double monthlyBenefitsIncluded, double benefitsIncludedContinuous, double benefitsIncludedNonContinuous, double insuranceShare, DateTime startWorkDate, DateTime? leftWorkDate, long jobId, bool includeStatus)
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه
+ /// DSW_INC
+ ///
+ public double DailyWagePlusBaseYears { get; private set; }
+
+ ///
+ /// حق تاهل
+ /// DSW_SPOUSE
+ ///
+ public double MarriedAllowance { get; private set; }
+
+
+ public void Edit(int workingDays, double dailyWage, double monthlySalary, double monthlyBenefits, double monthlyBenefitsIncluded,
+ double benefitsIncludedContinuous, double benefitsIncludedNonContinuous, double insuranceShare, DateTime startWorkDate,
+ DateTime? leftWorkDate, long jobId, bool includeStatus, double baseYears, double marriedAllowance)
{
WorkingDays = workingDays;
@@ -71,7 +128,11 @@ public class EmployeeInsurancListData : EntityBase
LeftWorkDate = leftWorkDate;
JobId = jobId;
IncludeStatus= includeStatus;
+ BaseYears = baseYears;
+ MarriedAllowance = marriedAllowance;
+ DailyWagePlusBaseYears = dailyWage + baseYears;
}
+
}
\ No newline at end of file
diff --git a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
index 7efc607b..e99d7a11 100644
--- a/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
+++ b/Company.Domain/InsuranceListAgg/IInsuranceListRepository.cs
@@ -27,6 +27,20 @@ public interface IInsuranceListRepository:IRepository
InsuranceListViewModel GetInsuranceListByWorkshopIdAndYear(long workshopId, string year);
+ #region farokhi
+ ///
+ /// جستجوی لیست بیمه بهینه شده
+ ///
+ ///
+ ///
+ public List OptimizedSearch(InsuranceListSearchModel searchModel);
+
+ ///
+ /// محاسبه پایه سنوات بیمه برای پرسنل
+ ///
+ ///
+ (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay, DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft);
+ #endregion
#region client
List SearchForClient(InsuranceListSearchModel searchModel);
diff --git a/Company.Domain/InsuranceListAgg/InsuranceList.cs b/Company.Domain/InsuranceListAgg/InsuranceList.cs
index b40844a0..b0880d7f 100644
--- a/Company.Domain/InsuranceListAgg/InsuranceList.cs
+++ b/Company.Domain/InsuranceListAgg/InsuranceList.cs
@@ -13,7 +13,8 @@ public class InsuranceList : EntityBase
public InsuranceList(long workshopId, string year, string month, int sumOfEmployees, int sumOfWorkingDays,
double sumOfSalaries, double sumOfBenefitsIncluded, double included, double includedAndNotIncluded, double insuredShare,
- double employerShare, double unEmploymentInsurance, double difficultJobsInsuranc, DateTime startDate, DateTime endDate, double sumOfDailyWage, bool confirmSentlist=false)
+ double employerShare, double unEmploymentInsurance, double difficultJobsInsuranc, DateTime startDate, DateTime endDate,
+ double sumOfDailyWage, double sumOfBaseYears, double sumOfMarriedAllowance, bool confirmSentlist=false)
{
WorkshopId = workshopId;
Year = year;
@@ -31,46 +32,130 @@ public class InsuranceList : EntityBase
StartDate = startDate;
EndDate = endDate;
SumOfDailyWage = sumOfDailyWage;
+ SumOfBaseYears = sumOfBaseYears;
+ SumOfMarriedAllowance = sumOfMarriedAllowance;
ConfirmSentlist = confirmSentlist;
+ SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears;
+
}
//آی دی کارگاه
public long WorkshopId { get; private set; }
- //سال
+
+ ///
+ /// سال ارسال لیست
+ /// DSK_YY
+ ///
public string Year { get; private set; }
- //ماه
+
+ ///
+ /// ماه ارسال لیست
+ /// DSK_MM
+ ///
public string Month { get; private set; }
- //مجموع تعداد پرسنل
+
+ ///
+ /// تعداد کارکنان
+ /// DSK_NUM
+ ///
public int SumOfEmployees { get; private set; }
- //مجموع روزهای کارکرد پرسنل
+
+ ///
+ /// مجموع روزهای کارکرد کارکنان
+ /// DSK_TDD
+ ///
public int SumOfWorkingDays { get; private set; }
- // مجموع دستمزد پرسنل
+
+ ///
+ /// مجموع دستمزد ماهانه کارکنان
+ /// DSK_TMAH
+ ///
public double SumOfSalaries { get; private set; }
+ ///
+ /// مجموع دستمزد روزانه کارکنان
+ /// DSK_TROOZ
+ ///
public double SumOfDailyWage { get; set; }
- //مجموع مزایای مشمول
+
+ ///
+ /// مجموع مزایای ماهانه مشمول
+ /// DSK_TMAZ
+ ///
public double SumOfBenefitsIncluded { get; private set; }
- //مشمول
+
+ ///
+ /// مجموع دستمزد و مزایای ماهانه مشمول
+ /// DSK_TMASH
+ ///
public double Included { get; private set; }
- //غیرمشمول
+
+ ///
+ /// مجموع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
+ /// DSK_TTOTL
+ ///
public double IncludedAndNotIncluded { get; private set; }
- //سهم بیمه شده
+
+ ///
+ /// مجموع حق بیمه سهم بیمه شده
+ /// DSK_TBIME
+ ///
public double InsuredShare { get; private set; }
- //سهم کارفرما
+
+ ///
+ /// مجموع حق بیمه سهم کارفرما
+ /// DSK_TKOSO
+ ///
public double EmployerShare { get; private set; }
- //حق بیمه بیکاری
+
+ ///
+ /// مجموع حق بیمه بیکاری
+ /// DSK_BIC
+ ///
public double UnEmploymentInsurance { get; private set; }
- //مزایای مشاغل سخت
+
+ ///
+ /// نرخ مشاغل سخت زیان آور
+ /// DSK_BIMH
+ ///
public double DifficultJobsInsuranc { get; private set; }
- //تاریخ شروع لیست
+
+ ///
+ /// تاریخ شروع لیست
+ /// میلادی
+ ///
public DateTime StartDate { get; private set; }
- // تاریخ پایان لیست
+
+ ///
+ /// تاریخ پایان لیست
+ /// میلادی
+ ///
public DateTime EndDate { get; private set; }
+
public bool ConfirmSentlist { get; private set; }
+
+ ///
+ /// مجموع پایه سنواتی کارکنان
+ /// DSK_INC
+ ///
+ public double SumOfBaseYears { get; private set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه کارکنان
+ /// DSW_INC
+ ///
+ public double SumOfDailyWagePlusBaseYears { get; private set; }
+
+ ///
+ /// مجموع حق تاهل کارکنان
+ /// DSK_SPOUSE
+ ///
+ public double SumOfMarriedAllowance { get; private set; }
+
public List InsuranceListWorkshops { get; set; }
public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included,
double includedAndNotIncluded, double insuredShare, double employerShare, double unEmploymentInsurance, double difficultJobsInsuranc,
- DateTime startDate, double sumOfDailyWage,bool confirmSentlist)
+ DateTime startDate, double sumOfDailyWage, double sumOfBaseYears, double sumOfMarriedAllowance, bool confirmSentlist)
{
SumOfEmployees = sumOfEmployees;
SumOfWorkingDays = sumOfWorkingDays;
@@ -83,7 +168,10 @@ public class InsuranceList : EntityBase
UnEmploymentInsurance = unEmploymentInsurance;
DifficultJobsInsuranc = difficultJobsInsuranc;
SumOfDailyWage = sumOfDailyWage;
+ SumOfBaseYears = sumOfBaseYears;
+ SumOfMarriedAllowance = sumOfMarriedAllowance;
ConfirmSentlist = confirmSentlist;
+ SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears;
}
}
\ No newline at end of file
diff --git a/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs b/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs
index de06adce..5bd39f8e 100644
--- a/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs
+++ b/Company.Domain/LeftWorkInsuranceAgg/ILeftWorkInsuranceRepository.cs
@@ -31,4 +31,14 @@ public interface ILeftWorkInsuranceRepository : IRepository
+ /// دریافت شروع و ترک کار بیمه پرسنل و اطلاعات هویتی آن
+ ///
+ ///
+ ///
+ List GetEmployeeInsuranceLeftWorksAndInformation(long workshopId, DateTime startDate, DateTime endDate);
+
+ #endregion
}
\ No newline at end of file
diff --git a/Company.Domain/WorkshopAgg/IWorkshopRepository.cs b/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
index 14612d9d..ae70a623 100644
--- a/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
+++ b/Company.Domain/WorkshopAgg/IWorkshopRepository.cs
@@ -63,5 +63,15 @@ public interface IWorkshopRepository : IRepository
PersonalContractingPartyViewModel GetPersonalContractingPartyByWorkshopId(long workshopId);
List GetWorkshopsByClientAccountId(long clientAccountId);
- #endregion
+ #endregion
+
+ #region Insurance
+ ///
+ /// لیست انتخاب کارگاه در مودال ایجاد بیمه
+ ///
+ ///
+ List GetWorkshopSelectListInsuransce();
+
+ #endregion
+
}
\ No newline at end of file
diff --git a/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs b/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
index 02e354c0..25c5c6f7 100644
--- a/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
+++ b/Company.Domain/YearlySalaryAgg/IYearlySalaryRepository.cs
@@ -51,7 +51,14 @@ public interface IYearlySalaryRepository : IRepository
Task HolidayGregorian(DateTime gregorianDate);
Task HolidayShamsi(string shamsiDate);
- #endregion
+ #endregion
+
+
+ #region Insurance
+
+ InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
+
+ #endregion
+
-
}
\ No newline at end of file
diff --git a/Company.Domain/empolyerAgg/IEmployerRepository.cs b/Company.Domain/empolyerAgg/IEmployerRepository.cs
index 88973019..ed6a4139 100644
--- a/Company.Domain/empolyerAgg/IEmployerRepository.cs
+++ b/Company.Domain/empolyerAgg/IEmployerRepository.cs
@@ -44,7 +44,13 @@ public interface IEmployerRepository : IRepository
OperationResult ActiveAll(long id);
List GetAllEmployers();
- #endregion
+ #endregion
+
+ #region Insurance
+
+ (string employerName, bool isLegal) InsuranceEmployerByWorkshopId(long workshopId);
+
+ #endregion
diff --git a/CompanyManagment.App.Contracts/EmployeeInsurancListData/CreateEmployeeInsurancListData.cs b/CompanyManagment.App.Contracts/EmployeeInsurancListData/CreateEmployeeInsurancListData.cs
index 5274327e..088c90c1 100644
--- a/CompanyManagment.App.Contracts/EmployeeInsurancListData/CreateEmployeeInsurancListData.cs
+++ b/CompanyManagment.App.Contracts/EmployeeInsurancListData/CreateEmployeeInsurancListData.cs
@@ -12,29 +12,78 @@ public class CreateEmployeeInsurancListData
{ //آی دی کارگاه
public long InsuranceListId { get; set; }
public long EmployeeId { get; set; }
- //روزهای کارکرد پرسنل
+
+ ///
+ /// تعداد روز های کارکرد پرسنل
+ /// DSW_DD
+ ///
public int WorkingDays { get; set; }
- // دستمزد روزانه
- public double DailyWage { get; set; }
- //دستمزد ماهانه
- public double MonthlySalary { get; set; }
- //مزایای ماهانه
- public double MonthlyBenefits { get; set; }
- //دستمزد و مزایای ماهانه مشمول
+ ///
+ /// دستمزد روزانه پرسنل double
+ /// DSW_ROOZ
+ ///
+ public double DailyWage { get; set; }
+
+ ///
+ /// دستمزد ماهانه پرسنل double
+ /// DSW_MAH
+ ///
+ public double MonthlySalary { get; set; }
+
+ ///
+ /// مزایای ماهانه
+ /// DSW_MAZ
+ ///
+ public double MonthlyBenefits { get; set; }
+
+ ///
+ /// جمع دستمزد و مزایای ماهانه مشمول
+ /// DSW_MASH
+ ///
public double MonthlyBenefitsIncluded { get; set; }
// مزایای مشمول مستمر
public double BenefitsIncludedContinuous { get; set; }
//مزایای مشمول غیر مستمر
public double BenefitsIncludedNonContinuous { get; set; }
- //سهم بیمه حق کارگر
+
+ ///
+ /// حق بیمه سهم بیمه شده
+ /// DSW_BIME
+ ///
public double InsuranceShare { get; set; }
- // تاریخ شروع به کار
+
+ ///
+ /// تایخ شروع بکار میلادی
+ /// DSW_SDATE
+ ///
public DateTime StartWorkDate { get; set; }
- //تاریخ ترک کار
+
+ ///
+ /// تاریخ ترک کار میلادی
+ /// DSW_EDATE
+ ///
public DateTime? LeftWorkDate { get; set; }
// آی دی شغل
public long JobId { get; set; }
public bool IncludeStatus { get; set; }
+
+ ///
+ /// پایه سنواتی
+ /// DSW_INC
+ ///
+ public double BaseYears { get; set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه
+ /// DSW_INC
+ ///
+ public double DailyWagePlusBaseYears { get; set; }
+
+ ///
+ /// حق تاهل
+ /// DSW_SPOUSE
+ ///
+ public double MarriedAllowance { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataSearchModel.cs b/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataSearchModel.cs
index da0f4fca..cfe2d96a 100644
--- a/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataSearchModel.cs
+++ b/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataSearchModel.cs
@@ -35,4 +35,22 @@ public class EmployeeInsurancListDataSearchModel
public DateTime LeftWorkDate { get; set; }
// آی دی شغل
public long JobId { get; set; }
+
+ ///
+ /// پایه سنواتی
+ /// DSW_INC
+ ///
+ public double BaseYears { get; set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه
+ /// DSW_INC
+ ///
+ public double DailyWagePlusBaseYears { get; set; }
+
+ ///
+ /// حق تاهل
+ /// DSW_SPOUSE
+ ///
+ public double MarriedAllowance { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataViewModel.cs b/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataViewModel.cs
index 0962c286..52c694e9 100644
--- a/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataViewModel.cs
+++ b/CompanyManagment.App.Contracts/EmployeeInsurancListData/EmployeeInsurancListDataViewModel.cs
@@ -11,32 +11,76 @@ public class EmployeeInsurancListDataViewModel
public long InsuranceListId { get; set; }
public long EmployeeId { get; set; }
- //روزهای کارکرد پرسنل
+
+ ///
+ /// تعداد روز های کارکرد پرسنل
+ /// DSW_DD
+ ///
public int WorkingDays { get; set; }
- // دستمزد روزانه
+
+ ///
+ /// دستمزد روزانه پرسنل double
+ /// DSW_ROOZ
+ ///
public double DailyWage { get; set; }
- //دستمزد ماهانه
+
+ ///
+ /// دستمزد ماهانه پرسنل double
+ /// DSW_MAH
+ ///
public double MonthlySalary { get; set; }
- //مزایای ماهانه
+ ///
+ /// مزایای ماهانه
+ /// DSW_MAZ
+ ///
public double MonthlyBenefits { get; set; }
- //دستمزد و مزایای ماهانه مشمول
+
+ ///
+ /// جمع دستمزد و مزایای ماهانه مشمول
+ /// DSW_MASH
+ ///
public double MonthlyBenefitsIncluded { get; set; }
// مزایای مشمول مستمر
public double BenefitsIncludedContinuous { get; set; }
//مزایای مشمول غیر مستمر
public double BenefitsIncludedNonContinuous { get; set; }
- //مشمول و غیر مشمول
+ ///
+ /// جمع کل دستمزد و مزایای ماهانه
+ /// DSW_TOTL
+ ///
public double IncludedAndNotIncluded { get; set; }
- //سهم بیمه حق کارگر
+
+ ///
+ /// حق بیمه سهم بیمه شده
+ /// DSW_BIME
+ ///
public double InsuranceShare { get; set; }
- // تاریخ شروع به کار
+
+ ///
+ /// تایخ شروع بکار میلادی
+ /// DSW_SDATE
+ ///
public DateTime StartWorkDate { get; set; }
- //تاریخ ترک کار
+
+ ///
+ /// تاریخ ترک کار میلادی
+ /// DSW_EDATE
+ ///
public DateTime? LeftWorkDate { get; set; }
// آی دی شغل
public long JobId { get; set; }
+
+ ///
+ /// نام شغل
+ /// DSW_OCP
+ ///
public string JobName { get; set; }
+
+ ///
+ /// کد شغل
+ /// DSW_JOB
+ ///
public string JobCode { get; set; }
public string StrStartWorkDate { get; set; }
public string StrLeftWorkDate { get; set; }
@@ -53,5 +97,23 @@ public class EmployeeInsurancListDataViewModel
public bool IncludeStatus { get; set; }
public bool HasConfilictLeftWork { get; set; }
+ ///
+ /// پایه سنواتی
+ /// DSW_INC
+ ///
+ public double BaseYears { get; set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه
+ /// DSW_INC
+ ///
+ public double DailyWagePlusBaseYears { get; set; }
+
+ ///
+ /// حق تاهل
+ /// DSW_SPOUSE
+ ///
+ public double MarriedAllowance { get; set; }
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs b/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
index 32e00882..969638b4 100644
--- a/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
+++ b/CompanyManagment.App.Contracts/Employer/IEmployerApplication.cs
@@ -44,8 +44,12 @@ public interface IEmployerApplication
OperationResult ActiveAll(long id);
List GetAllEmployers();
- #endregion
+ #endregion
+ #region Insurance
+ (string employerName, bool isLegal) InsuranceEmployerByWorkshopId(long workshopId);
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceList/CreateInsuranceList.cs b/CompanyManagment.App.Contracts/InsuranceList/CreateInsuranceList.cs
index 109e3dc5..394b34b5 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/CreateInsuranceList.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/CreateInsuranceList.cs
@@ -14,48 +14,141 @@ public class CreateInsuranceList
{ //آی دی کارگاه
public long WorkshopId { get; set; }
public string WorkshopName { get; set; }
-
- //سال
+
+ ///
+ /// سال ارسال لیست
+ /// DSK_YY
+ ///
public string Year { get; set; }
- //ماه
+
+ ///
+ /// ماه ارسال لیست
+ /// DSK_MM
+ ///
public string Month { get; set; }
- //مجموع تعداد پرسنل
+
+ ///
+ /// تعداد کارکنان
+ /// DSK_NUM
+ ///
public int SumOfEmployees { get; set; }
- //مجموع روزهای کارکرد پرسنل
+
+ ///
+ /// مجموع روزهای کارکرد کارکنان
+ /// DSK_TDD
+ ///
public int SumOfWorkingDays { get; set; }
- // مجموع دستمزد پرسنل
+
+ ///
+ /// مجموع دستمزد ماهانه کارکنان
+ /// DSK_TMAH
+ ///
public double SumOfSalaries { get; set; }
- //مجموع مزایای مشمول
+
+ ///
+ /// مجموع مزایای ماهانه مشمول
+ /// DSK_TMAZ
+ ///
public double SumOfBenefitsIncluded { get; set; }
- //مشمول
+
+ ///
+ /// مجموع دستمزد و مزایای ماهانه مشمول
+ /// DSK_TMASH
+ ///
public double Included { get; set; }
- //غیرمشمول و مشمول
+
+ ///
+ /// مجموع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
+ /// DSK_TTOTL
+ ///
public double IncludedAndNotIncluded { get; set; }
- //سهم بیمه شده
+
+ ///
+ /// مجموع حق بیمه سهم بیمه شده
+ /// DSK_TBIME
+ ///
public double InsuredShare { get; set; }
- //سهم کارفرما
+
+ ///
+ /// مجموع حق بیمه سهم کارفرما
+ /// DSK_TKOSO
+ ///
public double EmployerShare { get; set; }
- //حق بیمه بیکاری
+
+ ///
+ /// مجموع حق بیمه بیکاری
+ /// DSK_BIC
+ ///
public double UnEmploymentInsurance { get; set; }
- //مزایای مشاغل سخت
+
+ ///
+ /// نرخ مشاغل سخت زیان آور
+ /// DSK_BIMH
+ ///
public double DifficultJobsInsuranc { get; set; }
- //تاریخ شروع لیست
+
+ ///
+ /// تاریخ شروع لیست
+ /// میلادی
+ ///
public DateTime StartDate { get; set; }
- // تاریخ پایان لیست
+
+ ///
+ /// تاریخ پایان لیست
+ /// میلادی
+ ///
public DateTime EndDate { get; set; }
public List WorkShopList { get; set; }
public SelectList WorkShopSelectList { get; set; }
public List YearList { get; set; }
public string BeforCurrentMonth { get; set; }
public string CurrentYear { get; set; }
+ ///
+ /// اطلاعات ذخیره شده کارگاه برای بیمه
+ ///
public InsuranceWorkshopInfoViewModel InsuranceWorkshopInfo { get; set; }
+ ///
+ /// لیست اطلاعات هویتی کارکنان
+ ///
public List EmployeeDetailsForInsuranceList { get; set; }
+ ///
+ /// لیست اطلاعات محاسباتی کارکنان
+ ///
public List EmployeeInsurancListDataList { get; set; }
public List WorkshopIds { get; set; }
+ ///
+ /// کمک هزینه مسکن
+ ///
public double HousingAllowance { get; set; }
+ ///
+ /// کمک هزینه اقلام مصرفی
+ ///
public double ConsumableItems { get; set; }
+ ///
+ /// مجموع دستمزد روزانه کارکنان
+ /// DSK_TROOZ
+ ///
public double SumOfDailyWage { get; set; }
public double AllInsuredShare { get; set; }
+
+ ///
+ /// مجموع پایه سنواتی کارکنان
+ /// DSK_INC
+ ///
+ public double SumOfBaseYears { get; set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه کارکنان
+ /// DSW_INC
+ ///
+ public double SumOfDailyWagePlusBaseYears { get; set; }
+
+ ///
+ /// مجموع حق تاهل کارکنان
+ /// DSK_SPOUSE
+ ///
+ public double SumOfMarriedAllowance { get; set; }
+
public bool ConfirmSentlist { get; set; }
diff --git a/CompanyManagment.App.Contracts/InsuranceList/EmployeeDetailsForInsuranceListViewModel.cs b/CompanyManagment.App.Contracts/InsuranceList/EmployeeDetailsForInsuranceListViewModel.cs
index 69283ea5..415d893e 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/EmployeeDetailsForInsuranceListViewModel.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/EmployeeDetailsForInsuranceListViewModel.cs
@@ -6,84 +6,225 @@ using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.InsuranceList;
+///
+/// اطلاعات ذخریه شده پرسنل برای بیمه
+///
public class EmployeeDetailsForInsuranceListViewModel
{
public long EmployeeId { get; set; }
public long InsuranceEmployeeInformationId { get; set; }
+
+ ///
+ /// نام
+ /// DSW_FNAME
+ ///
public string FName { get; set; }
+
+ ///
+ /// نام خانوادگی
+ /// DSW_LNAME
+ ///
public string LName { get; set; }
+ ///
+ /// نام پدر
+ /// DSW_DNAME
+ ///
public string FatherName { get; set; }
+
+ ///
+ /// تاریخ تولد میلادی
+ /// DSW_BDATE
+ ///
public DateTime DateOfBirthGr { get; set; }
+ ///
+ /// تاریخ صدور میلادی
+ /// DSW_IDATE
+ ///
public DateTime DateOfIssueGr { get; set; }
+
+ ///
+ /// تاریخ تولد شمسی
+ /// DSW_BDATE
+ ///
public string DateOfBirth { get; set; }
+ ///
+ /// تاریخ صدور شمسی
+ /// DSW_IDATE
+ ///
public string DateOfIssue { get; set; }
+ ///
+ /// محل صدور
+ /// DSW_IDPLC
+ ///
public string PlaceOfIssue { get; set; }
+
+ ///
+ /// کد ملی پرسنل
+ /// PER_NATCOD
+ ///
public string NationalCode { get; set; }
+
+ ///
+ /// ملیت
+ /// DSW_NAT
+ ///
public string Nationality { get; set; }
+ ///
+ /// شماره شناسنامه
+ /// DSW_IDNO
+ ///
public string IdNumber { get; set; }
+
+ ///
+ /// جنسیت
+ /// DSW_SEX
+ ///
public string Gender { get; set; }
+
+ ///
+ /// شماره بیمه
+ /// DSW_ID1
+ ///
public string InsuranceCode { get; set; }
// public long EmployeeInsurancListDataId { get; set; }
public long InsuranceListId { get; set; }
- //روزهای کارکرد پرسنل
+ ///
+ /// تعداد روز های کارکرد پرسنل
+ /// DSW_DD
+ ///
public int WorkingDays { get; set; }
- // دستمزد روزانه
+
+
+ ///
+ /// دستمزد روزانه پرسنل double
+ /// DSW_ROOZ
+ ///
public double DailyWage { get; set; }
+
+ ///
+ /// دستمزد روزانه پرسنل str
+ /// DSW_ROOZ
+ ///
public string DailyWageStr { get; set; }
- //دستمزد ماهانه
+
+ ///
+ /// دستمزد ماهانه پرسنل double
+ /// DSW_MAH
+ ///
public double MonthlySalary { get; set; }
public double MonthlyBaseYears { get; set; }
public string MonthlyBaseYearsStr { get; set; }
- //مزایای ماهانه
+ ///
+ /// مزایای ماهانه
+ /// DSW_MAZ
+ ///
public double MonthlyBenefits { get; set; }
- //دستمزد و مزایای ماهانه مشمول
+
+ ///
+ /// جمع دستمزد و مزایای ماهانه مشمول
+ /// DSW_MASH
+ ///
public double MonthlyBenefitsIncluded { get; set; }
- // مزایای مشمول مستمر
+ ///
+ /// مزایای مشمول مستمر
+ ///
public double BenefitsIncludedContinuous { get; set; }
- //مزایای مشمول غیر مستمر
+ ///
+ /// مزایای مشمول غیر مستمر
+ ///
public double BenefitsIncludedNonContinuous { get; set; }
+
+ ///
+ /// جمع کل دستمزد و مزایای ماهانه
+ /// DSW_TOTL
+ ///
public double IncludedAndNotIncluded { get; set; }
- //سهم بیمه حق کارگر
+
+ ///
+ /// حق بیمه سهم بیمه شده
+ /// DSW_BIME
+ ///
public double InsuranceShare { get; set; }
// تاریخ شروع به کار
public string StartWorkDate { get; set; }
- //تاریخ ترک کار
+
+
public string LeftWorkDate { get; set; }
- // تاریخ شروع به کار
+
+ ///
+ /// تایخ شروع بکار میلادی
+ /// DSW_SDATE
+ ///
public DateTime StartWorkDateGr { get; set; }
- //تاریخ ترک کار
+
+ ///
+ /// تاریخ ترک کار میلادی
+ /// DSW_EDATE
+ ///
public DateTime? LeftWorkDateGr { get; set; }
// آی دی شغل
public long JobId { get; set; }
+
+ ///
+ /// نام شغل
+ /// DSW_OCP
+ ///
public string JobName { get; set; }
+
+ ///
+ /// کد شغل
+ /// DSW_JOB
+ ///
public string JobCode { get; set; }
public double HousingAllowance { get; set; }
public double ConsumableItems { get; set; }
- public double MaritalStatus { get; set; }
+
+ ///
+ /// وضعیت تاهل
+ ///
+ public string MaritalStatus { get; set; }
public bool IsMaritalStatusSet { get; set; }
public int EndMonthCurrentDay { get; set; }
public double SumOfDailyWage { get; set; }
- //بیمه سهم کارفرما
+
+ ///
+ /// حق بیمه سهم کارفرما
+ ///
public double EmployerShare { get; set; }
- //بیمه بیکاری
+ ///
+ /// بیمه بیکاری
+ ///
public double UnEmploymentInsurance { get; set; }
public string StartMonthCurrent { get; set; }
public bool HasLeftWorkInMonth { get; set; }
public bool HasStartWorkInMonth { get; set; }
public long EmployeeInsurancListDataId { get; set; }
+ ///
+ /// مشمول مزیا - عدم مشمول مزایا
+ ///
public bool IncludeStatus { get; set; }
-
+
+ ///
+ /// تایخ شروع بکار میلادی جدید
+ /// DSW_SDATE
+ ///
public DateTime StartWorkDateNew { get; set; }
+
+ ///
+ /// تاریخ ترک کار میلادی جدید
+ /// DSW_EDATE
+ ///
public DateTime? LeftWorkDateNew { get; set; }
+
public string StrLeftWorkDateNew { get; set; }
public string StrStartWorkDateNew { get; set; }
public long JobIdNew { get; set; }
@@ -93,4 +234,40 @@ public class EmployeeDetailsForInsuranceListViewModel
public bool HasConfilictLeftWork { get; set; }
public double YearlySalaryItem { get; set; }
public bool HasConfilictJobs { get; set; }
+
+
+ ///
+ /// پایه سنواتی
+ /// DSW_INC
+ ///
+ public double BaseYears { get; set; }
+
+ ///
+ /// جمع پایه سنوات و دستمزد روزانه
+ /// DSW_INC
+ ///
+ public double DailyWagePlusBaseYears { get; set; }
+
+ ///
+ /// حق تاهل
+ /// DSW_SPOUSE
+ ///
+ public double MarriedAllowance { get; set; }
+ /////
+ ///// مجموع پایه سنواتی کارکنان
+ ///// DSK_INC
+ /////
+ //public double SumOfBaseYears { get; set; }
+
+ /////
+ ///// جمع پایه سنوات و دستمزد روزانه کارکنان
+ ///// DSW_INC
+ /////
+ //public double SumOfDailyWagePlusBaseYears { get; set; }
+
+ /////
+ ///// مجموع حق تاهل کارکنان
+ ///// DSK_SPOUSE
+ /////
+ //public double SumOfMarriedAllowance { get; set; }
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceList/MainEmployeeDetailsViewModel.cs b/CompanyManagment.App.Contracts/InsuranceList/MainEmployeeDetailsViewModel.cs
index 3f541a9c..740380f4 100644
--- a/CompanyManagment.App.Contracts/InsuranceList/MainEmployeeDetailsViewModel.cs
+++ b/CompanyManagment.App.Contracts/InsuranceList/MainEmployeeDetailsViewModel.cs
@@ -12,4 +12,5 @@ public class MainEmployeeDetailsViewModel
public bool IsExist { get; set; }
public bool IsBlock { get; set; }
public double MaritalStatus { get; set; }
+
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/InsuranceWorkshopInfo/InsuranceWorkshopInfoViewModel.cs b/CompanyManagment.App.Contracts/InsuranceWorkshopInfo/InsuranceWorkshopInfoViewModel.cs
index bea04389..2b1981d0 100644
--- a/CompanyManagment.App.Contracts/InsuranceWorkshopInfo/InsuranceWorkshopInfoViewModel.cs
+++ b/CompanyManagment.App.Contracts/InsuranceWorkshopInfo/InsuranceWorkshopInfoViewModel.cs
@@ -10,16 +10,37 @@ public class InsuranceWorkshopInfoViewModel
{
public long InsuranceWorkshopInfoId { get; set; }
public long WorkshopId { get; set; }
- //نام کارگاه
+ ///
+ /// نام کارگاه
+ /// DSK_NAME
+ ///
public string WorkshopName { get; set; }
- //کد کارگاهی بیمه
+ ///
+ /// کد کارگاهی بیمه
+ /// DSK_ID
+ ///
public string InsuranceCode { get; set; }
- //ردیف پیمان
+
+ ///
+ /// ردیف پیمان
+ ///
public string AgreementNumber { get; set; }
- // نام کارفرما
+
+ ///
+ /// نام کارفرما
+ /// DSK_FARM
+ ///
public string EmployerName { get; set; }
- //آدرس کارگاه
+ ///
+ /// آدرس کارگاه
+ /// DSK_ADRS
+ ///
public string Address { get; set; }
+
+ ///
+ /// شماره لیست
+ /// DSK_LISTNO
+ ///
public string ListNumber { get; set; }
//public bool FixedSalary { get; set; }
//public string Population { get; set; }
diff --git a/CompanyManagment.App.Contracts/LeftWorkInsurance/ILeftWorkInsuranceApplication.cs b/CompanyManagment.App.Contracts/LeftWorkInsurance/ILeftWorkInsuranceApplication.cs
index c9cc6081..f9a3d9c3 100644
--- a/CompanyManagment.App.Contracts/LeftWorkInsurance/ILeftWorkInsuranceApplication.cs
+++ b/CompanyManagment.App.Contracts/LeftWorkInsurance/ILeftWorkInsuranceApplication.cs
@@ -31,4 +31,14 @@ public interface ILeftWorkInsuranceApplication
OperationResult CheckEditLeftWorkInsurance(long workshopId, long employeeId, string date, int type);
OperationResult CheckBeforeSaveLeftWorkInsurance(long workshopId, long employeeId, string date, int type);
+
+ #region Insurance
+ ///
+ /// دریافت شروع و ترک کار بیمه پرسنل و اطلاعات هویتی آن
+ ///
+ ///
+ ///
+ List GetEmployeeInsuranceLeftWorksAndInformation(long workshopId, DateTime startDate, DateTime endDate);
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs b/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
index 971aa982..b3303f0a 100644
--- a/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
+++ b/CompanyManagment.App.Contracts/PersonalContractingParty/IPersonalContractingPartyApp.cs
@@ -42,6 +42,16 @@ public interface IPersonalContractingPartyApp
OperationResult DisableBlock(long id);
#endregion
+ #region Insurance
+ ///
+ /// چک میکند که آیا طرف حساب بلاک است یا خیر
+ /// با دریافت آی دی کارگاه
+ ///
+ ///
+ ///
+ bool IsBlockCheckByWorkshopId(long workshopId);
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs b/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
index a38ed9d3..73d34584 100644
--- a/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
+++ b/CompanyManagment.App.Contracts/Workshop/IWorkshopApplication.cs
@@ -61,4 +61,14 @@ public interface IWorkshopApplication
#endregion
AccountViewModel GetClientAccountByWorkshopId(long workshopId);
+
+
+ #region Insurance
+ ///
+ /// لیست انتخاب کارگاه در مودال ایجاد بیمه
+ ///
+ ///
+ List GetWorkshopSelectListInsuransce();
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs b/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
index 3e2fd568..d068375a 100644
--- a/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
+++ b/CompanyManagment.App.Contracts/YearlySalary/IYearlySalaryApplication.cs
@@ -19,4 +19,10 @@ public interface IYearlySalaryApplication
Task HolidayGregorian(DateTime gregorianDate);
Task HolidayShamsi(string shamsiDate);
+
+ #region Insurance
+
+ InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.App.Contracts/YearlySalary/InsuranceYearlySalaryModel.cs b/CompanyManagment.App.Contracts/YearlySalary/InsuranceYearlySalaryModel.cs
new file mode 100644
index 00000000..093d2053
--- /dev/null
+++ b/CompanyManagment.App.Contracts/YearlySalary/InsuranceYearlySalaryModel.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CompanyManagment.App.Contracts.YearlySalary;
+
+public class InsuranceYearlySalaryModel
+{
+ public double DayliWage { get; set; }
+ public double HousingAllowance { get; set; }
+ public double ConsumableItems { get; set; }
+ public double MarriedAllowance { get; set; }
+
+}
\ No newline at end of file
diff --git a/CompanyManagment.Application/EmployeeInsurancListDataApplication.cs b/CompanyManagment.Application/EmployeeInsurancListDataApplication.cs
index 30f996a0..01a97daf 100644
--- a/CompanyManagment.Application/EmployeeInsurancListDataApplication.cs
+++ b/CompanyManagment.Application/EmployeeInsurancListDataApplication.cs
@@ -26,7 +26,9 @@ public class EmployeeInsurancListDataApplication : IEmployeeInsurancListDataAppl
if (command == null)
return operation.Failed("لطفا اطلاعات ورودی را تکمیل نمایید!");
- var employeeInsurancListData = new EmployeeInsurancListData(command.InsuranceListId, command.EmployeeId, command.WorkingDays, command.DailyWage, command.MonthlySalary, command.MonthlyBenefits, command.MonthlyBenefitsIncluded, command.BenefitsIncludedContinuous, command.BenefitsIncludedNonContinuous, command.InsuranceShare, command.StartWorkDate,command.LeftWorkDate,command.JobId,command.IncludeStatus);
+ var employeeInsurancListData = new EmployeeInsurancListData(command.InsuranceListId, command.EmployeeId, command.WorkingDays, command.DailyWage, command.MonthlySalary, command.MonthlyBenefits,
+ command.MonthlyBenefitsIncluded, command.BenefitsIncludedContinuous, command.BenefitsIncludedNonContinuous, command.InsuranceShare,
+ command.StartWorkDate,command.LeftWorkDate,command.JobId,command.IncludeStatus, command.BaseYears,command.MarriedAllowance);
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
_employeeInsurancListDataRepository.SaveChanges();
return operation.Succcedded();
diff --git a/CompanyManagment.Application/EmployerApplication.cs b/CompanyManagment.Application/EmployerApplication.cs
index d3498c57..594b12c3 100644
--- a/CompanyManagment.Application/EmployerApplication.cs
+++ b/CompanyManagment.Application/EmployerApplication.cs
@@ -939,5 +939,16 @@ public class EmployerApplication : IEmployerApplication
return _EmployerRepository.GetAllEmployers();
}
- #endregion
+
+
+ #endregion
+
+ #region Insurance
+
+ public (string employerName, bool isLegal) InsuranceEmployerByWorkshopId(long workshopId)
+ {
+ return _EmployerRepository.InsuranceEmployerByWorkshopId(workshopId);
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/InsuranceListApplication.cs b/CompanyManagment.Application/InsuranceListApplication.cs
index fa7836c7..cd9bf530 100644
--- a/CompanyManagment.Application/InsuranceListApplication.cs
+++ b/CompanyManagment.Application/InsuranceListApplication.cs
@@ -1,12 +1,15 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using _0_Framework.Application;
+using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using Company.Domain.DateSalaryAgg;
using Company.Domain.DateSalaryItemAgg;
using Company.Domain.EmployeeAgg;
using Company.Domain.EmployeeChildrenAgg;
+using Company.Domain.empolyerAgg;
using Company.Domain.InsuranceEmployeeInfoAgg;
using Company.Domain.InsuranceJobItemAgg;
using Company.Domain.InsuranceListAgg;
@@ -337,352 +340,521 @@ public class InsuranceListApplication: IInsuranceListApplication
public List Search(InsuranceListSearchModel searchModel)
{
- var result = _insuranceListRepositpry.Search(searchModel);
- result = result.Select(x => new InsuranceListViewModel()
- {
- Id = x.Id,
- Year = x.Year,
- Month = x.Month.GetMonthByNumber(),
- MonthNumber = x.MonthNumber,
- WorkShopCode = x.WorkShopCode,
- WorkShopName = x.WorkShopName,
- WorkShopId = x.WorkShopId,
- TypeOfInsuranceSend = x.TypeOfInsuranceSend,
- FixedSalary = x.FixedSalary,
- StrFixedSalary = x.StrFixedSalary,
- EmployerName = x.EmployerName,
- Branch = x.Branch,
- City = x.City,
- ConfirmSentlist = x.ConfirmSentlist,
- EmployerId = x.EmployerId,
- IsBlockCantracingParty = _contractingPartyApp.IsBlockByEmployerId(x.EmployerId),
+ return _insuranceListRepositpry.OptimizedSearch(searchModel);
+ //var result = _insuranceListRepositpry.Search(searchModel);
+ //result = result.Select(x => new InsuranceListViewModel()
+ //{
+ // Id = x.Id,
+ // Year = x.Year,
+ // Month = x.Month.GetMonthByNumber(),
+ // MonthNumber = x.MonthNumber,
+ // WorkShopCode = x.WorkShopCode,
+ // WorkShopName = x.WorkShopName,
+ // WorkShopId = x.WorkShopId,
+ // TypeOfInsuranceSend = x.TypeOfInsuranceSend,
+ // FixedSalary = x.FixedSalary,
+ // StrFixedSalary = x.StrFixedSalary,
+ // EmployerName = x.EmployerName,
+ // Branch = x.Branch,
+ // City = x.City,
+ // ConfirmSentlist = x.ConfirmSentlist,
+ // EmployerId = x.EmployerId,
+ // IsBlockCantracingParty = _contractingPartyApp.IsBlockByEmployerId(x.EmployerId),
- }).ToList();
- return result;
+ //}).ToList();
+ //return result;
}
- // محاسبه جدول پرسنل در - DSKWOR 1 create
+ ///
+ /// محاسبه جدول پرسنل در مودال ایجاد لیست بیمه
+ ///
+ ///
+ ///
public MainEmployeeDetailsViewModel SearchEmployeeForCreateInsuranceList( EmployeeForCreateInsuranceListSearchModel searchModel)
{
+ var watch = new Stopwatch();
+
var result = new MainEmployeeDetailsViewModel();
var workshopId = searchModel.WorkshopIds.FirstOrDefault();
- var employerId = _workShopRepository.GetDetails(workshopId).EmployerIdList.FirstOrDefault();
- var isBolock = _contractingPartyApp.IsBlockByEmployerId(employerId);
+ //var employerId = _workShopRepository.GetDetails(workshopId).EmployerIdList.FirstOrDefault();
+ //var isBolock = _contractingPartyApp.IsBlockByEmployerId(employerId);
+ var isBolock = _contractingPartyApp.IsBlockCheckByWorkshopId(workshopId);
double monthlybaseYear = 0;
- // اگر لیست بیمه تکراری نبود
- if (!_insuranceListRepositpry.Exists(x =>x.Year == searchModel.Year && x.Month == searchModel.Month && searchModel.WorkshopIds.Contains(x.WorkshopId)))
+ // اگر در این سال و ماه برای این کارگاه لیست بیمه ایجاد نشده بود
+ if (!_insuranceListRepositpry.Exists(x =>
+ x.Year == searchModel.Year && x.Month == searchModel.Month &&
+ searchModel.WorkshopIds.Contains(x.WorkshopId)))
{
- List list = new List();
-
- // شروع بکار و ترک کار بیمه
- var leftWorkInsuranceViewModelList =_leftWorkInsuranceApplication.SearchForCreateInsuranceList(searchModel);
+ var startMonthFa = $"{searchModel.Year}/{searchModel.Month}/01";
+ DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
+ DateTime endDateGr = startMonthFa.FindeEndOfMonth()
+ .ToGeorgianDateTime();
+ int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
- int leftWorkInsuranceCount= leftWorkInsuranceViewModelList.Count();
+
+ //مقادیر سالانه این تاریخ
+ var yearlysaleries = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, searchModel.Year);
- string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
- string endMonthCurrent = startMonthCurrent.FindeEndOfMonth();
- var model = new YearlySalarySearchModel();
- var startDate = startMonthCurrent.ToGeorgianDateTime();
- model.StartDateGr = startDate;
- model.EndDateGr = endMonthCurrent.ToGeorgianDateTime();
- model.year = searchModel.Year;
-
-
- //مقادیر سالانه این تاریخ
- var yearSalaryObj = _yearlySalaryApplication.GetDetailsBySearchModel(model);
-
- var yearlysalaryItem = new YearlysalaryItemViewModel();
- var housingAllowance = new YearlysalaryItemViewModel();
- var consumableItems = new YearlysalaryItemViewModel();
- var maritalStatus = new YearlysalaryItemViewModel();
- if (yearSalaryObj != null)
- {
- yearlysalaryItem = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id)
- .Where(x => x.ItemName == "مزد روزانه").FirstOrDefault();
- housingAllowance = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id)
- .Where(x => x.ItemName == "کمک هزینه مسکن").FirstOrDefault();
- consumableItems = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id)
- .Where(x => x.ItemName == "کمک هزینه اقلام").FirstOrDefault();
- maritalStatus = _yearlySalaryItemApplication.GetItemsByYearlySalaryId(yearSalaryObj.Id)
- .Where(x => x.ItemName == "حق تاهل").FirstOrDefault();
-
- }
-
- foreach (var item in leftWorkInsuranceViewModelList)
- {
- var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
-
- var employeeDetailsForInsuranceObj = new EmployeeDetailsForInsuranceListViewModel();
- employeeDetailsForInsuranceObj.HasConfilictJobs = false;
+ // دریافت اطلاعات هویتی و شروع و ترک کار کارکنان
+ var employeesInfoAndLeftWorks =
+ _leftWorkInsuranceApplication.GetEmployeeInsuranceLeftWorksAndInformation(workshopId, startDateGr,
+ endDateGr);
+ watch.Start();
+ var computeResult = employeesInfoAndLeftWorks.Select(employee =>
+ {
+ var dateOfBirth = employee.DateOfBirthGr.ToFarsi();
+ var dateOfIssue = employee.DateOfIssueGr.ToFarsi();
+ var leftDate = employee.LeftWorkDateGr != null ? employee.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
- employeeDetailsForInsuranceObj.IsMaritalStatusSet = // آیا وضعیت تاهل پرسنل ست شده است
- !string.IsNullOrWhiteSpace(employeeObject.MaritalStatus);
- if (_insuranceEmployeeInfoRepository.Exists(x => x.EmployeeId == item.EmployeeId))
- {
- var employeeInfoObject = _insuranceEmployeeInfoApplication.GetDetailsByEmployeeId(item.EmployeeId);
- employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = employeeInfoObject.Id;
- employeeDetailsForInsuranceObj.EmployeeId = employeeInfoObject.EmployeeId;
- employeeDetailsForInsuranceObj.FName = employeeInfoObject.FName;
- employeeDetailsForInsuranceObj.LName = employeeInfoObject.LName;
- employeeDetailsForInsuranceObj.FatherName = employeeInfoObject.FatherName;
- employeeDetailsForInsuranceObj.DateOfBirth = employeeInfoObject.DateOfBirth;
- employeeDetailsForInsuranceObj.DateOfIssue = employeeInfoObject.DateOfIssue;
- employeeDetailsForInsuranceObj.DateOfBirthGr = employeeInfoObject.DateOfBirthGr;
- employeeDetailsForInsuranceObj.DateOfIssueGr = employeeInfoObject.DateOfIssueGr;
- employeeDetailsForInsuranceObj.PlaceOfIssue = employeeInfoObject.PlaceOfIssue;
- employeeDetailsForInsuranceObj.IdNumber = employeeInfoObject.IdNumber;
- employeeDetailsForInsuranceObj.Gender = employeeInfoObject.Gender;
+ var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employee.StartWorkDateGr, leftDate, startDateGr,endDateGr, employee.EmployeeId);
+ var leftWorkFa = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr.ToFarsi(): "";
+ var startWorkFa = workingDays.startWork.ToFarsi();
+ //به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
+ var dailyWage = searchModel.FixedSalary ?
+ Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId, employee.EmployeeId, startDateGr, endDateGr, employee.JobId, searchModel.Population, searchModel.InsuranceJobId))
+ : ComputeDailyWage(yearlysaleries.DayliWage, employee.EmployeeId, workshopId, searchModel.Year);
+ //بدست آوردن پایه سنوات
+ var baseYears = _insuranceListRepositpry.GetEmployeeInsuranceBaseYear(employee.EmployeeId, workshopId,
+ workingDays.countWorkingDays, startDateGr, endDateGr,workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
- //از جدول پرسنل پر می شود
- employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode; //employeeInfoObject.NationalCode;
- employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
- employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode; //employeeInfoObject.InsuranceCode;
- }
- else
- {
- // var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
- employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = 0;
- //employeeDetailsForInsuranceObj.EmployeeInsurancListDataId = 0;
- employeeDetailsForInsuranceObj.EmployeeId = employeeObject.Id;
- employeeDetailsForInsuranceObj.FName = employeeObject.FName;
- employeeDetailsForInsuranceObj.LName = employeeObject.LName;
- employeeDetailsForInsuranceObj.FatherName = employeeObject.FatherName;
- employeeDetailsForInsuranceObj.DateOfBirth = (employeeObject.DateOfBirth=="1300/10/11"?"" : employeeObject.DateOfBirth);
- employeeDetailsForInsuranceObj.DateOfIssue = employeeObject.DateOfIssue;
- employeeDetailsForInsuranceObj.PlaceOfIssue = employeeObject.PlaceOfIssue;
- employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode;
- employeeDetailsForInsuranceObj.IdNumber = employeeObject.IdNumber;
- employeeDetailsForInsuranceObj.Gender = employeeObject.Gender;
- employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode;
- employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
- }
+
+
+ //جمع مزد روزانه و پایه سنوات
+ var dailyWagePlusBaseYears = dailyWage + baseYears.baseYear;
+
- #region ComputingWorkingDays
- int startWork = 0;
- int endWork = 0;
+ //دستمزد ماهانه با محاسبه پایه سنوات
+ var monthlySalary = GetRoundValue(dailyWagePlusBaseYears * workingDays.countWorkingDays);
- var year = Convert.ToInt32(searchModel.Year);
- var month = Convert.ToInt32(searchModel.Month);
- var day = 1;
- var persianCurrentStartDate = new PersianDateTime(year, month, day);
- var dayMonthCurrent = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
- var persianCurrentEndDate = new PersianDateTime(year, month, dayMonthCurrent);
- //آخرین روز ماه جاری
- var endMonthCurrentDay = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
+ //حق تاهل
+ var marriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
- var yearStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(0, 4));
- var monthStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(5, 2));
- var dayStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(8, 2));
- var persianStartDateUser = new PersianDateTime(yearStartDateUser, monthStartDateUser, dayStartDateUser);
+ //محاسبه مزایای ماهانه
+ var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId);
- if (persianStartDateUser < persianCurrentStartDate)
- employeeDetailsForInsuranceObj.HasStartWorkInMonth = false;
- else
- employeeDetailsForInsuranceObj.HasStartWorkInMonth = true;
+ //محاسبه مزایای مشمول مستمر
+ var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
- //اگر شروع به کار کاربر از ابتدای ماه جاری کمتر باشد
- if (persianStartDateUser <= persianCurrentStartDate)
- {
- startWork = 1;
- }
- else
- {
- startWork = dayStartDateUser;
- }
+ //محاسبه حق بیمه سهم بیمه شده
+ var insuranceShare = (benefitsIncludedContinuous * 7) / 100;
- if (!string.IsNullOrEmpty(item.LeftWorkDate))
- {
- var yearEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(0, 4));
- var monthEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(5, 2));
- var dayEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(8, 2));
- var persianLeftDateUser = new PersianDateTime(yearEndDateUser, monthEndDateUser, dayEndDateUser);
- var persianEndDateUser = persianLeftDateUser.AddDays(-1);
- var persianEndDateUserStr = persianLeftDateUser.AddDays(-1).ToString("yyyy/MM/dd");
+ //محاسبه حق بیمه سهم کارفرما
+ var employerShare = (benefitsIncludedContinuous * 20) / 100;
- //if (persianLeftDateUser <= persianCurrentEndDate)
- // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
- //else
- // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
+ // محاسبه بیمه بیکاری
+ var unEmploymentInsurance = (benefitsIncludedContinuous * 3) / 100;
+ return new EmployeeDetailsForInsuranceListViewModel
+ {
+ #region EmployeeInfo
- //ترک کارش در ماه و سال جاری بود نمایش داده شود
- if (!item.LeftWorkDate.Contains(searchModel.Year + "/" + searchModel.Month))
- {
- employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
- item.LeftWorkDate = string.Empty;
- item.LeftWorkDateGr = null;
- }
- else
- {
- employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
- }
+ InsuranceEmployeeInformationId = employee.InsuranceEmployeeInformationId,
+ EmployeeId = employee.EmployeeId,
+ FName = employee.FName,
+ LName = employee.LName,
+ FatherName = employee.FatherName,
+ DateOfBirth = dateOfBirth == "1300/10/11" ? "" : dateOfBirth,
+ DateOfIssue = dateOfIssue,
+ DateOfBirthGr = employee.DateOfBirthGr,
+ DateOfIssueGr = employee.DateOfIssueGr,
+ PlaceOfIssue = employee.PlaceOfIssue,
+ IdNumber = employee.IdNumber,
+ Gender = employee.Gender,
+ NationalCode = employee.NationalCode,
+ Nationality = employee.Nationality,
+ InsuranceCode = employee.InsuranceCode,
+ // آیا وضعیت تاهل پرسنل ست شده است
+ IsMaritalStatusSet = !string.IsNullOrWhiteSpace(employee.MaritalStatus),
+ MaritalStatus = employee.MaritalStatus,
- //اگر پایان به کار کاربر از پایان ماه جاری بیشتر باشد
- if (persianEndDateUser >= persianCurrentEndDate)
- {
- endWork = endMonthCurrentDay;
- }
- else
- {
- endWork = Convert.ToInt32(persianEndDateUserStr.Substring(8, 2));
- }
- }
- else
- {
- employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
- endWork = endMonthCurrentDay;
- }
+ StartMonthCurrent = startMonthFa,
+ WorkingDays = workingDays.countWorkingDays,
+ StartWorkDate = startWorkFa,
+ StartWorkDateGr = workingDays.startWork,
+ LeftWorkDate = leftWorkFa,
+ LeftWorkDateGr = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr : null,
+ JobId = employee.JobId,
+ JobName = employee.JobName,
+ JobCode = employee.JobCode,
- int countWorkingDays = 0;
- for (int i = startWork; i <= endWork; i++)
- {
- countWorkingDays = countWorkingDays + 1;
- }
- //farokhiChanges
- //روزهای کارکرد پرسنل با آی دی های زیر دستی تعریف شد
- switch (item.EmployeeId)
- {
+ HasStartWorkInMonth = workingDays.hasStartWorkInMonth,
+ HasLeftWorkInMonth = workingDays.hasLeftWorkInMonth,
+ #endregion
+
+ #region Compute
+ //مشمول مزایا بودن
+ IncludeStatus = employee.IncludeStatus,
+
+ //دستمزد روزانه
+ DailyWage = GetRoundValue(dailyWage),
+ DailyWageStr = dailyWage.ToMoney(),
+
+ HasConfilictJobs = dailyWage == 0,
+
+ //پایه سنوات
+ BaseYears = baseYears.baseYear,
+
+ //مجموع مزد روزانه و پایه سنوات
+ DailyWagePlusBaseYears = dailyWagePlusBaseYears,
+
+ //حق تاهل
+ MarriedAllowance = employee.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0,
+
+ //دستمزد ماهانه
+ MonthlySalary = monthlySalary,
- //case 3812://ثابت- کسری حاجی پور
- // countWorkingDays = 15;
- // break;
- case 40463://ثابت
- countWorkingDays = 10;
- break;
- case 40469://ثابت
- countWorkingDays = 7;
- break;
- case 9950://ثابت
- countWorkingDays = 15;
- break;
- case 9640://ثابت
- countWorkingDays = 15;
- break;
- case 40998://ثابت
- countWorkingDays = 15;
- break;
- case 6219://ثابت
- countWorkingDays = 15;
- break;
- //case 7897://ثابت
- // countWorkingDays = 15;
- break;
- }
- #endregion
+
+ //مزایای ماهانه
+ MonthlyBenefits = monthlyBenefits,
- employeeDetailsForInsuranceObj.IncludeStatus = item.IncludeStatus;
+ //مزایای مشمول مستمر
+ BenefitsIncludedContinuous = benefitsIncludedContinuous,
+
+ //مزیایی مشمول غیر مستمر
+ BenefitsIncludedNonContinuous = 0,
+
+ // جمع کل دستمزد و مزایای ماهانه
+ IncludedAndNotIncluded = benefitsIncludedContinuous,
+
+ //حق بیمه سهم بیمه شده
+ InsuranceShare = GetRoundValue(insuranceShare),
+
+ //حق بیمه سهم کارفرما
+ EmployerShare = GetRoundValue(employerShare),
+
+ //بیمه بیکاری
+ UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance),
+
+ //کمک هزینه مسکن
+ HousingAllowance = yearlysaleries.HousingAllowance,
+ //کمک هزینه اقلام
+ ConsumableItems = yearlysaleries.ConsumableItems,
+
+ EndMonthCurrentDay = endOfMonth,
+ YearlySalaryItem = yearlysaleries.DayliWage,
+ MonthlyBaseYearsStr = "0",
+ MonthlyBaseYears = 0,
+ #endregion
- #region InsuranceJob
- double dailyWage = employeeDetailsForInsuranceObj.DailyWage;
- if (searchModel.FixedSalary)
- {
- dailyWage = Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, item.WorkshopId,item.EmployeeId, model.StartDateGr, model.EndDateGr, item.JobId, searchModel.Population, searchModel.InsuranceJobId));
- employeeDetailsForInsuranceObj.HasConfilictJobs = (dailyWage == 0 ? true : false);
- }
- #endregion
+ };
+ });
+ Console.WriteLine("New Compute : " + watch.Elapsed);
+ watch.Stop();
- if (yearlysalaryItem != null)
- {
- if(!searchModel.FixedSalary )
- {
- //dailyWage= yearlysalaryItem.ItemValue;
- dailyWage = ComputeDailyWage(yearlysalaryItem.ItemValue, item.EmployeeId,item.WorkshopId, searchModel.Year) ;
- //(double basic, int totalYears) basicResult = BasicYear(item.EmployeeId, workshopId, startDate);
- //var basic = basicResult.basic;
-
- //if (basicResult.totalYears > 0)
- //{
- // monthlybaseYear = GetMonthlyBaseYear(basicResult.basic, countWorkingDays);
- //}
- }
- employeeDetailsForInsuranceObj.DailyWage = GetRoundValue(dailyWage);
- employeeDetailsForInsuranceObj.DailyWageStr = employeeDetailsForInsuranceObj.DailyWage.ToMoney();
- employeeDetailsForInsuranceObj.MonthlySalary = GetRoundValue(dailyWage * countWorkingDays);
- employeeDetailsForInsuranceObj.HousingAllowance = housingAllowance.ItemValue;
- employeeDetailsForInsuranceObj.ConsumableItems = consumableItems.ItemValue;
- employeeDetailsForInsuranceObj.EndMonthCurrentDay = endMonthCurrentDay;
- employeeDetailsForInsuranceObj.YearlySalaryItem = yearlysalaryItem.ItemValue;
- employeeDetailsForInsuranceObj.MonthlyBaseYearsStr = monthlybaseYear.ToMoney();
-
- if (item.IncludeStatus)
- {
- var marital = employeeObject.MaritalStatus == "متاهل" ? maritalStatus.ItemValue : 0;
- employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays);
- }
- else
- {
- employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
- }
+ watch.Start();
- if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId == 10) //کمک دولت
- {
- employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
- }
- //farokhiChanges
- if (item.EmployeeId == 42783)
- employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
+ #region Old_heydari
+ //List list = new List();
+ //var leftWorkInsuranceViewModel = _leftWorkInsuranceApplication.SearchForCreateInsuranceList(searchModel);
+ ////int leftWorkInsuranceCount= leftWorkInsuranceViewModelList.Count();
- employeeDetailsForInsuranceObj.BenefitsIncludedContinuous =employeeDetailsForInsuranceObj.MonthlyBenefits + employeeDetailsForInsuranceObj.MonthlySalary;
-
- //if ((!item.IncludeStatus &&(item.JobId == 10 || item.JobId == 17 || item.JobId == 18 || item.JobId == 16)) ||(item.IncludeStatus && item.JobId == 10)) // 10 --> karfarma
- //{
- // var insuranceShare2 =(employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 27) / 100;
- // employeeDetailsForInsuranceObj.InsuranceShare =GetRoundValue(insuranceShare2);
- //}
- //else
- //{
- var insuranceShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 7) / 100;
- employeeDetailsForInsuranceObj.InsuranceShare = GetRoundValue(insuranceShare); //Math.Round(insuranceShare, MidpointRounding.ToPositiveInfinity);
- //}
+ //string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
+ //string endMonthCurrent = startMonthCurrent.FindeEndOfMonth();
- var employerShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 20) / 100;
- employeeDetailsForInsuranceObj.EmployerShare = GetRoundValue(employerShare); //Math.Round(employerShare, MidpointRounding.ToPositiveInfinity);
+ //var model = new YearlySalarySearchModel();
+ //var startDate = startMonthCurrent.ToGeorgianDateTime();
+ //var endDate = endMonthCurrent.ToGeorgianDateTime();
+ //model.StartDateGr = startDate;
+ //model.EndDateGr = endMonthCurrent.ToGeorgianDateTime();
+ //model.year = searchModel.Year;
- //if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId==10)//کمک دولت
- //{employeeDetailsForInsuranceObj.InsuranceShare = 0;}
- var unEmploymentInsurance =(employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 3) / 100;
- employeeDetailsForInsuranceObj.UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance);
- employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous;
- employeeDetailsForInsuranceObj.IncludedAndNotIncluded = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous + employeeDetailsForInsuranceObj.BenefitsIncludedContinuous;
+ //foreach (var item in leftWorkInsuranceViewModel)
+ //{
+ // var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
- }
+ // var employeeDetailsForInsuranceObj = new EmployeeDetailsForInsuranceListViewModel();
+ // employeeDetailsForInsuranceObj.HasConfilictJobs = false;
- employeeDetailsForInsuranceObj.StartMonthCurrent = startMonthCurrent;
- employeeDetailsForInsuranceObj.WorkingDays = countWorkingDays;
- employeeDetailsForInsuranceObj.StartWorkDate = item.StartWorkDate;
- employeeDetailsForInsuranceObj.LeftWorkDate = item.LeftWorkDate;
- employeeDetailsForInsuranceObj.JobId = item.JobId;
- employeeDetailsForInsuranceObj.JobName = item.JobName;
- employeeDetailsForInsuranceObj.JobCode = item.JobCode;
- if (!string.IsNullOrWhiteSpace(item.LeftWorkDate))
- employeeDetailsForInsuranceObj.LeftWorkDateGr = item.LeftWorkDateGr;
+ // // آیا وضعیت تاهل پرسنل ست شده است
+ // employeeDetailsForInsuranceObj.IsMaritalStatusSet =
+ // !string.IsNullOrWhiteSpace(employeeObject.MaritalStatus);
+ // //دزیافت اطلاعات هویتی پرسنل
+ // //در صورت نداشن دیتا از جدول پرسنل پر می شود
+ // #region PersonnelInfo
- employeeDetailsForInsuranceObj.StartWorkDateGr = item.StartWorkDateGr;
- //farokhiChanges
- if (item.EmployeeId == 42783)
- employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
+ // if (_insuranceEmployeeInfoRepository.Exists(x => x.EmployeeId == item.EmployeeId))
+ // {
+ // var employeeInfoObject = _insuranceEmployeeInfoApplication.GetDetailsByEmployeeId(item.EmployeeId);
+ // employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = employeeInfoObject.Id;
+ // employeeDetailsForInsuranceObj.EmployeeId = employeeInfoObject.EmployeeId;
+ // employeeDetailsForInsuranceObj.FName = employeeInfoObject.FName;
+ // employeeDetailsForInsuranceObj.LName = employeeInfoObject.LName;
+ // employeeDetailsForInsuranceObj.FatherName = employeeInfoObject.FatherName;
+ // employeeDetailsForInsuranceObj.DateOfBirth = employeeInfoObject.DateOfBirth;
+ // employeeDetailsForInsuranceObj.DateOfIssue = employeeInfoObject.DateOfIssue;
+ // employeeDetailsForInsuranceObj.DateOfBirthGr = employeeInfoObject.DateOfBirthGr;
+ // employeeDetailsForInsuranceObj.DateOfIssueGr = employeeInfoObject.DateOfIssueGr;
+ // employeeDetailsForInsuranceObj.PlaceOfIssue = employeeInfoObject.PlaceOfIssue;
+ // employeeDetailsForInsuranceObj.IdNumber = employeeInfoObject.IdNumber;
+ // employeeDetailsForInsuranceObj.Gender = employeeInfoObject.Gender;
- list.Add(employeeDetailsForInsuranceObj);
- }
+ // //از جدول پرسنل پر می شود
+ // employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode; //employeeInfoObject.NationalCode;
+ // employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
+ // employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode; //employeeInfoObject.InsuranceCode;
+ // }
+ // else
+ // {
+ // // var employeeObject = _employeeRepository.GetDetailsByADDate(item.EmployeeId);
+ // employeeDetailsForInsuranceObj.InsuranceEmployeeInformationId = 0;
+ // //employeeDetailsForInsuranceObj.EmployeeInsurancListDataId = 0;
+ // employeeDetailsForInsuranceObj.EmployeeId = employeeObject.Id;
+ // employeeDetailsForInsuranceObj.FName = employeeObject.FName;
+ // employeeDetailsForInsuranceObj.LName = employeeObject.LName;
+ // employeeDetailsForInsuranceObj.FatherName = employeeObject.FatherName;
+ // employeeDetailsForInsuranceObj.DateOfBirth = (employeeObject.DateOfBirth == "1300/10/11" ? "" : employeeObject.DateOfBirth);
+ // employeeDetailsForInsuranceObj.DateOfIssue = employeeObject.DateOfIssue;
+ // employeeDetailsForInsuranceObj.PlaceOfIssue = employeeObject.PlaceOfIssue;
+ // employeeDetailsForInsuranceObj.NationalCode = employeeObject.NationalCode;
+ // employeeDetailsForInsuranceObj.IdNumber = employeeObject.IdNumber;
+ // employeeDetailsForInsuranceObj.Gender = employeeObject.Gender;
+ // employeeDetailsForInsuranceObj.InsuranceCode = employeeObject.InsuranceCode;
+ // employeeDetailsForInsuranceObj.Nationality = employeeObject.Nationality;
+ // }
+ // #endregion
- list = list.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
+ // //روزهای کارکرد پرسنل
+ // #region ComputingWorkingDays
+
+ // int startWork = 0;
+ // int endWork = 0;
+
+ // var year = Convert.ToInt32(searchModel.Year);
+ // var month = Convert.ToInt32(searchModel.Month);
+ // var day = 1;
+ // var persianCurrentStartDate = new PersianDateTime(year, month, day);
+ // var dayMonthCurrent = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
+ // var persianCurrentEndDate = new PersianDateTime(year, month, dayMonthCurrent);
+ // //آخرین روز ماه جاری
+ // var endMonthCurrentDay = Convert.ToInt32(endMonthCurrent.Substring(8, 2));
+
+ // var yearStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(0, 4));
+ // var monthStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(5, 2));
+ // var dayStartDateUser = Convert.ToInt32(item.StartWorkDate.Substring(8, 2));
+ // var persianStartDateUser = new PersianDateTime(yearStartDateUser, monthStartDateUser, dayStartDateUser);
+
+ // if (persianStartDateUser < persianCurrentStartDate)
+ // employeeDetailsForInsuranceObj.HasStartWorkInMonth = false;
+ // else
+ // employeeDetailsForInsuranceObj.HasStartWorkInMonth = true;
+
+ // //اگر شروع به کار کاربر از ابتدای ماه جاری کمتر باشد
+ // if (persianStartDateUser <= persianCurrentStartDate)
+ // {
+ // startWork = 1;
+ // }
+ // else
+ // {
+ // startWork = dayStartDateUser;
+ // }
+
+ // if (!string.IsNullOrEmpty(item.LeftWorkDate))
+ // {
+ // var yearEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(0, 4));
+ // var monthEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(5, 2));
+ // var dayEndDateUser = Convert.ToInt32(item.LeftWorkDate.Substring(8, 2));
+ // var persianLeftDateUser = new PersianDateTime(yearEndDateUser, monthEndDateUser, dayEndDateUser);
+ // var persianEndDateUser = persianLeftDateUser.AddDays(-1);
+ // var persianEndDateUserStr = persianLeftDateUser.AddDays(-1).ToString("yyyy/MM/dd");
+
+ // //if (persianLeftDateUser <= persianCurrentEndDate)
+ // // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
+ // //else
+ // // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
+
+ // //ترک کارش در ماه و سال جاری بود نمایش داده شود
+ // if (!item.LeftWorkDate.Contains(searchModel.Year + "/" + searchModel.Month))
+ // {
+ // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
+ // item.LeftWorkDate = string.Empty;
+ // item.LeftWorkDateGr = null;
+ // }
+ // else
+ // {
+ // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = true;
+ // }
+
+ // //اگر پایان به کار کاربر از پایان ماه جاری بیشتر باشد
+ // if (persianEndDateUser >= persianCurrentEndDate)
+ // {
+ // endWork = endMonthCurrentDay;
+ // }
+ // else
+ // {
+ // endWork = Convert.ToInt32(persianEndDateUserStr.Substring(8, 2));
+ // }
+ // }
+ // else
+ // {
+ // employeeDetailsForInsuranceObj.HasLeftWorkInMonth = false;
+ // endWork = endMonthCurrentDay;
+ // }
+
+ // int countWorkingDays = 0;
+ // for (int i = startWork; i <= endWork; i++)
+ // {
+ // countWorkingDays = countWorkingDays + 1;
+ // }
+ // //farokhiChanges
+ // //روزهای کارکرد پرسنل با آی دی های زیر دستی تعریف شد
+ // switch (item.EmployeeId)
+ // {
+
+ // //case 3812://ثابت- کسری حاجی پور
+ // // countWorkingDays = 15;
+ // // break;
+ // case 40463://ثابت
+ // countWorkingDays = 10;
+ // break;
+ // case 40469://ثابت
+ // countWorkingDays = 7;
+ // break;
+ // case 9950://ثابت
+ // countWorkingDays = 15;
+ // break;
+ // case 9640://ثابت
+ // countWorkingDays = 15;
+ // break;
+ // case 40998://ثابت
+ // countWorkingDays = 15;
+ // break;
+ // case 6219://ثابت
+ // countWorkingDays = 15;
+ // break;
+ // //case 7897://ثابت
+ // // countWorkingDays = 15;
+ // break;
+ // }
+ // #endregion
+
+ // employeeDetailsForInsuranceObj.IncludeStatus = item.IncludeStatus;
+
+
+ // #region InsuranceJob
+ // double dailyWage = employeeDetailsForInsuranceObj.DailyWage;
+ // if (searchModel.FixedSalary)
+ // {
+ // dailyWage = Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId, item.EmployeeId, model.StartDateGr, model.EndDateGr, item.JobId, searchModel.Population, searchModel.InsuranceJobId));
+ // employeeDetailsForInsuranceObj.HasConfilictJobs = (dailyWage == 0 ? true : false);
+ // }
+ // #endregion
+
+ // if (yearlysaleries != null)
+ // {
+ // if (!searchModel.FixedSalary)
+ // {
+ // //dailyWage= yearlysalaryItem.ItemValue;
+ // dailyWage = ComputeDailyWage(yearlysaleries.DayliWage, item.EmployeeId, workshopId, searchModel.Year);
+ // //(double basic, int totalYears) basicResult = BasicYear(item.EmployeeId, workshopId, startDate);
+ // //var basic = basicResult.basic;
+
+ // //if (basicResult.totalYears > 0)
+ // //{
+ // // monthlybaseYear = GetMonthlyBaseYear(basicResult.basic, countWorkingDays);
+ // //}
+ // }
+ // employeeDetailsForInsuranceObj.DailyWage = GetRoundValue(dailyWage);
+ // employeeDetailsForInsuranceObj.BaseYears = 0;
+
+ // employeeDetailsForInsuranceObj.DailyWageStr = employeeDetailsForInsuranceObj.DailyWage.ToMoney();
+ // employeeDetailsForInsuranceObj.DailyWagePlusBaseYears = 0;
+ // employeeDetailsForInsuranceObj.MonthlySalary = GetRoundValue(dailyWage * countWorkingDays);
+ // employeeDetailsForInsuranceObj.HousingAllowance = yearlysaleries.HousingAllowance;
+ // employeeDetailsForInsuranceObj.ConsumableItems = yearlysaleries.ConsumableItems;
+ // employeeDetailsForInsuranceObj.EndMonthCurrentDay = endMonthCurrentDay;
+ // employeeDetailsForInsuranceObj.YearlySalaryItem = yearlysaleries.DayliWage;
+ // employeeDetailsForInsuranceObj.MonthlyBaseYearsStr = monthlybaseYear.ToMoney();
+
+
+
+ // employeeDetailsForInsuranceObj.MarriedAllowance = 0;
+
+ // if (item.IncludeStatus)
+ // {
+ // var marital = employeeObject.MaritalStatus == "متاهل" ? yearlysaleries.MarriedAllowance : 0;
+ // employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
+ // }
+ // else
+ // {
+ // employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
+ // }
+
+ // if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId == 10) //کمک دولت
+ // {
+ // employeeDetailsForInsuranceObj.MonthlyBenefits = 0;
+ // }
+ // //farokhiChanges
+ // if (item.EmployeeId == 42783)
+ // employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
+
+ // employeeDetailsForInsuranceObj.BenefitsIncludedContinuous = employeeDetailsForInsuranceObj.MonthlyBenefits + employeeDetailsForInsuranceObj.MonthlySalary;
+
+
+ // //حق بیمه سهم بیمه شده
+ // var insuranceShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 7) / 100;
+ // employeeDetailsForInsuranceObj.InsuranceShare = GetRoundValue(insuranceShare); //Math.Round(insuranceShare, MidpointRounding.ToPositiveInfinity);
+
+ // //حق بیمه سهم کارفرما
+ // var employerShare = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 20) / 100;
+ // employeeDetailsForInsuranceObj.EmployerShare = GetRoundValue(employerShare); //Math.Round(employerShare, MidpointRounding.ToPositiveInfinity);
+
+
+ // //if (searchModel.TypeOfInsuranceSendWorkshop == "Govermentlist" && item.JobId==10)//کمک دولت
+ // //{employeeDetailsForInsuranceObj.InsuranceShare = 0;}
+
+
+ // var unEmploymentInsurance = (employeeDetailsForInsuranceObj.BenefitsIncludedContinuous * 3) / 100;
+ // employeeDetailsForInsuranceObj.UnEmploymentInsurance = GetRoundValue(unEmploymentInsurance);
+
+ // employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous;
+ // employeeDetailsForInsuranceObj.IncludedAndNotIncluded = employeeDetailsForInsuranceObj.BenefitsIncludedNonContinuous + employeeDetailsForInsuranceObj.BenefitsIncludedContinuous;
+
+ // }
+
+ // employeeDetailsForInsuranceObj.StartMonthCurrent = startMonthCurrent;
+ // employeeDetailsForInsuranceObj.WorkingDays = countWorkingDays;
+ // employeeDetailsForInsuranceObj.StartWorkDate = item.StartWorkDate;
+ // employeeDetailsForInsuranceObj.LeftWorkDate = item.LeftWorkDate;
+ // employeeDetailsForInsuranceObj.JobId = item.JobId;
+ // employeeDetailsForInsuranceObj.JobName = item.JobName;
+ // employeeDetailsForInsuranceObj.JobCode = item.JobCode;
+ // if (!string.IsNullOrWhiteSpace(item.LeftWorkDate))
+ // employeeDetailsForInsuranceObj.LeftWorkDateGr = item.LeftWorkDateGr;
+
+ // employeeDetailsForInsuranceObj.StartWorkDateGr = item.StartWorkDateGr;
+ // //farokhiChanges
+ // if (item.EmployeeId == 42783)
+ // employeeDetailsForInsuranceObj.MonthlyBenefits = 53082855;
+
+ // list.Add(employeeDetailsForInsuranceObj);
+ //}
+
+ //result.EmployeeDetailsForInsuranceList = list.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
+ // .ThenBy(x => x.LName).ToList();
+
+
+ #endregion
+
+ result.EmployeeDetailsForInsuranceList = computeResult.OrderByDescending(x => x.HasLeftWorkInMonth).ThenByDescending(x => x.HasStartWorkInMonth)
.ThenBy(x => x.LName).ToList();
- result.EmployeeDetailsForInsuranceList = list;
+ Console.WriteLine("ToList compute : " + watch.Elapsed);
result.IsExist = false;
- result.IsBlock = isBolock == "true"?true:false;
- result.MaritalStatus = maritalStatus.ItemValue;
+ result.IsBlock = isBolock;
+ result.MaritalStatus = yearlysaleries.MarriedAllowance;
+
}
else
{
result.IsExist = true;
- result.IsBlock = isBolock == "true" ? true : false;
+ result.IsBlock = isBolock;
}
+
return result;
}
@@ -1031,7 +1203,7 @@ public class InsuranceListApplication: IInsuranceListApplication
.Where(x => x.ItemName == "حق تاهل").FirstOrDefault();
item.HousingAllowance = housingAllowance.ItemValue;
item.ConsumableItems = consumableItems.ItemValue;
- item.MaritalStatus = maritalStatus.ItemValue;
+ item.MarriedAllowance = maritalStatus.ItemValue;
item.YearlySalaryItem = yearlysalaryItem.ItemValue;
}
@@ -1132,7 +1304,7 @@ public class InsuranceListApplication: IInsuranceListApplication
if (item.IncludeStatus)
{
var marital = employeeObject.MaritalStatus == "متاهل" ? maritalStatus.ItemValue : 0;
- item.MonthlyBenefits = GetMonthlyBenefits(dayMonthCurrent, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays);
+ item.MonthlyBenefits = GetMonthlyBenefits(dayMonthCurrent, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
}
else
{
@@ -1286,8 +1458,27 @@ public class InsuranceListApplication: IInsuranceListApplication
return result;
}
- private double GetMonthlyBenefits(int endMonthCurrentDay, double consumableItemsItemValue, double housingAllowanceItemValue,double maritalStatus, int countWorkingDays)
+ ///
+ /// محاسبه مزایای ماهانه
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ private double GetMonthlyBenefits(int endMonthCurrentDay, double consumableItemsItemValue, double housingAllowanceItemValue,double maritalStatus, int countWorkingDays, string typeOfInsuranceSendWorkshop, long jobId,long employeeId)
{
+ //اگر پرسنل کارفرما بود و نوع لیست کارگاه کمک دولت بود مزایا محاسبه نشود
+ if (typeOfInsuranceSendWorkshop == "Govermentlist" && jobId == 10)
+ return 0;
+ //پرسنل استثناء
+ if (employeeId == 42783)
+ return 53082855;
+
//مزایای ماهانه با توجه به پایان ماه که 30 یا 31 روزه است، متفاوت می باشد
//برای ماه 29 روزه هم تقسیم بر 30 می شود.
if (countWorkingDays == endMonthCurrentDay)
@@ -1315,6 +1506,8 @@ public class InsuranceListApplication: IInsuranceListApplication
dailyWage=employeeInsurancListData.DailyWage;
}
}
+
+ dailyWage = employeeId == 6536 ? 9399512 : dailyWage;
return dailyWage;
}
public MainEmployeeDetailsViewModel GetEmployeeForInsuranceList(List leftWorkInsuranceViewModelList, EmployeeForEditInsuranceListSearchModel searchModel)
@@ -1545,7 +1738,7 @@ public class InsuranceListApplication: IInsuranceListApplication
if (item.IncludeStatus)
{
var marital = employeeObject.MaritalStatus == "متاهل" ? maritalStatus.ItemValue : 0;
- employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays);
+ employeeDetailsForInsuranceObj.MonthlyBenefits = GetMonthlyBenefits(endMonthCurrentDay, consumableItems.ItemValue, housingAllowance.ItemValue, marital, countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, item.JobId, item.EmployeeId);
}
else
{
diff --git a/CompanyManagment.Application/LeftWorkInsuranceApplication.cs b/CompanyManagment.Application/LeftWorkInsuranceApplication.cs
index 9b155cea..8594755b 100644
--- a/CompanyManagment.Application/LeftWorkInsuranceApplication.cs
+++ b/CompanyManagment.Application/LeftWorkInsuranceApplication.cs
@@ -447,30 +447,17 @@ public class LeftWorkInsuranceApplication : ILeftWorkInsuranceApplication
public List SearchForCreateInsuranceList(
EmployeeForCreateInsuranceListSearchModel searchModel)
{
- var resultList = new List();
+ string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
+ var resultList = new List();
var leftWorkInsuranceList = _leftWorkInsuranceRepository.SearchForCreateInsuranceList(searchModel);
- //foreach (var item in leftWorkInsuranceList)
- //{
- // item.StartWorkDate = item.StartWorkDateGr.ToFarsi();
- // if (item.LeftWorkDateGr != null)
- // {
- // item.LeftWorkDate = item.LeftWorkDateGr.ToFarsi();
- // item.EndWorkDate = GetBeforeDate(item.LeftWorkDate);
- // item.IsActiveWorkshop = false;
- // }
- // else
- // {
- // item.IsActiveWorkshop = true;
- // }
- //}
//انتخاب ماه و سال برای ثبت بیمه اجباری است
if (!string.IsNullOrWhiteSpace(searchModel.Year) && !string.IsNullOrWhiteSpace(searchModel.Month))
{
string yearAndMonth = searchModel.Year + "/" + searchModel.Month;
- string startMonthCurrent = searchModel.Year + "/" + searchModel.Month + "/01";
+
// string endMonthCurrent = searchModel.Year + "/" + searchModel.Month + startMonthCurrent.FindeEndOfMonth();
var year = Convert.ToInt32(searchModel.Year);
@@ -619,4 +606,15 @@ public class LeftWorkInsuranceApplication : ILeftWorkInsuranceApplication
return _leftWorkInsuranceRepository.CheckBeforeSaveLeftWorkInsurance(workshopId, employeeId, date.ToGeorgianDateTime(), type);
}
+
+ #region Insurance
+
+ public List GetEmployeeInsuranceLeftWorksAndInformation(long workshopId, DateTime startDate, DateTime endDate)
+ {
+ return _leftWorkInsuranceRepository.GetEmployeeInsuranceLeftWorksAndInformation(workshopId, startDate, endDate);
+ }
+
+ #endregion
+
+
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/PersonalContractingPartyApplication.cs b/CompanyManagment.Application/PersonalContractingPartyApplication.cs
index ec919574..6aa564db 100644
--- a/CompanyManagment.Application/PersonalContractingPartyApplication.cs
+++ b/CompanyManagment.Application/PersonalContractingPartyApplication.cs
@@ -491,7 +491,16 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
return opration.Succcedded();
}
-
+
+
+ #endregion
+
+ #region Insurance
+
+ public bool IsBlockCheckByWorkshopId(long workshopId)
+ {
+ return _personalContractingPartyRepository2.IsBlockCheckByWorkshopId(workshopId);
+ }
#endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/WorkshopAppliction.cs b/CompanyManagment.Application/WorkshopAppliction.cs
index cdd32b06..a7d06170 100644
--- a/CompanyManagment.Application/WorkshopAppliction.cs
+++ b/CompanyManagment.Application/WorkshopAppliction.cs
@@ -16,6 +16,7 @@ using CompanyManagment.App.Contracts.RollCallService;
using CompanyManagment.App.Contracts.Workshop;
using CompanyManagment.App.Contracts.WorkshopPlan;
using CompanyManagment.EFCore.Migrations;
+using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration.UserSecrets;
using Microsoft.Identity.Client;
using Workshop = Company.Domain.WorkshopAgg.Workshop;
@@ -754,10 +755,21 @@ public class WorkshopAppliction : IWorkshopApplication
return _personalContractingPartyRepository.GetAccountByPersonalContractingParty(contractingParty.id);
}
- //public List GetConnectedPersonnelsForMain(long workshopId)
- //{
- // return _workshopRepository.GetConnectedPersonnelsForMain(workshopId);
- //}
- #endregion
+
+ //public List GetConnectedPersonnelsForMain(long workshopId)
+ //{
+ // return _workshopRepository.GetConnectedPersonnelsForMain(workshopId);
+ //}
+
+ #endregion
+
+ #region Insurance
+
+ public List GetWorkshopSelectListInsuransce()
+ {
+ return _workshopRepository.GetWorkshopSelectListInsuransce();
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.Application/YearlySalaryApplication.cs b/CompanyManagment.Application/YearlySalaryApplication.cs
index d2344aaf..82afe137 100644
--- a/CompanyManagment.Application/YearlySalaryApplication.cs
+++ b/CompanyManagment.Application/YearlySalaryApplication.cs
@@ -148,4 +148,19 @@ public class YearlySalaryApplication : IYearlySalaryApplication
{
return _yearlySalaryRepository.HolidayShamsi(shamsiDate);
}
+
+ #region Insurance
+ ///
+ /// دریافت مقادیر برای استفاده در بیمه
+ ///
+ ///
+ ///
+ ///
+ ///
+ public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
+ {
+ return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/CompanyManagment.EFCore/Migrations/20250116224550_AddBaseYearsToInsurance.Designer.cs b/CompanyManagment.EFCore/Migrations/20250116224550_AddBaseYearsToInsurance.Designer.cs
new file mode 100644
index 00000000..2193b3d8
--- /dev/null
+++ b/CompanyManagment.EFCore/Migrations/20250116224550_AddBaseYearsToInsurance.Designer.cs
@@ -0,0 +1,8401 @@
+//
+using System;
+using CompanyManagment.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace CompanyManagment.EFCore.Migrations
+{
+ [DbContext(typeof(CompanyContext))]
+ [Migration("20250116224550_AddBaseYearsToInsurance")]
+ partial class AddBaseYearsToInsurance
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.10")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IsActive")
+ .IsRequired()
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("Path")
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("Title")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("VersionCode")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("VersionName")
+ .HasMaxLength(35)
+ .HasColumnType("nvarchar(35)");
+
+ b.HasKey("id");
+
+ b.ToTable("AndroidApkVersions", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.BillAgg.EntityBill", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Appointed")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Contact")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsActiveString")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProcessingStage")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SubjectBill")
+ .IsRequired()
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.HasKey("id");
+
+ b.ToTable("TextManager_Bill", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.Board.Board", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("BoardChairman")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BoardType_Id")
+ .HasColumnType("int");
+
+ b.Property("Branch")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("DisputeResolutionPetitionDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ExpertReport")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("File_Id")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("BoardType_Id");
+
+ b.HasIndex("File_Id");
+
+ b.ToTable("Boards", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.BoardType.BoardType", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Title")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("BoardTypes", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ChapterAgg.EntityChapter", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Chapter")
+ .IsRequired()
+ .HasMaxLength(60)
+ .HasColumnType("nvarchar(60)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IsActiveString")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Subtitle_Id")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("Subtitle_Id");
+
+ b.ToTable("TextManager_Chapter", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CheckoutAgg.Checkout", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("AbsenceDeduction")
+ .HasColumnType("float");
+
+ b.Property("AbsencePeriod")
+ .HasColumnType("float");
+
+ b.Property("AbsenceValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("ArchiveCode")
+ .HasMaxLength(15)
+ .HasColumnType("nvarchar(15)");
+
+ b.Property("AverageHoursPerDay")
+ .HasColumnType("float");
+
+ b.Property("BaseYearsPay")
+ .HasColumnType("float");
+
+ b.Property("BonusesPay")
+ .HasColumnType("float");
+
+ b.Property("ConsumableItems")
+ .HasColumnType("float");
+
+ b.Property("ContractEnd")
+ .HasColumnType("datetime2");
+
+ b.Property("ContractId")
+ .HasColumnType("bigint");
+
+ b.Property("ContractNo")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ContractStart")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("CreditLeaves")
+ .HasColumnType("float");
+
+ b.Property("DateOfBirth")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("EmployeeFullName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("EmployeeId")
+ .HasColumnType("bigint");
+
+ b.Property("FamilyAllowance")
+ .HasColumnType("float");
+
+ b.Property("FathersName")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("FridayPay")
+ .HasColumnType("float");
+
+ b.Property("FridayWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("HasRollCall")
+ .HasColumnType("bit");
+
+ b.Property("HousingAllowance")
+ .HasColumnType("float");
+
+ b.Property("InstallmentDeduction")
+ .HasColumnType("float");
+
+ b.Property("InsuranceDeduction")
+ .HasColumnType("float");
+
+ b.Property("IsActiveString")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("LeaveCheckout")
+ .HasColumnType("bit");
+
+ b.Property("LeavePay")
+ .HasColumnType("float");
+
+ b.Property("MarriedAllowance")
+ .HasColumnType("float");
+
+ b.Property("MissionPay")
+ .HasColumnType("float");
+
+ b.Property("Month")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("MonthlySalary")
+ .HasColumnType("float");
+
+ b.Property("NationalCode")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("NightworkPay")
+ .HasColumnType("float");
+
+ b.Property("OverNightWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("OverTimeWorkValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("OvertimePay")
+ .HasColumnType("float");
+
+ b.Property("PersonnelCode")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("RewardPay")
+ .HasColumnType("float");
+
+ b.Property("RotatingShiftValue")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("SalaryAidDeduction")
+ .HasColumnType("float");
+
+ b.Property("ShiftPay")
+ .HasColumnType("float");
+
+ b.Property("Signature")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("SumOfWorkingDays")
+ .HasMaxLength(6)
+ .HasColumnType("nvarchar(6)");
+
+ b.Property("TaxDeducation")
+ .HasColumnType("float");
+
+ b.Property("TotalClaims")
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.Property("TotalDayOfBunosesCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDayOfLeaveCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDayOfYearsCompute")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("TotalDeductions")
+ .HasMaxLength(25)
+ .HasColumnType("nvarchar(25)");
+
+ b.Property("TotalPayment")
+ .HasColumnType("float");
+
+ b.Property("WorkingHoursId")
+ .HasColumnType("bigint");
+
+ b.Property("WorkshopId")
+ .HasColumnType("bigint");
+
+ b.Property("WorkshopName")
+ .HasMaxLength(70)
+ .HasColumnType("nvarchar(70)");
+
+ b.Property("Year")
+ .HasMaxLength(4)
+ .HasColumnType("nvarchar(4)");
+
+ b.Property("YearsPay")
+ .HasColumnType("float");
+
+ b.HasKey("id");
+
+ b.HasIndex("WorkshopId");
+
+ b.ToTable("Checkouts", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("EndDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Group1")
+ .HasColumnType("float");
+
+ b.Property("Group10")
+ .HasColumnType("float");
+
+ b.Property("Group11")
+ .HasColumnType("float");
+
+ b.Property("Group12")
+ .HasColumnType("float");
+
+ b.Property("Group13")
+ .HasColumnType("float");
+
+ b.Property("Group14")
+ .HasColumnType("float");
+
+ b.Property("Group15")
+ .HasColumnType("float");
+
+ b.Property("Group16")
+ .HasColumnType("float");
+
+ b.Property("Group17")
+ .HasColumnType("float");
+
+ b.Property("Group18")
+ .HasColumnType("float");
+
+ b.Property("Group19")
+ .HasColumnType("float");
+
+ b.Property("Group2")
+ .HasColumnType("float");
+
+ b.Property("Group20")
+ .HasColumnType("float");
+
+ b.Property("Group3")
+ .HasColumnType("float");
+
+ b.Property("Group4")
+ .HasColumnType("float");
+
+ b.Property("Group5")
+ .HasColumnType("float");
+
+ b.Property("Group6")
+ .HasColumnType("float");
+
+ b.Property("Group7")
+ .HasColumnType("float");
+
+ b.Property("Group8")
+ .HasColumnType("float");
+
+ b.Property("Group9")
+ .HasColumnType("float");
+
+ b.Property("StartDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Year")
+ .HasColumnType("int");
+
+ b.HasKey("id");
+
+ b.ToTable("ClassifiedSalaries", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b =>
+ {
+ b.Property("WorkshopId")
+ .HasColumnType("bigint");
+
+ b.Property("EmployeeId")
+ .HasColumnType("bigint");
+
+ b.HasKey("WorkshopId", "EmployeeId");
+
+ b.HasIndex("EmployeeId");
+
+ b.ToTable("ClientWorkshopEmployee", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.Contact2Agg.EntityContact", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IsActiveString")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NameContact")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Signature")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("id");
+
+ b.ToTable("TextManager_Contact", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("Address")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("AgentPhone")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ArchiveCode")
+ .HasColumnType("int");
+
+ b.Property("BlockTimes")
+ .HasColumnType("int");
+
+ b.Property("City")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("FName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IdNumber")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("IsActiveString")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("IsBlock")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.Property("IsLegal")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("LName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("NationalId")
+ .IsRequired()
+ .HasMaxLength(15)
+ .HasColumnType("nvarchar(15)");
+
+ b.Property("Nationalcode")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("Phone")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("RegisterId")
+ .IsRequired()
+ .HasMaxLength(15)
+ .HasColumnType("nvarchar(15)");
+
+ b.Property("RepresentativeFullName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("RepresentativeId")
+ .HasColumnType("bigint");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SureName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Zone")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("id");
+
+ b.HasIndex("RepresentativeId");
+
+ b.ToTable("PersonalContractingParties", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ContractAgg.Contract", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("AgreementSalary")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ArchiveCode")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("ConsumableItems")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ContarctStart")
+ .HasColumnType("datetime2");
+
+ b.Property("ContractEnd")
+ .HasColumnType("datetime2");
+
+ b.Property("ContractNo")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("ContractPeriod")
+ .HasMaxLength(2)
+ .HasColumnType("nvarchar(2)");
+
+ b.Property("ContractType")
+ .IsRequired()
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("DayliWage")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("EmployeeId")
+ .HasColumnType("bigint");
+
+ b.Property("EmployerId")
+ .HasColumnType("bigint");
+
+ b.Property("FamilyAllowance")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("GetWorkDate")
+ .HasColumnType("datetime2");
+
+ b.Property("HousingAllowance")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsActiveString")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("JobType")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("JobTypeId")
+ .HasColumnType("bigint");
+
+ b.Property("MandatoryHoursid")
+ .HasColumnType("bigint");
+
+ b.Property("PersonnelCode")
+ .HasColumnType("bigint");
+
+ b.Property("SetContractDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Signature")
+ .HasMaxLength(1)
+ .HasColumnType("nvarchar(1)");
+
+ b.Property("WorkingHoursWeekly")
+ .IsRequired()
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ b.Property("WorkshopAddress1")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("WorkshopAddress2")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("WorkshopIds")
+ .HasColumnType("bigint");
+
+ b.Property("YearlySalaryId")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("EmployeeId");
+
+ b.HasIndex("EmployerId");
+
+ b.HasIndex("JobTypeId");
+
+ b.HasIndex("MandatoryHoursid");
+
+ b.HasIndex("WorkshopIds");
+
+ b.HasIndex("YearlySalaryId");
+
+ b.ToTable("Contracts", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.ContractingPartyAccountAgg.ContractingPartyAccount", b =>
+ {
+ b.Property("PersonalContractingPartyId")
+ .HasColumnType("bigint");
+
+ b.Property("AccountId")
+ .HasColumnType("bigint");
+
+ b.HasKey("PersonalContractingPartyId", "AccountId");
+
+ b.ToTable("ContractingPartyAccount", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CrossJobAgg.CrossJob", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("CrossJobGuildId")
+ .HasColumnType("bigint");
+
+ b.Property("EquivalentRialOver")
+ .HasColumnType("bigint");
+
+ b.Property("EquivalentRialUnder")
+ .HasColumnType("bigint");
+
+ b.Property("SalaryRatioOver")
+ .HasColumnType("float");
+
+ b.Property("SalaryRatioUnder")
+ .HasColumnType("float");
+
+ b.HasKey("id");
+
+ b.HasIndex("CrossJobGuildId");
+
+ b.ToTable("CrossJobs", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CrossJobGuildAgg.CrossJobGuild", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("EconomicCode")
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasMaxLength(255)
+ .HasColumnType("nvarchar(255)");
+
+ b.Property("Year")
+ .HasMaxLength(4)
+ .HasColumnType("int");
+
+ b.HasKey("id");
+
+ b.ToTable("CrossJobGuilds", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CrossJobItemsAgg.CrossJobItems", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("CrossJobId")
+ .HasColumnType("bigint");
+
+ b.Property("JobId")
+ .HasColumnType("bigint");
+
+ b.HasKey("id");
+
+ b.HasIndex("CrossJobId");
+
+ b.HasIndex("JobId");
+
+ b.ToTable("CrossJobItems", (string)null);
+ });
+
+ modelBuilder.Entity("Company.Domain.CustomizeCheckoutAgg.CustomizeCheckout", b =>
+ {
+ b.Property("id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("id"));
+
+ b.Property("BaseYearsPay")
+ .HasColumnType("float");
+
+ b.Property("BonusesPay")
+ .HasColumnType("float");
+
+ b.Property("ContractEnd")
+ .HasColumnType("datetime2");
+
+ b.Property("ContractId")
+ .HasColumnType("bigint");
+
+ b.Property("ContractNo")
+ .HasMaxLength(20)
+ .HasColumnType("nvarchar(20)");
+
+ b.Property("ContractStart")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("DateOfBirth")
+ .HasColumnType("datetime2");
+
+ b.Property("EarlyExitDeduction")
+ .HasColumnType("float");
+
+ b.Property("EmployeeFName")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("EmployeeId")
+ .HasColumnType("bigint");
+
+ b.Property("EmployeeLName")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("FamilyAllowance")
+ .HasColumnType("float");
+
+ b.Property("FineAbsenceDeduction")
+ .HasColumnType("float");
+
+ b.Property