Compare commits

...

27 Commits

Author SHA1 Message Date
e9907650e9 fix - connected personnel on get to show the create and sign options for contract and checkout 2025-06-15 20:05:54 +03:30
831b426f9f initialize options for create and sign in checkout and contract 2025-06-11 21:07:36 +03:30
SamSys
befcc70d46 Client Sidebar bug fixed 2025-06-11 15:34:40 +03:30
SamSys
f249df5b49 RotatingShiftReport And Compute Changed - StaticWorkongHoures Interference bug fixed 2025-06-10 20:02:50 +03:30
996adec188 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-09 16:52:17 +03:30
6f47948e40 merge from goverment list calculation 2025-06-09 16:52:10 +03:30
SamSys
d135eb73ea Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-09 16:45:30 +03:30
SamSys
86143a044c report bug fixed 2025-06-09 16:45:23 +03:30
8a6d4e0af6 add insurance list changes 2025-06-09 16:38:46 +03:30
c9183fb57e add goverment list calculation 2025-06-09 13:51:31 +03:30
SamSys
c4d21be4aa new inurancelist bug fixed - FiexedSalary changes added 2025-06-08 16:20:30 +03:30
SamSys
e9386708dc Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-08 16:17:16 +03:30
SamSys
d70abb60d7 guid for application download link 2025-06-08 16:17:08 +03:30
36cdde7e6a change insurance govermentlist 2025-06-08 14:32:43 +03:30
SamSys
34358a36c9 change upload apk 2025-06-07 19:21:34 +03:30
SamSys
babecda188 add new permission to InsuranceList 2025-06-07 16:09:50 +03:30
SamSys
98c3e7c821 New-Insurance-Opration Merged 2025-06-05 02:05:24 +03:30
SamSys
5d91b29f2b Create File Bug Fixed 2025-06-03 21:45:20 +03:30
87b0d248a3 Convert checkoutPrintOne to CheckoutPrintAll for best performance 2025-06-03 19:38:18 +03:30
a410d0c216 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-03 19:11:52 +03:30
a640f91703 fix leave hours bugs 2025-06-03 19:11:44 +03:30
SamSys
99c8dcb764 add comment to InsuranceList metod 2025-06-03 16:32:12 +03:30
SamSys
d44935329f checkoutBug Fixed 2025-06-02 22:06:41 +03:30
SamSys
3a7fc7087b changesAuthHelper 2025-06-02 22:05:21 +03:30
925f43214c fix checkout bug 2025-06-02 22:02:33 +03:30
SamSys
c2fc7dabc1 print bug fixed 2025-06-02 21:38:56 +03:30
SamSys
dec5666eb7 changes 2025-06-02 21:37:27 +03:30
59 changed files with 36649 additions and 16166 deletions

View File

@@ -1396,6 +1396,73 @@ public static class Tools
return false;
return true;
}
/// <summary>
/// چک میکند که در دو شیفت استاتیک تداخل زمانی وجود دارد یا خیر
/// چک میکند که آیا ساعات وارد شده ولید هستند یا خیر
/// </summary>
/// <param name="start1"></param>
/// <param name="end1"></param>
/// <param name="start2"></param>
/// <param name="end2"></param>
/// <returns></returns>
public static bool InterferenceTime(string start1, string end1, string start2, string end2)
{
if (!CheckValidHm(start1))
return true;
if (!CheckValidHm(end1))
return true;
if (!CheckValidHm(start2))
return true;
if (!CheckValidHm(end2))
return true;
//اگه دو شیفت نبود
if (string.IsNullOrWhiteSpace(start1) || string.IsNullOrWhiteSpace(start2))
return false;
try
{
var start1Gr = Convert.ToDateTime(start1);
var end1Gr = Convert.ToDateTime(end1);
if (end1Gr < start1Gr)
end1Gr = end1Gr.AddDays(1);
var start2Gr = Convert.ToDateTime(start2);
var end2Gr = Convert.ToDateTime(end2);
start2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, start2Gr.Hour, start2Gr.Minute,
start2Gr.Second);
end2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, end2Gr.Hour, end2Gr.Minute,
end2Gr.Second);
if (end2Gr < start2Gr)
end2Gr = end2Gr.AddDays(1);
var diff = (end1Gr - start1Gr).Add((end2Gr - start2Gr));
if (diff > new TimeSpan(24,0,0))
return true;
if (start2Gr <= end1Gr)
return true;
return false;
}
catch (Exception)
{
return true;
}
}
public static DateTime FindFirstDayOfMonthGr(this DateTime date)
{
var pc = new PersianCalendar();

View File

@@ -9,30 +9,83 @@ namespace Company.Domain.EmployeeComputeOptionsAgg
{
public class EmployeeComputeOptions : EntityBase
{
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions)
{
WorkshopId = workshopId;
EmployeeId = employeeId;
ComputeOptions = computeOptions;
BonusesOptions = bonusesOptions;
YearsOptions = yearsOptions;
}
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions,
bool createContract, bool signContract, bool createCheckout, bool signCheckout)
{
WorkshopId = workshopId;
EmployeeId = employeeId;
ComputeOptions = computeOptions;
BonusesOptions = bonusesOptions;
YearsOptions = yearsOptions;
public long WorkshopId { get; private set;}
public long EmployeeId { get; private set;}
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
}
//نحوه محاسبه مزد مرخصی
public string ComputeOptions { get; private set; }
//نحوه محاسبه عیدی
public string BonusesOptions { get; private set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; private set; }
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions)
{
ComputeOptions = computeOptions;
BonusesOptions = bonusesOptions;
YearsOptions = yearsOptions;
}
}
public long WorkshopId { get; private set; }
public long EmployeeId { get; private set; }
//نحوه محاسبه مزد مرخصی
public string ComputeOptions { get; private set; }
//نحوه محاسبه عیدی
public string BonusesOptions { get; private set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; private set; }
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; private set; }
/// <summary>
/// امضای قرارداد
/// </summary>
public bool SignContract { get; private set; }
/// <summary>
/// ایجاد تصفیه
/// </summary>
public bool CreateCheckout { get; private set; }
/// <summary>
/// امضای تصفیه
/// </summary>
public bool SignCheckout { get; private set; }
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
bool signCheckout)
{
ComputeOptions = computeOptions;
BonusesOptions = bonusesOptions;
YearsOptions = yearsOptions;
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
}
private void SetContractAndCheckoutOptions(bool createContract, bool signContract, bool createCheckout,
bool signCheckout)
{
CreateContract = createContract;
if (createContract)
{
SignContract = signContract;
CreateCheckout = createCheckout;
if (createCheckout)
{
SignCheckout = signCheckout;
}
else
{
SignCheckout = false;
}
}
else
{
SignContract = false;
CreateCheckout = false;
SignCheckout = false;
}
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Globalization;
using System.Security.AccessControl;
using _0_Framework.Application;
using _0_Framework.Domain;
using Company.Domain.CheckoutAgg;
using Company.Domain.ClientEmployeeWorkshopAgg;
@@ -92,7 +93,7 @@ public class Workshop : EntityBase
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear)
{
WorkshopName = workshopName;
WorkshopSureName = workshopSureName;
@@ -136,7 +137,12 @@ public class Workshop : EntityBase
WorkshopHolidayWorking = workshopHolidayWorking;
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
}
CreateContract = createContract;
SignContract = signContract;
CreateCheckout = createCheckout;
SignCheckout = signCheckout;
CutContractEndOfYear = cutContractEndOfYear;
}
public string WorkshopName { get; private set; }
@@ -210,6 +216,19 @@ public class Workshop : EntityBase
/// محاسبه حق اولاد در لیست بیمه
/// </summary>
public bool InsuranceCheckoutFamilyAllowance { get; private set; }
public bool CreateContract { get; private set; }
public bool SignContract { get; private set; }
public bool CreateCheckout { get; private set; }
public bool SignCheckout { get; private set; }
/// <summary>
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
/// این آیتم
/// True
/// است
/// </summary>
public IsActive CutContractEndOfYear { get; private set; }
//public Employer Employer { get; private set; }
public Workshop()
@@ -243,7 +262,7 @@ public class Workshop : EntityBase
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
string agreementNumber, bool fixedSalary, string population, long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay,
bool totalPaymentHide, bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear)
{
WorkshopName = workshopName;
WorkshopSureName = workshopSureName;
@@ -284,7 +303,12 @@ public class Workshop : EntityBase
WorkshopHolidayWorking = workshopHolidayWorking;
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
}
CreateContract = createContract;
SignContract = signContract;
CreateCheckout = createCheckout;
SignCheckout = signCheckout;
CutContractEndOfYear = cutContractEndOfYear;
}
public void Active(string archiveCode)

View File

@@ -132,6 +132,8 @@ public class CheckoutViewModel
/// مدت مرخصی استحقاقی
/// </summary>
public string TotalPaidLeave { get; set; }
public TimeSpan TotalHourlyLeave { get; set; }
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }

View File

@@ -17,5 +17,22 @@ namespace CompanyManagment.App.Contracts.EmployeeComputeOptions
public string BonusesOptions { get; set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; set; }
}
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; set; }
/// <summary>
/// امضای قرارداد
/// </summary>
public bool SignContract { get; set; }
/// <summary>
/// ایجاد تصفیه
/// </summary>
public bool CreateCheckout { get; set; }
/// <summary>
/// امضای تصفیه
/// </summary>
public bool SignCheckout { get; set; }
}
}

View File

@@ -12,4 +12,20 @@ public class EmployeeComputeOptionsViewModel
public string BonusesOptions { get; set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; set; }
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; set; }
/// <summary>
/// امضای قرارداد
/// </summary>
public bool SignContract { get; set; }
/// <summary>
/// ایجاد تصفیه
/// </summary>
public bool CreateCheckout { get; set; }
/// <summary>
/// امضای تصفیه
/// </summary>
public bool SignCheckout { get; set; }
}

View File

@@ -298,4 +298,6 @@ public class EmployeeDetailsForInsuranceListViewModel
///// DSK_SPOUSE
///// </summary>
//public double SumOfMarriedAllowance { get; set; }
public string Month { get; set; }
public string Year { get; set; }
}

View File

@@ -26,4 +26,21 @@ public class ConnectedPersonnelViewModel
public string BonusesOptions { get; set; }
//نحوه محاسبه سنوات
public string YearsOptions { get; set; }
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; set; }
/// <summary>
/// امضای قرارداد
/// </summary>
public bool SignContract { get; set; }
/// <summary>
/// ایجاد تصفیه
/// </summary>
public bool CreateCheckout { get; set; }
/// <summary>
/// امضای تصفیه
/// </summary>
public bool SignCheckout { get; set; }
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.InsuranceJob;
@@ -116,4 +117,29 @@ public class CreateWorkshop
/// </summary>
public bool InsuranceCheckoutFamilyAllowance { get; set; }
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; set; }
/// <summary>
/// امضاء قراداد
/// </summary>
public bool SignContract { get; set; }
/// <summary>
/// ایجات تصفیه حساب
/// </summary>
public bool CreateCheckout { get; set; }
/// <summary>
/// امضاء تصفیه حساب
/// </summary>
public bool SignCheckout { get; set; }
/// <summary>
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
/// این آیتم
/// True
/// است
/// </summary>
public IsActive CutContractEndOfYear { get; set; }
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.LeftWork;
@@ -80,5 +81,31 @@ public class WorkshopViewModel
public string HasRollCallFreeVip { get; set; }
#endregion
#endregion
/// <summary>
/// ایجاد قرارداد
/// </summary>
public bool CreateContract { get; set; }
/// <summary>
/// امضاء قراداد
/// </summary>
public bool SignContract { get; set; }
/// <summary>
/// ایجات تصفیه حساب
/// </summary>
public bool CreateCheckout { get; set; }
/// <summary>
/// امضاء تصفیه حساب
/// </summary>
public bool SignCheckout { get; set; }
/// <summary>
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
/// این آیتم
/// True
/// است
/// </summary>
public IsActive CutContractEndOfYear { get; set; }
}

View File

@@ -25,4 +25,5 @@ public interface IYearlySalaryApplication
InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
#endregion
}

View File

@@ -48,9 +48,9 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
Directory.CreateDirectory(path);
var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
//var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}.v{apk.VersionName}{Path.GetExtension(file.FileName)}";
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}{Path.GetExtension(file.FileName)}";
string filepath = Path.Combine(path, uniqueFileName);
@@ -60,7 +60,7 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
await file.CopyToAsync(stream);
}
var entity = new AndroidApkVersion(apk.VersionName, apk.VersionCode, IsActive.True, filepath);
var entity = new AndroidApkVersion("0", "0", IsActive.True, filepath);
_androidApkVersionRepository.Create(entity);
_androidApkVersionRepository.SaveChanges();
return op.Succcedded();

View File

@@ -19,490 +19,505 @@ namespace CompanyManagment.Application;
public class CheckoutApplication : ICheckoutApplication
{
private readonly ICheckoutRepository _checkoutRepository;
private readonly IYearlySalaryRepository _yearlySalaryRepository;
private readonly ILeftWorkRepository _leftWorkRepository;
private readonly IEmployerRepository _employerRepository;
private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly ILeaveApplication _leaveApplication;
private readonly IMandatoryHoursApplication _mandatoryHoursApplication;
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository,
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository)
{
_checkoutRepository = checkoutRepository;
_yearlySalaryRepository = yearlySalaryRepository;
_leftWorkRepository = leftWorkRepository;
_employerRepository = employerRepository;
_contractingPartyApp = contractingPartyApp;
_leaveApplication = leaveApplication;
_mandatoryHoursApplication = mandatoryHoursApplication;
_rollCallMandatoryRepository = rollCallMandatoryRepository;
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
public void Create(CreateCheckout command)
{
var operation = new OperationResult();
var syear = Convert.ToInt32(command.ContractStart.Substring(0, 4));
var smonth = Convert.ToInt32(command.ContractStart.Substring(5, 2));
string month = string.Empty;
switch (smonth)
{
case 1:
month = "فروردین";
break;
case 2:
month = "اردیبهشت";
break;
case 3:
month = "خرداد";
break;
case 4:
month = "تیر";
break;
case 5:
month = "مرداد";
break;
case 6:
month = "شهریور";
break;
case 7:
month = "مهر";
break;
case 8:
month = "آبان";
break;
case 9:
month = "آذر";
break;
case 10:
month = "دی";
break;
case 11:
month = "بهمن";
break;
case 12:
month = "اسفند";
break;
}
var year = syear.ToString();
#region SickLeav
//var serachModel = new LeaveSearchModel()
//{
// EmployeeId = command.EmployeeId,
// WorkshopId = command.WorkshopId,
// LeaveType = "استعلاجی",
// StartLeave = command.ContractStart,
// EndLeave = command.ContractEnd,
// IsAccepted = true,
//};
//var leavList = _leaveApplication.search(serachModel);
// int sickLeaveCount = 0;
//if (leavList.Count > 0)
//{
// foreach (var leave in leavList)
// {
// if (leave.StartLeaveGr < command.ContractStartGr && leave.EndLeaveGr <= command.ContractEndGr)
// {
// int res = (int)((leave.EndLeaveGr - command.ContractStartGr).TotalDays +1);
// sickLeaveCount += res;
// }
// else if (leave.StartLeaveGr >= command.ContractStartGr && leave.EndLeaveGr > command.ContractEndGr)
// {
// int res = (int)((command.ContractEndGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res;
// }
// else
// {
// int res = (int)((leave.EndLeaveGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res;
// }
// }
//}
#endregion
var dayliWage = command.DayliWage.MoneyToDouble();
// کمک هزینه اقلام
var consumableItem = command.ConsumableItems.MoneyToDouble();
//حق اولاد
var familyAllowance = command.FamilyAllowance.MoneyToDouble();
//کمک هزینه مسکن
var housingAllowance = command.HousingAllowance.MoneyToDouble();
//حق تاهل
var marriedAllowance = command.MarriedAllowance.MoneyToDouble();
var MontlyYearsBunos =
_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
//دستمزد ماهانه
var monthlyWage = MontlyYearsBunos.MontlyWage;
//سنوات
var years = command.YearsPay;
//عیدی و پاداش
var bunos = command.BonusesPay;
//پایه سنوات
var bacicYears = MontlyYearsBunos.BasicYears;
var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay;
if (command.friday > 0)
{
var fridayPercent = dayliWage * 40 / 100;
//فوق العاده جمعه کاری
command.FridayPay = fridayPercent * command.friday;
}
//حق بیمه سهم کارگر
var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance) * 7 / 100;
if (command.OvertimePay > 0 && command.AbsenceDeduction > 0)
{
if (command.AbsenceDeduction >= command.OvertimePay)
{
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
command.OvertimePay = 0;
}
else
{
command.OvertimePay = command.OvertimePay - command.AbsenceDeduction;
command.AbsenceDeduction = 0;
}
}
var checkoutStart = $"{command.Year}/{command.Month}/01";
var checkoutEnd = checkoutStart.FindeEndOfMonth();
var salaryAids =
_rollCallMandatoryRepository.SalaryAidsForCheckout(command.EmployeeId, command.WorkshopId, checkoutStart.ToGeorgianDateTime(), checkoutEnd.ToGeorgianDateTime())
.Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList();
command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble());
var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId,
command.WorkshopId, command.ContractStartGr, command.ContractEndGr)
.Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
var totalClaims = totalClaimsDouble.ToMoney();
var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
var totalDeductions = totalDeductionDouble.ToMoney();
var totalPayment = totalClaimsDouble - totalDeductionDouble;
if (_checkoutRepository.Exists(x =>
x.Month == command.Month && x.Year == command.Year && x.ContractNo == command.ContractNo))
{
operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
}
else
{
if (string.IsNullOrWhiteSpace(command.Signature))
{
command.Signature = "0";
}
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids);
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
//_checkoutRepository.SaveChanges();
//var employeeFullName = new SqlParameter("@EmployeeFullName", SqlDbType.NVarChar, 50);
//employeeFullName.Value = command.EmployeeFullName;
//var fathersName = new SqlParameter("@FathersName", SqlDbType.NVarChar, 20);
//fathersName.Value = command.EmployeeFullName;
}
}
public OperationResult Edit(EditCheckout command)
{
throw new NotImplementedException();
}
public EditCheckout GetDetails(long id)
{
return _checkoutRepository.GetDetails(id);
}
public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month,
string contractStart, string contractEnd)
{
return await _checkoutRepository.GetContractResultToCreateCheckout(workshopId, employeeId, year, month, contractStart,
contractEnd);
}
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
{
var result = new List<CheckoutViewModel>();
var query = await _checkoutRepository.SearchForMainCheckout(searchModel);
query = query.Select(x => new CheckoutViewModel()
{
Id = x.Id,
EmployeeFullName = x.EmployeeFullName,
ContractStart = x.ContractStart,
ContractEnd = x.ContractEnd,
ContractStartGr = x.ContractStartGr,
ContractEndGr = x.ContractEndGr,
PersonnelCode = x.PersonnelCode,
PersonnelCodeInt = x.PersonnelCodeInt,
ArchiveCode = x.ArchiveCode,
SumOfWorkingDays = x.SumOfWorkingDays,
WorkshopName = x.WorkshopName,
Month = x.Month,
Year = x.Year,
ContractNo = x.ContractNo,
ContractId = x.ContractId,
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
IsActiveString = x.IsActiveString,
Signature = x.Signature,
CreationDate = x.CreationDate,
EmployerName = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.EmployerFullName,
IsBlockCantracingParty = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.IsBlockContractingParty,
}).ToList();
//foreach (var items in query)
//{
// var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId);
// if (s != null)
// {
// items.EmployerName = s.FirstOrDefault().EmployerFullName;
// }
// result.Add(items);
// //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId)
// // .Select(x => x.EmployerId).FirstOrDefault();
// //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName;
// // = employerName;
//}
return query;
}
public List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel)
{
return _checkoutRepository.SimpleSearch(searchModel);
}
public List<CheckoutViewModel> PrintAll(List<long> id)
{
var result = _checkoutRepository.PrintAll(id);
var oneRecord = result.FirstOrDefault();
if (oneRecord == null)
return new();
result.ForEach(x =>
{
int yearFa;
int monthFa;
try
{
yearFa = int.Parse(oneRecord.Year);
monthFa = oneRecord.Month.ToMonthByStringValue();
}
catch (Exception e)
{
return;
}
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks));
var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks));
var totalPresent = totalWorking + totalBreakTime;
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
});
return result;
}
public CheckoutViewModel PrintOne(long id)
{
var result = _checkoutRepository.PrintOne(id);
int yearFa;
int monthFa;
try
{
yearFa = int.Parse(result.Year);
monthFa = result.Month.ToMonthByStringValue();
}
catch (Exception e)
{
return new();
}
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
TimeSpan totalWorking;
TimeSpan totalBreakTime;
TimeSpan totalPresent;
if (result.HasRollCall)
{
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime;
}
else
{
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = totalPresent - totalBreakTime;
}
result.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
result.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
result.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
result.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
return result;
}
public CheckoutLeavePrintViewModel LeavePrint(long id)
{
return _checkoutRepository.PrintLeave(id);
}
public OperationResult Sign(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.Sign();
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
public OperationResult UnSign(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.UnSign();
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
public OperationResult Active(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.Active();
_checkoutRepository.SaveChanges();
return opration.Succcedded();
}
public OperationResult DeActive(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.DeActive();
_checkoutRepository.SaveChanges();
return opration.Succcedded();
}
public OperationResult RemoveCheckout(long id)
{
return _checkoutRepository.RemoveCheckout(id);
}
public OperationResult CustomSet(long id, double rewardPay, double salaryAidDeduction)
{
var opration = new OperationResult();
var checkout = _checkoutRepository.Get(id);
var totalClaimsDouble = checkout.TotalClaims.MoneyToDouble();
var totalDeductionsDouble = checkout.TotalDeductions.MoneyToDouble();
totalClaimsDouble = (double)(totalClaimsDouble - checkout.RewardPay);
totalDeductionsDouble = totalDeductionsDouble - checkout.SalaryAidDeduction;
var totalClaims = totalClaimsDouble + rewardPay;
var totalDeductions = totalDeductionsDouble + salaryAidDeduction;
var totalClaimsString = totalClaims.ToMoney();
var totalDeductionsString = totalDeductions.ToMoney();
var totalPayment = totalClaims - totalDeductions;
checkout.CustomSet(rewardPay, salaryAidDeduction, totalClaimsString, totalDeductionsString, totalPayment);
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
#region Client
public List<CheckoutViewModel> SearchForClient(CheckoutSearchModel searchModel)
{
return _checkoutRepository.SearchForClient(searchModel);
}
#endregion
#region NewChangeByHeydari
public List<long> CheckHasSignature(List<long> ids)
{
return _checkoutRepository.CheckHasSignature(ids);
}
public OperationResult DeleteAllCheckouts(List<long> ids)
{
return _checkoutRepository.DeleteAllCheckouts(ids);
}
public OperationResult DeleteCheckout(long id)
{
return _checkoutRepository.DeleteCheckout(id);
}
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
{
return await _checkoutRepository.SearchForMainCheckout(searchModel);
}
#endregion
#region Pooya
public List<(long EmployeeId, DateTime CheckoutStart, DateTime CheckoutEnd)> GetLastCheckoutsByWorkshopIdForWorkFlow(long workshopId, DateTime start, DateTime end)
{
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
}
private readonly ICheckoutRepository _checkoutRepository;
private readonly IYearlySalaryRepository _yearlySalaryRepository;
private readonly ILeftWorkRepository _leftWorkRepository;
private readonly IEmployerRepository _employerRepository;
private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly ILeaveApplication _leaveApplication;
private readonly IMandatoryHoursApplication _mandatoryHoursApplication;
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository,
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository)
{
_checkoutRepository = checkoutRepository;
_yearlySalaryRepository = yearlySalaryRepository;
_leftWorkRepository = leftWorkRepository;
_employerRepository = employerRepository;
_contractingPartyApp = contractingPartyApp;
_leaveApplication = leaveApplication;
_mandatoryHoursApplication = mandatoryHoursApplication;
_rollCallMandatoryRepository = rollCallMandatoryRepository;
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
public void Create(CreateCheckout command)
{
var operation = new OperationResult();
var syear = Convert.ToInt32(command.ContractStart.Substring(0, 4));
var smonth = Convert.ToInt32(command.ContractStart.Substring(5, 2));
string month = string.Empty;
switch (smonth)
{
case 1:
month = "فروردین";
break;
case 2:
month = "اردیبهشت";
break;
case 3:
month = "خرداد";
break;
case 4:
month = "تیر";
break;
case 5:
month = "مرداد";
break;
case 6:
month = "شهریور";
break;
case 7:
month = "مهر";
break;
case 8:
month = "آبان";
break;
case 9:
month = "آذر";
break;
case 10:
month = "دی";
break;
case 11:
month = "بهمن";
break;
case 12:
month = "اسفند";
break;
}
var year = syear.ToString();
#region SickLeav
//var serachModel = new LeaveSearchModel()
//{
// EmployeeId = command.EmployeeId,
// WorkshopId = command.WorkshopId,
// LeaveType = "استعلاجی",
// StartLeave = command.ContractStart,
// EndLeave = command.ContractEnd,
// IsAccepted = true,
//};
//var leavList = _leaveApplication.search(serachModel);
// int sickLeaveCount = 0;
//if (leavList.Count > 0)
//{
// foreach (var leave in leavList)
// {
// if (leave.StartLeaveGr < command.ContractStartGr && leave.EndLeaveGr <= command.ContractEndGr)
// {
// int res = (int)((leave.EndLeaveGr - command.ContractStartGr).TotalDays +1);
// sickLeaveCount += res;
// }
// else if (leave.StartLeaveGr >= command.ContractStartGr && leave.EndLeaveGr > command.ContractEndGr)
// {
// int res = (int)((command.ContractEndGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res;
// }
// else
// {
// int res = (int)((leave.EndLeaveGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res;
// }
// }
//}
#endregion
var dayliWage = command.DayliWage.MoneyToDouble();
// کمک هزینه اقلام
var consumableItem = command.ConsumableItems.MoneyToDouble();
//حق اولاد
var familyAllowance = command.FamilyAllowance.MoneyToDouble();
//کمک هزینه مسکن
var housingAllowance = command.HousingAllowance.MoneyToDouble();
//حق تاهل
var marriedAllowance = command.MarriedAllowance.MoneyToDouble();
var MontlyYearsBunos =
_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
//دستمزد ماهانه
var monthlyWage = MontlyYearsBunos.MontlyWage;
//سنوات
var years = command.YearsPay;
//عیدی و پاداش
var bunos = command.BonusesPay;
//پایه سنوات
var bacicYears = MontlyYearsBunos.BasicYears;
var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay;
if (command.friday > 0)
{
var fridayPercent = dayliWage * 40 / 100;
//فوق العاده جمعه کاری
command.FridayPay = fridayPercent * command.friday;
}
//حق بیمه سهم کارگر
var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance) * 7 / 100;
if (command.OvertimePay > 0 && command.AbsenceDeduction > 0)
{
if (command.AbsenceDeduction >= command.OvertimePay)
{
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
command.OvertimePay = 0;
}
else
{
command.OvertimePay = command.OvertimePay - command.AbsenceDeduction;
command.AbsenceDeduction = 0;
}
}
var checkoutStart = $"{command.Year}/{command.Month}/01";
var checkoutEnd = checkoutStart.FindeEndOfMonth();
var salaryAids =
_rollCallMandatoryRepository.SalaryAidsForCheckout(command.EmployeeId, command.WorkshopId, checkoutStart.ToGeorgianDateTime(), checkoutEnd.ToGeorgianDateTime())
.Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList();
command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble());
var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId,
command.WorkshopId, command.ContractStartGr, command.ContractEndGr)
.Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
var totalClaims = totalClaimsDouble.ToMoney();
var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
var totalDeductions = totalDeductionDouble.ToMoney();
var totalPayment = totalClaimsDouble - totalDeductionDouble;
if (_checkoutRepository.Exists(x =>
x.Month == command.Month && x.Year == command.Year && x.ContractNo == command.ContractNo))
{
operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
}
else
{
if (string.IsNullOrWhiteSpace(command.Signature))
{
command.Signature = "0";
}
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids);
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
//_checkoutRepository.SaveChanges();
//var employeeFullName = new SqlParameter("@EmployeeFullName", SqlDbType.NVarChar, 50);
//employeeFullName.Value = command.EmployeeFullName;
//var fathersName = new SqlParameter("@FathersName", SqlDbType.NVarChar, 20);
//fathersName.Value = command.EmployeeFullName;
}
}
public OperationResult Edit(EditCheckout command)
{
throw new NotImplementedException();
}
public EditCheckout GetDetails(long id)
{
return _checkoutRepository.GetDetails(id);
}
public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month,
string contractStart, string contractEnd)
{
return await _checkoutRepository.GetContractResultToCreateCheckout(workshopId, employeeId, year, month, contractStart,
contractEnd);
}
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
{
var result = new List<CheckoutViewModel>();
var query = await _checkoutRepository.SearchForMainCheckout(searchModel);
query = query.Select(x => new CheckoutViewModel()
{
Id = x.Id,
EmployeeFullName = x.EmployeeFullName,
ContractStart = x.ContractStart,
ContractEnd = x.ContractEnd,
ContractStartGr = x.ContractStartGr,
ContractEndGr = x.ContractEndGr,
PersonnelCode = x.PersonnelCode,
PersonnelCodeInt = x.PersonnelCodeInt,
ArchiveCode = x.ArchiveCode,
SumOfWorkingDays = x.SumOfWorkingDays,
WorkshopName = x.WorkshopName,
Month = x.Month,
Year = x.Year,
ContractNo = x.ContractNo,
ContractId = x.ContractId,
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
IsActiveString = x.IsActiveString,
Signature = x.Signature,
CreationDate = x.CreationDate,
EmployerName = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.EmployerFullName,
IsBlockCantracingParty = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.IsBlockContractingParty,
}).ToList();
//foreach (var items in query)
//{
// var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId);
// if (s != null)
// {
// items.EmployerName = s.FirstOrDefault().EmployerFullName;
// }
// result.Add(items);
// //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId)
// // .Select(x => x.EmployerId).FirstOrDefault();
// //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName;
// // = employerName;
//}
return query;
}
public List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel)
{
return _checkoutRepository.SimpleSearch(searchModel);
}
public List<CheckoutViewModel> PrintAll(List<long> id)
{
var result = _checkoutRepository.PrintAll(id);
var oneRecord = result.FirstOrDefault();
if (oneRecord == null)
return new();
result.ForEach(x =>
{
int yearFa;
int monthFa;
try
{
yearFa = int.Parse(oneRecord.Year);
monthFa = oneRecord.Month.ToMonthByStringValue();
}
catch (Exception e)
{
return;
}
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks));
var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks));
TimeSpan totalPresent = totalWorking + totalBreakTime;
if (x.HasRollCall)
{
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - x.TotalHourlyLeave;
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime ;
}
else
{
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = totalPresent - totalBreakTime;
}
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
});
return result;
}
public CheckoutViewModel PrintOne(long id)
{
var result = _checkoutRepository.PrintOne(id);
int yearFa;
int monthFa;
try
{
yearFa = int.Parse(result.Year);
monthFa = result.Month.ToMonthByStringValue();
}
catch (Exception e)
{
return new();
}
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
TimeSpan totalWorking;
TimeSpan totalBreakTime;
TimeSpan totalPresent;
TimeSpan totalHoursLeave;
if (result.HasRollCall)
{
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - result.TotalHourlyLeave;
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime ;
}
else
{
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = totalPresent - totalBreakTime;
}
result.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
result.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
result.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
result.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
return result;
}
public CheckoutLeavePrintViewModel LeavePrint(long id)
{
return _checkoutRepository.PrintLeave(id);
}
public OperationResult Sign(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.Sign();
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
public OperationResult UnSign(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.UnSign();
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
public OperationResult Active(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.Active();
_checkoutRepository.SaveChanges();
return opration.Succcedded();
}
public OperationResult DeActive(long id)
{
var opration = new OperationResult();
var contract = _checkoutRepository.Get(id);
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد");
contract.DeActive();
_checkoutRepository.SaveChanges();
return opration.Succcedded();
}
public OperationResult RemoveCheckout(long id)
{
return _checkoutRepository.RemoveCheckout(id);
}
public OperationResult CustomSet(long id, double rewardPay, double salaryAidDeduction)
{
var opration = new OperationResult();
var checkout = _checkoutRepository.Get(id);
var totalClaimsDouble = checkout.TotalClaims.MoneyToDouble();
var totalDeductionsDouble = checkout.TotalDeductions.MoneyToDouble();
totalClaimsDouble = (double)(totalClaimsDouble - checkout.RewardPay);
totalDeductionsDouble = totalDeductionsDouble - checkout.SalaryAidDeduction;
var totalClaims = totalClaimsDouble + rewardPay;
var totalDeductions = totalDeductionsDouble + salaryAidDeduction;
var totalClaimsString = totalClaims.ToMoney();
var totalDeductionsString = totalDeductions.ToMoney();
var totalPayment = totalClaims - totalDeductions;
checkout.CustomSet(rewardPay, salaryAidDeduction, totalClaimsString, totalDeductionsString, totalPayment);
_checkoutRepository.SaveChanges();
opration.IsSuccedded = true;
return opration.Succcedded();
}
#region Client
public List<CheckoutViewModel> SearchForClient(CheckoutSearchModel searchModel)
{
return _checkoutRepository.SearchForClient(searchModel);
}
#endregion
#region NewChangeByHeydari
public List<long> CheckHasSignature(List<long> ids)
{
return _checkoutRepository.CheckHasSignature(ids);
}
public OperationResult DeleteAllCheckouts(List<long> ids)
{
return _checkoutRepository.DeleteAllCheckouts(ids);
}
public OperationResult DeleteCheckout(long id)
{
return _checkoutRepository.DeleteCheckout(id);
}
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
{
return await _checkoutRepository.SearchForMainCheckout(searchModel);
}
#endregion
#region Pooya
public List<(long EmployeeId, DateTime CheckoutStart, DateTime CheckoutEnd)> GetLastCheckoutsByWorkshopIdForWorkFlow(long workshopId, DateTime start, DateTime end)
{
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
}
#endregion
#endregion
}

View File

@@ -21,41 +21,46 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
public OperationResult Create(CreateEmployeeComputeOptions command)
{
var opration = new OperationResult();
try
{
if (_employeeComputeOptionsRepository.Exists(x =>
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
{
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
_employeeComputeOptionsRepository.SaveChanges();
return opration.Succcedded();
}
else
{
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
_employeeComputeOptionsRepository.Create(createOptions);
_employeeComputeOptionsRepository.SaveChanges();
return opration.Succcedded();
}
}
catch (Exception a)
{
return opration.Failed("ثبت با خطا مواجه شد");
}
var opration = new OperationResult();
try
{
if (_employeeComputeOptionsRepository.Exists(x =>
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
{
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions,
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout);
_employeeComputeOptionsRepository.SaveChanges();
return opration.Succcedded();
}
else
{
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
command.ComputeOptions, command.BonusesOptions, command.YearsOptions, command.CreateContract,
command.SignContract, command.CreateCheckout, command.SignCheckout);
_employeeComputeOptionsRepository.Create(createOptions);
_employeeComputeOptionsRepository.SaveChanges();
return opration.Succcedded();
}
}
catch (Exception a)
{
return opration.Failed("ثبت با خطا مواجه شد");
}
}
public EmployeeComputeOptionsViewModel GetEmployeeOptions(long workshopId, long employeeId)
{
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
}
public List<EmployeeComputeOptionsViewModel> GetAllByWorkshopId(long workshopId)
{
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -73,10 +73,28 @@ public class WorkshopAppliction : IWorkshopApplication
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
return operation.Failed("موارد اجباری را پر کنید");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
// return operation.Failed("نام کارگاه تکراری است");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
// return operation.Failed("نام کارگاه تکراری است");
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
command.CutContractEndOfYear = IsActive.None;
if (!command.CreateContract)
{
command.SignContract = false;
command.CreateCheckout = false;
command.SignCheckout = false;
}
if (!command.CreateCheckout)
{
command.SignCheckout = false;
}
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
return operation.Failed("کد بیمه کارگاه تکراری است");
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
@@ -145,7 +163,11 @@ public class WorkshopAppliction : IWorkshopApplication
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,
command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,
command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking,
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract, command.SignContract,
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear);
_workshopRepository.Create(workshop);
_workshopRepository.SaveChanges();
@@ -211,10 +233,28 @@ public class WorkshopAppliction : IWorkshopApplication
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
var employer = command.EmployerIdList.ToList();
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
// return operation.Failed(" نام کارگاه تکراری است ");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
// return operation.Failed(" نام کارگاه تکراری است ");
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
command.CutContractEndOfYear = IsActive.None;
if (!command.CreateContract)
{
command.SignContract = false;
command.CreateCheckout = false;
command.SignCheckout = false;
}
if (!command.CreateCheckout)
{
command.SignCheckout = false;
}
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
return operation.Failed("کد بیمه کارگاه تکراری است");
@@ -315,7 +355,10 @@ public class WorkshopAppliction : IWorkshopApplication
command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified, command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified,
command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip,
command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance,
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear);
_workshopRepository.SaveChanges();
_workshopRepository.RemoveOldRelation(command.Id);
@@ -535,159 +578,169 @@ public class WorkshopAppliction : IWorkshopApplication
{
return _workshopRepository.SearchForClient(searchModel);
}
public OperationResult CreateForClient(CreateWorkshop command)
{
var accountIds = new List<long>();
var operation = new OperationResult();
//if (command.EmployerIdList == null)
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
var employer = command.EmployerIdList.ToList();
if (command.AccountIdsList != null)
{
accountIds = command.AccountIdsList.ToList();
}
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
return operation.Failed("موارد اجباری را پر کنید");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
// return operation.Failed("نام کارگاه تکراری است");
if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
{
if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
return operation.Failed("کد بیمه کارگاه تکراری است");
}
if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
return operation.Failed("شماره بایگانی تکراری است");
if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
if (command.City == "0" || command.City == "شهرستان")
return operation.Failed("لطفا شهر را انتخاب کنید");
if (string.IsNullOrEmpty(command.Address))
return operation.Failed("لطفا آدرس را وارد کنید");
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
if (command.FixedSalary)
{
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
return operation.Failed("لطفا صنف را انتخاب کنید");
if (string.IsNullOrWhiteSpace(command.Population))
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
}
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
_workshopRepository.Create(workshop);
_workshopRepository.SaveChanges();
foreach (var e in employer)
{
_workshopRepository.EmployerWorkshop(workshop.id, e);
}
_workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
return operation.Succcedded();
throw new NotImplementedException();
}
public OperationResult EditForClient(EditWorkshop command)
{
var leftSearch = new LeftWorkSearchModel()
{
WorkshopId = command.Id
};
var leftWork = _leftWorkRepository.search(leftSearch);
var accountIds = new List<long>();
var operation = new OperationResult();
var workshop = _workshopRepository.Get(command.Id);
if (command.AccountIdsList != null)
{
accountIds = command.AccountIdsList.ToList();
}
if (workshop == null)
operation.Failed("رکورد مورد نظر وجود ندارد");
if (command.EmployerIdList == null)
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
var employer = command.EmployerIdList.ToList();
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
return operation.Failed("موارد اجباری را پر کنید");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
// return operation.Failed(" رکورد مورد نظر تکراری است ");
if (_workshopRepository.Exists(x =>
x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
{
if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
return operation.Failed("کد بیمه کارگاه تکراری است");
}
if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
return operation.Failed("شماره بایگانی تکراری است");
if (command.State == null)
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
if ((command.City == "0" || command.City == "شهرستان"))
return operation.Failed("لطفا شهر را انتخاب کنید");
if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
if (command.Address == null)
return operation.Failed("لطفا آدرس را وارد کنید");
if (command.FixedSalary)
{
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
return operation.Failed("لطفا صنف را انتخاب کنید");
if (string.IsNullOrWhiteSpace(command.Population))
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
}
workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
_workshopRepository.SaveChanges();
//_workshopRepository.RemoveOldRelation(command.Id);
_workshopRepository.RemoveEmployerWorkshop(command.Id);
foreach (var e in employer)
{
_workshopRepository.EmployerWorkshop(workshop.id, e);
}
// _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
foreach (var item in leftWork)
{
var editLeft = _leftWorkRepository.Get(item.Id);
editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
_leftWorkRepository.SaveChanges();
}
return operation.Succcedded();
throw new NotImplementedException();
}
//public OperationResult CreateForClient(CreateWorkshop command)
//{
// var accountIds = new List<long>();
// var operation = new OperationResult();
// //if (command.EmployerIdList == null)
// // return operation.Failed("لطفا کارفرما را انتخاب نمایید");
// var employer = command.EmployerIdList.ToList();
// if (command.AccountIdsList != null)
// {
// accountIds = command.AccountIdsList.ToList();
// }
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
// return operation.Failed("موارد اجباری را پر کنید");
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
// // return operation.Failed("نام کارگاه تکراری است");
// if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
// {
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
// return operation.Failed("کد بیمه کارگاه تکراری است");
// }
// if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
// return operation.Failed("شماره بایگانی تکراری است");
// if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
// if (command.City == "0" || command.City == "شهرستان")
// return operation.Failed("لطفا شهر را انتخاب کنید");
// if (string.IsNullOrEmpty(command.Address))
// return operation.Failed("لطفا آدرس را وارد کنید");
// if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
// if (command.FixedSalary)
// {
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
// return operation.Failed("لطفا صنف را انتخاب کنید");
// if (string.IsNullOrWhiteSpace(command.Population))
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
// }
// //if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
// // return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
// var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
// command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
// command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
// command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
// command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
// _workshopRepository.Create(workshop);
// _workshopRepository.SaveChanges();
// foreach (var e in employer)
// {
// _workshopRepository.EmployerWorkshop(workshop.id, e);
// }
// _workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
// return operation.Succcedded();
//}
//public OperationResult EditForClient(EditWorkshop command)
//{
// var leftSearch = new LeftWorkSearchModel()
// {
// WorkshopId = command.Id
// };
// var leftWork = _leftWorkRepository.search(leftSearch);
// var accountIds = new List<long>();
// var operation = new OperationResult();
// var workshop = _workshopRepository.Get(command.Id);
// if (command.AccountIdsList != null)
// {
// accountIds = command.AccountIdsList.ToList();
// }
// if (workshop == null)
// operation.Failed("رکورد مورد نظر وجود ندارد");
// if (command.EmployerIdList == null)
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
// var employer = command.EmployerIdList.ToList();
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
// return operation.Failed("موارد اجباری را پر کنید");
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
// // return operation.Failed(" رکورد مورد نظر تکراری است ");
// if (_workshopRepository.Exists(x =>
// x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
// {
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
// return operation.Failed("کد بیمه کارگاه تکراری است");
// }
// if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
// return operation.Failed("شماره بایگانی تکراری است");
// if (command.State == null)
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
// if ((command.City == "0" || command.City == "شهرستان"))
// return operation.Failed("لطفا شهر را انتخاب کنید");
// if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
// if (command.Address == null)
// return operation.Failed("لطفا آدرس را وارد کنید");
// if (command.FixedSalary)
// {
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
// return operation.Failed("لطفا صنف را انتخاب کنید");
// if (string.IsNullOrWhiteSpace(command.Population))
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
// }
// workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
// command.Address,
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
// , command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
// command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
// command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
// command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
// _workshopRepository.SaveChanges();
// //_workshopRepository.RemoveOldRelation(command.Id);
// _workshopRepository.RemoveEmployerWorkshop(command.Id);
// foreach (var e in employer)
// {
// _workshopRepository.EmployerWorkshop(workshop.id, e);
// }
// // _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
// foreach (var item in leftWork)
// {
// var editLeft = _leftWorkRepository.Get(item.Id);
// editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
// _leftWorkRepository.SaveChanges();
// }
// return operation.Succcedded();
//}
public bool GetWorkshopAccountByAcountID(long acountID)
{

View File

@@ -160,7 +160,7 @@ public class YearlySalaryApplication : IYearlySalaryApplication
public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
{
return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
}
}
#endregion
}

View File

@@ -1,4 +1,6 @@
using Company.Domain.InsurancWorkshopInfoAgg;
using System;
using _0_Framework.Application;
using Company.Domain.InsurancWorkshopInfoAgg;
using Company.Domain.WorkshopAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -38,10 +40,13 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
builder.Property(x => x.IsOldContract);
builder.Property(x => x.HasRollCallFreeVip).HasMaxLength(5);
builder.Property(x => x.WorkshopHolidayWorking);
//builder.HasOne(x => x.Employer)
// .WithMany(x => x.Workshops)
// .HasForeignKey(x => x.EmployerId);
builder.HasMany(x => x.LeftWorks)
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
//builder.HasOne(x => x.Employer)
// .WithMany(x => x.Workshops)
// .HasForeignKey(x => x.EmployerId);
builder.HasMany(x => x.LeftWorks)
.WithOne(x => x.Workshop)
.HasForeignKey(x => x.WorkshopId);

View File

@@ -0,0 +1,74 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addworkshopcreatecontractsettings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CreateCheckout",
table: "Workshops",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CreateContract",
table: "Workshops",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "CutContractEndOfYear",
table: "Workshops",
type: "nvarchar(5)",
maxLength: 5,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "SignCheckout",
table: "Workshops",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SignContract",
table: "Workshops",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreateCheckout",
table: "Workshops");
migrationBuilder.DropColumn(
name: "CreateContract",
table: "Workshops");
migrationBuilder.DropColumn(
name: "CutContractEndOfYear",
table: "Workshops");
migrationBuilder.DropColumn(
name: "SignCheckout",
table: "Workshops");
migrationBuilder.DropColumn(
name: "SignContract",
table: "Workshops");
}
}
}

View File

@@ -0,0 +1,62 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addsettingsforemployeecomputeoptions : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CreateCheckout",
table: "EmployeeComputeOptions",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CreateContract",
table: "EmployeeComputeOptions",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SignCheckout",
table: "EmployeeComputeOptions",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SignContract",
table: "EmployeeComputeOptions",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreateCheckout",
table: "EmployeeComputeOptions");
migrationBuilder.DropColumn(
name: "CreateContract",
table: "EmployeeComputeOptions");
migrationBuilder.DropColumn(
name: "SignCheckout",
table: "EmployeeComputeOptions");
migrationBuilder.DropColumn(
name: "SignContract",
table: "EmployeeComputeOptions");
}
}
}

View File

@@ -1809,12 +1809,24 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("EmployeeId")
.HasColumnType("bigint");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
@@ -5646,9 +5658,20 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("CutContractEndOfYear")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<bool>("FixedSalary")
.HasColumnType("bit");
@@ -5686,6 +5709,12 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<string>("State")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");

View File

@@ -1058,8 +1058,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
});
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
@@ -1387,7 +1387,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
ch.TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan());
var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan()).ToList();
var dailyPaidLeaveTimeSpans = dailyPaidLeave.Select(x =>
{
@@ -1397,7 +1397,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
});
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");

View File

@@ -30,8 +30,12 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
ComputeOptions = x.ComputeOptions,
YearsOptions = x.YearsOptions,
BonusesOptions = x.BonusesOptions,
SignCheckout = x.SignCheckout,
CreateCheckout = x.CreateCheckout,
CreateContract = x.CreateContract,
SignContract = x.SignContract,
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
if (result == null)
{
@@ -45,7 +49,11 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
ComputeOptions = getFromWorkshop.ComputeOptions,
YearsOptions = getFromWorkshop.YearsOptions,
BonusesOptions= getFromWorkshop.BonusesOptions,
};
CreateCheckout = true,
CreateContract = true,
SignCheckout = true,
SignContract = true
};
result = fromWorkshop;

View File

@@ -2089,6 +2089,7 @@ public class ReportRepository : IReportRepository
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
{
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
var contractCreated = workshop.Contracts2.Count();
int contractSignedPercent = 0;
@@ -2103,9 +2104,12 @@ public class ReportRepository : IReportRepository
if (contractSignedPercent < 100 && contractCreated > 0)
{
var contractEmployeeIds = workshop.Contracts2.Where(x => x.Signature == "0")
.Select(x => x.EmployeeId).ToList();
var lefts = workshop.LeftWorks.Select(x => x.EmployeeId).Distinct().ToList();
var contractNotNullEmployeeId = lefts.Where(x => contractEmployeeIds.Contains(x)).ToList();
var employeeNotDone =
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
workshop.Contracts2.Where(x => x.Signature == "0" && contractNotNullEmployeeId.Contains(x.EmployeeId)).Select(l => new EmployeeNotDone()
{
Id = l.EmployeeId,
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,

View File

@@ -60,8 +60,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
_leaveRepository = leaveRepository;
_holidayItemRepository = holidayItemRepository;
_testDbContext = testDbContext;
}
}
#region OfficialChckout
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
@@ -108,8 +108,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
#endregion
@@ -145,16 +145,31 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x =>
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
TimeSpan breakTime;
if (contractStart > endOfFarvardin)
{
breakTime = CalculateBreakTime(
x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
}
else
{
breakTime = CalculateBreakTime(breakTimeEntity, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
}
return new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value })
.ToList(),
HasFriday = x.Any(s =>
s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday ||
s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - breakTime,
BreakTime = breakTime,
};
}).OrderBy(x => x.CreationDate).ToList();
}
@@ -621,45 +636,75 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
{
validCount = 8;
validCount = 6;
}
else
{
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
validCount = (int)((totalDays * 8) / 28);
validCount = (int)((totalDays * 6) / 28);
}
string maxName;
int maxValue = moriningCount;
if (moriningCount >= validCount)
RotatingfaName.Add("صبح");
if (eveningCount >= validCount)
RotatingfaName.Add("عصر");
if (nightCount >= validCount)
RotatingfaName.Add("شب");
var rotatingFaResult = "";
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
{
shiftOver22Hours = "0";
shiftOver22Minuts = "0";
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else if (RotatingfaName.Count <= 1)
{
rotatingFaResult = "نوبت کاری ندارد";
maxName = "moriningCount";
if (eveningCount > maxValue)
{
maxValue = eveningCount;
maxName = "eveningCount";
}
if (nightCount > maxValue)
{
maxValue = nightCount;
maxName = "nightCount";
}
var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
int countOutOfRange = 0;
}
switch (maxName)
{
case "moriningCount":
countOutOfRange = eveningCount + nightCount;
break;
case "eveningCount":
countOutOfRange = moriningCount + nightCount;
break;
case "nightCount":
countOutOfRange = moriningCount + eveningCount;
break;
}
var rotatingFaResult = "";
if (countOutOfRange >= validCount)
{
shiftOver22Hours = "0";
shiftOver22Minuts = "0";
if (moriningCount >= 1)
RotatingfaName.Add("صبح");
if (eveningCount >= 1)
RotatingfaName.Add("عصر");
if (nightCount >= 1)
RotatingfaName.Add("شب");
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else
{
rotatingFaResult = "نوبت کاری ندارد";
var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
}
#endregion
//******* محاسبه مبلغ نوبت کاری *************
#region ShiftPayPercent
@@ -728,52 +773,52 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
/// <summary>
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
/// </summary>
/// <param name="employeeId"></param>
/// <param name="workshopId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <returns></returns>
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
DateTime contractStart, DateTime contractEnd)
{
//bool hasRollcall =
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
//if (!hasRollcall)
// return (false, new TimeSpan());
List<RollCallViewModel> rollCallResult;
List<GroupedRollCalls> groupedRollCall;
rollCallResult = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
CreationDate = x.ShiftDate,
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
}).OrderBy(x => x.CreationDate).ToList();
/// <summary>
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
/// </summary>
/// <param name="employeeId"></param>
/// <param name="workshopId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <returns></returns>
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
DateTime contractStart, DateTime contractEnd)
{
//bool hasRollcall =
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
//if (!hasRollcall)
// return (false, new TimeSpan());
List<RollCallViewModel> rollCallResult;
List<GroupedRollCalls> groupedRollCall;
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
return (true, sumSpans);
}
rollCallResult = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
CreationDate = x.ShiftDate,
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
}).OrderBy(x => x.CreationDate).ToList();
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
return (true, sumSpans);
}
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
@@ -864,20 +909,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
// شبکاری
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
var RotatingfaName = new List<string>();
//if (shiftwork != "1" && shiftwork != "2" && shiftwork != "4")//اگر چرخشی بود و منظم نبود
//{
// if (moriningCount > 0)
// RotatingfaName.Add("صبح");
// if (eveningCount > 0)
// RotatingfaName.Add("عصر");
// if (nightCount > 0)
// RotatingfaName.Add("شب");
//}
//else// اگر منظم و شیفتی بود
//{
//}
var totalDays = (int)(contractEnd - contractStart).TotalDays + 1;
int validCount = 0;
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
@@ -894,37 +926,66 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
validCount = (int)((totalDays * 6) / 28);
}
Console.WriteLine(validCount);
if (moriningCount >= validCount)
RotatingfaName.Add("صبح");
if (eveningCount >= validCount)
RotatingfaName.Add("عصر");
if (nightCount >= validCount)
RotatingfaName.Add("شب");
var rotatingFaResult = "";
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
{
string maxName;
int maxValue = moriningCount;
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else if (RotatingfaName.Count <= 1)
{
rotatingFaResult = "نوبت کاری ندارد";
maxName = "moriningCount";
if (eveningCount > maxValue)
{
maxValue = eveningCount;
maxName = "eveningCount";
}
if (nightCount > maxValue)
{
maxValue = nightCount;
maxName = "nightCount";
}
int countOutOfRange = 0;
switch (maxName)
{
case "moriningCount":
countOutOfRange = eveningCount + nightCount;
break;
case "eveningCount":
countOutOfRange = moriningCount + nightCount;
break;
case "nightCount":
countOutOfRange = moriningCount + eveningCount;
break;
}
var rotatingFaResult = "";
if (countOutOfRange >= validCount)
{
if (moriningCount >= 1)
RotatingfaName.Add("صبح");
if (eveningCount >= 1)
RotatingfaName.Add("عصر");
if (nightCount >= 1)
RotatingfaName.Add("شب");
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else
{
rotatingFaResult = "نوبت کاری ندارد";
}
}
return new ComputingViewModel
{
@@ -939,19 +1000,19 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
//{
// if (breakTime.BreakTimeType != BreakTimeType.WithTime)
// return new TimeSpan();
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
{
if (breakTime.BreakTimeType != BreakTimeType.WithTime)
return new TimeSpan();
// var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
// if (breakTimeSpan * 2 >= sumOneDaySpan)
// return new TimeSpan();
if (breakTimeSpan * 2 >= sumOneDaySpan)
return new TimeSpan();
// return breakTimeSpan; ;
return breakTimeSpan; ;
//}
}
public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
{
if (breakTimeSpan * 2 >= sumOneDaySpan)
@@ -2090,7 +2151,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var starTimeSingel1 = Convert.ToDateTime(shift1Start);
var endTimeSingel2 = Convert.ToDateTime(shift1End);
bool hasRestTime = false;
bool hasRestTime = false;
shift1StartGr = new DateTime(cuurentDate.Year, cuurentDate.Month, cuurentDate.Day, starTimeSingel1.Hour, starTimeSingel1.Minute, 0);
@@ -2099,92 +2160,92 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay)
shift1EndGr = shift1EndGr.AddDays(1);
var shiftEndWithoutRest = shift1EndGr;
var shiftEndWithoutRest = shift1EndGr;
var shiftSpan = (shift1EndGr - shift1StartGr);
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
{
hasRestTime = true;
shift1EndGr = shift1EndGr.Subtract(restTime);
shiftSpan = (shift1EndGr - shift1StartGr);
}
var shiftSpan = (shift1EndGr - shift1StartGr);
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
{
hasRestTime = true;
shift1EndGr = shift1EndGr.Subtract(restTime);
shiftSpan = (shift1EndGr - shift1StartGr);
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType =="روزانه"))
{
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
if (hourseLeaveTypeResult == null)
{
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = shift1EndGr,
ShiftSpan = shiftSpan,
ShiftDate = shift1StartGr,
}
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "روزانه"))
{
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
if (hourseLeaveTypeResult == null)
{
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = shift1EndGr,
ShiftSpan = shiftSpan,
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else
{
});
}
else
{
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
});
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
});
}
@@ -3021,13 +3082,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var endFarvarding = new DateTime(2025, 4, 20);
if (contractStart>endFarvarding)
if (contractStart > endFarvarding)
{
customizeWorkshopEmployeeSettings=_context.CustomizeWorkshopEmployeeSettings
customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings
.AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
customizeWorkshopSettings =_context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
}
else
@@ -3982,40 +4043,40 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}).ToList();
}
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
{
return _context.Loans
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
.SelectMany(x => x.LoanInstallments)
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
.Select(x => new LoanInstallmentViewModel()
{
Id = x.Id,
Month = x.Month,
IsActive = x.IsActive,
Amount = x.AmountForMonth.ToMoney(),
Year = x.Year,
AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
.Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList();
}
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
{
return _context.Loans
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
.SelectMany(x => x.LoanInstallments)
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
.Select(x => new LoanInstallmentViewModel()
{
Id = x.Id,
Month = x.Month,
IsActive = x.IsActive,
Amount = x.AmountForMonth.ToMoney(),
Year = x.Year,
AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
.Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList();
}
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
{
return _context.SalaryAids
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
{
Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount,
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime,
CalculationDateTimeGe = x.CalculationDate,
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
Id = x.id
}).ToList();
}
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
{
return _context.SalaryAids
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
{
Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount,
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime,
CalculationDateTimeGe = x.CalculationDate,
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
Id = x.id
}).ToList();
}
private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year,
DateTime contractStart)

View File

@@ -152,16 +152,16 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
{
var firstDayOfMonth = $"{startMonthDay.ToFarsi().Substring(0,8)}01".ToGeorgianDateTime();
var endFarvardin = "1404/01/31".ToGeorgianDateTime();
//گرفتن ساعت استراحت پرسنل از تنظیمات
#region breakTime
//BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().FirstOrDefault(x =>
// x.WorkshopId == workshopId && x.EmployeeId == employeeId);
////اگر ساعت استراحت پرسنل وجود نداشت صفر است
//var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery().FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
#endregion
var rollCalls = _context.RollCalls.Where(x =>
var rollCalls = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined &&
x.ShiftDate.Date >= startMonthDay && x.ShiftDate.Date <= endMonthDay).ToList();
@@ -224,26 +224,30 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
var rollCallTimeSpanPerDay =
new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks));
var breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(x.First().BreakTimeSpan, rollCallTimeSpanPerDay);
TimeSpan breakTimePerDay ;
if(startMonthDay>endFarvardin)
breakTimePerDay= RollCallMandatoryRepository.CalculateBreakTime(x.First().BreakTimeSpan, rollCallTimeSpanPerDay);
else
breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(breakTime, rollCallTimeSpanPerDay);
return new CheckoutDailyRollCallViewModel()
{
StartDate1 = orderedRollcalls.FirstOrDefault().StartDate.Value.ToString("HH:mm"),
EndDate1 = orderedRollcalls.FirstOrDefault().EndDate.Value.ToString("HH:mm"),
{
StartDate1 = orderedRollcalls.FirstOrDefault().StartDate.Value.ToString("HH:mm"),
EndDate1 = orderedRollcalls.FirstOrDefault().EndDate.Value.ToString("HH:mm"),
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.StartDate?.ToString("HH:mm") ?? "",
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndDate?.ToString("HH:mm") ?? "",
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.StartDate?.ToString("HH:mm") ?? "",
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndDate?.ToString("HH:mm") ?? "",
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
BreakTimeTimeSpan = breakTimePerDay,
BreakTimeTimeSpan = breakTimePerDay,
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
RollCallDateFa = x.Key.Date.ToFarsi(),
DateTimeGr = x.Key.Date,
IsSliced = x.Count() > 2,
IsAbsent = false
};
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
RollCallDateFa = x.Key.Date.ToFarsi(),
DateTimeGr = x.Key.Date,
IsSliced = x.Count() > 2,
IsAbsent = false
};
});

View File

@@ -197,9 +197,14 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
HasRollCallFreeVip = x.HasRollCallFreeVip,
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
InsuranceCheckoutFamilyAllowance = x.InsuranceCheckoutFamilyAllowance
InsuranceCheckoutFamilyAllowance = x.InsuranceCheckoutFamilyAllowance,
CutContractEndOfYear = x.CutContractEndOfYear,
CreateContract = x.CreateContract,
SignContract = x.SignContract,
CreateCheckout = x.CreateCheckout,
SignCheckout = x.SignCheckout,
}).FirstOrDefault(x => x.Id == id);
}).FirstOrDefault(x => x.Id == id);
}
public List<long> GetRelation(long workshopid)

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Govermentlist/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -770,15 +770,28 @@
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
</label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80217" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام نشده </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80218" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب در حال انجام </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80219" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب آماده ارسال لیست </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80220" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام بیمه </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد </span> </label>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد لیست بیمه </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تایید ارسال </span> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مراحل تایید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>

View File

@@ -783,13 +783,26 @@
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد </span> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80217" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام نشده </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80218" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب در حال انجام </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80219" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب آماده ارسال لیست </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80220" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام بیمه </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد لیست بیمه </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تایید ارسال </span> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مراحل تایید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>

View File

@@ -1013,7 +1013,7 @@ public class IndexModel : PageModel
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
//var res = _contractApplication.PrintAll(ids);
if (res.HasRollCall) return Partial("PrintDetailsRollCall", res);

View File

@@ -1,7 +1,7 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
string adminVersion = _0_Framework.Application.Version.AdminVersion;
}
<link href="~/assetsadmin/page/checkouts/css/printdetailsrollcall.css?ver=@adminVersion" rel="stylesheet" />
@@ -19,18 +19,18 @@
<div class="modal-body print" id="printThis">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black;
<fieldset style="border: 1px solid black;
padding: revert;
border-radius: 10px;
height: 28cm;
margin: 3mm 5mm 0 5mm; ">
<div class="row" dir="rtl">
<div class="col-xs-3 d-inline-block"></div>
<div class="col-xs-6 d-inline-block text-center">
<p style="font-size: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p>
<p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
</div>
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 70%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
<div class="col-xs-6 d-inline-block text-center">
<p style="font-size: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p>
<p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
</div>
<div class="col-xs-3 d-inline-block"></div>
</div>
@@ -54,336 +54,336 @@
{
<span>@Model.FathersName</span>
}
</div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">به کد ملی<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{
<span style="margin-left: 15px; visibility: hidden"></span>
}
else
{
<span>
@Model.NationalCode
</span>
}
</div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">متولد<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{
<span style="visibility: hidden">1401/01/01</span>
}
else
{
<span>@Model.DateOfBirth</span>
}
</div>
</div>
</div>
<div class="col-xs-12" style="font-size: 12px; text-align: justify; padding: 0 10px;">
<div style="display: flex;align-items: center;border-bottom: 1px solid #000000 !important;height: 23px; padding: 0;">
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<div style="width: 50%; padding: 3px 0 !important;">
<div>
<span class="cusSpanTitle">نام کارگاه<span>:</span> </span>
<span>@Model.WorkshopName</span>
}
</div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">به کد ملی<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{
<span style="margin-left: 15px; visibility: hidden"></span>
}
else
{
<span>
@Model.NationalCode
</span>
}
</div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">متولد<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{
<span style="visibility: hidden">1401/01/01</span>
}
else
{
<span>@Model.DateOfBirth</span>
}
</div>
</div>
</div>
<div class="col-xs-12" style="font-size: 12px; text-align: justify; padding: 0 10px;">
<div style="display: flex;align-items: center;border-bottom: 1px solid #000000 !important;height: 23px; padding: 0;">
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<div style="width: 50%; padding: 3px 0 !important;">
<div>
<span class="cusSpanTitle">نام کارگاه<span>:</span> </span>
<span>@Model.WorkshopName</span>
</div>
</div>
</div>
<div style="width: 50%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">نام کارفرما<span>:</span> </span>
@if (Model.EmployerList.Count > 1)
{
<div style="width: 50%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">نام کارفرما<span>:</span> </span>
@if (Model.EmployerList.Count > 1)
{
<span>
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span>
}
else
{
<span>
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
}
</div>
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<div style="width: 100%; padding: 3px 0 !important;">
<span class="cusSpanTitle">پـرسنل شرکت/موسسه<span>:</span> </span>
<span>
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
@Model.WorkshopName
</span>
}
else
{
<span>
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
}
</div>
</div>
}
}
</div>
<div style="text-align: justify; padding: 0 6px;">
@{
var items = new List<string>();
if (Model.MonthlySalary != "0") items.Add("حقوق و مزد");
if (Model.ConsumableItems != "0") items.Add("کمک هزینه اقلام مصرفی خانوار");
if (Model.HousingAllowance != "0") items.Add("کمک هزینه مسکن");
if (!string.IsNullOrWhiteSpace(Model.OvertimePay) && Model.OvertimePay != "0") items.Add("فوق العاده اضافه کاری");
if (!string.IsNullOrWhiteSpace(Model.NightworkPay) && Model.NightworkPay != "0") items.Add("فوق العاده شب کاری");
if (!string.IsNullOrWhiteSpace(Model.FridayPay) && Model.FridayPay != "0") items.Add("فوق العاده جمعه کاری");
if (Model.MissionPay != "0") items.Add("فوق العاده ماموریت");
if (Model.ShiftPay != "0") items.Add("فوق العاده نوبت کاری");
if (Model.FamilyAllowance != "0") items.Add("کمک هزینه عائله مندی");
if (Model.MarriedAllowance != "0") items.Add("حق تاهل");
if (Model.RewardPay != "0") items.Add("پاداش");
if (Model.BonusesPay != "0") items.Add("عیدی و پاداش");
if (Model.YearsPay != "0") items.Add("سنوات");
if (Model.LeavePay != "0") items.Add("مزد مرخصی");
string finalText = "";
if (items.Count == 1)
{
finalText = items[0];
}
else if (items.Count > 1)
{
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
}
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<div style="width: 100%; padding: 3px 0 !important;">
<span class="cusSpanTitle">پـرسنل شرکت/موسسه<span>:</span> </span>
<span>
@Model.WorkshopName
</span>
</div>
}
}
<span>
کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
</span>
</div>
</div>
<div style="text-align: justify; padding: 0 6px;">
@{
var items = new List<string>();
</div>
</div>
if (Model.MonthlySalary != "0") items.Add("حقوق و مزد");
if (Model.ConsumableItems != "0") items.Add("کمک هزینه اقلام مصرفی خانوار");
if (Model.HousingAllowance != "0") items.Add("کمک هزینه مسکن");
if (!string.IsNullOrWhiteSpace(Model.OvertimePay) && Model.OvertimePay != "0") items.Add("فوق العاده اضافه کاری");
if (!string.IsNullOrWhiteSpace(Model.NightworkPay) && Model.NightworkPay != "0") items.Add("فوق العاده شب کاری");
if (!string.IsNullOrWhiteSpace(Model.FridayPay) && Model.FridayPay != "0") items.Add("فوق العاده جمعه کاری");
if (Model.MissionPay != "0") items.Add("فوق العاده ماموریت");
if (Model.ShiftPay != "0") items.Add("فوق العاده نوبت کاری");
if (Model.FamilyAllowance != "0") items.Add("کمک هزینه عائله مندی");
if (Model.MarriedAllowance != "0") items.Add("حق تاهل");
if (Model.RewardPay != "0") items.Add("پاداش");
if (Model.BonusesPay != "0") items.Add("عیدی و پاداش");
if (Model.YearsPay != "0") items.Add("سنوات");
if (Model.LeavePay != "0") items.Add("مزد مرخصی");
string finalText = "";
if (items.Count == 1)
{
finalText = items[0];
}
else if (items.Count > 1)
{
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
}
}
<div class="row m-t-20">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
<table style="/* table-layout: fixed; */ width: 100%">
<span>
کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
</span>
</div>
</div>
</div>
</div>
<div class="row m-t-20">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
<table style="/* table-layout: fixed; */ width: 100%">
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@* <th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th> *@
<th colspan="4" style="text-align: center; position: relative ; font-size: 13px;padding-top:4px;border-left: 2px solid #000;"> مطالبات </th>
@* <th style="text-align: center;"> </th>
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@* <th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th> *@
<th colspan="4" style="text-align: center; position: relative ; font-size: 13px;padding-top:4px;border-left: 2px solid #000;"> مطالبات </th>
@* <th style="text-align: center;"> </th>
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th> *@
<th colspan="3" style="text-align: center; font-size: 13px; position: relative; padding-top: 4px;"> کسورات </th>
@* <th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
<th colspan="3" style="text-align: center; font-size: 13px; position: relative; padding-top: 4px;"> کسورات </th>
@* <th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 0px 0px 0px;"> </th> *@
</tr>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
</tr>
<tr style="font-size: 12px; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
</tr>
<tr style="font-size: 12px; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
<td style="padding-right: 8px; border-left: 1px solid #000; white-space: nowrap;"> کمک هزینه اقلام مصرفی خانوار </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
<td style="padding-right: 8px; border-left: 1px solid #000; white-space: nowrap;"> کمک هزینه اقلام مصرفی خانوار </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
@{
if (Model.IsLeft)
{
<td style="text-align: center; background-color: #ffffff !important;" colspan="3" rowspan="3">
<div style="border-top: 1px solid #000;border-top-left-radius: 15px;border-top-right-radius: 15px; height: 65px;">
<div style="padding: 0 6px; text-align: start;display: block;align-items: center;height: 64px;margin: 6px;">
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span>
<span>@Model.LastDayOfWork</span>
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span>
<span>@Model.LeftWorkDate</span>
<span>می باشد</span>
</div>
</div>
</td>
}
else
{
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays)</td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
@{
if (!Model.IsLeft)
{
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
@{
if (!Model.IsLeft)
{
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
<td style="text-align: center; padding: 2px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
</tr>
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
<td style="padding-right: 8px;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
</tr>
</table>
</fieldset>
</div>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
@{
if (Model.IsLeft)
{
<td style="text-align: center; background-color: #ffffff !important;" colspan="3" rowspan="3">
<div style="border-top: 1px solid #000;border-top-left-radius: 15px;border-top-right-radius: 15px; height: 65px;">
<div style="padding: 0 6px; text-align: start;display: block;align-items: center;height: 64px;margin: 6px;">
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span>
<span>@Model.LastDayOfWork</span>
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span>
<span>@Model.LeftWorkDate</span>
<span>می باشد</span>
</div>
</div>
</td>
}
else
{
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays)</td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
@{
if (!Model.IsLeft)
{
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
@{
if (!Model.IsLeft)
{
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
}
}
</tr>
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
<td style="text-align: center; padding: 2px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
</tr>
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
<td style="padding-right: 8px;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
</tr>
</table>
</fieldset>
</div>
<div style="">
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
@@ -580,47 +580,47 @@
<div class="" style="margin: 10px 0 0 0;display: flex;gap: 0px;">
<div style="width: 65%;">
<div style="display: flex; gap: 10px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
<div style="display: flex; gap: 10px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
<div class="table-container">
<table style="width: 100%;">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<div class="table-container">
<table style="width: 100%;">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="text-align: center; font-size: 10px; padding: 1px 4px; height: 15px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center; font-size: 11px;">مساعده</th>
</tr>
<tr style="text-align: center; font-size: 10px; padding: 1px 4px; height: 15px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center; font-size: 11px;">مساعده</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 15px;">
<th style="padding: 1px 4px; text-align: center; border-left: 1px solid black; min-width: 3rem; font-size: 11px;">تاریخ</th>
<th style="padding: 1px 4px; text-align: center; min-width: 4rem; font-size: 11px;">مبلغ</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 15px;">
<th style="padding: 1px 4px; text-align: center; border-left: 1px solid black; min-width: 3rem; font-size: 11px;">تاریخ</th>
<th style="padding: 1px 4px; text-align: center; min-width: 4rem; font-size: 11px;">مبلغ</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 15px;">
<td style="font-size: 8px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
: "")
</td>
<td style="font-size: 8px; text-align: center;">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 15px;">
<td style="font-size: 8px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
: "")
</td>
<td style="font-size: 8px; text-align: center;">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
</table>
</table>
</div>
</div>
</fieldset>
</fieldset>
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
<div class="table-container">
@@ -680,7 +680,7 @@
</div>
</div>
</fieldset>
</fieldset>
</div>
</div>
</div>
@@ -690,7 +690,7 @@
<input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">

View File

@@ -2,620 +2,204 @@
@model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel
@{
Layout = "Shared/_AdminLayout";
ViewData["title"] = "لیست پرسنل‌های " + Model.WorkshopFullName;
var i = 1;
<style>
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border-bottom: 1px solid #cfe5e0;
font-size: 1rem;
text-align: right;
white-space: nowrap;
}
th {
padding: 1.5rem 1rem;
}
td {
padding: 1rem;
}
tbody tr {
cursor: pointer;
}
tbody tr.selected td {
background: #e0eeeb;
}
tbody tr:hover:not(.selected) td,
tbody tr.hover:not(.selected) td {
background: #f0f7f5;
}
.table-footer, .table-header {
font-size: .875rem;
}
.table-footer {
margin: -1.5rem 0 0;
}
.table-header {
margin: 0 0 1rem;
}
.table-footer.grid,
.table-header.grid {
align-items: center;
display: grid;
grid-auto-flow: column;
justify-content: space-between;
}
.border-index {
background: #dbeafe;
height: 30px;
width: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
color: #3f3f46;
}
.black {
background: #00000070
}
button:disabled,
button[disabled] {
border: 1px solid #999999 !important;
background-color: #cccccc !important;
color: #666666 !important;
}
.top-information,
.bottom-information {
padding: 0 20px;
}
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
background-color: #29cc97;
top: 14px;
width: 16px;
height: 16px;
line-height: 16px;
border: 0;
font-weight: bold;
box-shadow: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
background-color: fec400;
}
.dataTables_wrapper {
direction: rtl;
}
.dataTables_length {
float: left;
}
.dataTables_filter {
float: right;
text-align: right;
}
#DataTables_Table_0_last {
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-right-radius: 0px;
-khtml-border-bottom-right-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-right-radius: 0px;
-khtml-border-top-right-radius: 0px;
border-top-right-radius: 0px;
-moz-border-radius-bottomleft: 6px;
-webkit-border-bottom-left-radius: 6px;
-khtml-border-bottom-left-radius: 6px;
border-bottom-left-radius: 6px;
-moz-border-radius-topleft: 6px;
-webkit-border-top-left-radius: 6px;
-khtml-border-top-left-radius: 6px;
border-top-left-radius: 6px;
}
#DataTables_Table_0_first {
-moz-border-radius-bottomright: 6px;
-webkit-border-bottom-right-radius: 6px;
-khtml-border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px;
-moz-border-radius-topright: 6px;
-webkit-border-top-right-radius: 6px;
-khtml-border-top-right-radius: 6px;
border-top-right-radius: 6px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-bottom-left-radius: 0px;
-khtml-border-bottom-left-radius: 0px;
border-bottom-left-radius: 0px;
-moz-border-radius-topleft: 0px;
-webkit-border-top-left-radius: 0px;
-khtml-border-top-left-radius: 0px;
border-top-left-radius: 0px;
}
.dataTables_info {
float: left;
}
.dataTables_paginate {
float: right;
text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
padding: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details {
width: 100%;
}
</style>
Layout = "Shared/_AdminLayout";
ViewData["title"] = "لیست پرسنل‌های " + @Model.WorkshopFullName;
string adminVersion = _0_Framework.Application.Version.AdminVersion;
int i = 1;
}
@section Styles
{
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet"/>
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet"/>
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet"/>
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet" />
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet" />
<link href="~/assetsadmin/page/connectedpersonnels/css/index.css?ver=@adminVersion" rel="stylesheet" />
}
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId"/>
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId" />
<div class="row">
<div class="col-sm-12">
<div permission="10312" class="panel panel-default">
<div class="panel-heading" style="background-color: #465149">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنل‌های @Model.WorkshopFullName</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
<thead>
<tr>
<th>ردیف</th>
<th>نام و نام خانوادگی</th>
<th>کد پرسنلی</th>
<th>دارای قرارداد</th>
<th>دارای بیمه</th>
<th>انتخاب نوع محاسبه طلب مرخصی</th>
<th>انتخاب نوع محاسبه سنوات</th>
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
<th>عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.PersonnelList.ConnectedPersonnelViewModels)
{
<tr class="tableFindBtn @(item.Black ? "black" : "")">
<td class="text-center">
<div class="border-index">@i</div>
</td>
@{
i++;
}
<td>
<h6>@item.PersonName</h6>
</td>
<td class="text-center">
<h6>@item.PersonelCode</h6>
</td>
<td class="text-center">
@if (item.ContractPerson && !item.ContractLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
</td>
<td class="text-center">
@if (item.InsurancePerson && !item.InsurancetLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 230px;font-size: 12px;">
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
}
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId })">
<i class="ion-information-circled ionSize"></i>
</a>
</td>
<div class="col-sm-12">
<div permission="10312" class="panel panel-default">
<div class="panel-heading" style="background-color: #465149">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنل‌های @Model.WorkshopFullName</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
<thead>
<tr>
<th>ردیف</th>
<th>نام و نام خانوادگی</th>
<th>کد پرسنلی</th>
<th>دارای قرارداد</th>
<th>دارای بیمه</th>
<th>انتخاب نوع محاسبه طلب مرخصی</th>
<th>انتخاب نوع محاسبه سنوات</th>
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<th>عدم قرارداد</th>
<th>عدم تصفیه حساب</th>
<th>عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in @Model.PersonnelList.ConnectedPersonnelViewModels)
{
<tr class="tableFindBtn @(item.Black ? "black" : "")">
<td class="text-center">
<div class="border-index">@i</div>
</td>
@{
i++;
}
<td>
<h6>@item.PersonName</h6>
</td>
<td class="text-center">
<h6>@item.PersonelCode</h6>
</td>
<td class="text-center">
@if (@item.ContractPerson && !@item.ContractLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td class="text-center">
@if (@item.InsurancePerson && !@item.InsurancetLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 170px;font-size: 12px;">
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 170px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 170px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
</select>
}
</td>
<td style="user-select: none">
@if (@item.ContractPerson)
{
<div>
<label for="FailureCreateContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureCreateContract_@item.EmployeeId" @(!item.CreateContract ? "checked" : "") />
عدم ایجاد قرارداد
</label>
</div>
<div>
<label for="FailureSignContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureSignContract_@item.EmployeeId" @(!item.SignContract ? "checked" : "") />
عدم امضا قرارداد
</label>
</div>
}
</td>
<td style="user-select: none">
@if (@item.ContractPerson)
{
<div>
<label for="FailureCreateCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureCreateCheckout_@item.EmployeeId" @(!item.CreateCheckout ? "checked" : "") />
عدم ایجاد تصفیه حساب
</label>
</div>
<div>
<label for="FailureSignCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureSignCheckout_@item.EmployeeId" @(!item.SignCheckout ? "checked" : "") />
عدم امضا تصفیه حساب
</label>
</div>
}
</td>
<td>
@if (@item.ContractPerson)
{
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
}
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId})">
<i class="ion-information-circled ionSize"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@section Script {
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script> *@
<script type="text/javascript">
$(document).ready(function() {
$('#responsive-data-table').DataTable({
"alengthMenu": [["All", 10, 50, 100, -1], ["All", 10, 50, 100, "All"]],
"order": [[0, 'asc']],
"dom": '<"row justify-content-between top-information"lf>rt<"row justify-content-between bottom-information"ip><"clear">',
"language": {
"emptyTable": "هیچ داده‌ای در جدول وجود ندارد",
"info": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
"infoEmpty": "نمایش 0 تا 0 از 0 ردیف",
"infoFiltered": "(فیلتر شده از _MAX_ ردیف)",
"infoThousands": ",",
"lengthMenu": "نمایش _MENU_ ردیف",
"processing": "در حال پردازش...",
"search": "جستجو:",
"zeroRecords": "رکوردی با این مشخصات پیدا نشد",
"paginate": {
"next": "بعدی",
"previous": "قبلی",
"first": "ابتدا",
"last": "انتها"
},
"aria": {
"sortAscending": ": فعال سازی نمایش به صورت صعودی",
"sortDescending": ": فعال سازی نمایش به صورت نزولی"
},
"autoFill": {
"cancel": "انصراف",
"fill": "پر کردن همه سلول ها با ساختار سیستم",
"fillHorizontal": "پر کردن سلول به صورت افقی",
"fillVertical": "پرکردن سلول به صورت عمودی"
},
"buttons": {
"collection": "مجموعه",
"colvis": "قابلیت نمایش ستون",
"colvisRestore": "بازنشانی قابلیت نمایش",
"copy": "کپی",
"copySuccess": {
"1": "یک ردیف داخل حافظه کپی شد",
"_": "%ds ردیف داخل حافظه کپی شد"
},
"copyTitle": "کپی در حافظه",
"pageLength": {
"-1": "نمایش همه ردیف‌ها",
"_": "نمایش %d ردیف",
"1": "نمایش 1 ردیف"
},
"print": "چاپ",
"copyKeys": "برای کپی داده جدول در حافظه سیستم کلید های ctrl یا ⌘ + C را فشار دهید",
"csv": "فایل CSV",
"pdf": "فایل PDF",
"renameState": "تغییر نام",
"updateState": "به روز رسانی",
"excel": "فایل اکسل",
"createState": "ایجاد وضعیت جدول",
"removeAllStates": "حذف همه وضعیت ها",
"removeState": "حذف",
"savedStates": "وضعیت های ذخیره شده",
"stateRestore": "بازگشت به وضعیت %d"
},
"searchBuilder": {
"add": "افزودن شرط",
"button": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"clearAll": "خالی کردن همه",
"condition": "شرط",
"conditions": {
"date": {
"after": "بعد از",
"before": "بعد از",
"between": "میان",
"empty": "خالی",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"number": {
"between": "میان",
"empty": "خالی",
"gt": "بزرگتر از",
"gte": "برابر یا بزرگتر از",
"lt": "کمتر از",
"lte": "برابر یا کمتر از",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"string": {
"contains": "حاوی",
"empty": "خالی",
"endsWith": "به پایان می رسد با",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"startsWith": "شروع شود با",
"notContains": "نباشد حاوی",
"notEndsWith": "پایان نیابد با",
"notStartsWith": "شروع نشود با",
"equals": "برابر باشد با"
},
"array": {
"empty": "خالی",
"contains": "حاوی",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"without": "بدون",
"equals": "برابر باشد با"
}
},
"data": "اطلاعات",
"logicAnd": "و",
"logicOr": "یا",
"title": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"value": "مقدار",
"deleteTitle": "حذف شرط فیلتر",
"leftTitle": "شرط بیرونی",
"rightTitle": "شرط فرورفتگی"
},
"select": {
"cells": {
"1": "1 سلول انتخاب شد",
"_": "%d سلول انتخاب شد"
},
"columns": {
"1": "یک ستون انتخاب شد",
"_": "%d ستون انتخاب شد"
},
"rows": {
"1": "1ردیف انتخاب شد",
"_": "%d انتخاب شد"
}
},
"thousands": ",",
"searchPanes": {
"clearMessage": "همه را پاک کن",
"collapse": {
"0": "صفحه جستجو",
"_": "صفحه جستجو (٪ d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "صفحه جستجو وجود ندارد",
"loadMessage": "در حال بارگیری صفحات جستجو ...",
"title": "فیلترهای فعال - %d",
"showMessage": "نمایش همه",
"collapseMessage": "بستن همه"
},
"loadingRecords": "در حال بارگذاری...",
"datetime": {
"previous": "قبلی",
"next": "بعدی",
"hours": "ساعت",
"minutes": "دقیقه",
"seconds": "ثانیه",
"amPm": [
"صبح",
"عصر"
],
"months": {
"0": "ژانویه",
"1": "فوریه",
"10": "نوامبر",
"4": "می",
"8": "سپتامبر",
"11": "دسامبر",
"3": "آوریل",
"9": "اکتبر",
"7": "اوت",
"2": "مارس",
"5": "ژوئن",
"6": "ژوئیه"
},
"unknown": "-",
"weekdays": [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه"
]
},
"editor": {
"close": "بستن",
"create": {
"button": "جدید",
"title": "ثبت جدید",
"submit": "ایجــاد"
},
"edit": {
"button": "ویرایش",
"title": "ویرایش",
"submit": "به روز رسانی"
},
"remove": {
"button": "حذف",
"title": "حذف",
"submit": "حذف",
"confirm": {
"_": "آیا از حذف %d خط اطمینان دارید؟",
"1": "آیا از حذف یک خط اطمینان دارید؟"
}
},
"multi": {
"restore": "واگرد",
"noMulti": "این ورودی را می توان به صورت جداگانه ویرایش کرد، اما نه بخشی از یک گروه",
"title": "مقادیر متعدد",
"info": "مقادیر متعدد"
},
"error": {
"system": "خطایی رخ داده (اطلاعات بیشتر)"
}
},
"decimal": ".",
"stateRestore": {
"creationModal": {
"button": "ایجاد",
"columns": {
"search": "جستجوی ستون",
"visible": "وضعیت نمایش ستون"
},
"name": "نام:",
"order": "مرتب سازی",
"paging": "صفحه بندی",
"search": "جستجو",
"select": "انتخاب",
"title": "ایجاد وضعیت جدید",
"toggleLabel": "شامل:",
"scroller": "موقعیت جدول (اسکرول)",
"searchBuilder": "صفحه جستجو"
},
"emptyError": "نام نمیتواند خالی باشد.",
"removeConfirm": "آیا از حذف %s مطمئنید؟",
"removeJoiner": "و",
"renameButton": "تغییر نام",
"renameLabel": "نام جدید برای $s :",
"duplicateError": "وضعیتی با این نام از پیش ذخیره شده.",
"emptyStates": "هیچ وضعیتی ذخیره نشده",
"removeError": "حذف با خطا موماجه شد",
"removeSubmit": "حذف وضعیت",
"removeTitle": "حذف وضعیت جدول",
"renameTitle": "تغییر نام وضعیت"
}
}
});
$(document).on('change',
'.tableFindBtn',
function() {
$(this).find(".save").prop("disabled", false);
});
});
function save(EmployeeId) {
var command = {};
command.WorkshopId = Number($("#workshopId").val());
command.EmployeeId = Number(EmployeeId);
command.ComputeOptions = $(`[data-ComputeOptions="${EmployeeId}"]`).val();
command.BonusesOptions = $(`[data-BonusesOptions="${EmployeeId}"]`).val();
command.YearsOptions = $(`[data-YearsOptions="${EmployeeId}"]`).val();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Create")',
data: command,
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function(response) {
if (response.isSuccedded) {
command = {};
console.log();
$(`[data-save="${EmployeeId}"]`).prop("disabled", true);
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
} else {
command = {};
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function(response) {
console.log(5, response);
}
});
}
<script>
var AntiForgeryToken = $('@Html.AntiForgeryToken()').val();
var saveCreateUrl = `@Url.Page("./Index", "Create")`;
</script>
<script src="~/AssetsAdmin/page/ConnectedPersonnels/js/Index.js?ver=@adminVersion"></script>
}

View File

@@ -1,170 +1,204 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.EmployeeComputeOptions;
using CompanyManagment.App.Contracts.RollCallEmployee;
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Transactions;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.Contract;
namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels;
public class IndexModel : PageModel
namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels
{
private readonly IAuthHelper _authHelper;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IWorkshopApplication _workshopApplication;
public ConnectedPersonnelViewModel PersonnelList;
public string WorkshopFullName;
public long workshopId;
public class IndexModel : PageModel
{
public ConnectedPersonnelViewModel PersonnelList;
public string WorkshopFullName;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
private readonly IEmployeeApplication _employeeApplication;
private readonly IAuthHelper _authHelper;
public long workshopId;
private readonly IWebHostEnvironment _webHostEnvironment;
public IndexModel(IAuthHelper authHelper, IWorkshopApplication workshopApplication,
IEmployeeComputeOptionsApplication employeeComputeOptionsApplication, IWebHostEnvironment webHostEnvironment)
{
_authHelper = authHelper;
_workshopApplication = workshopApplication;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_webHostEnvironment = webHostEnvironment;
}
public IndexModel(IAuthHelper authHelper, IWorkshopApplication workshopApplication, IEmployeeComputeOptionsApplication employeeComputeOptionsApplication, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IEmployeeApplication employeeApplication)
{
_authHelper = authHelper;
_workshopApplication = workshopApplication;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_webHostEnvironment = webHostEnvironment;
_rollCallEmployeeApplication = rollCallEmployeeApplication;
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
_employeeApplication = employeeApplication;
}
public void OnGet(long workshopID)
{
var workshop = _workshopApplication.GetWorkshopInfo(workshopID);
WorkshopFullName = workshop.WorkshopFullName;
workshopId = workshopID;
public void OnGet(long workshopID)
{
var workshop = _workshopApplication.GetWorkshopInfo(workshopID);
WorkshopFullName = workshop.WorkshopFullName;
workshopId = workshopID;
var result = _workshopApplication.GetConnectedPersonnels(workshopID).GroupBy(x => x.PersonName)
.Select(x => x.First()).ToList();
var result = _workshopApplication.GetConnectedPersonnels(workshopID).GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
var final = new List<ConnectedPersonnelViewModel>();
foreach (var item in result)
{
var option = new EmployeeComputeOptionsViewModel();
if (item.ContractPerson)
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
var final = new List<ConnectedPersonnelViewModel>();
foreach (var item in result)
{
var option = new EmployeeComputeOptionsViewModel();
if (item.ContractPerson)
{
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
}
var finalResult = new ConnectedPersonnelViewModel
{
WorkshopId = item.WorkshopId,
EmployeeId = item.EmployeeId,
PersonName = item.PersonName,
PersonelCode = item.PersonelCode,
ContractPerson = item.ContractPerson,
InsurancePerson = item.InsurancePerson,
ContractLeft = item.ContractLeft,
InsurancetLeft = item.InsurancetLeft,
Black = item.Black,
StartWork = item.StartWork,
BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null",
ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null",
YearsOptions = item.ContractPerson ? option.YearsOptions : "null"
};
var finalResult = new ConnectedPersonnelViewModel()
{
WorkshopId = item.WorkshopId,
EmployeeId = item.EmployeeId,
PersonName = item.PersonName,
PersonelCode = item.PersonelCode,
ContractPerson = item.ContractPerson,
InsurancePerson = item.InsurancePerson,
ContractLeft = item.ContractLeft,
InsurancetLeft = item.InsurancetLeft,
Black = item.Black,
StartWork = item.StartWork,
BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null",
ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null",
YearsOptions = item.ContractPerson ? option.YearsOptions : "null",
CreateContract = item.ContractPerson ? option.CreateContract :false,
CreateCheckout = item.ContractPerson ? option.CreateCheckout : false,
SignContract = item.ContractPerson ? option.SignContract : false,
SignCheckout = item.ContractPerson ? option.SignCheckout : false
};
final.Add(finalResult);
}
final.Add(finalResult);
}
PersonnelList = new ConnectedPersonnelViewModel
{
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList()
};
}
PersonnelList = new ConnectedPersonnelViewModel()
{
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
};
}
public IActionResult OnGetCreate(CreateEmployeeComputeOptions command)
{
var result = _employeeComputeOptionsApplication.Create(command);
return new JsonResult(new
{
isSuccedded = result.IsSuccedded,
message = result.Message
});
}
public IActionResult OnPostCreate(CreateEmployeeComputeOptions command)
{
var result = _employeeComputeOptionsApplication.Create(command);
return new JsonResult(new
{
isSuccedded = result.IsSuccedded,
message = result.Message
});
}
public IActionResult OnGetTakePicture(long employeeId, long workshopId)
{
var res = new TakePictureModel
{
EmployeeId = employeeId,
WorkshopId = workshopId
};
public IActionResult OnGetTakePicture(long employeeId, long workshopId)
{
var res = new TakePictureModel()
{
EmployeeId = employeeId,
WorkshopId = workshopId
};
return Partial("TakePicture", res);
}
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
{
try
{
var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
var filePath1 = Path.Combine(directoryPath) + $@"\1.jpg";
CreateImageFromBase64(base64pic1, filePath1);
var filePath2 = Path.Combine(directoryPath) + $@"\2.jpg";
CreateImageFromBase64(base64pic2, filePath2);
var employee = _employeeApplication.GetDetailsForClient(employeeId, workshopId);
var rollCallEmployee = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
var result = new OperationResult()
{
IsSuccedded = false,
Message = "åäæÒ Úãá?ÇÊ? ÇäÌÇã äÔÏå ÇÓÊ"
};
var result2 = new OperationResult()
{
IsSuccedded = false,
Message = "åäæÒ Úãá?ÇÊ? ÇäÌÇã äÔÏå ÇÓÊ"
};
using var transaction = new TransactionScope();
if (rollCallEmployee == null)
{
var createCommand = new CreateRollCallEmployee()
{
EmployeeId = employeeId,
WorkshopId = workshopId,
EmployeeFullName = employee.EmployeeFullName,
HasUploadedImage = "true",
};
result = _rollCallEmployeeApplication.Create(createCommand);
result2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
{ RollCallEmployeeId = result.SendId });
}
else
{
result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId);
}
if (result.IsSuccedded && result2.IsSuccedded)
{
transaction.Complete();
return new JsonResult(new
{
IsSuccedded = result.IsSuccedded,
Message = result.Message,
src = Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), employeeId.ToString(), "1.jpg"), 150, 150)
});
}
else
{
if (result.IsSuccedded == false)
return new JsonResult(new
{
IsSuccedded = result.IsSuccedded,
Message = result.Message,
});
else
return new JsonResult(new
{
IsSuccedded = result2.IsSuccedded,
Message = result2.Message
});
}
}
catch (Exception e)
{
Console.WriteLine(e);
return new JsonResult(new
{
IsSuccedded = false,
Message = e.Message,
});
}
return Partial("TakePicture", res);
}
}
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
{
try
{
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\Faces\\{workshopId}\\{employeeId}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
var filePath1 = Path.Combine(directoryPath) + @"\1.jpg";
CreateImageFromBase64(base64pic1, filePath1);
var filePath2 = Path.Combine(directoryPath) + @"\2.jpg";
CreateImageFromBase64(base64pic2, filePath2);
return new JsonResult(new
{
IsSuccedded = true
});
//var fileName = file.FileName;
//var fileExtention = Path.GetExtension(fileName);
//if (!string.IsNullOrWhiteSpace(filePath))
//{
// StoreInFolder(file, filePath);
//}
//var files = HttpContext.Request.Form.Files;
//if (files != null)
//{
// foreach (var file in files)
// {
// if (file.Length > 0)
// {
// var fileName = file.FileName;
// var uniqName = "1";
// var fileExtention = Path.GetExtension(fileName);
// var filePath = Path.Combine(_webHostEnvironment.WebRootPath, "Faces") + $@"\uniqName";
// if (!string.IsNullOrWhiteSpace(filePath))
// {
// StoreInFolder(file, filePath);
// }
// }
// }
// return new JsonResult(new
// {
// IsSuccedded = true,
// });
//}
//else
//{
// return new JsonResult(new
// {
// IsSuccedded = false,
// });
//}
}
catch (Exception e)
{
Console.WriteLine(e);
return new JsonResult(new
{
IsSuccedded = false
});
}
}
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
{
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
//Convert the base64 to byte array
var bytes = Convert.FromBase64String(subBase64);
//Here you can save the byte array to the SQL database. You can use your own function
//bool saved = DAL.SaveUserPhoto(bytes);
//Create the physical image from the byte array
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
}
}
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
{
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
//Convert the base64 to byte array
byte[] bytes = Convert.FromBase64String(subBase64);
//Here you can save the byte array to the SQL database. You can use your own function
//bool saved = DAL.SaveUserPhoto(bytes);
//Create the physical image from the byte array
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
}
}
}

View File

@@ -297,7 +297,22 @@
<script>
$(document).ready(function () {
$('#workshops').on('submit', function (e) {
var $submitBtn = $(this).find('button[type="submit"]');
if ($submitBtn.prop('disabled')) {
e.preventDefault();
return;
}
$submitBtn.prop('disabled', true);
setTimeout(function () {
$submitBtn.prop('disabled', false);
}, 3000);
});
});
$(".select2-tag").select2({
language: "fa",
dir: "rtl"

View File

@@ -98,7 +98,7 @@
</div>
<!--اطلاعات کارگاه-->
<div class="col-md-12 col-12 col-sm-12 form-box" id="divInsuranceWorkshopInfo">
@* <div class="d-flex">
@* <div class="d-flex">
<span class="form-title">کپی از آخرین لیست ارسالی </span>
<div id="resultExistPersonel" class="alert alert-danger" style="display:none"></div>
</div> *@
@@ -148,87 +148,87 @@
</ul>
<div class="tab-content">
<div class="tab-pane active" id="DSSKAR">
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br/> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br /> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6" style="display: none">
</div>
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group" style="display: none">
<label class="col-md-10 col-10 col-sm-10 text-small"> 4% سخت و زیان آور </label>
<input type="text" placeholder="" id="txtDifficultJobsInsuranc" asp-for="DifficultJobsInsuranc" class="input green col-md-2 col-2 col-sm-2">
</div>
</div>
<div class="tab-pane" id="DSKWOR">
<div id="table-container">
@@ -738,12 +738,12 @@
var employeeId = $(this).attr("data-employeeid");
if (employeeId == id) {
$(this).find('td:eq(1)').text($('#LeftWorkDate').val());
$(this).find('td:eq(2)').text($('#StartWorkDate').val());
$(this).find('td:eq(3)').text(jobName);
$(this).find('td:eq(4)').text($('#InsuranceShare').val());
var monthlySalaryPlusBaseyear = getNumberValue($('#hiddenMonthlySalaryPlusBaseYear').val());
var benefitsIncludedContinuous = getNumberValue($('#BenefitsIncludedContinuous').val());
var benefitsIncluded = Number(monthlySalaryPlusBaseyear) + Number(benefitsIncludedContinuous);
@@ -768,10 +768,10 @@
$(this).find('td:eq(7)').attr('data-monthlybenefits', benefitsIncludedContinuous);
$(this).find('td:eq(8)').text($('#hiddenMonthlySalaryPlusBaseYear').val());
$(this).find('td:eq(8)').attr("data-monthlysalary", monthlySalaryPlusBaseyear);
$(this).find('td:eq(8)').attr("data-monthlysalary", monthlySalaryPlusBaseyear);
$(this).find('td:eq(8)').attr("data-MonthlySalaryPlusBaseyear", monthlySalaryPlusBaseyear);
$(this).find('td:eq(11)').text($('#DailyWage').val());
$(this).find('td:eq(11)').text($('#DailyWage').val());
$(this).find('td:eq(11)').attr("data-dailywage", getNumberValue($('#DailyWage').val()));
$(this).find('td:eq(11)').attr("data-DailyWagePlusBaseYears", getNumberValue($('#hiddendaailyWagePlusBaseYear').val()));
@@ -792,7 +792,7 @@
var marriedAllowance = getNumberValue($('#hiddenMarriedAllowance').val());
$(this).find('td:eq(9)').text($('#hiddenMarriedAllowance').val());
$(this).find('td:eq(9)').attr("data-MarriedAllowance", marriedAllowance);
var baseYears = getNumberValue($('#hiddenBaseYearToEditModal').val());
$(this).find('td:eq(10)').text($('#hiddenBaseYearToEditModal').val());
$(this).find('td:eq(10)').attr("data-BaseYears", baseYears);
@@ -1052,12 +1052,15 @@
employeeDetails.IncludedAndNotIncluded = Number($(this).find('td:eq(5)').attr('data-includedandnotincluded'));
employeeDetails.InsuranceShare = Number($(this).find('td:eq(4)').attr('data-insuranceshare'));
employeeDetails.WorkingDays = Number($(this).find('td:eq(12)').text());
employeeDetails.MarriedAllowance = Number($(this).find('td:eq(9)').attr('data-MarriedAllowance'));
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
@@ -1099,7 +1102,7 @@
$('#txtSumOfMarriedAllowance').val(response.sumOfMarriedAllowance);
$('#txtSumOfDailyWagePlusBaseYears').val(response.sumOfDailyWagePlusBaseYears);
$('#txtSumOfBenefitsIncludedNonContinuous').val(response.sumOfBenefitsIncludedNonContinuous);
console.log(response.sumOfBenefitsIncludedNonContinuous);
},
failure: function (response) {
@@ -1251,7 +1254,7 @@
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="SumOfBaseYears" id="SumOfBaseYears" value="${getNumberValue($("#txtSumOfBaseYears").val())}" />`);
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="SumOfMarriedAllowance" id="SumOfMarriedAllowance" value="${getNumberValue($("#txtSumOfMarriedAllowance").val())}" />`);
//$("#divEmployeeInsurancListData").append('<input type="hidden" name="InsuranceWorkshopInfo.FixedSalary" id="InsuranceWorkshopInfo_FixedSalary" value="'+fixedSalary+'" />');
//$("#divEmployeeInsurancListData").append('<input type="hidden" name="InsuranceWorkshopInfo.Population" id="InsuranceWorkshopInfo_Population" value="'+population+'" />');
@@ -1381,7 +1384,7 @@
$.Notification.autoHideNotify('success', 'top right', response.message);
$("#MainModal").modal('hide');
// $('.btn-search1').click();
// Reload Function
pageIndexJs = 0;
hasMoreData = true;

View File

@@ -776,7 +776,8 @@
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
//console.log(employeeDetailsForInsuranceList);

View File

@@ -178,7 +178,7 @@ public class IndexModel : PageModel
double included = 0; //مشمول
double sumOfWorkingDays = 0;
double benefitsIncludedNonContinuous = 0; //مزایای ماهانه غیر مشمول
double sumOfSalaries = 0;
double sumOfSalaries = 0;
double sumOfDailyWage = 0;
double insuredShare = 0;
double employerShare = 0; //سهم بیمه کارفرما
@@ -192,12 +192,24 @@ public class IndexModel : PageModel
double countWithoutLeft = 0;
double sumOfBaseYears = 0;
double sumOfMarriedAllowance = 0;
double sumOfDailyWagePlusBaseYear = 0;
double sumOfBenefitIncludedAndNotIncluded = 0; //مشمول و غیر مشمول
double yearlySalaryDailyWage = 0;
if (employeeDetailsForInsuranceList.Count > 0)
{
var employeeDetail = employeeDetailsForInsuranceList.First();
var startMonthFa = $"{employeeDetail.Year}/{employeeDetail.Month.PadLeft(2, '0')}/01";
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
.ToGeorgianDateTime();
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
yearlySalaryDailyWage = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, employeeDetail.Year).DayliWage;
}
double sumOfDailyWagePlusBaseYear = 0;
for (var i = 0; i < employeeDetailsForInsuranceList.Count; i++)
double sumOfBenefitIncludedAndNotIncluded = 0; //مشمول و غیر مشمول
double sumOfMonthlySalaryWithoutBaseYears = 0; //جمع حقوق ماهیانه بدون پایه سنوات
for (var i = 0; i < employeeDetailsForInsuranceList.Count; i++)
{
var leftWorkDay = "";
if (!string.IsNullOrWhiteSpace(employeeDetailsForInsuranceList[i].LeftWorkDate))
@@ -214,16 +226,16 @@ public class IndexModel : PageModel
}
//بدست آوردن جمع پایه سنواتی
var baseYear = employeeDetailsForInsuranceList[i].BaseYears *
employeeDetailsForInsuranceList[i].WorkingDays;
sumOfBaseYears += baseYear;
var baseYear = employeeDetailsForInsuranceList[i].BaseYears *
employeeDetailsForInsuranceList[i].WorkingDays;
sumOfBaseYears += baseYear;
//بدست آوردن جمع حق تاهل
sumOfMarriedAllowance += employeeDetailsForInsuranceList[i].MarriedAllowance;
//بدست آوردن جمع حق تاهل
sumOfMarriedAllowance += employeeDetailsForInsuranceList[i].MarriedAllowance;
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
(employeeDetailsForInsuranceList[i].JobCode == "027079" ||
employeeDetailsForInsuranceList[i].JobCode == "024398" ||
employeeDetailsForInsuranceList[i].JobCode == "011015" ||
@@ -251,14 +263,18 @@ public class IndexModel : PageModel
monthlyBenefits = monthlyBenefits + +employeeDetailsForInsuranceList[i].MonthlyBenefits;
sumOfIncluded = sumOfIncluded + employeeDetailsForInsuranceList[i].BenefitsIncludedContinuous;
sumOfDailyWagePlusBaseYear += employeeDetailsForInsuranceList[i].DailyWagePlusBaseYears;
sumOfDailyWagePlusBaseYear += employeeDetailsForInsuranceList[i].DailyWagePlusBaseYears;
//Mahan Changes
//مجموع حقوق ماهیانه خالص
sumOfMonthlySalaryWithoutBaseYears +=
GetRoundValueWhitGovermentlist(yearlySalaryDailyWage * employeeDetailsForInsuranceList[i].WorkingDays, typeOfInsuranceSendWorkshop);
if (leftWorkDay != "01") //اگر ترک کار آن یکم ماه نبود
if (leftWorkDay != "01") //اگر ترک کار آن یکم ماه نبود
sumOfBenefitIncludedAndNotIncluded += employeeDetailsForInsuranceList[i].IncludedAndNotIncluded;
benefitsIncludedNonContinuous += employeeDetailsForInsuranceList[i].BenefitsIncludedNonContinuous;
insuredShare = insuredShare + employeeDetailsForInsuranceList[i].InsuranceShare;
benefitsIncludedNonContinuous += employeeDetailsForInsuranceList[i].BenefitsIncludedNonContinuous;
insuredShare = insuredShare + employeeDetailsForInsuranceList[i].InsuranceShare;
}
employerShare = GetRoundValueWhitGovermentlist(sumOfIncluded * 20 / 100, typeOfInsuranceSendWorkshop);
@@ -301,6 +317,13 @@ public class IndexModel : PageModel
employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
}
//اگر گارگاه کمک دولت بود بعد از اجرای فرمول ها
//بیست درصد از اختلاف ( مجموع حقوق خالص با مجموع مزایای مشمول ) به سهم کارفرما اضافه میشود
if (typeOfInsuranceSendWorkshop == "Govermentlist")
{
var result = ((sumOfIncluded - sumOfMonthlySalaryWithoutBaseYears) * 20 / 100);
employerShare += GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
}
#endregion
//sumOfIncluded مجموع حقوق و مزایای ماهیانه مشمول
@@ -399,18 +422,18 @@ public class IndexModel : PageModel
//جمع پایه سنواتی
SumOfBaseYears = sumOfBaseYears.ToMoney(),
//جمع حق تاهل
SumOfMarriedAllowance = sumOfMarriedAllowance.ToMoney(),
SumOfMarriedAllowance = sumOfMarriedAllowance.ToMoney(),
//جمع دستمزد روزانه + پایه سنوات روزانه
SumOfDailyWagePlusBaseYears = sumOfDailyWagePlusBaseYear.ToMoney(),
//جمع دستمزد روزانه + پایه سنوات روزانه
SumOfDailyWagePlusBaseYears = sumOfDailyWagePlusBaseYear.ToMoney(),
//جمع مزایای غیر مشمول
SumOfBenefitsIncludedNonContinuous = benefitsIncludedNonContinuous.ToMoney(),
SumOfBenefitsIncludedNonContinuous = benefitsIncludedNonContinuous.ToMoney(),
});
});
}
public IActionResult OnPostCreate(CreateInsuranceList command)
{
//var result =new OperationResult();
@@ -562,14 +585,14 @@ public class IndexModel : PageModel
odbf.Header.AddColumn(new DbfColumn("DSK_DISC", DbfColumn.DbfColumnType.Character, 100, 0));
//تعداد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_NUM", DbfColumn.DbfColumnType.Number, 5, 0));
//مجموع روزهای کارکرد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TDD", DbfColumn.DbfColumnType.Number, 6, 0));
//مجموع روزهای کارکرد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TDD", DbfColumn.DbfColumnType.Number, 6, 0));
//مجموع دستمزد روزانه کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TROOZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع دستمزد ماهانه کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TMAH", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMAZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMAZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع دستمزد و مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMASH", DbfColumn.DbfColumnType.Number, 12, 0));
// مجموع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
@@ -589,11 +612,11 @@ public class IndexModel : PageModel
//ردیف پیمان
odbf.Header.AddColumn(new DbfColumn("MON_PYM", DbfColumn.DbfColumnType.Character, 3, 0));
//مجموع پایه سنواتی ها
odbf.Header.AddColumn(new DbfColumn("DSK_INC", DbfColumn.DbfColumnType.Character, 12, 0));
//مجموع حق تاهل ها
odbf.Header.AddColumn(new DbfColumn("DSK_SPOUSE", DbfColumn.DbfColumnType.Character, 12, 0));
var orec = new DbfRecord(odbf.Header);
//مجموع پایه سنواتی ها
odbf.Header.AddColumn(new DbfColumn("DSK_INC", DbfColumn.DbfColumnType.Character, 12, 0));
//مجموع حق تاهل ها
odbf.Header.AddColumn(new DbfColumn("DSK_SPOUSE", DbfColumn.DbfColumnType.Character, 12, 0));
var orec = new DbfRecord(odbf.Header);
//کد کارگاه
orec[0] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.InsuranceCode, 10);
@@ -615,12 +638,12 @@ public class IndexModel : PageModel
orec[8] = GetSpecifiedCharactes("", 100).ToIranSystem();
//تعداد کرکنان
orec[9] = createInsuranceList.SumOfEmployees.ToString();
//مجموع روزهای کارکرد کارکنان
orec[10] = createInsuranceList.SumOfWorkingDays.ToString();
//مجموع روزهای کارکرد کارکنان
orec[10] = createInsuranceList.SumOfWorkingDays.ToString();
//مجموع دستمزد روزانه کارکنان
orec[11] = createInsuranceList.SumOfDailyWage.ToString();
//مجموع دستمزد ماهانه کارکنان
orec[12] = createInsuranceList.SumOfSalaries.ToString();
//مجموع دستمزد ماهانه کارکنان
orec[12] = createInsuranceList.SumOfSalaries.ToString();
//مجموع مزایای ماهانه مشمول
orec[13] = createInsuranceList.SumOfBenefitsIncluded.ToString();
//مجموع دستمزد و مزایای ماهانه مشمول
@@ -631,7 +654,7 @@ public class IndexModel : PageModel
orec[16] = createInsuranceList.InsuredShare.ToString();
//مجموع حق بیمه سهم کارفرما
orec[17] = createInsuranceList.EmployerShare.ToString(); //"44911361";
//مجموع حق بیمه بیکاری
//مجموع حق بیمه بیکاری
orec[18] = createInsuranceList.UnEmploymentInsurance.ToString();
//نرخ حق بیمه
orec[19] = "23";
@@ -642,18 +665,18 @@ public class IndexModel : PageModel
//ردیف پیمان
orec[22] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.AgreementNumber, 12);
//مجموع پایه سنواتی ها
orec[23] = createInsuranceList.SumOfBaseYears.ToString();
//مجموع پایه سنواتی ها
orec[23] = createInsuranceList.SumOfBaseYears.ToString();
//مجموع حق تاهل ها
orec[24] = createInsuranceList.SumOfMarriedAllowance.ToString();
//مجموع حق تاهل ها
orec[24] = createInsuranceList.SumOfMarriedAllowance.ToString();
odbf.Write(orec);
odbf.Write(orec);
//odbf.Header.RecordCount = 50;
odbf.WriteHeader();
odbf.Close();
}
//ایجاد فایل پرسنل - DSW
if (createInsuranceList.EmployeeInsurancListDataList != null)
{
@@ -715,12 +738,12 @@ public class IndexModel : PageModel
// کد ملی
dsw.Header.AddColumn(new DbfColumn("PER_NATCOD", DbfColumn.DbfColumnType.Character, 10, 0));
// پایه سنوات
dsw.Header.AddColumn(new DbfColumn("DSW_INC", DbfColumn.DbfColumnType.Number, 12, 0));
// حق تاهل
dsw.Header.AddColumn(new DbfColumn("DSW_SPOUSE", DbfColumn.DbfColumnType.Number, 12, 0));
// پایه سنوات
dsw.Header.AddColumn(new DbfColumn("DSW_INC", DbfColumn.DbfColumnType.Number, 12, 0));
// حق تاهل
dsw.Header.AddColumn(new DbfColumn("DSW_SPOUSE", DbfColumn.DbfColumnType.Number, 12, 0));
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
{
var employee = createInsuranceList.EmployeeDetailsForInsuranceList.FirstOrDefault(p => p.EmployeeId == item.EmployeeId);
@@ -798,12 +821,12 @@ public class IndexModel : PageModel
//کد ملی
dswrec[26] = employee.NationalCode;
//پایه سنوات
dswrec[27] = item.BaseYears.ToString();
//حق تاهل
dswrec[28] = item.MarriedAllowance.ToString();
//پایه سنوات
dswrec[27] = item.BaseYears.ToString();
//حق تاهل
dswrec[28] = item.MarriedAllowance.ToString();
dsw.Write(dswrec);
dsw.Write(dswrec);
}
@@ -845,18 +868,18 @@ public class IndexModel : PageModel
return Partial("Edit", insurance);
}
//-2
/// <summary>
/// لود اطلاعات پرسنل در مودال ویرایش بیمه -- DSKWOR
/// محاسبه تب پرسنل
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
public IActionResult OnGetEmployeeListForEdit(EmployeeForEditInsuranceListSearchModel searchModel)
//-2
/// <summary>
/// لود اطلاعات پرسنل در مودال ویرایش بیمه -- DSKWOR
/// محاسبه تب پرسنل
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
public IActionResult OnGetEmployeeListForEdit(EmployeeForEditInsuranceListSearchModel searchModel)
{
// var result = _insuranceListApplication.SearchEmployeeListForEditByInsuranceListId(searchModel);
var result = _insuranceListApplication.GetEmployeeListForEditByInsuranceListId(searchModel);
return Partial("./EmployeeListForEdit", result);
// var result = _insuranceListApplication.SearchEmployeeListForEditByInsuranceListId(searchModel);
var result = _insuranceListApplication.GetEmployeeListForEditByInsuranceListId(searchModel);
return Partial("./EmployeeListForEdit", result);
}
//-3
@@ -899,7 +922,7 @@ public class IndexModel : PageModel
}
return new JsonResult(result);
}
}
#endregion
public IActionResult OnGetInsuranceSummary(long id)
@@ -925,7 +948,7 @@ public class IndexModel : PageModel
string benefitsIncludedContinuous, string jobId, string housingAllowance, string includeStatus,
string consumableItems, string endMonthCurrentDay, long employeeId, double maritalStatus, double baseYear)
{
if(workingDays == "0")
if (workingDays == "0")
return new JsonResult(new
{
monthlySalaryPlusBaseYear = "0",
@@ -939,15 +962,15 @@ public class IndexModel : PageModel
baseYears = "0",
});
var benefitsIncludedContinuousL = benefitsIncludedContinuous.MoneyToDouble();
bool isManager = jobId is "10" or "16" or "17" or "18" or "3498";
bool isManager = jobId is "10" or "16" or "17" or "18" or "3498";
//if (isManager && includeStatus !="1") شنبه
if (isManager)
maritalStatus = 0;
double sum = 0;
double sum = 0;
var employeeMaritalStatus = _employeeApplication.GetDetails(employeeId);
if (employeeMaritalStatus.MaritalStatus == "متاهل")
sum = consumableItems.MoneyToDouble() + housingAllowance.MoneyToDouble() + maritalStatus;
@@ -960,10 +983,10 @@ public class IndexModel : PageModel
var jobIdL = Convert.ToInt64(jobId);
var includeStatusL = Convert.ToInt64(includeStatus);
var dailyWageL = (dailyWage.MoneyToDouble()) + baseYear;
var dailyWageWithOutBaseYear = dailyWage.MoneyToDouble();
var dailyWageWithOutBaseYear = dailyWage.MoneyToDouble();
if (workingDaysL == endMonthCurrentDayL) benefitsIncludedContinuousL = sum;
if (workingDaysL == endMonthCurrentDayL) benefitsIncludedContinuousL = sum;
//farokhiChanges
if (employeeId == 42783)
benefitsIncludedContinuousL = 53082855;
@@ -986,24 +1009,24 @@ public class IndexModel : PageModel
// benefitsIncludedContinuousL = 0;
//}
if (isManager && includeStatus != "1")
benefitsIncludedContinuousL = 0;
benefitsIncludedContinuousL = 0;
var monthlySalaryL = workingDaysL * dailyWageL;
var insuranceShareL = (benefitsIncludedContinuousL + monthlySalaryL) * 7 / 100;
insuranceShareL = _insuranceListApplication.GetRoundValue(insuranceShareL);
var monthlySalaryWithOutBaseYear = workingDaysL * dailyWageWithOutBaseYear;
//var persianBefore = "";
//var year = Convert.ToInt32(date.Substring(0, 4));
//var month = Convert.ToInt32(date.Substring(5, 2));
//var day = Convert.ToInt32(date.Substring(8, 2));
//var persianDate = new PersianDateTime(year, month, day);
//var persianBeforeDate = persianDate.AddDays(-1);
//persianBefore = persianBeforeDate.ToString("yyyy/MM/dd");
var monthlySalaryWithOutBaseYear = workingDaysL * dailyWageWithOutBaseYear;
//var persianBefore = "";
//var year = Convert.ToInt32(date.Substring(0, 4));
//var month = Convert.ToInt32(date.Substring(5, 2));
//var day = Convert.ToInt32(date.Substring(8, 2));
//var persianDate = new PersianDateTime(year, month, day);
//var persianBeforeDate = persianDate.AddDays(-1);
//persianBefore = persianBeforeDate.ToString("yyyy/MM/dd");
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 && dailyWageL == 0)
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 && dailyWageL == 0)
workingDaysL = 0;
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 &&
workingDaysL == 0) dailyWageL = 0;
workingDaysL == 0) dailyWageL = 0;
var includeStatusBool = includeStatus == "1";
double marridAllowance = 0;
@@ -1013,23 +1036,23 @@ public class IndexModel : PageModel
includeStatusBool, Convert.ToInt32(workingDays), maritalStatus, Convert.ToInt32(endMonthCurrentDay));
}
var baseYears = baseYear;
var baseYears = baseYear;
Console.WriteLine(baseYears);
return new JsonResult(new
{
monthlySalaryPlusBaseYear = monthlySalaryL.ToMoney(),
monthlySalary = monthlySalaryWithOutBaseYear.ToMoney(),
monthlySalaryPlusBaseYear = monthlySalaryL.ToMoney(),
monthlySalary = monthlySalaryWithOutBaseYear.ToMoney(),
benefitsIncludedContinuous = benefitsIncludedContinuousL.ToMoney(),
insuranceShare = insuranceShareL.ToMoney(),
workingDay = workingDaysL,
dailyWag = dailyWageWithOutBaseYear.ToMoney(),
dailyWagePlusBaseYear = dailyWageL,
dailyWagePlusBaseYear = dailyWageL,
marriedAllowance = marridAllowance.ToMoney(),
baseYears = baseYears.ToMoney(),
});
});
}
public double GetRoundValueWhitGovermentlist(double value, string type)
{
@@ -1073,7 +1096,7 @@ public class IndexModel : PageModel
{
var result = _employerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
@@ -1111,8 +1134,8 @@ public class IndexModel : PageModel
}
public async Task<IActionResult> OnGetOperationsModal(long id)
{
var command = await _insuranceListApplication.GetInsuranceOperationDetails(id);
{
var command = await _insuranceListApplication.GetInsuranceOperationDetails(id);
return Partial("_Partials/OperationsModal", command);
}

View File

@@ -51,7 +51,8 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Workshops
SeniorInsuranceAccountList = accounts.Where(x => x.RoleId == 7).ToList(),
JuniorInsuranceAccountsList = accounts.Where(x => x.RoleId == 8).ToList(),
InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle"),
};
CutContractEndOfYear = IsActive.None
};
var res = _workshopApplication.GetWorkshop();
var checkOk = res.Any();

View File

@@ -1,457 +1,10 @@
@page
@using _0_Framework.Application
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ServiceHost.Areas.Admin.Pages.Company.Workshops.EditWorkshopModel
@{
<link href="~/admintheme/css/workshop-create.css" rel="stylesheet" />
<style>
#titleHead {
font-size: 20px;
margin: 0 0 5px 0;
}
input[type=checkbox], input[type=radio]
{
accent-color: #495d2b;
}
#radio2, #radio3, #radio4 {
position:relative;
margin: 25px 0 0 0;
display:flex;
flex-direction:column;
justify-content:center
}
#radio2 h4, #radio3 h4,#radio4 h4{
font-size: 14px;
font-weight: 400;
position: absolute;
top: -24px;
background-color: white;
padding: 1px 3px;
}
#radio2 label, #radio3 label, #radio4 label{
font-size: 12px;
font-weight: 300;
margin: 0 0 0px 0;
}
.textFloat {
position:relative;
margin: 25px 0 0 0;
}
.textFloat h5{
font-size: 13px;
font-weight: 400;
position: absolute;
top: -10px;
background-color: white;
padding: 0;
margin: 0 20px;
}
.box {
height: 500px !important;
}
#form1 {
right: 0px;
}
#form2 {
left: 0px;
}
#form3 {
right: 0px;
}
#form4 {
right: 0px;
}
#progress {
width: 20%;
}
.btn-default.btn-on-2.active {
background-color: #00d554;
color: white;
}
.btn-default.btn-off-2.active {
background-color: #A7A7A7;
color: white;
}
.classifidedField1 {
margin: 7px;
border-radius: 15px;
border: 2px dotted #4b9082;
margin-top: 14px;
background-color: #88aba58a;
height: 90px;
}
.classifidedField1 input {
background-color: #ecfcfc !important;
}
.classifidedField1 label {
color: #0a4c53;
}
.classifidedField2 {
margin: 7px;
border: 1px solid #939393;
border-radius: 15px;
margin-top: 14px;
height: 230px;
}
.blured {
filter: blur(2px);
}
.cat {
background: #8fceb8;
padding: 7px 0px;
color: aliceblue;
width: 100.2%;
border: 1px solid #939393;
border-radius: 15px 15px 0px 0px;
position: relative;
right: -1px;
left: -6px;
top: -11px;
}
.cat1 {
padding: 7px 16px;
border-left: 1px solid #939393;
text-align: center;
}
.cat2 {
padding: 7px 140px;
border-left: 1px solid #939393;
text-align: center;
}
.cat3 {
padding: 7px 42px;
border-left: 1px solid #939393;
text-align: center;
}
.cat4 {
padding: 7px 38px;
border-left: 1px solid #939393;
text-align: center;
}
.cat5 {
padding: 7px 30px;
text-align: center;
}
.trContainer {
display: inline-block;
height: 190px;
width: 100.4%;
overflow-y: auto;
position: relative;
top: -8px;
left: 0px;
border-radius: 0px 0px 18px 18px;
}
.groupTr {
display: flex;
position: relative;
margin: 1px auto;
top: -3px;
padding: 5px 0px;
/* min-height: 44px; */
/* height: auto; */
background-color: #b8dfdf;
}
.groupTr input {
background-color: #ecfcfc !important;
}
.groupTr:nth-child(even) {
background-color: #aad5cd !important;
}
.groupTr:nth-child(even) select {
background-color: #ecfcf8 !important;
}
.groups {
width: 9.5%;
margin: 0px 5px;
text-align: center;
padding: 7px 9px;
color: #3aa892;
background: #cff3e75c;
border-radius: 8px;
}
.jobTitles {
width: 366px;
max-width: 366px;
overflow-y: hidden;
padding: 0px 3px;
z-index: 999;
}
.jobSalary {
width: 16.33%;
padding: 0px 3px;
direction: ltr;
}
.baseSalary {
width: 17%;
padding: 0px 3px;
direction: ltr;
}
.mabna {
width: 14.4%;
padding: 0px 3px;
direction: ltr;
}
.trContainer.hide-scrollbar::-webkit-scrollbar {
width: 0px;
}
.trContainer::-webkit-scrollbar {
width: 6px;
}
.trContainer::-webkit-scrollbar-track {
background-color: #3aa89200;
}
.trContainer::-webkit-scrollbar-thumb {
background-color: #3aa892;
border-radius: 10px;
}
.trContainer::-webkit-scrollbar-thumb:hover {
background-color: #1bba9a;
margin-right: 5px !important
}
.ul-search {
list-style: none;
display: revert;
width: 106%;
right: 2.6rem;
position: relative;
}
.ul-search li:last-of-type {
float: right;
}
.custom-select {
position: relative;
display: block;
width: 100%;
height: 100%;
padding: 5px 0px;
border-radius: 5px;
background-color: #fff;
text-align: left;
cursor: pointer;
border: 1px solid #ccc;
}
.options {
right: 0px !important;
border: 1px solid #0000002e;
border-top: 0;
width: 100% !important;
top: 13px;
position: relative;
z-index: 10;
margin: 0;
padding: 0;
list-style: none;
max-height: 156px;
overflow-y: scroll;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 13px;
}
.options::-webkit-scrollbar {
width: 6px;
}
.options::-webkit-scrollbar-track {
background-color: #8bd8ed42;
border-radius: 12px;
}
.options::-webkit-scrollbar-thumb {
background-color: #3159adb8;
border-radius: 12px;
}
.options::-webkit-scrollbar-thumb:hover {
background-color: #aaa;
}
.options.visible {
display: block;
}
.options li {
padding: 12px 20px 27px 20px;
box-shadow: 0 2px 2px 0 rgb(136 137 141), 0 -1px 3px 0 rgba(0, 0, 0, 0.12);
border-top: none;
background-color: #fff;
cursor: pointer;
}
.options li:hover {
background-color: #f5f5f5;
}
.input-text {
padding-right: 5px;
border: 0;
direction: rtl;
background: inherit;
}
.input-text {
width: 2.4rem;
}
.items-selected {
float: right;
border: 1px solid #a7a6a6;
background: #e5e5e5;
margin: 2px;
border-radius: 7px;
padding-right: 0px;
padding-left: 2px;
font-size: 13px;
color: #343434;
position: relative;
bottom: 3px;
}
.del-selected {
margin: 0px 4px;
color: #e11414;
font-size: 12px;
}
.select2-container .select2-search--inline {
float: right !important;
}
.name-right {
position: absolute;
right: 10px;
max-width: 23rem;
overflow: hidden;
white-space: nowrap !important;
direction: rtl;
}
.code-left {
position: absolute;
left: 10px;
}
.job-item {
position: relative;
}
.groupTr .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #f06f3d !important;
}
.groupTr .select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice {
color: #458c73 !important;
background-color: #d7f6e9 !important;
border-color: #d7f6e9 !important;
font-size: 13px !important;
}
#form5 {
display: inline-block;
}
.disabled {
filter: blur(1px);
}
</style>
@*select2 css start*@
<style>
.opt {
background-color: #f5f5f5;
border-radius: 10px;
text-align: right;
padding: 2px 5px;
text-overflow: ellipsis;
overflow-x: hidden;
width: 100%;
}
.opt:hover {
background-color: #d3f3f5 !important;
}
.selectDiv {
position: relative;
z-index: 2;
border-radius: 10px;
min-height: 20px;
max-height: 190px;
overflow: hidden scroll;
width: 100%;
background-color: rgb(255 255 255);
display: block;
box-shadow: 0px -1px 12px 0px rgba(0,0,0,.16), 2px 1px 10px 0 rgba(0,0,0,.12);
}
.selectedOption {
color: #04556a !important;
background-color: #e0f8ff !important;
}
.keyboardSelected {
color: #04556a !important;
background-color: #e0f8ff !important;
}
.handle-title {
display: flex;
align-items: center;
justify-content: space-between;
}
.handle-title a {
background-color: #1e293b;
color: #ffffff;
border-radius: 7px;
padding: 3px 5px;
font-size: 12px;
}
.handle-title a:hover {
color: #ffffff !important;
}
</style>
string adminVersion = _0_Framework.Application.Version.AdminVersion;
<link href="~/admintheme/css/workshop-create.css?ver=@adminVersion" rel="stylesheet" />
}
<div class="container">
@@ -670,11 +223,11 @@
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="form-group">
@* <div class="neighborField">
<input type="text" asp-for="ZoneName" class="neighborInput form-control">
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div> *@
<input type="text" asp-for="ZoneName" class="neighborInput form-control">
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div> *@
<div class="neighborField">
<input type="text" class="neighborInput form-control" disabled="disabled">
@@ -766,12 +319,12 @@
<div style="@(Model.HasPermissionContract ? "" : "display: none;")">
<div class="col-lg-12 col-md-12 col-xs-12">
@* <div class="" style="margin-top: 5px;">
<label>تعیین سطح دسترسی برای قرارداد </label>
<select class="form-control select-city" multiple asp-for="@Model.Command.AccountIdsList" asp-items='new SelectList(Model.Command.AccountsList, "Id", "Fullname")'>
</select>
<label>تعیین سطح دسترسی برای قرارداد </label>
<select class="form-control select-city" multiple asp-for="@Model.Command.AccountIdsList" asp-items='new SelectList(Model.Command.AccountsList, "Id", "Fullname")'>
</select>
</div> *@
<div class="" style="display: flex; align-items: center;">
<input type="checkbox" asp-for="Command.WorkshopHolidayWorking" class="form-control" style="width: 15px;margin: 0 0 0 10px;"/>
<input type="checkbox" asp-for="Command.WorkshopHolidayWorking" class="form-control" style="width: 15px;margin: 0 0 0 10px;" />
<label asp-for="Command.WorkshopHolidayWorking" style="margin: 0;">این کارگاه در ایام تعطیلات رسمی باز است</label>
</div>
</div>
@@ -828,32 +381,106 @@
</div>
</div>
<div class="col-xs-12" style="margin: 13px 0 0 0;">
<div class="card area-workshop-3">
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="createContract" asp-for="Command.CreateContract" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
ایجاد قرارداد
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="signContract" asp-for="Command.SignContract" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
امضا قرارداد
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="createCheckout" asp-for="Command.CreateCheckout" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
ایجاد تصفیه حساب
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="signCheckout" asp-for="Command.SignCheckout" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
امضا تصفیه حساب
</label>
</div>
</div>
<div class="col-xs-12 area-workshop-2">
<div class="card textFloat">
<h5 class="title-contract">لطفا مدت قرارداد خود را انتخاب کنید :</h5>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 spanBox1">
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">1 ماهه</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="1">1 ماهه</span>
</div>
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">2 ماهه</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="2">2 ماهه</span>
</div>
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">3 ماهه</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="3">3 ماهه</span>
</div>
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">6 ماهه</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="6">6 ماهه</span>
</div>
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">1 ساله</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="12">1 ساله</span>
</div>
<div>
<span class="btn btn-deactive waves-effect waves-light contractDuration">دائمی</span>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="permanent">دائمی</span>
</div>
<input type="hidden" id="asp-contract-hidden" asp-for="Command.ContractTerm" />
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<input type="hidden" id="CutContractEndOfYear" asp-for="Command.CutContractEndOfYear" />
<div style="display: flex; align-items: center; gap: 14px;">
آیا قراردادهای بالای یک ماه منتهی به پایان سال باشد یا نباشد؟
<div style="display: flex; align-items: center; gap: 15px;">
<label class="@(Model.Command.CutContractEndOfYear == IsActive.None ? "disable" : "")" style="display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; margin: 0;">
<input type="checkbox" class="form-control single-check" style="margin: 0;" value="@IsActive.True" @(Model.Command.CutContractEndOfYear == IsActive.True ? "checked" : "")/>
باشد
</label>
<label class="@(Model.Command.CutContractEndOfYear == IsActive.None ? "disable" : "")" style="display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; margin: 0;">
<input type="checkbox" class="form-control single-check" style="margin: 0;" value="@IsActive.False" @(Model.Command.CutContractEndOfYear == IsActive.False ? "checked" : "")/>
نباشد
</label>
</div>
</div>
</div>
</div>
</div>
<div class="card textFloat">
<h5>در صورت تمایل به محاسبه ی عناوین ذیل در فیش حقوقی، گزینه های موردنظر را فعال نمایید</h5>
@@ -883,11 +510,11 @@
<label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutOvertime" class="checkboxes"> <span>اضافه کار فیش حقوقی در لیست بیمه محاسبه گردد</span></label>
</div>
<div>
<label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutFamilyAllowance" class="checkboxes"><span class="m-r-5">حق عائله مندی فیش حقوقی در لیست بیمه محاسبه گردد </span></label>
<label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutFamilyAllowance" class="checkboxes"><span class="m-r-5">حق عائله مندی فیش حقوقی در لیست بیمه محاسبه گردد </span></label>
</div>
</div>
</div>
<div class="row card">
<div class="col-md-6 col-xs-12">
@@ -901,7 +528,7 @@
<div>
<label class="form-control-label"><input type="checkbox" value="Familylist" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه خانوادگی</label>
</div>
<input type="hidden" asp-for="Command.TypeOfInsuranceSend" id="asp-hidden"/>
<input type="hidden" asp-for="Command.TypeOfInsuranceSend" id="asp-hidden" />
</div>
<div class="col-md-3 col-xs-12 disabled" id="myDiv4">
<label class="input-label">کد کارگاهی بیمه</label>
@@ -998,12 +625,12 @@
<script>
$("#hasRollCall").on("click", function () {
if ($(this).is(":checked")) {
$("#hasChekoutService").removeAttr("disabled");
}else{
$("#hasChekoutService").attr("disabled", "disabled");
$("#hasChekoutService").removeAttr("disabled");
} else {
$("#hasChekoutService").attr("disabled", "disabled");
}
});
});
</script>
</div>
</div>
@@ -1161,20 +788,20 @@
</div>
<div class="col-md-12 col-sm-12 col-xs-12">
@* <div class="card">
<div class="d-flex align-items-center text-white">
<div class="header">گروه بندی</div>
<div class="header">عناوین شغلی</div>
<div class="header">مزد شغل</div>
<div class="header">مزد سنوات</div>
<div class="header">مزد مبنا</div>
</div>
<div class="d-flex align-items-center text-white">
<div class="row-col">گروه بندی</div>
<div class="row-col">عناوین شغلی</div>
<div class="row-col">مزد شغل</div>
<div class="row-col">مزد سنوات</div>
<div class="row-col">مزد مبنا</div>
</div>
<div class="d-flex align-items-center text-white">
<div class="header">گروه بندی</div>
<div class="header">عناوین شغلی</div>
<div class="header">مزد شغل</div>
<div class="header">مزد سنوات</div>
<div class="header">مزد مبنا</div>
</div>
<div class="d-flex align-items-center text-white">
<div class="row-col">گروه بندی</div>
<div class="row-col">عناوین شغلی</div>
<div class="row-col">مزد شغل</div>
<div class="row-col">مزد سنوات</div>
<div class="row-col">مزد مبنا</div>
</div>
</div> *@
</div>
@@ -1226,4 +853,4 @@
var employerIdList = Number(@Model.Command.EmployerIdList[0]);
</script>
<script src="~/AssetsAdmin/page/Workshop/js/EditWorkshopAdmin.js"></script>
<script src="~/AssetsAdmin/page/Workshop/js/EditWorkshopAdmin.js?ver=@adminVersion"></script>

View File

@@ -5,13 +5,13 @@
}
<h1>Upload File</h1>
@* <form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data">
<form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data">
<div>
<label asp-for="File">Choose a file:</label>
<input asp-for="File" type="file" required>
</div>
<button type="submit">Upload</button>
</form> *@
</form>
<form asp-page-handler="ShiftDate" id="8" method="post">

View File

@@ -233,7 +233,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);
@@ -246,7 +246,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOneMobile(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);

View File

@@ -100,7 +100,7 @@
<div class="card p-0">
<div class="card-section-btn bg-white">
<div class="content btn-group">
<a href="/apk/android" type="button" class="btn-download-android d-flex align-items-center justify-content-center">
<a href="/apk/android?@Guid.NewGuid()" type="button" class="btn-download-android d-flex align-items-center justify-content-center">
<svg width="30" height="30" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -197,7 +197,7 @@
@if (Model.HasApkToDownload)
{
<div class="d-md-none d-block" style="position: static; margin-top:100px;" id="downloadAppLogin">
<a href="/apk/android" type="button" class="btn-login d-block mx-auto w-100 text-white px-3 py-2 d-flex align-items-center">
<a href="/apk/android?@Guid.NewGuid()" type="button" class="btn-login d-block mx-auto w-100 text-white px-3 py-2 d-flex align-items-center">
<svg width="18" height="18" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -6,8 +6,11 @@
<!--<StartupObject>ServiceHost.Program</StartupObject>-->
</PropertyGroup>
<PropertyGroup>
<RazorCompileOnBuild>true</RazorCompileOnBuild>
</PropertyGroup>
<!--<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<!--<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,163 @@
table {
border-collapse: collapse;
width: 100%;
}
td, th {
border-bottom: 1px solid #cfe5e0;
font-size: 1rem;
text-align: right;
white-space: nowrap;
}
th {
padding: 1.5rem 1rem;
}
td {
padding: 1rem;
}
tbody tr {
cursor: pointer;
}
tbody tr.selected td {
background: #e0eeeb;
}
tbody tr:hover:not(.selected) td,
tbody tr.hover:not(.selected) td {
background: #f0f7f5;
}
.table-footer, .table-header {
font-size: .875rem;
}
.table-footer {
margin: -1.5rem 0 0;
}
.table-header {
margin: 0 0 1rem;
}
.table-footer.grid,
.table-header.grid {
align-items: center;
display: grid;
grid-auto-flow: column;
justify-content: space-between;
}
.border-index {
background: #dbeafe;
height: 30px;
width: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
color: #3f3f46;
}
.black {
background: #00000070
}
button:disabled,
button[disabled] {
border: 1px solid #999999 !important;
background-color: #cccccc !important;
color: #666666 !important;
}
.top-information,
.bottom-information {
padding: 0 20px;
}
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
background-color: #29cc97;
top: 14px;
width: 16px;
height: 16px;
line-height: 16px;
border: 0;
font-weight: bold;
box-shadow: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before, table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
background-color: #fec400;
}
.dataTables_wrapper {
direction: rtl;
}
.dataTables_length {
float: left;
}
.dataTables_filter {
float: right;
text-align: right;
}
#DataTables_Table_0_last {
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-right-radius: 0px;
-khtml-border-bottom-right-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-topright: 0px;
-webkit-border-top-right-radius: 0px;
-khtml-border-top-right-radius: 0px;
border-top-right-radius: 0px;
-moz-border-radius-bottomleft: 6px;
-webkit-border-bottom-left-radius: 6px;
-khtml-border-bottom-left-radius: 6px;
border-bottom-left-radius: 6px;
-moz-border-radius-topleft: 6px;
-webkit-border-top-left-radius: 6px;
-khtml-border-top-left-radius: 6px;
border-top-left-radius: 6px;
}
#DataTables_Table_0_first {
-moz-border-radius-bottomright: 6px;
-webkit-border-bottom-right-radius: 6px;
-khtml-border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px;
-moz-border-radius-topright: 6px;
-webkit-border-top-right-radius: 6px;
-khtml-border-top-right-radius: 6px;
border-top-right-radius: 6px;
-moz-border-radius-bottomleft: 0px;
-webkit-border-bottom-left-radius: 0px;
-khtml-border-bottom-left-radius: 0px;
border-bottom-left-radius: 0px;
-moz-border-radius-topleft: 0px;
-webkit-border-top-left-radius: 0px;
-khtml-border-top-left-radius: 0px;
border-top-left-radius: 0px;
}
.dataTables_info {
float: left;
}
.dataTables_paginate {
float: right;
text-align: right;
}
div.dataTables_wrapper div.dataTables_paginate ul.pagination {
padding: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details {
width: 100%;
}

View File

@@ -0,0 +1,412 @@
class CheckboxNode {
constructor(id) {
this.id = id;
this.checkbox = document.getElementById(id);
this.children = [];
this.parents = [];
if (this.checkbox) {
this.checkbox.addEventListener("change", () => this.handleChange());
}
}
addChild(childNode) {
this.children.push(childNode);
childNode.parents.push(this);
}
setChecked(value) {
this.checkbox.checked = value;
}
isChecked() {
return this.checkbox.checked;
}
hasActiveParents() {
return this.parents.some(p => p.isChecked());
}
handleChange() {
if (this.isChecked()) {
// اگه تیک زد (یعنی نمی‌خوای انجامش بدی) → بقیه هم باید انجام نشن
this.children.forEach(child => {
if (!child.isChecked()) {
child.setChecked(true);
child.handleChange();
}
});
} else {
// اگه تیک رو برداشتی (یعنی می‌خوای انجامش بدی) → فقط اگه والد هنوز تیک داره، نمی‌تونی
this.parents.forEach(parent => {
if (parent.isChecked()) {
parent.setChecked(false);
parent.handleChange();
}
});
// حالا بچه‌ها باید بررسی کنن که دیگه هیچ والد فعالی ندارن
this.children.forEach(child => {
if (!child.hasActiveParents() && child.isChecked()) {
child.setChecked(false);
child.handleChange();
}
});
}
}
}
$(document).ready(function () {
$('#responsive-data-table').DataTable({
"alengthMenu": [["All", 10, 50, 100, -1], ["All", 10, 50, 100, "All"]],
"order": [[0, 'asc']],
"dom": '<"row justify-content-between top-information"lf>rt<"row justify-content-between bottom-information"ip><"clear">',
"language": {
"emptyTable": "هیچ داده‌ای در جدول وجود ندارد",
"info": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
"infoEmpty": "نمایش 0 تا 0 از 0 ردیف",
"infoFiltered": "(فیلتر شده از _MAX_ ردیف)",
"infoThousands": ",",
"lengthMenu": "نمایش _MENU_ ردیف",
"processing": "در حال پردازش...",
"search": "جستجو:",
"zeroRecords": "رکوردی با این مشخصات پیدا نشد",
"paginate": {
"next": "بعدی",
"previous": "قبلی",
"first": "ابتدا",
"last": "انتها"
},
"aria": {
"sortAscending": ": فعال سازی نمایش به صورت صعودی",
"sortDescending": ": فعال سازی نمایش به صورت نزولی"
},
"autoFill": {
"cancel": "انصراف",
"fill": "پر کردن همه سلول ها با ساختار سیستم",
"fillHorizontal": "پر کردن سلول به صورت افقی",
"fillVertical": "پرکردن سلول به صورت عمودی"
},
"buttons": {
"collection": "مجموعه",
"colvis": "قابلیت نمایش ستون",
"colvisRestore": "بازنشانی قابلیت نمایش",
"copy": "کپی",
"copySuccess": {
"1": "یک ردیف داخل حافظه کپی شد",
"_": "%ds ردیف داخل حافظه کپی شد"
},
"copyTitle": "کپی در حافظه",
"pageLength": {
"-1": "نمایش همه ردیف‌ها",
"_": "نمایش %d ردیف",
"1": "نمایش 1 ردیف"
},
"print": "چاپ",
"copyKeys": "برای کپی داده جدول در حافظه سیستم کلید های ctrl یا ⌘ + C را فشار دهید",
"csv": "فایل CSV",
"pdf": "فایل PDF",
"renameState": "تغییر نام",
"updateState": "به روز رسانی",
"excel": "فایل اکسل",
"createState": "ایجاد وضعیت جدول",
"removeAllStates": "حذف همه وضعیت ها",
"removeState": "حذف",
"savedStates": "وضعیت های ذخیره شده",
"stateRestore": "بازگشت به وضعیت %d"
},
"searchBuilder": {
"add": "افزودن شرط",
"button": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"clearAll": "خالی کردن همه",
"condition": "شرط",
"conditions": {
"date": {
"after": "بعد از",
"before": "بعد از",
"between": "میان",
"empty": "خالی",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"number": {
"between": "میان",
"empty": "خالی",
"gt": "بزرگتر از",
"gte": "برابر یا بزرگتر از",
"lt": "کمتر از",
"lte": "برابر یا کمتر از",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"string": {
"contains": "حاوی",
"empty": "خالی",
"endsWith": "به پایان می رسد با",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"startsWith": "شروع شود با",
"notContains": "نباشد حاوی",
"notEndsWith": "پایان نیابد با",
"notStartsWith": "شروع نشود با",
"equals": "برابر باشد با"
},
"array": {
"empty": "خالی",
"contains": "حاوی",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"without": "بدون",
"equals": "برابر باشد با"
}
},
"data": "اطلاعات",
"logicAnd": "و",
"logicOr": "یا",
"title": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"value": "مقدار",
"deleteTitle": "حذف شرط فیلتر",
"leftTitle": "شرط بیرونی",
"rightTitle": "شرط فرورفتگی"
},
"select": {
"cells": {
"1": "1 سلول انتخاب شد",
"_": "%d سلول انتخاب شد"
},
"columns": {
"1": "یک ستون انتخاب شد",
"_": "%d ستون انتخاب شد"
},
"rows": {
"1": "1ردیف انتخاب شد",
"_": "%d انتخاب شد"
}
},
"thousands": ",",
"searchPanes": {
"clearMessage": "همه را پاک کن",
"collapse": {
"0": "صفحه جستجو",
"_": "صفحه جستجو (٪ d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "صفحه جستجو وجود ندارد",
"loadMessage": "در حال بارگیری صفحات جستجو ...",
"title": "فیلترهای فعال - %d",
"showMessage": "نمایش همه",
"collapseMessage": "بستن همه"
},
"loadingRecords": "در حال بارگذاری...",
"datetime": {
"previous": "قبلی",
"next": "بعدی",
"hours": "ساعت",
"minutes": "دقیقه",
"seconds": "ثانیه",
"amPm": [
"صبح",
"عصر"
],
"months": {
"0": "ژانویه",
"1": "فوریه",
"10": "نوامبر",
"4": "می",
"8": "سپتامبر",
"11": "دسامبر",
"3": "آوریل",
"9": "اکتبر",
"7": "اوت",
"2": "مارس",
"5": "ژوئن",
"6": "ژوئیه"
},
"unknown": "-",
"weekdays": [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه"
]
},
"editor": {
"close": "بستن",
"create": {
"button": "جدید",
"title": "ثبت جدید",
"submit": "ایجــاد"
},
"edit": {
"button": "ویرایش",
"title": "ویرایش",
"submit": "به روز رسانی"
},
"remove": {
"button": "حذف",
"title": "حذف",
"submit": "حذف",
"confirm": {
"_": "آیا از حذف %d خط اطمینان دارید؟",
"1": "آیا از حذف یک خط اطمینان دارید؟"
}
},
"multi": {
"restore": "واگرد",
"noMulti": "این ورودی را می توان به صورت جداگانه ویرایش کرد، اما نه بخشی از یک گروه",
"title": "مقادیر متعدد",
"info": "مقادیر متعدد"
},
"error": {
"system": "خطایی رخ داده (اطلاعات بیشتر)"
}
},
"decimal": ".",
"stateRestore": {
"creationModal": {
"button": "ایجاد",
"columns": {
"search": "جستجوی ستون",
"visible": "وضعیت نمایش ستون"
},
"name": "نام:",
"order": "مرتب سازی",
"paging": "صفحه بندی",
"search": "جستجو",
"select": "انتخاب",
"title": "ایجاد وضعیت جدید",
"toggleLabel": "شامل:",
"scroller": "موقعیت جدول (اسکرول)",
"searchBuilder": "صفحه جستجو"
},
"emptyError": "نام نمیتواند خالی باشد.",
"removeConfirm": "آیا از حذف %s مطمئنید؟",
"removeJoiner": "و",
"renameButton": "تغییر نام",
"renameLabel": "نام جدید برای $s :",
"duplicateError": "وضعیتی با این نام از پیش ذخیره شده.",
"emptyStates": "هیچ وضعیتی ذخیره نشده",
"removeError": "حذف با خطا موماجه شد",
"removeSubmit": "حذف وضعیت",
"removeTitle": "حذف وضعیت جدول",
"renameTitle": "تغییر نام وضعیت"
}
}
});
$(document).on('change', '.tableFindBtn', function () {
$(this).find(".save").prop("disabled", false);
});
//function handleCheckboxLogic1(employeeId) {
// const $createContract = $(`#FailureCreateContract_${employeeId}`);
// const $signContract = $(`#FailureSignContract_${employeeId}`);
// const $createCheckout = $(`#FailureCreateCheckout_${employeeId}`);
// const $signCheckout = $(`#FailureSignCheckout_${employeeId}`);
// const isFailureCreateContract = $createContract.is(':checked');
// const isFailureCreateCheckout = $createCheckout.is(':checked');
// if (isFailureCreateContract) {
// $signContract.prop('checked', true);
// $createCheckout.prop('checked', true);
// $signCheckout.prop('checked', true);
// } else {
// //$createCheckout.prop('checked', false);
// if (isFailureCreateCheckout) {
// $signCheckout.prop('checked', true);
// }
// }
//}
//$('[id^="FailureCreateContract_"], [id^="FailureSignContract_"], [id^="FailureCreateCheckout_"], [id^="FailureSignCheckout_"]').on('change', function () {
// const employeeId = this.id.split('_')[1];
// handleCheckboxLogic1(employeeId);
//});
//$('[id^="FailureCreateContract_"]').each(function () {
// const employeeId = this.id.split('_')[1];
// handleCheckboxLogic1(employeeId);
//});
$('[id^="FailureCreateContract_"]').each(function () {
const employeeId = this.id.split('_')[1];
const $notCreateContract = document.getElementById(`FailureCreateContract_${employeeId}`);
const $notSignContract = document.getElementById(`FailureSignContract_${employeeId}`);
const $notCreateCheckout = document.getElementById(`FailureCreateCheckout_${employeeId}`);
const $notSignCheckout = document.getElementById(`FailureSignCheckout_${employeeId}`);
$notCreateContract.addEventListener("change", () => handler());
$notSignContract.addEventListener("change", () => handler());
$notCreateCheckout.addEventListener("change", () => handler());
$notSignCheckout.addEventListener("change", () => handler());
//// تعریف روابط
//$createContract.addChild($signContract);
//$createContract.addChild($createCheckout);
//$createCheckout.addChild($signCheckout);
function handler() {
if ($notCreateContract.checked) {
$notSignContract.checked = true;
$notCreateCheckout.checked = true;
}
if ($notCreateCheckout.checked) {
$notSignCheckout.checked = true;
}
}
});
});
function save(EmployeeId) {
var command = {};
command.WorkshopId = Number($("#workshopId").val());
command.EmployeeId = Number(EmployeeId);
command.ComputeOptions = $('[data-ComputeOptions="' + EmployeeId + '"]').val();
command.BonusesOptions = $('[data-BonusesOptions="' + EmployeeId + '"]').val();
command.YearsOptions = $('[data-YearsOptions="' + EmployeeId + '"]').val();
command.CreateContract = !$(`#FailureCreateContract_${EmployeeId}`).prop("checked");
command.SignContract = !$(`#FailureSignContract_${EmployeeId}`).prop("checked");
command.CreateCheckout = !$(`#FailureCreateCheckout_${EmployeeId}`).prop("checked");
command.SignCheckout = !$(`#FailureSignCheckout_${EmployeeId}`).prop("checked");
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: saveCreateUrl,
data: command,
headers: { "RequestVerificationToken": AntiForgeryToken },
success: function (response) {
if (response.isSuccedded) {
command = {};
console.log()
$('[data-save="' + EmployeeId + '"]').prop("disabled", true);
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
} else {
command = {};
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
console.log(5, response);
}
});
}

View File

@@ -0,0 +1,103 @@
if ($(window).width() < 992) {
Webcam.set({
width: 1800,
height: 1800,
// final cropped size
// crop_width: 296,
// crop_height: 396,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "300px",
});
demoVideo.css({
width: "300px",
height: "300px",
});
} else {
Webcam.set({
width: 600,
height: 600,
image_format: 'jpeg',
jpeg_quality: 100
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "400px",
});
demoVideo.css({
width: "300px",
height: "400px",
});
}
function take_snapshot1() {
Webcam.snap(function (data_uri) {
document.getElementById('result1').innerHTML = '<img style="display:none;" id="pic1" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
document.getElementById('demoResult1').innerHTML = '<img style="width: 300px; height: 300px;" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
});
}
function take_snapshot2() {
Webcam.snap(function (data_uri) {
document.getElementById('result2').innerHTML = '<img style="display:none;" id="pic2" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
document.getElementById('demoResult2').innerHTML = '<img style="width: 300px; height: 300px;" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
});
}
function set() {
let pic1 = $("#pic1").attr('src');
let pic2 = $("#pic2").attr('src');
let workshopId = Number($('#workshopId').val());
let employeeId = Number($('#employeeId').val());
if (pic1 != null && pic2 != null) {
$.ajax({
// async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'POST',
url: '@Url.Page("./Index", "TakePicture")',
data: { "base64pic1": pic1, "base64pic2": pic2, "workshopId": workshopId, "employeeId": employeeId },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function (response) {
if (response.isSuccedded) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "ok");
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "not");
}
},
failure: function (response) {
console.log(5, response);
}
});
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "گرفتن دو عکس الزامیست");
}
}

View File

@@ -1635,3 +1635,56 @@ function checkEnValid(fixDate1) {
}
$(document).ready(function () {
$('.real-checkbox').on('change', function () {
const $CreateContract = $('[data-role="createContract"]');
const $SignContract = $('[data-role="signContract"]');
const $CreateCheckout = $('[data-role="createCheckout"]');
const $SignCheckout = $('[data-role="signCheckout"]');
if (!$CreateContract.is(':checked')) {
$SignContract.prop('checked', false);
$CreateCheckout.prop('checked', false);
}
if (!$CreateCheckout.is(':checked')) {
$SignCheckout.prop('checked', false);
}
});
$(".single-check").click(function () {
if ($(this).is(":checked")) {
$(".single-check").not(this).prop("checked", false);
$('#CutContractEndOfYear').val($(this).val());
} else {
$('#CutContractEndOfYear').val('None');
}
});
});
$(document).on('change', '.checkbox-colored', function () {
if ($(this).is(':checked')) {
$(this).addClass('checked');
} else {
$(this).removeClass('checked');
}
});
$(document).on('click', '.contractDuration', function () {
const duration = $(this).data('duration');
$('.contractDuration').removeClass('btn-active').addClass('btn-deactive');
$(this).removeClass('btn-deactive').addClass('btn-active');
const $checkboxes = $('label:contains("باشد") input[type="checkbox"], label:contains("نباشد") input[type="checkbox"]');
if (duration == 1) {
$checkboxes.prop('disabled', true).prop('checked', false);
$checkboxes.closest('label').addClass('disable');
$('#CutContractEndOfYear').val('None');
} else {
$checkboxes.prop('disabled', false);
$checkboxes.closest('label').removeClass('disable');
}
});

View File

@@ -3,7 +3,8 @@
.sidebar-menu {
display: flex;
flex-direction: column;
height: 100vh;
/* height: 100vh;*/
height: 100%;
}
.sidebar-navigation {

View File

@@ -554,6 +554,10 @@ video {
display: none;
}
.tw-col-span-1 {
grid-column: span 1 / span 1;
}
.tw-col-span-2 {
grid-column: span 2 / span 2;
}
@@ -571,10 +575,14 @@ video {
margin-bottom: 0.5rem;
}
.tw-mb-3 {
margin-bottom: 0.75rem;
.tw-mb-4 {
margin-bottom: 1rem;
}
.tw-mb-\[3px\] {
margin-bottom: 3px;
.tw-mt-0 {
margin-top: 0px;
}
@@ -595,6 +603,8 @@ video {
display: none;
}
.tw-h-\[20px\] {
height: 20px;
.tw-h-\[25px\] {
height: 25px;
}
@@ -603,30 +613,54 @@ video {
height: 35px;
}
.tw-h-full {
height: 100%;
}
.tw-w-\[10\%\] {
width: 10%;
}
.tw-w-\[100\%\] {
width: 100%;
.tw-w-\[13\%\] {
width: 13%;
}
.tw-w-\[14\%\] {
width: 14%;
}
.tw-w-\[15\%\] {
width: 15%;
}
.tw-w-\[18\%\] {
width: 18%;
.tw-w-\[25px\] {
width: 25px;
}
.tw-w-\[2\%\] {
width: 2%;
.tw-w-\[3\%\] {
width: 3%;
}
.tw-w-\[20\%\] {
width: 20%;
}
.tw-w-\[25\%\] {
width: 25%;
}
.tw-w-\[35\%\] {
width: 35%;
}
.tw-w-\[40\%\] {
width: 40%;
.tw-w-\[4\%\] {
width: 4%;
}
@@ -639,10 +673,26 @@ video {
width: 50%;
}
.tw-w-\[58px\] {
width: 58px;
}
.tw-w-\[7\%\] {
width: 7%;
}
.tw-w-\[70\%\] {
width: 70%;
}
.tw-w-\[8\%\] {
width: 8%;
}
.tw-w-\[95\%\] {
width: 95%;
}
.tw-w-\[97\%\] {
width: 97%;
}
@@ -656,6 +706,18 @@ video {
width: max-content;
}
.tw-w-60 {
width: 15rem;
}
.tw-w-\[30\%\] {
width: 30%;
}
.tw-cursor-pointer {
cursor: pointer;
}
.tw-grid-cols-12 {
grid-template-columns: repeat(12, minmax(0, 1fr));
}
@@ -684,6 +746,14 @@ video {
justify-content: center;
}
.tw-justify-between {
justify-content: space-between;
}
.tw-gap-1 {
gap: 0.25rem;
}
.tw-gap-2 {
gap: 0.5rem;
}
@@ -700,6 +770,14 @@ video {
gap: 10rem;
}
.tw-gap-5 {
gap: 1.25rem;
}
.tw-gap-6 {
gap: 1.5rem;
}
.tw-overflow-x-auto {
overflow-x: auto;
}
@@ -714,6 +792,8 @@ video {
white-space: nowrap;
}
.tw-rounded-\[15px\] {
border-radius: 15px;
.tw-rounded-\[10px\] {
border-radius: 10px;
}
@@ -722,12 +802,14 @@ video {
border-radius: 5px;
}
.tw-bg-\[\#3B73D0\] {
.tw-rounded-full {
border-radius: 9999px;
}
.tw-bg-\[\#2090C2\] {
--tw-bg-opacity: 1;
background-color: rgb(59 115 208 / var(--tw-bg-opacity, 1));
background-color: rgb(32 144 194 / var(--tw-bg-opacity, 1));
}
@@ -741,18 +823,24 @@ video {
background-color: rgb(69 77 92 / var(--tw-bg-opacity, 1));
}
.tw-bg-\[\#DFF0FF\] {
.tw-bg-\[\#84CC16\] {
--tw-bg-opacity: 1;
background-color: rgb(223 240 255 / var(--tw-bg-opacity, 1));
background-color: rgb(132 204 22 / var(--tw-bg-opacity, 1));
}
.tw-bg-blue-500 {
.tw-bg-\[\#84D500\] {
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));
background-color: rgb(132 213 0 / var(--tw-bg-opacity, 1));
}
.tw-bg-white {
.tw-bg-\[\#ADE7F2\] {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
background-color: rgb(173 231 242 / var(--tw-bg-opacity, 1));
}
@@ -766,21 +854,27 @@ video {
background-color: rgb(255 135 152 / var(--tw-bg-opacity, 1));
}
.tw-bg-\[\#BABDBF\] {
.tw-bg-\[\#b1c3c3\] {
--tw-bg-opacity: 1;
background-color: rgb(186 189 191 / var(--tw-bg-opacity, 1));
background-color: rgb(177 195 195 / var(--tw-bg-opacity, 1));
}
.tw-bg-\[\#DDF4F4\] {
.tw-bg-\[\#ddf4f4\] {
--tw-bg-opacity: 1;
background-color: rgb(221 244 244 / var(--tw-bg-opacity, 1));
}
.tw-bg-\[\#ECFFFF\] {
.tw-bg-\[\#ecffff\] {
--tw-bg-opacity: 1;
background-color: rgb(236 255 255 / var(--tw-bg-opacity, 1));
}
.tw-bg-\[linear-gradient\(180deg\,_\#41D1D1_0\%\,_\#2CD0D0_100\%\)\] {
background-image: linear-gradient(180deg, #41D1D1 0%, #2CD0D0 100%);
.tw-bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
@@ -790,6 +884,8 @@ video {
padding: 1rem;
}
.tw-p-2 {
padding: 0.5rem;
.tw-p-\[4px\] {
padding: 4px;
}
@@ -799,6 +895,9 @@ video {
padding-right: 0.5rem;
}
.tw-px-4 {
padding-left: 1rem;
padding-right: 1rem;
.tw-px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
@@ -817,18 +916,41 @@ video {
text-align: right;
}
.tw-text-start {
text-align: start;
}
.tw-text-end {
text-align: end;
}
.tw-text-\[10px\] {
font-size: 10px;
}
.tw-text-\[12px\] {
font-size: 12px;
}
.tw-text-\[14px\] {
font-size: 14px;
}
.tw-text-\[16px\] {
font-size: 16px;
}
.tw-text-\[8px\] {
font-size: 8px;
}
.tw-text-xs {
font-size: 0.75rem;
line-height: 1rem;
}
.tw-text-\[13px\] {
font-size: 13px;
.tw-text-\[18px\] {
font-size: 18px;
}
@@ -841,11 +963,19 @@ video {
font-weight: 500;
}
.tw-font-\[600\] {
font-weight: 600;
}
.tw-ordinal {
--tw-ordinal: ordinal;
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.tw-leading-\[20px\] {
line-height: 20px;
}
.tw-text-green-500 {
--tw-text-opacity: 1;
color: rgb(34 197 94 / var(--tw-text-opacity, 1));
@@ -856,24 +986,88 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}
.tw-transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
.tw-transition-all {
transition-property: all;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.tw-delay-150 {
transition-delay: 150ms;
}
.tw-duration-300 {
transition-duration: 300ms;
}
.tw-ease-in-out {
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.even\:tw-bg-\[\#D1E9FF\]:nth-child(even) {
--tw-bg-opacity: 1;
background-color: rgb(209 233 255 / var(--tw-bg-opacity, 1));
}
.hover\:tw-bg-\[\#C9F0F0\]:hover {
--tw-bg-opacity: 1;
background-color: rgb(201 240 240 / var(--tw-bg-opacity, 1));
}
@media (min-width: 768px) {
.md\:tw-col-span-2 {
grid-column: span 2 / span 2;
.hover\:tw-bg-\[\#bbc6c6\]:hover {
--tw-bg-opacity: 1;
background-color: rgb(187 198 198 / var(--tw-bg-opacity, 1));
}
}
@media (min-width: 768px) {
.md\:tw-block {
display: block;
}
.md\:tw-hidden {
display: none;
}
.md\:tw-h-\[28px\] {
height: 28px;
}
.md\:tw-w-\[98px\] {
width: 98px;
}
.md\:tw-grid-cols-12 {
grid-template-columns: repeat(12, minmax(0, 1fr));
}
.md\:tw-text-\[14px\] {
font-size: 14px;
}
.md\:tw-text-\[20px\] {
font-size: 20px;
}
.md\:tw-text-\[13px\] {
font-size: 13px;
}
.md\:tw-font-\[400\] {
font-weight: 400;
}
.md\:tw-font-\[600\] {
font-weight: 600;
}
.md\:tw-leading-\[28px\] {
line-height: 28px;
}
}

File diff suppressed because one or more lines are too long