Compare commits
79 Commits
Feature/Ma
...
Feature/Re
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fa49a4988 | |||
|
|
99e807fa23 | ||
|
|
2ce17dcac9 | ||
|
|
233c1a3aa9 | ||
|
|
43c56aa4a1 | ||
|
|
349c374ca3 | ||
|
|
c81cafa228 | ||
|
|
c0e438aa6d | ||
|
|
37cd07c2b8 | ||
|
|
6201492879 | ||
|
|
fc43e97cc4 | ||
|
|
eeea868c05 | ||
|
|
140adb2588 | ||
|
|
afb07aa90f | ||
|
|
ee2adf1c13 | ||
|
|
986092135f | ||
|
|
489528d076 | ||
|
|
ab2c1124ca | ||
|
|
bc36d8e151 | ||
|
|
f7f44b98fb | ||
|
|
8aa8ffe8c8 | ||
|
|
5a8bccb98f | ||
|
|
3c73a277ce | ||
|
|
75da32167e | ||
|
|
d99e69fa5b | ||
|
|
d90e01d733 | ||
|
|
5f71cf829b | ||
|
|
da738054df | ||
|
|
521aa9b6ee | ||
|
|
bb2802002a | ||
|
|
2049d8b2eb | ||
|
|
2c6a39bf67 | ||
|
|
88a0552a07 | ||
|
|
429b9aad27 | ||
|
|
60052f6cd2 | ||
|
|
c7ac3ac7cb | ||
|
|
48f7a7f975 | ||
|
|
e0793bc300 | ||
|
|
601511ef77 | ||
|
|
020b46f911 | ||
|
|
ac1bb05515 | ||
|
|
2a8d2d5581 | ||
|
|
71c55cd779 | ||
|
|
3c8f212825 | ||
|
|
73feb3dd78 | ||
|
|
8d175920d5 | ||
|
|
6857ba6bc1 | ||
|
|
a9c2f09f9e | ||
|
|
22b722e3dc | ||
|
|
c168843afc | ||
|
|
1b7af456b0 | ||
|
|
51291d6de7 | ||
|
|
97ac0e440c | ||
|
|
586f0a29c2 | ||
|
|
a620872de1 | ||
|
|
cebb525968 | ||
|
|
666964609d | ||
|
|
5ef277d604 | ||
|
|
802f9a39c5 | ||
|
|
8cc26936cd | ||
|
|
b0293bf25c | ||
|
|
5b97f79fbd | ||
|
|
a9c5c8f8ca | ||
|
|
9e60c12212 | ||
|
|
ff339b9eee | ||
|
|
86c7113987 | ||
|
|
552ee74d56 | ||
|
|
fbf367677c | ||
|
|
612dd99bfe | ||
|
|
3a6f87eaca | ||
|
|
fb2f7ba7c1 | ||
|
|
5daa36cfb5 | ||
|
|
62502fcede | ||
|
|
4022a1afd8 | ||
|
|
86cd776c4d | ||
|
|
ec277629fb | ||
|
|
01f06530c7 | ||
|
|
faeb297f5c | ||
|
|
c3457881b0 |
@@ -41,6 +41,23 @@ public static class Tools
|
||||
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="monthPlus"></param>
|
||||
/// <returns></returns>
|
||||
public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
|
||||
{
|
||||
|
||||
int startYear = Convert.ToInt32(startDate.Substring(0, 4));
|
||||
int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
|
||||
int startDay = Convert.ToInt32(startDate.Substring(8, 2));
|
||||
var start = new PersianDateTime(startYear, startMonth, startDay);
|
||||
var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
|
||||
return ($"{end}".ToGeorgianDateTime(), $"{end}");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
|
||||
@@ -889,30 +906,39 @@ public static class Tools
|
||||
string result = "";
|
||||
switch (value)
|
||||
{
|
||||
case "1":
|
||||
case "01":
|
||||
result = "فروردین";
|
||||
break;
|
||||
case "2":
|
||||
case "02":
|
||||
result = "اردیبهشت";
|
||||
break;
|
||||
case "3":
|
||||
case "03":
|
||||
result = "خرداد";
|
||||
break;
|
||||
case "4":
|
||||
case "04":
|
||||
result = "تیر";
|
||||
break;
|
||||
case "5":
|
||||
case "05":
|
||||
result = "مرداد";
|
||||
break;
|
||||
case "6":
|
||||
case "06":
|
||||
result = "شهریور";
|
||||
break;
|
||||
case "7":
|
||||
case "07":
|
||||
result = "مهر";
|
||||
break;
|
||||
case "8":
|
||||
case "08":
|
||||
result = "آبان";
|
||||
break;
|
||||
case "9":
|
||||
case "09":
|
||||
result = "آذر";
|
||||
break;
|
||||
@@ -1408,6 +1434,8 @@ public static class Tools
|
||||
|
||||
if (@char == char.Parse("ي"))
|
||||
res += "ی";
|
||||
else if (@char == char.Parse("ك"))
|
||||
res += "ک";
|
||||
else
|
||||
res += @char;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,16 @@ namespace Company.Domain.CheckoutAgg;
|
||||
|
||||
public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
{
|
||||
/// <summary>
|
||||
/// چک میکند که آیا پرسنل در سال و ماه درخواستی در این کارگاه فیش حقوقی دارد یا خیر
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeId"></param>
|
||||
/// <param name="سال به صورت رشته عددی"></param>
|
||||
/// <param name="ماه بصورت رشته عددی"></param>
|
||||
/// <returns></returns>
|
||||
(bool hasChekout, double FamilyAlloance, double OverTimePay) HasCheckout(long workshopId, long employeId,
|
||||
string year, string month);
|
||||
EditCheckout GetDetails(long id);
|
||||
|
||||
void CreateCkeckout(Checkout command);
|
||||
|
||||
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public class ContactUs:EntityBase
|
||||
{
|
||||
public ContactUs(string firstName, string lastName, string email, string phoneNumber, string title, string message)
|
||||
{
|
||||
FirstName = firstName.Trim();
|
||||
LastName = lastName.Trim();
|
||||
Email = email;
|
||||
PhoneNumber = phoneNumber;
|
||||
Title = title;
|
||||
Message = message;
|
||||
FullName = FirstName + " " + LastName;
|
||||
}
|
||||
|
||||
public string FirstName { get; private set; }
|
||||
public string LastName { get; private set; }
|
||||
public string Email { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
|
||||
}
|
||||
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public interface IContactUsRepository : IRepository<long, ContactUs>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public class EmployeeInsurancListData : EntityBase
|
||||
{
|
||||
public EmployeeInsurancListData(long insuranceListId, long employeeId, int workingDays, double dailyWage, double monthlySalary,
|
||||
double monthlyBenefits, double monthlyBenefitsIncluded, double benefitsIncludedContinuous, double benefitsIncludedNonContinuous,
|
||||
double insuranceShare, DateTime startWorkDate, DateTime? leftWorkDate, long jobId,bool includeStatus, double baseYears, double marriedAllowance)
|
||||
double insuranceShare, DateTime startWorkDate, DateTime? leftWorkDate, long jobId,bool includeStatus, double baseYears, double marriedAllowance, double overTimePay, double familyAllowance)
|
||||
{
|
||||
InsuranceListId = insuranceListId;
|
||||
EmployeeId = employeeId;
|
||||
@@ -30,6 +30,8 @@ public class EmployeeInsurancListData : EntityBase
|
||||
IncludeStatus = includeStatus;
|
||||
BaseYears = baseYears;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
OverTimePay = overTimePay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
DailyWagePlusBaseYears = dailyWage + baseYears;
|
||||
}
|
||||
|
||||
@@ -110,10 +112,20 @@ public class EmployeeInsurancListData : EntityBase
|
||||
/// </summary>
|
||||
public double MarriedAllowance { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اضافه کار فیش حقوقی
|
||||
/// </summary>
|
||||
public double OverTimePay { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// حق اولاد فیش حقوقی
|
||||
/// </summary>
|
||||
public double FamilyAllowance { get; private set; }
|
||||
|
||||
|
||||
public void Edit(int workingDays, double dailyWage, double monthlySalary, double monthlyBenefits, double monthlyBenefitsIncluded,
|
||||
double benefitsIncludedContinuous, double benefitsIncludedNonContinuous, double insuranceShare, DateTime startWorkDate,
|
||||
DateTime? leftWorkDate, long jobId, bool includeStatus, double baseYears, double marriedAllowance)
|
||||
DateTime? leftWorkDate, long jobId, bool includeStatus, double baseYears, double marriedAllowance, double overTimePay, double familyAllowance)
|
||||
{
|
||||
|
||||
WorkingDays = workingDays;
|
||||
@@ -130,6 +142,8 @@ public class EmployeeInsurancListData : EntityBase
|
||||
IncludeStatus= includeStatus;
|
||||
BaseYears = baseYears;
|
||||
MarriedAllowance = marriedAllowance;
|
||||
OverTimePay = overTimePay;
|
||||
FamilyAllowance = familyAllowance;
|
||||
DailyWagePlusBaseYears = dailyWage + baseYears;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Drawing.Chart;
|
||||
using System.Collections;
|
||||
|
||||
namespace Company.Domain.RollCallAgg.DomainService;
|
||||
|
||||
@@ -25,11 +26,15 @@ public interface IRollCallDomainService
|
||||
long workshopId);
|
||||
|
||||
TimeOnly GetEmployeeOffSetForRegularSettings(long employeeId, long workshopId);
|
||||
DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId, DateTime rollCallStartDate,DateTime rollCallEndDate);
|
||||
DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId, DateTime rollCallStartDate, DateTime rollCallEndDate);
|
||||
|
||||
void CalculateTimeDifferences(RollCall rollCall);
|
||||
|
||||
(DateTime start, DateTime end) FindRotatingShift(DateTime startRollCall, DateTime endRollCall, ICollection<CustomizeRotatingShift> rotatingShifts);
|
||||
(DateTime start, DateTime end) FindRotatingShift(List<(DateTime StartDate, DateTime EndDate)> rollcalls, ICollection<CustomizeRotatingShift> rotatingShifts);
|
||||
|
||||
BreakTime GetBreakTime(long employeeId, long workshopId);
|
||||
|
||||
}
|
||||
|
||||
public class RollCallDomainService : IRollCallDomainService
|
||||
@@ -173,16 +178,16 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
}
|
||||
|
||||
public DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId,
|
||||
DateTime rollCallStartDate,DateTime rollCallEndDate)
|
||||
DateTime rollCallStartDate, DateTime rollCallEndDate)
|
||||
{
|
||||
var shiftDetails = GetEmployeeShiftDetails(employeeId, workshopId);
|
||||
|
||||
|
||||
var offset = GetEmployeeOffSetForRegularSettings(employeeId, workshopId);
|
||||
|
||||
return shiftDetails.shiftType switch
|
||||
{
|
||||
WorkshopShiftStatus.Regular => CalculateRegularShiftDate(rollCallStartDate, offset),
|
||||
WorkshopShiftStatus.Rotating => FindRotatingShift(rollCallStartDate,rollCallEndDate,shiftDetails.rotatingShifts).start.Date,
|
||||
WorkshopShiftStatus.Rotating => FindRotatingShift(rollCallStartDate, rollCallEndDate, shiftDetails.rotatingShifts).start.Date,
|
||||
WorkshopShiftStatus.Irregular => rollCallStartDate.Date,
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
@@ -216,6 +221,7 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
rollCalls.Remove(deletedRollCall);
|
||||
rollCalls.Add(rollCall);
|
||||
|
||||
rollCall.ClearTimeDiff();
|
||||
switch (shiftDetails.shiftType)
|
||||
{
|
||||
case WorkshopShiftStatus.Regular:
|
||||
@@ -256,7 +262,8 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
var lateEntryRollCall = rollCallsInShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate > employeeShift.start);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var previousShift = employeeShifts.OrderByDescending(x => x.start)
|
||||
.FirstOrDefault(x => x.end < employeeShift.start);
|
||||
@@ -299,8 +306,6 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
var lateExitRollCall = rollCallsInShift.OrderBy(x => x.EndDate).FirstOrDefault(x => x.EndDate > employeeShift.end);
|
||||
|
||||
|
||||
|
||||
// تعجیل در خروج - زود رفتن
|
||||
var nextShift = employeeShifts.OrderBy(x => x.start)
|
||||
.FirstOrDefault(x => x.start > employeeShift.end);
|
||||
@@ -353,7 +358,9 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
var rotatingShifts = shiftDetails.rotatingShifts;
|
||||
|
||||
var shift = FindRotatingShift(starDateTime, endDateTime, rotatingShifts);
|
||||
var rollCallStartEnds = rollCalls.Select(x => (x.StartDate.Value, x.EndDate.Value)).ToList();
|
||||
|
||||
var shift = FindRotatingShift(rollCallStartEnds, rotatingShifts);
|
||||
|
||||
var rotatingShiftStart = shift.start;
|
||||
var rotatingShiftEnd = shift.end;
|
||||
@@ -373,8 +380,8 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
var earlyEntryRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate < shift.start);
|
||||
|
||||
var lateEntryRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate > shift.start);
|
||||
|
||||
|
||||
//برای خالی کردن اولیه حضور غیاب انتخاب شده
|
||||
earlyEntryRollCallRotating?.SetEarlyEnter(TimeSpan.Zero);
|
||||
|
||||
if (earlyEntryRollCallRotating != null)
|
||||
{
|
||||
@@ -403,9 +410,10 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
var earlyExitRollCallRotating = rollCallsInRotatingShift.OrderByDescending(x => x.EndDate).FirstOrDefault(x => x.EndDate < shift.end);
|
||||
|
||||
var lateExitRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.EndDate).FirstOrDefault(x => x.EndDate > shift.end);
|
||||
//برای خالی کردن اولیه حضور غیاب انتخاب شده
|
||||
earlyExitRollCallRotating?.SetEarlyExit(TimeSpan.Zero);
|
||||
|
||||
|
||||
|
||||
|
||||
if (earlyExitRollCallRotating != null && (rollCallsInRotatingShift.Any(x =>
|
||||
x.StartDate < rotatingShiftEnd && x.StartDate > earlyExitRollCallRotating.EndDate) == false))
|
||||
@@ -448,17 +456,6 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
DateTime startDate = startRollCall.Date;
|
||||
DateTime endDate = endRollCall.Date;
|
||||
|
||||
|
||||
|
||||
DateTime startEntryWithDate = startDate.Add(startRollCall.TimeOfDay);
|
||||
DateTime endEntryWithDate = endDate.Add(endRollCall.TimeOfDay);
|
||||
|
||||
DateTime oneHourBeforeStart = startEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterStart = startEntryWithDate.AddHours(1);
|
||||
DateTime oneHourBeforeEnd = endEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterEnd = endEntryWithDate.AddHours(1);
|
||||
|
||||
|
||||
var shiftDateTimes = rotatingShifts.SelectMany(shift =>
|
||||
{
|
||||
var shifts = new List<(DateTime Start, DateTime End)>();
|
||||
@@ -477,56 +474,69 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
#region مقایسه شروع حضور غیاب با شیفت
|
||||
|
||||
var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeStart <= shift.Start && oneHourAfterStart >= shift.Start) ||
|
||||
(oneHourBeforeStart <= shift.End && oneHourAfterStart >= shift.End)).ToList();
|
||||
//var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeStart <= shift.Start && twoHourAfterStart >= shift.Start) ||
|
||||
// (twoHourBeforeStart <= shift.End && twoHourAfterStart >= shift.End)).ToList();
|
||||
|
||||
if (startFilteredTimes.Count == 0)
|
||||
{
|
||||
startFilteredTimes = shiftDateTimes;
|
||||
}
|
||||
else if (startFilteredTimes.Count == 1)
|
||||
{
|
||||
var startChosenShift = startFilteredTimes.First();
|
||||
//if (startFilteredTimes.Count == 0)
|
||||
//{
|
||||
// startFilteredTimes = shiftDateTimes;
|
||||
//}
|
||||
//else if (startFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var startChosenShift = startFilteredTimes.First();
|
||||
|
||||
if (startChosenShift.End < startChosenShift.Start)
|
||||
startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
// if (startChosenShift.End < startChosenShift.Start)
|
||||
// startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
|
||||
return startChosenShift;
|
||||
}
|
||||
// return startChosenShift;
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
//#endregion
|
||||
|
||||
#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeEnd <= shift.Start && oneHourAfterEnd >= shift.Start) ||
|
||||
(oneHourBeforeEnd <= shift.End && oneHourAfterEnd >= shift.End)).ToList();
|
||||
if (endFilteredTimes.Count == 0)
|
||||
{
|
||||
endFilteredTimes = startFilteredTimes;
|
||||
}
|
||||
else if (endFilteredTimes.Count == 1)
|
||||
{
|
||||
var endChosenShift = endFilteredTimes.First();
|
||||
return endChosenShift;
|
||||
}
|
||||
//#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
//var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeEnd <= shift.Start && twoHourAfterEnd >= shift.Start) ||
|
||||
// (twoHourBeforeEnd <= shift.End && twoHourAfterEnd >= shift.End)).ToList();
|
||||
//if (endFilteredTimes.Count == 0)
|
||||
//{
|
||||
// endFilteredTimes = startFilteredTimes;
|
||||
//}
|
||||
//else if (endFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var endChosenShift = endFilteredTimes.First();
|
||||
// return endChosenShift;
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#region اشتراک حضور غیاب و شیفت
|
||||
|
||||
var overlapShifts = endFilteredTimes.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, oneHourAfterEnd.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, oneHourBeforeStart.Ticks)))
|
||||
});
|
||||
var overlapShifts = shiftDateTimes
|
||||
.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
// زمان حضور فرد در شیفت (مجموع Overlap با شیفت)
|
||||
TotalTimeInShift = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
StartDistance = Math.Abs((shift.Start - startRollCall).Ticks),
|
||||
EndDistance = Math.Abs((shift.End - endRollCall).Ticks),
|
||||
TotalDistance = Math.Abs((shift.Start - startRollCall).Ticks) + Math.Abs((shift.End - endRollCall).Ticks)
|
||||
})
|
||||
.OrderByDescending(s => s.TotalTimeInShift) // 1. بیشترین زمان حضور فرد
|
||||
.ThenByDescending(s => s.Overlap) // 2. بیشترین Overlap
|
||||
.ThenBy(s => s.TotalDistance)
|
||||
.ThenBy(s => s.StartDistance)
|
||||
.ThenBy(x => x.EndDistance); // 3. اگر برابر بود،
|
||||
|
||||
var overlapChosenShift = overlapShifts.MaxBy(s => s.Overlap);
|
||||
|
||||
var overlapChosenShift = overlapShifts.First();
|
||||
var end = overlapChosenShift.Shift.End;
|
||||
if (overlapChosenShift.Shift.End < overlapChosenShift.Shift.Start)
|
||||
end = overlapChosenShift.Shift.End.AddDays(1);
|
||||
@@ -537,6 +547,145 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
#endregion
|
||||
}
|
||||
|
||||
public (DateTime start, DateTime end) FindRotatingShift(List<(DateTime StartDate, DateTime EndDate)> rollCalls, ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
{
|
||||
|
||||
DateTime startDate = rollCalls.MinBy(x => x.StartDate).StartDate.Date;
|
||||
DateTime endDate = rollCalls.MaxBy(x => x.EndDate).EndDate.Date;
|
||||
|
||||
var shiftDateTimes = rotatingShifts.SelectMany(shift =>
|
||||
{
|
||||
var shifts = new List<(DateTime Start, DateTime End)>();
|
||||
for (int i = -1; i <= 1; i++)
|
||||
{
|
||||
var shiftStart = startDate.AddDays(i).Date;
|
||||
shiftStart = shiftStart.Add(shift.StartTime.ToTimeSpan());
|
||||
var shiftEnd = shift.StartTime < shift.EndTime
|
||||
? startDate.AddDays(i).Date.Add(shift.EndTime.ToTimeSpan())
|
||||
: startDate.AddDays(i + 1).Date.Add(shift.EndTime.ToTimeSpan());
|
||||
shifts.Add((shiftStart, shiftEnd));
|
||||
}
|
||||
|
||||
return shifts;
|
||||
}).ToList();
|
||||
|
||||
//var shiftScores = shiftDateTimes
|
||||
// .Select(shift =>
|
||||
// {
|
||||
// var totalOverlap = TimeSpan.Zero;
|
||||
|
||||
// var firstRollCall = rollCalls.MinBy(x => x.StartDate);
|
||||
// var lastRollCall = rollCalls.MaxBy(x => x.EndDate);
|
||||
|
||||
// long totalStartDistance = Math.Abs((shift.Start - firstRollCall.StartDate).Ticks);
|
||||
// long totalEndDistance = Math.Abs((shift.End - lastRollCall.EndDate).Ticks);
|
||||
|
||||
|
||||
// foreach (var rollCall in rollCalls)
|
||||
// {
|
||||
// var start = rollCall.StartDate;
|
||||
// var end = rollCall.EndDate;
|
||||
|
||||
// var overlapTicks = Math.Max(0,
|
||||
// Math.Min(shift.End.Ticks, end.Ticks) -
|
||||
// Math.Max(shift.Start.Ticks, start.Ticks));
|
||||
|
||||
// totalOverlap += new TimeSpan(overlapTicks);
|
||||
// //totalStartDistance += Math.Abs((shift.Start - start).Ticks);
|
||||
// //totalEndDistance += Math.Abs((shift.End - end).Ticks);
|
||||
// }
|
||||
|
||||
// return new
|
||||
// {
|
||||
// Shift = shift,
|
||||
// TotalOverlap = totalOverlap,
|
||||
// TotalDistance = totalStartDistance + totalEndDistance,
|
||||
// StartDistance = totalStartDistance,
|
||||
// EndDistance = totalEndDistance
|
||||
// };
|
||||
// })
|
||||
// .OrderBy(s => s.StartDistance)
|
||||
// .ThenBy(s => s.TotalDistance)
|
||||
// .ThenByDescending(s => s.TotalOverlap)
|
||||
// .ThenBy(s => s.EndDistance);
|
||||
|
||||
|
||||
// مرحله 1: گروهبندی بر اساس نزدیکی زمان شروع به اولین حضور و غیاب
|
||||
var groupedByStart = shiftDateTimes
|
||||
.GroupBy(shift =>
|
||||
{
|
||||
var firstRollCallStart = rollCalls.Min(x => x.StartDate);
|
||||
var ticksDiff = Math.Abs((shift.Start - firstRollCallStart).Ticks);
|
||||
return Math.Round(TimeSpan.FromTicks(ticksDiff).TotalMinutes / 30); // گروهبندی هر 30 دقیقه
|
||||
})
|
||||
.OrderBy(g => g.Key)
|
||||
.First(); // نزدیکترین گروه به شروع
|
||||
|
||||
// مرحله 2 (جایگزین مرحله ۴): گروهبندی بر اساس نزدیکی پایان شیفت به آخرین حضور و غیاب
|
||||
var filteredByEnd = groupedByStart
|
||||
.Select(shift =>
|
||||
{
|
||||
var lastRollCallEnd = rollCalls.Max(x => x.EndDate);
|
||||
var endDistance = Math.Abs((shift.End - lastRollCallEnd).Ticks);
|
||||
return new { Shift = shift, EndDistance = endDistance };
|
||||
})
|
||||
.GroupBy(x => x.EndDistance / TimeSpan.FromMinutes(30).Ticks) // گروهبندی هر 30 دقیقه
|
||||
.OrderBy(g => g.Key)
|
||||
.First() // نزدیکترین پایان
|
||||
.ToList();
|
||||
|
||||
// مرحله 3: فیلتر بر اساس بیشترین همپوشانی با حضور و غیابها
|
||||
var filteredByOverlap = filteredByEnd
|
||||
.Select(shift =>
|
||||
{
|
||||
var totalOverlap = TimeSpan.Zero;
|
||||
foreach (var rollCall in rollCalls)
|
||||
{
|
||||
var overlapTicks = Math.Max(0,
|
||||
Math.Min(shift.Shift.End.Ticks, rollCall.EndDate.Ticks) -
|
||||
Math.Max(shift.Shift.Start.Ticks, rollCall.StartDate.Ticks));
|
||||
totalOverlap += new TimeSpan(overlapTicks);
|
||||
}
|
||||
return new { Shift = shift.Shift, TotalOverlap = totalOverlap };
|
||||
})
|
||||
.GroupBy(x => Math.Round(x.TotalOverlap.TotalMinutes /5)) // گروهبندی همپوشانی
|
||||
.OrderByDescending(g => g.Key) // بیشترین همپوشانی اول
|
||||
.First()
|
||||
.ToList();
|
||||
|
||||
// مرحله 4 (جایگزین مرحله ۲): فیلتر نهایی بر اساس کمترین مجموع فاصله (TotalDistance)
|
||||
var bestShift = filteredByOverlap
|
||||
.Select(shift =>
|
||||
{
|
||||
var firstRollCall = rollCalls.MinBy(x => x.StartDate);
|
||||
var lastRollCall = rollCalls.MaxBy(x => x.EndDate);
|
||||
var totalDistance =
|
||||
Math.Abs((shift.Shift.Start - firstRollCall.StartDate).Ticks) +
|
||||
Math.Abs((shift.Shift.End - lastRollCall.EndDate).Ticks);
|
||||
return new { Shift = shift.Shift, TotalDistance = totalDistance };
|
||||
})
|
||||
.OrderBy(x => x.TotalDistance) // کمترین فاصله کلی
|
||||
.First(); // بهترین شیفت نهایی
|
||||
var overlapChosenShift = bestShift;
|
||||
var end = overlapChosenShift.Shift.End;
|
||||
if (overlapChosenShift.Shift.End < overlapChosenShift.Shift.Start)
|
||||
end = overlapChosenShift.Shift.End.AddDays(1);
|
||||
|
||||
|
||||
return (overlapChosenShift.Shift.Start, end);
|
||||
}
|
||||
|
||||
public BreakTime GetBreakTime(long employeeId, long workshopId)
|
||||
{
|
||||
var employeeSettings = _customizeWorkshopEmployeeSettingsRepository.GetByEmployeeIdAndWorkshopIdIncludeGroupSettings(workshopId,
|
||||
employeeId);
|
||||
if (employeeSettings == null)
|
||||
{
|
||||
return new BreakTime(false, TimeOnly.MinValue);
|
||||
}
|
||||
|
||||
return employeeSettings.BreakTime;
|
||||
}
|
||||
private DateTime CalculateRegularShiftDate(DateTime startDate, TimeOnly offset)
|
||||
{
|
||||
DateTime nextOffSetDateTime;
|
||||
|
||||
@@ -13,17 +13,26 @@ namespace Company.Domain.RollCallAgg;
|
||||
|
||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
{
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
||||
|
||||
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);
|
||||
|
||||
|
||||
List<RollCallViewModel> ConvertStaticHoursToRollCall(CreateWorkingHoursTemp command, bool workshopHolidyWorking);
|
||||
CustomizeCheckoutMandatoryViewModel CustomizeCheckoutMandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd);
|
||||
|
||||
List<LateToWorkEarlyExistSpannig> LateToWorkEarlyExit(List<GroupedRollCalls> groupedRollCall,
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> shiftSettings, List<LeaveViewModel> leavList);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="shiftwork"></param>
|
||||
/// <returns></returns>
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork);
|
||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ using System;
|
||||
using Company.Domain.RollCallAgg.DomainService;
|
||||
using System.Linq;
|
||||
using _0_Framework.Exceptions;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
|
||||
namespace Company.Domain.RollCallAgg
|
||||
{
|
||||
@@ -34,10 +36,10 @@ namespace Company.Domain.RollCallAgg
|
||||
{
|
||||
throw new NotFoundException("اطلاعات گروهبندی شخص نامعتبر است");
|
||||
}
|
||||
|
||||
SetBreakTime(service, employeeId, workshopId);
|
||||
//if (endDate.HasValue)
|
||||
//{
|
||||
// Edit(StartDate.Value,endDate.Value,service);
|
||||
// Edit(StartDate.Value,endDate.Value,service);
|
||||
//}
|
||||
|
||||
}
|
||||
@@ -198,30 +200,7 @@ namespace Company.Domain.RollCallAgg
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Truncates the TimeSpan to only include days, hours, and minutes.
|
||||
/// Removes seconds, milliseconds, and smaller units.
|
||||
/// </summary>
|
||||
/// <param name="time">The original TimeSpan value.</param>
|
||||
/// <returns>A truncated TimeSpan with only days, hours, and minutes.</returns>
|
||||
private TimeSpan TruncateTimeSpan(TimeSpan time)
|
||||
{
|
||||
return new TimeSpan(time.Days, time.Hours, time.Minutes, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates the DateTime to only include Years,Month,days,Hours and Minutes.
|
||||
/// Removes seconds, milliseconds, and smaller units.
|
||||
/// </summary>
|
||||
/// <param name="dateTime">The original DateTime value.</param>
|
||||
/// <returns>A truncated DateTime with only days, hours, and minutes.</returns>
|
||||
private DateTime TruncateDateTime(DateTime dateTime)
|
||||
{
|
||||
return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour,
|
||||
dateTime.Minute, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void SetEndDateTime(DateTime endDate, IRollCallDomainService service)
|
||||
{
|
||||
@@ -238,7 +217,7 @@ namespace Company.Domain.RollCallAgg
|
||||
////محاسبه اختلاف زمانی(تاخیر و تعجیل)ء
|
||||
service.CalculateTimeDifferences(this);
|
||||
|
||||
|
||||
SetBreakTime(service, EmployeeId, WorkshopId);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +238,8 @@ namespace Company.Domain.RollCallAgg
|
||||
//محاسبه اختلاف زمانی(تاخیر و تعجیل)ء
|
||||
service.CalculateTimeDifferences(this);
|
||||
|
||||
SetBreakTime(service, EmployeeId, WorkshopId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -331,6 +312,40 @@ namespace Company.Domain.RollCallAgg
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SetBreakTime(IRollCallDomainService rollCallDomainService, long employeeId, long workshopId)
|
||||
{
|
||||
var breakTime = rollCallDomainService.GetBreakTime(employeeId, workshopId);
|
||||
|
||||
if (breakTime.BreakTimeType == BreakTimeType.WithTime)
|
||||
BreakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates the TimeSpan to only include days, hours, and minutes.
|
||||
/// Removes seconds, milliseconds, and smaller units.
|
||||
/// </summary>
|
||||
/// <param name="time">The original TimeSpan value.</param>
|
||||
/// <returns>A truncated TimeSpan with only days, hours, and minutes.</returns>
|
||||
private TimeSpan TruncateTimeSpan(TimeSpan time)
|
||||
{
|
||||
return new TimeSpan(time.Days, time.Hours, time.Minutes, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates the DateTime to only include Years,Month,days,Hours and Minutes.
|
||||
/// Removes seconds, milliseconds, and smaller units.
|
||||
/// </summary>
|
||||
/// <param name="dateTime">The original DateTime value.</param>
|
||||
/// <returns>A truncated DateTime with only days, hours, and minutes.</returns>
|
||||
private DateTime TruncateDateTime(DateTime dateTime)
|
||||
{
|
||||
return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour,
|
||||
dateTime.Minute, 0);
|
||||
}
|
||||
//private static (DateTime start, DateTime end) FindRotatingShift(DateTime startRollCall, DateTime endRollCall, ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
//{
|
||||
|
||||
|
||||
@@ -14,5 +14,7 @@ public interface IWorkshopTempRepository : IRepository<long, WorkshopTemp>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp);
|
||||
|
||||
System.Threading.Tasks.Task RemoveWorkshopTemps(List<long> workshopTempIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -34,12 +34,14 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// OneTime
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// "12"
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
|
||||
@@ -90,7 +90,9 @@ public class Workshop : EntityBase
|
||||
//}
|
||||
public Workshop(string workshopName,string workshopSureName, string insuranceCode, string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide, bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking)
|
||||
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)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -132,6 +134,8 @@ public class Workshop : EntityBase
|
||||
YearsOptions = yearsOptions;
|
||||
HasRollCallFreeVip = hasRollCallFreeVip;
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +202,14 @@ public class Workshop : EntityBase
|
||||
//کارگاه هایی که در تعطیلات رسمی باز هستند
|
||||
public bool WorkshopHolidayWorking { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار فیش حقوقی در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutOvertime { get; private set; }
|
||||
/// <summary>
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; private set; }
|
||||
//public Employer Employer { get; private set; }
|
||||
|
||||
public Workshop()
|
||||
@@ -229,7 +241,9 @@ public class Workshop : EntityBase
|
||||
|
||||
public void Edit(string workshopName, string workshopSureName, string insuranceCode,string typeOfOwnership, string archiveCode, string agentName, string agentPhone,
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population, long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay,bool totalPaymentHide, bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking)
|
||||
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)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -268,7 +282,9 @@ public class Workshop : EntityBase
|
||||
YearsOptions = yearsOptions;
|
||||
HasRollCallFreeVip = hasRollCallFreeVip;
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
}
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
}
|
||||
|
||||
|
||||
public void Active(string archiveCode)
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface IYearlySalaryRepository : IRepository<long, YearlySalary>
|
||||
void TestDayliFeeCompute();
|
||||
List<string> GetYears();
|
||||
List<YearlySalaryViewModel> GetYearlySalary();
|
||||
MontlywageBunosYearsViewModel GetMontlyBunosYears(TimeSpan weeklyTime, DateTime contractStart,DateTime contractEnd, double daylyWage, string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking);
|
||||
MontlywageBunosYearsViewModel GetMontlyBunosYears(TimeSpan weeklyTime, DateTime contractStart,DateTime contractEnd, double daylyWage, string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking,string shiftWork);
|
||||
double GetLeavePay(DateTime contractStart, DateTime contractEnd, double daylyWage, double consumableItem, double housingAllowance, double familyAllowance , string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM);
|
||||
double GetOverTimeWorking(double dayliWage, string overTimeWorkH, string overTimeWorkM);
|
||||
double GetOverNightWorking(double dayliWage, string overNightWorkH, string overNightWorkM, string weeklyWorkingTime, int officialholiday, int friday, DateTime contractStart, DateTime contractEnd, string totalHoursH, string totalHorsM);
|
||||
|
||||
@@ -86,7 +86,7 @@ public class SalaryAidImportExcel
|
||||
worksheet.Cells[3, 4].Text != "مبلغ قابل پرداخت" ||
|
||||
worksheet.Cells[1, 3].Text != "تاریخ پرداخت" ||
|
||||
worksheet.Cells[1, 1].Text != "سال محاسبه" ||
|
||||
worksheet.Cells[1, 2].Text != "ماه محسابه")
|
||||
worksheet.Cells[1, 2].Text != "ماه محاسبه")
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("ساختار فایل اکسل اشتباه است.", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
return result;
|
||||
|
||||
@@ -136,4 +136,6 @@ public class CreateCheckout
|
||||
|
||||
public bool HolidayWorking { get; set; }
|
||||
|
||||
public string ShiftWork { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
public interface IContactUsApplication
|
||||
{
|
||||
OperationResult Create(CreateContactUs command);
|
||||
}
|
||||
|
||||
public class CreateContactUs
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
@@ -43,5 +43,6 @@ public class ComputingViewModel
|
||||
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -90,4 +90,14 @@ public class CreateEmployeeInsurancListData
|
||||
/// DSW_SPOUSE
|
||||
/// </summary>
|
||||
public double MarriedAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اضافه کار فیش حقوقی
|
||||
/// </summary>
|
||||
public double OverTimePay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حق اولاد فیش حقوقی
|
||||
/// </summary>
|
||||
public double FamilyAllowance { get; set; }
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class EmployeeInsurancListDataViewModel
|
||||
/// </summary>
|
||||
public double BenefitsIncludedNonContinuous { get; set; }
|
||||
/// <summary>
|
||||
/// جمع کل دستمزد و مزایای ماهانه
|
||||
/// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
/// DSW_TOTL
|
||||
/// </summary>
|
||||
public double IncludedAndNotIncluded { get; set; }
|
||||
@@ -119,5 +119,15 @@ public class EmployeeInsurancListDataViewModel
|
||||
/// </summary>
|
||||
public double MarriedAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اضافه کار فیش حقوقی
|
||||
/// </summary>
|
||||
public double OverTimePay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حق اولاد فیش حقوقی
|
||||
/// </summary>
|
||||
public double FamilyAllowance { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -253,21 +253,49 @@ public class EmployeeDetailsForInsuranceListViewModel
|
||||
/// DSW_SPOUSE
|
||||
/// </summary>
|
||||
public double MarriedAllowance { get; set; }
|
||||
///// <summary>
|
||||
///// مجموع پایه سنواتی کارکنان
|
||||
///// DSK_INC
|
||||
///// </summary>
|
||||
//public double SumOfBaseYears { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// جمع پایه سنوات و دستمزد روزانه کارکنان
|
||||
///// DSW_INC
|
||||
///// </summary>
|
||||
//public double SumOfDailyWagePlusBaseYears { get; set; }
|
||||
/// <summary>
|
||||
/// آیا پرسنل دارای فیش حقوقی برای این ماه است
|
||||
/// -
|
||||
/// جهت محاسبه اضافه کار و حق اولاد
|
||||
/// </summary>
|
||||
public bool EmployeeHasCheckout { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// مجموع حق تاهل کارکنان
|
||||
///// DSK_SPOUSE
|
||||
///// </summary>
|
||||
//public double SumOfMarriedAllowance { get; set; }
|
||||
/// <summary>
|
||||
/// اضافه کار فیش حقوقی
|
||||
/// </summary>
|
||||
public double OverTimePay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حق اولاد فیش حقوقی
|
||||
/// </summary>
|
||||
public double FamilyAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار
|
||||
/// </summary>
|
||||
public bool OverTimeIsSet { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///محاسبه حق اولاد
|
||||
/// </summary>
|
||||
public bool FamilyAllowanceIsSet { get; set; }
|
||||
///// <summary>
|
||||
///// مجموع پایه سنواتی کارکنان
|
||||
///// DSK_INC
|
||||
///// </summary>
|
||||
//public double SumOfBaseYears { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// جمع پایه سنوات و دستمزد روزانه کارکنان
|
||||
///// DSW_INC
|
||||
///// </summary>
|
||||
//public double SumOfDailyWagePlusBaseYears { get; set; }
|
||||
|
||||
///// <summary>
|
||||
///// مجموع حق تاهل کارکنان
|
||||
///// DSK_SPOUSE
|
||||
///// </summary>
|
||||
//public double SumOfMarriedAllowance { get; set; }
|
||||
}
|
||||
@@ -28,4 +28,13 @@ public class CreateInsuranceWorkshopInfo
|
||||
public long? InsuranceJobId { get; set; }
|
||||
//public bool ConfirmSentlist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار فیش حقوقی در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutOvertime { get; set; }
|
||||
/// <summary>
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; set; }
|
||||
|
||||
}
|
||||
@@ -8,7 +8,17 @@ namespace CompanyManagment.App.Contracts.RollCall;
|
||||
public interface IRollCallMandatoryApplication
|
||||
{
|
||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="shiftwork"></param>
|
||||
/// <returns></returns>
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork);
|
||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking);
|
||||
}
|
||||
@@ -61,4 +61,8 @@ public class RollCallViewModel
|
||||
/// مقدار تایم شیفت (مدت زمان شیفت کاری)
|
||||
/// </summary>
|
||||
public TimeSpan ShiftDurationTimeSpan { get; set; }
|
||||
/// <summary>
|
||||
/// مدت زمان استراحت
|
||||
/// </summary>
|
||||
public TimeSpan BreakTimeSpan { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
@@ -38,7 +39,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command);
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جمع کل خدمات برای یک کارگاه
|
||||
@@ -55,14 +56,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت کد برای کلاینت
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class MonthlyInstallment
|
||||
{
|
||||
/// <summary>
|
||||
/// مبلغ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstallmentAmountStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstalmentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شمارنده قسط
|
||||
/// </summary>
|
||||
public string InstallmentCounter{ get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -23,28 +24,54 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string TotalPaymentStr { get; set; }
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
@@ -83,4 +110,52 @@ public class ReviewAndPaymentViewModel
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartCurrentMonthFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartCurrentMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartNextMonthFa{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartNextMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractEndFa { get; set; }
|
||||
}
|
||||
@@ -107,4 +107,13 @@ public class CreateWorkshop
|
||||
|
||||
public string HasCustomizeCheckoutService { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار فیش حقوقی در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutOvertime { get; set; }
|
||||
/// <summary>
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; set; }
|
||||
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class PrintListWorkshop
|
||||
public string TypeOfOwnership { get; set; }
|
||||
|
||||
public string ArchiveCode { get; set; }
|
||||
public int ArchiveCodeInt { get; set; }
|
||||
|
||||
public string AgentName { get; set; }
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
//حق تاهل
|
||||
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);
|
||||
_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;
|
||||
//سنوات
|
||||
|
||||
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class ContactUsApplication : IContactUsApplication
|
||||
{
|
||||
private readonly IContactUsRepository _contactUsRepository;
|
||||
|
||||
public ContactUsApplication(IContactUsRepository contactUsRepository)
|
||||
{
|
||||
_contactUsRepository = contactUsRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateContactUs command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
if (string.IsNullOrWhiteSpace(command.FirstName))
|
||||
{
|
||||
return op.Failed("لطفا نام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.LastName))
|
||||
{
|
||||
return op.Failed("لطفا نام خانوادگی خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Email))
|
||||
{
|
||||
return op.Failed("لطفا ایمیل خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.PhoneNumber))
|
||||
{
|
||||
return op.Failed("لطفا شماره تماس خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.PhoneNumber, @"^(\+98|0)?9\d{9}$"))
|
||||
{
|
||||
return op.Failed("شماره تماس وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
|
||||
{
|
||||
return op.Failed("ایمیل وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Title))
|
||||
{
|
||||
return op.Failed("لطفا عنوان پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Message))
|
||||
{
|
||||
return op.Failed("لطفا پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
var entity = new ContactUs(command.FirstName, command.LastName, command.Email, command.PhoneNumber,
|
||||
command.Title, command.Message);
|
||||
|
||||
_contactUsRepository.Create(entity);
|
||||
|
||||
_contactUsRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -352,6 +352,15 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return op.Failed("گروه انتخاب شده نا معتبر است");
|
||||
}
|
||||
|
||||
if (_customizeWorkshopEmployeeSettingsRepository
|
||||
.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId)))
|
||||
{
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
_customizeWorkshopEmployeeSettingsRepository.RemoveByWorkshopIdAndEmployeeId(command.WorkshopId, employeeId);
|
||||
}
|
||||
}
|
||||
|
||||
if (customizeWorkshopGroupSettings.MainGroup)
|
||||
{
|
||||
var createDefaultEmployee = CreateEmployeeSettings(command);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class EmployeeInsurancListDataApplication : IEmployeeInsurancListDataAppl
|
||||
|
||||
var employeeInsurancListData = new EmployeeInsurancListData(command.InsuranceListId, command.EmployeeId, command.WorkingDays, command.DailyWage, command.MonthlySalary, command.MonthlyBenefits,
|
||||
command.MonthlyBenefitsIncluded, command.BenefitsIncludedContinuous, command.BenefitsIncludedNonContinuous, command.InsuranceShare,
|
||||
command.StartWorkDate,command.LeftWorkDate,command.JobId,command.IncludeStatus, command.BaseYears,command.MarriedAllowance);
|
||||
command.StartWorkDate,command.LeftWorkDate,command.JobId,command.IncludeStatus, command.BaseYears,command.MarriedAllowance,command.OverTimePay,command.FamilyAllowance);
|
||||
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
|
||||
_employeeInsurancListDataRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.DateSalaryAgg;
|
||||
using Company.Domain.DateSalaryItemAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
@@ -55,8 +56,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApp;
|
||||
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository;
|
||||
private readonly IInsuranceYearlySalaryApplication _insuranceYearlySalaryApplication;
|
||||
private readonly ICheckoutRepository _checkoutRepository;
|
||||
|
||||
public InsuranceListApplication( IInsuranceListRepository insuranceListRepositpry, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceEmployeeInfoRepository insuranceEmployeeInfoRepository, IEmployeeRepository employeeRepository, IWorkshopRepository workShopRepository, ILeftWorkInsuranceApplication leftWorkInsuranceApplication, IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication, IEmployeeInsurancListDataApplication employeeInsurancListDataApplication, IYearlySalaryApplication yearlySalaryApplication,IYearlySalaryItemApplication yearlySalaryItemApplication ,IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository,IInsuranceJobItemRepositpry insuranceJobItemRepository, IDateSalaryRepository dateSalaryRepository, IDateSalaryItemRepository dateSalaryItemRepository, IPersonalContractingPartyApp contractingPartyApp, ILeftWorkInsuranceRepository leftWorkInsuranceRepository, IInsuranceYearlySalaryApplication insuranceYearlySalaryApplication)
|
||||
public InsuranceListApplication( IInsuranceListRepository insuranceListRepositpry, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceEmployeeInfoRepository insuranceEmployeeInfoRepository, IEmployeeRepository employeeRepository, IWorkshopRepository workShopRepository, ILeftWorkInsuranceApplication leftWorkInsuranceApplication, IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication, IEmployeeInsurancListDataApplication employeeInsurancListDataApplication, IYearlySalaryApplication yearlySalaryApplication,IYearlySalaryItemApplication yearlySalaryItemApplication ,IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository,IInsuranceJobItemRepositpry insuranceJobItemRepository, IDateSalaryRepository dateSalaryRepository, IDateSalaryItemRepository dateSalaryItemRepository, IPersonalContractingPartyApp contractingPartyApp, ILeftWorkInsuranceRepository leftWorkInsuranceRepository, IInsuranceYearlySalaryApplication insuranceYearlySalaryApplication, ICheckoutRepository checkoutRepository)
|
||||
{
|
||||
// _transactionManager = transactionManager;
|
||||
|
||||
@@ -77,6 +79,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
_contractingPartyApp = contractingPartyApp;
|
||||
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
|
||||
_insuranceYearlySalaryApplication = insuranceYearlySalaryApplication;
|
||||
_checkoutRepository = checkoutRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateInsuranceList command)
|
||||
@@ -379,7 +382,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
|
||||
var result = new MainEmployeeDetailsViewModel();
|
||||
var workshopId = searchModel.WorkshopIds.FirstOrDefault();
|
||||
//var employerId = _workShopRepository.GetDetails(workshopId).EmployerIdList.FirstOrDefault();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
//var isBolock = _contractingPartyApp.IsBlockByEmployerId(employerId);
|
||||
var isBolock = _contractingPartyApp.IsBlockCheckByWorkshopId(workshopId);
|
||||
double monthlybaseYear = 0;
|
||||
@@ -388,6 +391,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
x.Year == searchModel.Year && x.Month == searchModel.Month &&
|
||||
searchModel.WorkshopIds.Contains(x.WorkshopId)))
|
||||
{
|
||||
|
||||
var startMonthFa = $"{searchModel.Year}/{searchModel.Month.PadLeft(2, '0')}/01";
|
||||
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
|
||||
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
|
||||
@@ -408,23 +412,67 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
_insuranceListRepositpry.GetEmployeeInsuranceDataAmonthAgo(startDateGr, workshopId);
|
||||
watch.Start();
|
||||
var computeResult = employeesInfoAndLeftWorks.Select(employee =>
|
||||
{
|
||||
var dateOfBirth = employee.DateOfBirthGr.ToFarsi();
|
||||
var dateOfIssue = employee.DateOfIssueGr.ToFarsi();
|
||||
var leftDate = employee.LeftWorkDateGr != null ? employee.LeftWorkDateGr.Value.AddDays(-1) : new DateTime();
|
||||
{
|
||||
var dateOfBirth = employee.DateOfBirthGr.ToFarsi();
|
||||
var dateOfIssue = employee.DateOfIssueGr.ToFarsi();
|
||||
var leftDate = employee.LeftWorkDateGr?.AddDays(-1) ?? new DateTime();
|
||||
|
||||
bool isManager = employee.JobId is 10 or 16 or 17 or 18 or 3498;
|
||||
|
||||
//آیا در کارگاه تیک محاسبه اضافه کار یا حق اولاد زده شده است؟
|
||||
bool hasWorkshopOverTimeOrFamilyAllowance =
|
||||
workshop.InsuranceCheckoutFamilyAllowance || workshop.InsuranceCheckoutOvertime;
|
||||
|
||||
//آیا پرسنل فیش حقوق دارد
|
||||
//این مورد زمانی چک می شود که تیک محاسبه در کارگاه زده شده باشد
|
||||
// در غیر اینصورت بصورت پیشفرض دارای فیش حقوق در نظر گرفته می شود
|
||||
bool employeeHasCheckout = true;
|
||||
double familyAllowance = 0;
|
||||
double overTimePay = 0;
|
||||
if (hasWorkshopOverTimeOrFamilyAllowance && (leftDate >= startDateGr || employee.LeftWorkDateGr == null))
|
||||
{
|
||||
var checkout = _checkoutRepository.HasCheckout(workshopId, employee.EmployeeId,
|
||||
searchModel.Year, searchModel.Month);
|
||||
if (checkout.hasChekout)
|
||||
{
|
||||
|
||||
familyAllowance = checkout.FamilyAlloance;
|
||||
overTimePay = checkout.OverTimePay;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
employeeHasCheckout = isManager == false ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employee.StartWorkDateGr, leftDate, startDateGr,endDateGr, employee.EmployeeId);
|
||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employee.LeftWorkDateGr.ToFarsi(): "";
|
||||
var startWorkFa = employee.StartWorkDateGr.ToFarsi();
|
||||
//به دست آوردن دستمزد روزانه با توجه به اینکه کارگاه مشاغل مقطوع است یا خیر
|
||||
var dailyWage = searchModel.FixedSalary ?
|
||||
Convert.ToDouble(GetDailyWageFixedSalary(searchModel.Year, workshopId, employee.EmployeeId, startDateGr, endDateGr, employee.JobId, searchModel.Population, searchModel.InsuranceJobId))
|
||||
: ComputeDailyWage(yearlysaleries.DayliWage, employee.EmployeeId, workshopId, searchModel.Year);
|
||||
|
||||
double dailyWage = 0;
|
||||
if (searchModel.FixedSalary)
|
||||
{
|
||||
var res = GetDailyWageFixedSalary(searchModel.Year, workshopId, employee.EmployeeId, startDateGr,
|
||||
endDateGr, employee.JobId, searchModel.Population, searchModel.InsuranceJobId);
|
||||
dailyWage = res ?? 0;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var res = ComputeDailyWage(yearlysaleries.DayliWage, employee.EmployeeId, workshopId, searchModel.Year);
|
||||
dailyWage = res;
|
||||
}
|
||||
|
||||
|
||||
//بدست آوردن پایه سنوات
|
||||
var baseYears = _insuranceListRepositpry.GetEmployeeInsuranceBaseYear(employee.EmployeeId, workshopId,
|
||||
workingDays.countWorkingDays, startDateGr, endDateGr,workingDays.startWork, workingDays.endWork, workingDays.hasLeftWorkInMonth);
|
||||
//آیا کارفرما یا مدیر عامل است؟
|
||||
bool isManager = employee.JobId is 10 or 16 or 17 or 18 or 3498;
|
||||
|
||||
baseYears.baseYear = isManager ? 0 : baseYears.baseYear;
|
||||
Console.WriteLine(employee.JobId + " - "+ baseYears.baseYear);
|
||||
//جمع مزد روزانه و پایه سنوات
|
||||
@@ -439,12 +487,22 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
|
||||
//محاسبه مزایای ماهانه
|
||||
var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId,employee.IncludeStatus);
|
||||
|
||||
|
||||
//if (employee.EmployeeId is 7999)// سید عباس خوشکلام سلیمان
|
||||
// monthlyBenefits = 80869389;
|
||||
//if (employee.EmployeeId is 43787)// شهرام براهیمی سیقلان
|
||||
// monthlyBenefits = 54748472;
|
||||
if (workshop.InsuranceCheckoutOvertime && employeeHasCheckout && !isManager)
|
||||
{
|
||||
|
||||
monthlyBenefits = GetRoundValue(monthlyBenefits += overTimePay);
|
||||
}
|
||||
|
||||
//سرای ملک
|
||||
// نوشین خالی
|
||||
// 39692467
|
||||
//if (employee.EmployeeId == 45280)
|
||||
// monthlyBenefits += 39692467;
|
||||
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
workingDays.countWorkingDays, yearlysaleries.MarriedAllowance, endOfMonth);
|
||||
@@ -466,14 +524,23 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
.FirstOrDefault(e => e.EmployeeId == employee.EmployeeId);
|
||||
//مزیای عیر مشمول لیست قبل
|
||||
var benefitsIncludedNonContinuous =
|
||||
employeeListData != null ? employeeListData.BenefitsIncludedNonContinuous : 0;
|
||||
employeeListData?.BenefitsIncludedNonContinuous ?? 0;
|
||||
if (workshop.InsuranceCheckoutFamilyAllowance && employeeHasCheckout && !isManager)
|
||||
{
|
||||
|
||||
benefitsIncludedNonContinuous = GetRoundValue(benefitsIncludedNonContinuous + familyAllowance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var includedAndNotIncluded = benefitsIncludedContinuous + benefitsIncludedNonContinuous;
|
||||
|
||||
|
||||
return new EmployeeDetailsForInsuranceListViewModel
|
||||
{
|
||||
#region EmployeeInfo
|
||||
|
||||
InsuranceEmployeeInformationId = employee.InsuranceEmployeeInformationId,
|
||||
EmployeeHasCheckout = employeeHasCheckout,
|
||||
InsuranceEmployeeInformationId = employee.InsuranceEmployeeInformationId,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
FName = employee.FName,
|
||||
LName = employee.LName,
|
||||
@@ -535,10 +602,10 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
//جمع مزایای مشمول و دستمزد ماهانه
|
||||
BenefitsIncludedContinuous = benefitsIncludedContinuous,
|
||||
|
||||
//مزایای غیر مشمول
|
||||
//مزایای غیر مشمول *
|
||||
BenefitsIncludedNonContinuous = benefitsIncludedNonContinuous,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول *
|
||||
IncludedAndNotIncluded = includedAndNotIncluded,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
@@ -559,11 +626,13 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
YearlySalaryItem = yearlysaleries.DayliWage,
|
||||
MonthlyBaseYearsStr = "0",
|
||||
MonthlyBaseYears = 0,
|
||||
OverTimePay = overTimePay,
|
||||
FamilyAllowance = familyAllowance
|
||||
#endregion
|
||||
|
||||
|
||||
};
|
||||
});
|
||||
}).ToList();
|
||||
Console.WriteLine("New Compute : " + watch.Elapsed);
|
||||
watch.Stop();
|
||||
|
||||
@@ -1423,6 +1492,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
var workingDays = Tools.GetEmployeeInsuranceWorkingDays(employeeData.StartWorkDateGr, leftDate, startDateGr, endDateGr, employeeData.EmployeeId);
|
||||
var leftWorkFa = workingDays.hasLeftWorkInMonth ? employeeData.LeftWorkDateGr.ToFarsi() : "";
|
||||
var startWorkFa = employeeData.StartWorkDateGr.ToFarsi();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
|
||||
//آیا کارفرما است
|
||||
bool isManager = employeeData.JobId is 10 or 16 or 17 or 18 or 3498;
|
||||
@@ -1432,9 +1502,53 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
|
||||
// محاسبه بیمه بیکاری
|
||||
var unEmploymentInsurance = (employeeData.BenefitsIncludedContinuous * 3) / 100;
|
||||
|
||||
|
||||
//آیا در کارگاه تیک محاسبه اضافه کار یا حق اولاد زده شده است؟
|
||||
//این مورد زمانی چک می شود که تیک محاسبه در کارگاه زده شده باشد
|
||||
// در غیر اینصورت بصورت پیشفرض دارای فیش حقوق در نظر گرفته می شود
|
||||
bool hasWorkshopOverTimeOrFamilyAllowance =
|
||||
workshop.InsuranceCheckoutFamilyAllowance || workshop.InsuranceCheckoutOvertime;
|
||||
|
||||
bool employeeHasCheckout = true;
|
||||
bool hasOverTimePay = false;
|
||||
bool hasFamilyAllowance = false;
|
||||
|
||||
if (hasWorkshopOverTimeOrFamilyAllowance && (leftDate >= startDateGr || employeeData.LeftWorkDateGr == null))
|
||||
{
|
||||
var checkout = _checkoutRepository.HasCheckout(workshopId, employeeData.EmployeeId,
|
||||
searchModel.Year, searchModel.Month);
|
||||
if (checkout.hasChekout)
|
||||
{
|
||||
if (checkout.OverTimePay > 0)
|
||||
hasOverTimePay = true;
|
||||
if (checkout.FamilyAlloance > 0)
|
||||
hasFamilyAllowance = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
employeeHasCheckout = isManager == false ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
bool familyAllowanceIsSet = true;
|
||||
bool overTimePayIsSet = true;
|
||||
if (workshop.InsuranceCheckoutFamilyAllowance && employeeHasCheckout && employeeData.FamilyAllowance == 0 && hasFamilyAllowance && !isManager)
|
||||
{
|
||||
|
||||
familyAllowanceIsSet = false;
|
||||
}
|
||||
|
||||
if (workshop.InsuranceCheckoutOvertime && employeeHasCheckout && employeeData.OverTimePay == 0 && hasOverTimePay && !isManager)
|
||||
{
|
||||
|
||||
overTimePayIsSet = false;
|
||||
}
|
||||
return new EmployeeDetailsForInsuranceListViewModel
|
||||
{
|
||||
#region EmployeeInfo
|
||||
#region EmployeeInfo
|
||||
EmployeeHasCheckout = employeeHasCheckout,
|
||||
EmployeeInsurancListDataId = employeeData.EmployeeInsurancListDataId,
|
||||
|
||||
InsuranceEmployeeInformationId = employeeData.InsuranceEmployeeInformationId,
|
||||
@@ -1523,6 +1637,9 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
YearlySalaryItem = yearlysaleries.DayliWage,
|
||||
MonthlyBaseYearsStr = "0",
|
||||
MonthlyBaseYears = 0,
|
||||
|
||||
OverTimeIsSet = overTimePayIsSet,
|
||||
FamilyAllowanceIsSet = familyAllowanceIsSet
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1557,93 +1674,138 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
|
||||
private double? GetDailyWageFixedSalary(string year, long workshopId,long employeeId,DateTime? startDateGr, DateTime? endDateGr, long jobId, string population, long? insuranceJobId)
|
||||
{
|
||||
|
||||
double? result = 0;
|
||||
//اگر مشاغل مقطوع بود و شغلش کارفرما بود
|
||||
// در جدول لیست بیمه قبلی چک شود
|
||||
if (jobId == 10) //کارفرما
|
||||
try
|
||||
{
|
||||
InsuranceListSearchModel searchModel = new InsuranceListSearchModel();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
if (workshop.FixedSalary)
|
||||
|
||||
if (workshopId == 318 && year == "1403")
|
||||
{
|
||||
double percent = 0;
|
||||
switch (jobId)
|
||||
{
|
||||
case 39:
|
||||
percent = 1.75;
|
||||
return 4180000;
|
||||
break;
|
||||
case 466:
|
||||
percent = 1.6;
|
||||
return 3822000;
|
||||
break;
|
||||
case 1192 or 398 or 8:
|
||||
percent = 1.5;
|
||||
return 3583000;
|
||||
break;
|
||||
}
|
||||
|
||||
//var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
//dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
//dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
//var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
//// && _dateSalary.Id >0
|
||||
//if (_dateSalary != null)
|
||||
//{
|
||||
// var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
// dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
// dateSaleryItemviewModel.Percent = percent;
|
||||
// var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
// if (dateSalaryItem != null)
|
||||
// result = dateSalaryItem[0].Salary;
|
||||
//}
|
||||
}
|
||||
if (jobId == 10) //کارفرما
|
||||
{
|
||||
InsuranceListSearchModel searchModel = new InsuranceListSearchModel();
|
||||
var workshop = _workShopRepository.GetDetails(workshopId);
|
||||
if (workshop.FixedSalary)
|
||||
|
||||
{
|
||||
var inJob = _insuranceJobItemRepository
|
||||
.GetInsuranceJobItemByInsuranceJobId((long)workshop.InsuranceJobId);
|
||||
if (workshop.Population == "MoreThan500")
|
||||
{
|
||||
var max = inJob.MaxBy(x => x.PercentageMoreThan);
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = max.PercentageMoreThan;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = max.PercentageMoreThan;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var max = inJob.MaxBy(x => x.PercentageLessThan);
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = max.PercentageLessThan;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
var max = inJob.MaxBy(x => x.PercentageLessThan);
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = max.PercentageLessThan;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//var insuransList = _insuranceListRepositpry.GetInsuranceListByWorkshopIdAndYear(workshopId, year);
|
||||
//var employeeInsurancListData = _employeeInsurancListDataRepository.GetEmployeeInsurancListDataByEmployeeIdAndInsuranceListId(employeeId, insuransList.Id);
|
||||
//if (employeeInsurancListData != null )
|
||||
//{
|
||||
// result = employeeInsurancListData.DailyWage;
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var searchModel = new InsuranceJobItemSearchModel();
|
||||
searchModel.InsuranceJobId = (long)insuranceJobId;
|
||||
var JobItem = _insuranceJobItemRepository.GetInsuranceJobItemByInsuranceJobIdForFixedSalary((long)insuranceJobId, jobId);
|
||||
|
||||
if (JobItem != null && JobItem.Id != 0)
|
||||
{
|
||||
double percent = 0;
|
||||
if (population == "MoreThan500")
|
||||
percent = JobItem.PercentageMoreThan;
|
||||
else if (population == "LessThan500")
|
||||
percent = JobItem.PercentageLessThan;
|
||||
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
// && _dateSalary.Id >0
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = percent;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//var insuransList = _insuranceListRepositpry.GetInsuranceListByWorkshopIdAndYear(workshopId, year);
|
||||
//var employeeInsurancListData = _employeeInsurancListDataRepository.GetEmployeeInsurancListDataByEmployeeIdAndInsuranceListId(employeeId, insuransList.Id);
|
||||
//if (employeeInsurancListData != null )
|
||||
//{
|
||||
// result = employeeInsurancListData.DailyWage;
|
||||
//}
|
||||
}
|
||||
else
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
var searchModel = new InsuranceJobItemSearchModel();
|
||||
searchModel.InsuranceJobId = (long)insuranceJobId;
|
||||
var JobItem = _insuranceJobItemRepository.GetInsuranceJobItemByInsuranceJobIdForFixedSalary((long)insuranceJobId, jobId);
|
||||
|
||||
if (JobItem != null && JobItem.Id != 0)
|
||||
{
|
||||
double percent = 0;
|
||||
if (population == "MoreThan500")
|
||||
percent = JobItem.PercentageMoreThan;
|
||||
else if (population == "LessThan500")
|
||||
percent = JobItem.PercentageLessThan;
|
||||
|
||||
var dateSaleryviewModel = new DateSalarySearchModel();
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
// && _dateSalary.Id >0
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
dateSaleryItemviewModel.DateSalaryId = _dateSalary.Id;
|
||||
dateSaleryItemviewModel.Percent = percent;
|
||||
var dateSalaryItem = _dateSalaryItemRepository.Search(dateSaleryItemviewModel);
|
||||
if (dateSalaryItem != null)
|
||||
result = dateSalaryItem[0].Salary;
|
||||
}
|
||||
}
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ public class InsuranceWorkshopInfoApplication: IInsuranceWorkshopInfoApplication
|
||||
workshop.InsuranceJobId = workshopObj.InsuranceJobId;
|
||||
workshop.InsuranceCode = workshopObj.InsuranceCode;
|
||||
workshop.AgreementNumber = workshopObj.AgreementNumber;
|
||||
workshop.InsuranceCheckoutOvertime = workshopObj.InsuranceCheckoutOvertime;
|
||||
workshop.InsuranceCheckoutFamilyAllowance = workshopObj.InsuranceCheckoutFamilyAllowance;
|
||||
return workshop;
|
||||
}
|
||||
else
|
||||
@@ -60,6 +62,8 @@ public class InsuranceWorkshopInfoApplication: IInsuranceWorkshopInfoApplication
|
||||
workshop.FixedSalary = workshopObj.FixedSalary;
|
||||
workshop.Population = workshopObj.Population;
|
||||
workshop.InsuranceJobId = workshopObj.InsuranceJobId;
|
||||
workshop.InsuranceCheckoutOvertime = workshopObj.InsuranceCheckoutOvertime;
|
||||
workshop.InsuranceCheckoutFamilyAllowance = workshopObj.InsuranceCheckoutFamilyAllowance;
|
||||
return workshop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ public class LoanApplication : ILoanApplication
|
||||
}
|
||||
|
||||
_loanRepository.SaveChanges();
|
||||
transaction.Complete();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
|
||||
if (newRollCallDates.Any(x => employeeRollCalls.Any(y =>
|
||||
y.StartDate.Value.Date != command.DateFa.ToGeorgianDateTime().Date &&
|
||||
y.ShiftDate.Date != command.DateFa.ToGeorgianDateTime().Date &&
|
||||
x.EndDate >= y.StartDate.Value && x.StartDate <= y.EndDate.Value)))
|
||||
return operation.Failed("بازه های وارد شده با حضور غیاب های مربوط به روز های قبل و بعد تداخل زمانی دارد");
|
||||
|
||||
@@ -504,6 +504,12 @@ public class RollCallApplication : IRollCallApplication
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.ClearTimeDiff();
|
||||
rollCallsAsEntityModel.SetShiftDate(_rollCallDomainService);
|
||||
}
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.Edit(rollCallsAsEntityModel.StartDate.Value, rollCallsAsEntityModel.EndDate.Value, _rollCallDomainService);
|
||||
}
|
||||
@@ -644,7 +650,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
}
|
||||
|
||||
if (newRollCallDates.Any(x => employeeRollCalls.Any(y =>
|
||||
y.StartDate.Value.Date != command.DateFa.ToGeorgianDateTime().Date &&
|
||||
y.ShiftDate.Date != command.DateFa.ToGeorgianDateTime().Date &&
|
||||
x.EndDate >= y.StartDate.Value && x.StartDate <= y.EndDate.Value)))
|
||||
return operation.Failed("بازه های وارد شده با حضور غیاب های مربوط به روز های قبل و بعد تداخل زمانی دارد");
|
||||
|
||||
@@ -673,6 +679,12 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.ClearTimeDiff();
|
||||
rollCallsAsEntityModel.SetShiftDate(_rollCallDomainService);
|
||||
}
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
@@ -781,17 +793,17 @@ public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
List<DateTime> fromDates = commands.Select(x => x.FromDate.ToGeorgianDateTime()).ToList();
|
||||
var employeeIds = commands.Select(x => x.EmployeeId).ToList();
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractEnd)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش رسمی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractEnd)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی نهایی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractEnd)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی موقت است");
|
||||
}
|
||||
@@ -815,7 +827,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
rollCall.SetEndDateTime(rollCall.EndDate!.Value, _rollCallDomainService);
|
||||
}
|
||||
}
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
return operationResult.Succcedded();
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
||||
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
||||
}
|
||||
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout)
|
||||
{
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking);
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout);
|
||||
}
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
||||
string shiftwork)
|
||||
string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork);
|
||||
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork,hasRollCall, command, holidayWorking);
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Failed("شماره همراه نا معتبر است");
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -141,6 +141,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.FName = createTemp.FName;
|
||||
result.LName = createTemp.LName;
|
||||
result.DateOfBirthFa = dateOfBirth;
|
||||
result.FatherName = createTemp.FatherName;
|
||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||
result.IdNumber = idNumber;
|
||||
|
||||
return op.Succcedded(result);
|
||||
@@ -188,7 +190,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -196,10 +198,17 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (updateWorkshopList.Count == 0 && createNewWorkshopList.Count == 0)
|
||||
return op.Failed("هیچ مجموعه ای ایجاد نشده است");
|
||||
var oldWorkshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
#region Update
|
||||
if (updateWorkshopList.Count > 0)
|
||||
{
|
||||
var updateListIds = updateWorkshopList.Select(x => x.Id).ToList();
|
||||
var oldWorkshopsIds = oldWorkshops.Select(x => x.Id).ToList();
|
||||
var exceptWorkshops = oldWorkshopsIds.Except(updateListIds).ToList();
|
||||
if (exceptWorkshops.Any())
|
||||
await _workshopTempRepository.RemoveWorkshopTemps(exceptWorkshops);
|
||||
|
||||
|
||||
foreach (var workshop in updateWorkshopList)
|
||||
{
|
||||
@@ -212,6 +221,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
workshop.RollCall == false && workshop.Insurance == false)
|
||||
op.Failed($"برای مجموعه {workshop.WorkshopName} هیچ سرویسی انتخاب نشده است");
|
||||
var existWorkshops = _workshopTempRepository.Get(workshop.Id);
|
||||
|
||||
if (existWorkshops != null)
|
||||
{
|
||||
if (workshop.ContractAndCheckout)
|
||||
@@ -256,6 +266,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, workshop.Id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -324,6 +336,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -352,8 +366,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -380,9 +395,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => 12,
|
||||
};
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (int)(totalPayment1MonthDouble / 1000000) * 1000000;
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = roundAmount * months;
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
|
||||
@@ -394,31 +410,112 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
startDate = result.ContractStartCurrentMonthFa;
|
||||
|
||||
result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
|
||||
if (contractStartType == "nextMonth")
|
||||
startDate = result.ContractStartNextMonthFa;
|
||||
|
||||
|
||||
|
||||
var findeEnd = Tools.FindEndOfContract(startDate, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
result.ContractEndGr = contractEndDate;
|
||||
result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
|
||||
if (periodModel == "1")
|
||||
{
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "سررسید پرداخت اول",
|
||||
2 => "سررسید پرداخت دوم",
|
||||
3 => "سررسید پرداخت سوم",
|
||||
4 => "سررسید پرداخت چهارم",
|
||||
5 => "سررسید پرداخت پنجم",
|
||||
6 => "سررسید پرداخت ششم",
|
||||
7 => "سررسید پرداخت هفتم",
|
||||
8 => "سررسید پرداخت هشتم",
|
||||
9 => "سررسید پرداخت نهم",
|
||||
10 => "سررسید پرداخت دهم",
|
||||
11 => "سررسید پرداخت یازدهم",
|
||||
12 => "سررسید پرداخت دوازدهم",
|
||||
_ => "سررسید پرداخت دوازدهم",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
@@ -430,19 +527,21 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
|
||||
var contractStartDate = contractStart;
|
||||
string contractStartFa = contractStart.ToFarsi();
|
||||
var findeEnd = Tools.FindEndOfContract(contractStartFa, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
if (institutionContractTemp == null)
|
||||
{
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId,paymentModel,periodModel,totalPayment,contractstart,contractEnd,"official", valueAddedTax,"", "BeforeSendVerifyCode", 0,null,null);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -451,20 +550,20 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
|
||||
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractstart, contractEnd, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -483,14 +582,14 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
return op.Failed("خطا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "BeforeSendVerifyCode")
|
||||
@@ -516,26 +615,29 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
|
||||
if (DateTime.Now < institutionContractTemp.VerifyCodeEndTime.Value)
|
||||
return op.Failed("کد دریافت شده را وارد کنید");
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning > new TimeSpan(0, 1, 0)))
|
||||
if ((spaning > new TimeSpan(0, 1, 0)))
|
||||
{
|
||||
//ساخت کد شش رقمی
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult =await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if(!sendResult.IsSuccedded)
|
||||
if (!sendResult.IsSuccedded)
|
||||
return op.Failed($"{sendResult.Message}");
|
||||
|
||||
|
||||
@@ -544,16 +646,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//ذخیره تاریخ ارسال و مهلت پایان
|
||||
//ذخیره آیدی پیامک
|
||||
//تغییر وضعیت به ارسال شده
|
||||
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent",sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -580,25 +682,25 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
if(institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
if (institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
return op.Failed("خطا");
|
||||
|
||||
if(institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
if (institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
return op.Failed("کد شما منقضی شده است");
|
||||
|
||||
if(institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
if (institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
{
|
||||
if (institutionContractTemp.VerifyCode == verifyCode)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ 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.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();
|
||||
|
||||
@@ -315,7 +315,7 @@ 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.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);
|
||||
@@ -583,12 +583,13 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
//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);
|
||||
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();
|
||||
|
||||
@@ -665,7 +666,9 @@ 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.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);
|
||||
|
||||
@@ -8,6 +8,7 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
using Company.Domain.Contact2Agg;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
@@ -174,6 +175,8 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
public DbSet<ContactUs> ContactUs { get; set; }
|
||||
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
#endregion
|
||||
|
||||
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class ContactUsMapping:IEntityTypeConfiguration<ContactUs>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ContactUs> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
builder.Property(x => x.FullName).HasMaxLength(200);
|
||||
builder.Property(x => x.Title).HasMaxLength(200);
|
||||
builder.Property(x => x.Email).HasMaxLength(200);
|
||||
builder.Property(x => x.FirstName).HasMaxLength(100);
|
||||
builder.Property(x => x.LastName).HasMaxLength(100);
|
||||
builder.Property(x => x.Message).HasMaxLength(500);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(20);
|
||||
builder.Property(x => x.DateOfBirth).IsRequired(false);
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => string.IsNullOrWhiteSpace(v) ? Gender.None : (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
|
||||
|
||||
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addcontactus : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContactUs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FirstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Message = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContactUs", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContactUs");
|
||||
}
|
||||
}
|
||||
}
|
||||
9413
CompanyManagment.EFCore/Migrations/20250429180132_addNewPropToWorkshop.Designer.cs
generated
Normal file
9413
CompanyManagment.EFCore/Migrations/20250429180132_addNewPropToWorkshop.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addNewPropToWorkshop : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "InsuranceCheckoutFamilyAllowance",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "InsuranceCheckoutOvertime",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InsuranceCheckoutFamilyAllowance",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "InsuranceCheckoutOvertime",
|
||||
table: "Workshops");
|
||||
}
|
||||
}
|
||||
}
|
||||
9483
CompanyManagment.EFCore/Migrations/20250510145511_NewPropToEmployeeInsuranceListData.Designer.cs
generated
Normal file
9483
CompanyManagment.EFCore/Migrations/20250510145511_NewPropToEmployeeInsuranceListData.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class NewPropToEmployeeInsuranceListData : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "FamilyAllowance",
|
||||
table: "EmployeeInsurancListData",
|
||||
type: "float",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "OverTimePay",
|
||||
table: "EmployeeInsurancListData",
|
||||
type: "float",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FamilyAllowance",
|
||||
table: "EmployeeInsurancListData");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OverTimePay",
|
||||
table: "EmployeeInsurancListData");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -529,6 +529,50 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Contact", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContactUsAgg.ContactUs", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ContactUs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1957,6 +2001,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("IncludeStatus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -1984,6 +2031,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("MonthlySalary")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("OverTimePay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("StartWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -5555,6 +5605,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutFamilyAllowance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutOvertime")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
@@ -47,6 +47,27 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
_rollCallRepository = rollCallRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چیک میکند که آیا پرسنل در سال و ماه درخواستی در این کارگاه فیش حقوقی دارد یا خیر
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="employeId"></param>
|
||||
/// <param name="سال به صورت رشته عددی"></param>
|
||||
/// <param name="ماه بصورت رشته عددی"></param>
|
||||
/// <returns></returns>
|
||||
public (bool hasChekout, double FamilyAlloance, double OverTimePay) HasCheckout(long workshopId, long employeId, string year, string month)
|
||||
{
|
||||
var farisMonthName = Tools.ToFarsiMonthByNumber(month);
|
||||
|
||||
var res = _context.CheckoutSet.FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeId && x.Year == year && x.Month == farisMonthName &&
|
||||
x.IsActiveString == "true");
|
||||
if (res == null)
|
||||
return (false, 0, 0);
|
||||
|
||||
return (true, res.FamilyAllowance, res.OvertimePay);
|
||||
}
|
||||
|
||||
public EditCheckout GetDetails(long id)
|
||||
{
|
||||
return _context.CheckoutSet.Select(x => new EditCheckout()
|
||||
|
||||
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ContactUsRepository:RepositoryBase<long,ContactUs>,IContactUsRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public ContactUsRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
}
|
||||
@@ -191,6 +191,11 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
return true;
|
||||
}
|
||||
|
||||
if (command.BreakTime.BreakTimeValue != employeeSettings.BreakTime.BreakTimeValue || command.BreakTime.HasBreakTimeValue != employeeSettings.BreakTime.HasBreakTimeValue)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
case WorkshopShiftStatus.Irregular:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.DateSalaryAgg;
|
||||
using Company.Domain.DateSalaryItemAgg;
|
||||
@@ -54,8 +55,8 @@ public class DateSalaryRepository : RepositoryBase<long, DateSalary>, IDateSalar
|
||||
}
|
||||
public DateSalaryViewModel GetDateSalaryViewModel(DateSalarySearchModel searchModel)
|
||||
{
|
||||
var query = _context.DateSalaries.Where(x =>x.StartDateGr >= searchModel.StartDateGr && searchModel.StartDateGr<x.EndDateGr &&
|
||||
x.StartDateGr > searchModel.EndDateGr && searchModel.EndDateGr <= x.EndDateGr).FirstOrDefault();
|
||||
|
||||
var query = _context.DateSalaries.FirstOrDefault(x => x.StartDateGr < searchModel.EndDateGr && x.EndDateGr > searchModel.StartDateGr);
|
||||
var dateSalary = new DateSalaryViewModel();
|
||||
if (query != null)
|
||||
{
|
||||
|
||||
@@ -1035,28 +1035,10 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
|
||||
// آمادهسازی activeEmployees یکبار با EF و انتقال به حافظه
|
||||
var activeEmployees = _companyContext.LeftWorkList
|
||||
.Where(x => workshops.Contains(x.WorkshopId) && x.LeftWorkDate.AddDays(-1) >= now)
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var clientTemp = _companyContext.EmployeeClientTemps
|
||||
.Where(x => workshops.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var leftWorkTemp = _companyContext.LeftWorkTemps
|
||||
.Where(x => workshops.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
// ترکیب کل لیستها در حافظه
|
||||
var allActiveEmployees = activeEmployees
|
||||
.Concat(clientTemp)
|
||||
.Concat(leftWorkTemp);
|
||||
|
||||
// دریافت فقط اطلاعات مورد نیاز
|
||||
var employeeDocumentsQuery = _companyContext.EmployeeDocuments
|
||||
.Where(x => workshops.Contains(x.WorkshopId)
|
||||
&& allActiveEmployees.Any(a=>a.WorkshopId == x.WorkshopId && a.EmployeeId == x.EmployeeId)
|
||||
&& x.IsSentToChecker == false
|
||||
&& x.HasRejectedItems)
|
||||
.Where(x => x.EmployeeDocumentItemCollection
|
||||
@@ -1104,29 +1086,10 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
|
||||
public async Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId, long roleId)
|
||||
{
|
||||
var employeeIdsInWorkshop = await _companyContext.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId && x.LeftWorkDate.AddDays(-1) >= DateTime.Today)
|
||||
.Select(x => new { x.EmployeeId, FullName = x.Employee.FName + " " + x.Employee.LName })
|
||||
.Union(
|
||||
_companyContext.EmployeeClientTemps
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.Select(x => new { x.EmployeeId, FullName = x.EmployeeFullName })
|
||||
)
|
||||
.Union(
|
||||
_companyContext.LeftWorkTemps
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.Join(_companyContext.Employees, x => x.EmployeeId, e => e.id,
|
||||
(x, e) => new { x.EmployeeId, FullName = e.FName + " " + e.LName })
|
||||
)
|
||||
.Distinct()
|
||||
.ToListAsync();
|
||||
|
||||
var employeeIdList = employeeIdsInWorkshop.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
var edItemsQuery = _companyContext.EmployeeDocumentItems
|
||||
.Where(x => x.WorkshopId == workshopId &&
|
||||
x.DocumentStatus == DocumentStatus.Rejected &&
|
||||
employeeIdList.Contains(x.EmployeeId) &&
|
||||
x.EmployeeDocuments.IsSentToChecker == false &&
|
||||
x.EmployeeDocuments.HasRejectedItems)
|
||||
.Include(x => x.EmployeeDocuments).AsSplitQuery();
|
||||
@@ -1165,6 +1128,9 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
.Select(x => new MediaViewModel { Id = x.id, Path = x.Path })
|
||||
.ToListAsync();
|
||||
|
||||
var employeeIds = edItemsGrouped.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
var employees = _companyContext.Employees.Where(x => employeeIds.Contains(x.id)).ToList();
|
||||
|
||||
|
||||
var result = edItemsGrouped.GroupBy(x => x.EmployeeId)
|
||||
@@ -1184,7 +1150,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
StatusString = y.DocumentStatus.ToString()
|
||||
}).ToList();
|
||||
|
||||
var employeeInfo = employeeIdsInWorkshop.First(e => e.EmployeeId == x.Key);
|
||||
var employeeInfo = employees.First(e => e.id == x.Key);
|
||||
|
||||
//var requiredItemsUploaded = employeeLatestConfirmedDocuments
|
||||
// .Where(y => requiredDocs.Contains(y.DocumentItemLabel)).Select(y => y.DocumentItemLabel)
|
||||
|
||||
@@ -121,14 +121,14 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,
|
||||
item.InsuranceShare, item.StartWorkDate,
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance);
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
|
||||
}
|
||||
else
|
||||
{
|
||||
var employeeInsurancListDataObj = _employeeInsurancListDataRepository.Get(item.EmployeeInsurancListDataId);
|
||||
employeeInsurancListDataObj.Edit(item.WorkingDays,item.DailyWage,item.MonthlySalary,item.MonthlyBenefits,item .MonthlyBenefitsIncluded,item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,item.InsuranceShare,item.StartWorkDate,item.LeftWorkDate,item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance);
|
||||
item.BenefitsIncludedNonContinuous,item.InsuranceShare,item.StartWorkDate,item.LeftWorkDate,item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
}
|
||||
}
|
||||
_employeeInsurancListDataRepository.SaveChanges();
|
||||
@@ -641,7 +641,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,
|
||||
item.InsuranceShare, item.StartWorkDate,
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance);
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
|
||||
|
||||
}_employeeInsurancListDataRepository.SaveChanges();
|
||||
@@ -1374,6 +1374,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
@@ -170,7 +169,6 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}
|
||||
|
||||
|
||||
public InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command)
|
||||
{
|
||||
var planPercentage = _context.PlanPercentages.FirstOrDefault();
|
||||
@@ -184,7 +182,10 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه")
|
||||
.Select(x => x.ItemValue).FirstOrDefault();
|
||||
|
||||
if (command.ContractAndCheckout)
|
||||
command.ContractAndCheckoutInPerson = true;
|
||||
if(command.Insurance)
|
||||
command.InsuranceInPerson = true;
|
||||
|
||||
if (command.CountPerson > 0)
|
||||
{
|
||||
@@ -193,28 +194,28 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
.Select(plan => new InstitutionPlanViewModel
|
||||
{
|
||||
CountPerson = plan.CountPerson,
|
||||
|
||||
|
||||
ContractAndCheckoutDouble = command.ContractAndCheckout ?
|
||||
((dailyWage * planPercentage.ContractAndCheckoutPercent / 100) * plan.CountPerson * plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceDouble = command.Insurance ? (((dailyWage * planPercentage.InsurancePercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
RollCallDouble = command.RollCall ? (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage),
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
|
||||
CustomizeCheckoutDouble =command.CustomizeCheckout ? (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceInPersonDouble = command.InsuranceInPerson ? (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
if(planByCountPerson == null)
|
||||
if (planByCountPerson == null)
|
||||
return new InstitutionPlanViewModel();
|
||||
//مبلغ کل خدمات حضوری
|
||||
var inPersonSumAmount = planByCountPerson.ContractAndCheckoutDouble + planByCountPerson.InsuranceDouble +
|
||||
@@ -236,7 +237,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
{
|
||||
CountPerson = planByCountPerson.CountPerson,
|
||||
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
|
||||
Insurance = planByCountPerson.InsuranceDouble > 0 ? planByCountPerson.InsuranceDouble.ToMoney() : "0",
|
||||
|
||||
@@ -259,7 +260,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return new InstitutionPlanViewModel();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -154,13 +154,13 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
//گرفتن ساعت استراحت پرسنل از تنظیمات
|
||||
#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();
|
||||
|
||||
@@ -223,7 +223,7 @@ 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(breakTime, rollCallTimeSpanPerDay);
|
||||
var breakTimePerDay = RollCallMandatoryRepository.CalculateBreakTime(x.First().BreakTimeSpan, rollCallTimeSpanPerDay);
|
||||
|
||||
return new CheckoutDailyRollCallViewModel()
|
||||
{
|
||||
@@ -469,12 +469,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
}
|
||||
else if (late != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = late.TotalMinutes > 99 ? "99" : late.TotalMinutes.ToString();
|
||||
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
|
||||
return $"{minutes}+";
|
||||
}
|
||||
else if (early != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = early.TotalMinutes > 99 ? "99" : early.TotalMinutes.ToString();
|
||||
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
|
||||
return $"{minutes}-";
|
||||
}
|
||||
else
|
||||
@@ -491,12 +491,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
}
|
||||
else if (late != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = late.TotalMinutes > 99 ? "99" : late.TotalMinutes.ToString();
|
||||
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
|
||||
return $"{minutes}-";
|
||||
}
|
||||
else if (early != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = early.TotalMinutes > 99 ? "99" : early.TotalMinutes.ToString();
|
||||
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
|
||||
return $"{minutes}+";
|
||||
}
|
||||
else
|
||||
@@ -756,7 +756,8 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
WorkshopId = workshopId,
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
DateGr = x.ShiftDate
|
||||
DateGr = x.ShiftDate,
|
||||
ShiftDate = x.ShiftDate
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
|
||||
EmployeeId = x.EmployeeId,
|
||||
CreationDate = x.CreationDate.ToFarsi(),
|
||||
Id = x.id,
|
||||
MonthFa = pc.GetMonth(x.SalaryAidDateTime).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.SalaryAidDateTime).ToString(),
|
||||
MonthFa = pc.GetMonth(x.CalculationDate).ToFarsiMonthByIntNumber(),
|
||||
YearFa = pc.GetYear(x.CalculationDate).ToString(),
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(p => p.EmployeeId == x.EmployeeId).PersonnelCode.ToString(),
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
|
||||
@@ -195,7 +195,9 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
IsOldContract = x.IsOldContract,
|
||||
EmployerIdList = emp,
|
||||
HasRollCallFreeVip = x.HasRollCallFreeVip,
|
||||
WorkshopHolidayWorking = x.WorkshopHolidayWorking
|
||||
WorkshopHolidayWorking = x.WorkshopHolidayWorking,
|
||||
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime,
|
||||
InsuranceCheckoutFamilyAllowance = x.InsuranceCheckoutFamilyAllowance
|
||||
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
@@ -1553,6 +1555,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
TypeOfOwnership = x.TypeOfOwnership,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ArchiveCodeInt = Convert.ToInt32(x.ArchiveCode),
|
||||
AgentName = x.AgentName,
|
||||
AgentPhone = x.AgentPhone,
|
||||
State = x.State,
|
||||
@@ -1591,7 +1594,7 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
item.HasBlockContractingParty = blockContractingPartyIds.Intersect(empContractingPartyIds).Any();
|
||||
}
|
||||
|
||||
return list;
|
||||
return list.OrderBy(x=>x.ArchiveCodeInt).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -40,5 +40,11 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task RemoveWorkshopTemps(List<long> workshopTempIds)
|
||||
{
|
||||
var result = _context.WorkshopTemps.Where(x => workshopTempIds.Contains(x.id));
|
||||
|
||||
_context.RemoveRange(result);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
//محاسبه حقوق ماهیانه عیدی و پاداش ، سنوات
|
||||
#region GetMontlyBunosYears
|
||||
public MontlywageBunosYearsViewModel GetMontlyBunosYears(TimeSpan weeklyTime, DateTime contractStart, DateTime contractEnd, double daylyWage,
|
||||
string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking)
|
||||
string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM, string basic, int fridayStartToEnd, double dayliFeeComplete, bool hasRollCall, bool holidaysWorking, string shiftWork)
|
||||
{
|
||||
double basicDouble = basic.MoneyToDouble();
|
||||
double sub = 0;
|
||||
@@ -120,10 +120,13 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
var totalHours = totalHoursHDouble + totalHoursMDouble;// ساعت کارکرد پرسنل در این ماه
|
||||
|
||||
//var MandatoryDays = TotalDays - friday - officialholiday;
|
||||
var MandatoryDays = TotalDays - fridayStartToEnd;
|
||||
//اگر حضورغیاب داشت
|
||||
if (hasRollCall)
|
||||
MandatoryDays = TotalDays - fridayStartToEnd - officialholiday;
|
||||
//var MandatoryDays = TotalDays - fridayStartToEnd;
|
||||
////اگر حضورغیاب داشت
|
||||
//if (hasRollCall)
|
||||
var MandatoryDays = TotalDays - fridayStartToEnd - officialholiday;
|
||||
|
||||
if (!hasRollCall && shiftWork != "4")
|
||||
MandatoryDays = TotalDays - fridayStartToEnd;
|
||||
//بدست آوردن ساعت موظفی این ماه
|
||||
var TotalMandatoryHours = MandatoryDays * 7.33;//ساعت موظفی این ماه
|
||||
|
||||
|
||||
@@ -205,6 +205,8 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
@@ -425,6 +427,9 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -770,15 +770,45 @@
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parent"> <input type="checkbox" value="1000" class="check-btn"> <span style="bottom: 2px;position: relative"> کارپوشه </span> </label>
|
||||
|
||||
|
||||
@* <div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="801" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست مشاغل مقطوع </span> </label>
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1001" class="check-btn"> <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="10011" class="check-btn"> <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="10012" class="check-btn"> <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="10013" class="check-btn"> <span style="bottom: 2px;position: relative"> عدم تایید توسط ناظر - کلاینت </span> </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1002" class="check-btn"> <span style="bottom: 2px;position: relative"> اعلام شروع بکار توسط کافرما </span> </label>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1003" class="check-btn"> <span style="bottom: 2px;position: relative"> اعلام ترک کار توسط کافرما </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
|
||||
@@ -771,15 +771,44 @@
|
||||
</label>
|
||||
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parent"> <input type="checkbox" value="1000" class="check-btn"> <span style="bottom: 2px;position: relative"> کارپوشه </span> </label>
|
||||
|
||||
|
||||
@* <div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="801" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست مشاغل مقطوع </span> </label>
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1001" class="check-btn"> <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="10011" class="check-btn"> <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="10012" class="check-btn"> <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="10013" class="check-btn"> <span style="bottom: 2px;position: relative"> عدم تایید توسط ناظر - کلاینت </span> </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1002" class="check-btn"> <span style="bottom: 2px;position: relative"> اعلام شروع بکار توسط کافرما </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<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="1003" class="check-btn"> <span style="bottom: 2px;position: relative"> اعلام ترک کار توسط کافرما </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
|
||||
@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.WorkingHoursItems;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using CompanyManagment.Application;
|
||||
using Humanizer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -159,7 +160,7 @@ public class IndexModel : PageModel
|
||||
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
|
||||
if (checkout.HasRollCall)
|
||||
{
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId,checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId,checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork,true,workingHours,false);
|
||||
result.HasRollCall = true;
|
||||
}
|
||||
else
|
||||
@@ -180,9 +181,10 @@ public class IndexModel : PageModel
|
||||
workingHours.WorkshopId = contract.WorkshopIds;
|
||||
workingHours.EmployeeId = contract.EmployeeId;
|
||||
|
||||
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
//result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -200,7 +202,7 @@ public class IndexModel : PageModel
|
||||
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
|
||||
if (checkout.HasRollCall)
|
||||
{
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, true, workingHours, false);
|
||||
result.HasRollCall = true;
|
||||
}
|
||||
else
|
||||
@@ -221,7 +223,8 @@ public class IndexModel : PageModel
|
||||
workingHours.WorkshopId = contract.WorkshopIds;
|
||||
workingHours.EmployeeId = contract.EmployeeId;
|
||||
|
||||
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
//result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork, false, workingHours, workshop.WorkshopHolidayWorking);
|
||||
|
||||
|
||||
|
||||
@@ -330,6 +333,10 @@ public class IndexModel : PageModel
|
||||
return Partial("./Create", command);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// متد اصلاحی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<IActionResult> OnGetCorrectCheckout()
|
||||
{
|
||||
var result = await _workingHoursTempApplication.Correct();
|
||||
@@ -542,18 +549,20 @@ public class IndexModel : PageModel
|
||||
{
|
||||
mandatoryCompute = _rollCallMandatoryApplication.MandatoryCompute(contract.EmployeeId,
|
||||
contract.WorkshopIds,
|
||||
separation.ContractStartGr, separation.ContractEndGr, workingHours, workshop.WorkshopHolidayWorking);
|
||||
}
|
||||
else
|
||||
{
|
||||
mandatoryCompute = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
//var hasLeave = _leaveApplication.LeavOnChekout(separation.ContractStartGr,
|
||||
// separation.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
|
||||
//if (hasLeave != null)
|
||||
//{
|
||||
// //var LeaveCompute = MandatoryHours(workingHours, hasLeave.Id);
|
||||
//}
|
||||
}
|
||||
separation.ContractStartGr, separation.ContractEndGr, workingHours, workshop.WorkshopHolidayWorking,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
mandatoryCompute = _rollCallMandatoryApplication.MandatoryCompute(contract.EmployeeId,
|
||||
contract.WorkshopIds,
|
||||
separation.ContractStartGr, separation.ContractEndGr, workingHours, workshop.WorkshopHolidayWorking, true);
|
||||
//var hasLeave = _leaveApplication.LeavOnChekout(separation.ContractStartGr,
|
||||
// separation.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
|
||||
//if (hasLeave != null)
|
||||
//{
|
||||
// //var LeaveCompute = MandatoryHours(workingHours, hasLeave.Id);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
var employee = _employeeApplication.GetDetails(contract.EmployeeId);
|
||||
@@ -653,7 +662,7 @@ public class IndexModel : PageModel
|
||||
{
|
||||
foundMandatoryCompute = _rollCallMandatoryApplication.MandatoryCompute(contract.EmployeeId,
|
||||
contract.WorkshopIds,
|
||||
found.ContractStart, found.ContractEnd, foundWorkingHours, workshop.WorkshopHolidayWorking);
|
||||
found.ContractStart, found.ContractEnd, foundWorkingHours, workshop.WorkshopHolidayWorking,false);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -666,7 +675,7 @@ public class IndexModel : PageModel
|
||||
_yearlySalaryRepository.GetMontlyBunosYears(foundMandatoryCompute.weeklyTime, found.ContractStart, found.ContractEnd,
|
||||
foundMandatoryCompute.SalaryCompute.MoneyToDouble(), foundMandatoryCompute.SumTime44, foundMandatoryCompute.OfficialHoliday,
|
||||
int.Parse(foundMandatoryCompute.NumberOfFriday), foundMandatoryCompute.TotalHolidayAndNotH, foundMandatoryCompute.TotalHolidayAndNotM,
|
||||
foundMandatoryCompute.Basic, foundMandatoryCompute.FridayStartToEnd, foundMandatoryCompute.DayliFeeComplete, hasRollCall, workshop.WorkshopHolidayWorking);
|
||||
foundMandatoryCompute.Basic, foundMandatoryCompute.FridayStartToEnd, foundMandatoryCompute.DayliFeeComplete, hasRollCall, workshop.WorkshopHolidayWorking, workingHours.ShiftWork);
|
||||
double foundMontlySalary = MontlyYearsBunos.MontlyWage + MontlyYearsBunos.BasicYears;
|
||||
int foundTotaldays = Convert.ToInt32(MontlyYearsBunos.SumOfWorkingDay);
|
||||
double foundDayliWage = foundMontlySalary / foundTotaldays;
|
||||
@@ -776,7 +785,8 @@ public class IndexModel : PageModel
|
||||
TotalDayOfYearsCompute = yearsPay.YearsPay > 0 ? $"{yearsPay.TotalDayCompute}" : "0",
|
||||
TotalDayOfBunosesCompute = bunosesPay.Bunoses > 0 ? $"{bunosesPay.TotalDayCompute}" : "0",
|
||||
HolidayWorking = workshop.WorkshopHolidayWorking,
|
||||
};
|
||||
ShiftWork = workingHours.ShiftWork,
|
||||
};
|
||||
_checkoutApplication.Create(command);
|
||||
|
||||
//var workshopId = $"{contract.WorkshopIds}";
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
}
|
||||
|
||||
.modal-body2 {
|
||||
background-color: #f2fbfb;
|
||||
width: 100%;
|
||||
height: 674px;
|
||||
border-radius: 25px;
|
||||
position: absolute;
|
||||
background-color: #f2fbfb;
|
||||
width: 100%;
|
||||
height: 720px;
|
||||
border-radius: 25px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.rotateHead {
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row" style="margin-top: 50px;">
|
||||
<div class="col-md-9"></div>
|
||||
<div class="modal2-btns col-md-3">
|
||||
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -507,6 +507,14 @@
|
||||
بر اساس ماده 190 قانون کار جمهوری اسلامی ایران ، پرسنل اقرار مینماید کلیه مبالغ پیش بینی شده در قانون کار را وفق قرارداد منعقده دریافت مینماید. این مبالغ قسمتی بصورت مستقیم از سوی کارفرما و قسمتی بر اساس شرایط کارگاه از محل درآمد حاصله از مشتری اخذ میگردد . با توجه به شرایط کارگاه کلیه مبالغ بصورت واریز به حساب و وجه نقد رایج کشور ، تواما به پرسنل پرداخت میگردد. امضا تصفیه حساب دارای مبالغ ، توسط پرسنل نشانگر تصفیه قطعی ایشان میباشد.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
break;
|
||||
case 683 or 687:
|
||||
|
||||
<div class="row m-t-5" style="padding: 0px 24px 10px">
|
||||
<p style="text-align: justify;">
|
||||
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
|
||||
|
||||
</div>
|
||||
break;
|
||||
default:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -450,6 +450,14 @@
|
||||
|
||||
</div>
|
||||
break;
|
||||
case 683 or 687:
|
||||
|
||||
<div class="row m-t-5" style="padding: 0px 24px 10px">
|
||||
<p style="text-align: justify;">
|
||||
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
|
||||
|
||||
</div>
|
||||
break;
|
||||
default:
|
||||
<textarea class="form-control"></textarea>
|
||||
break;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,148 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.LeftWork.EditLeftWork
|
||||
@{
|
||||
}
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="ReloadLeftWork">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group m-b-0" dir="rtl">
|
||||
<label asp-for="StartWorkDate" class="control-label m-r-5">تاریخ شروع به کار</label>
|
||||
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate"/>
|
||||
|
||||
<span asp-validation-for="StartWorkDate" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group m-b-0" dir="rtl">
|
||||
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
|
||||
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate"/>
|
||||
|
||||
<span asp-validation-for="LeftWorkDate" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id"/>
|
||||
<input type="hidden" asp-for="EmployeeId"/>
|
||||
<input type="hidden" asp-for="WorkshopId"/>
|
||||
<input type="hidden" asp-for="WorkshopName"/>
|
||||
<input type="hidden" asp-for="EmployeeFullName"/>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = Model.EmployeeId, workshopId = Model.WorkshopId, hd = 1 })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function validDate(inputField) {
|
||||
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField.value;
|
||||
|
||||
var m1, m2;
|
||||
var y1, y2, y3, y4;
|
||||
var d1, d2;
|
||||
var s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
var yRes = y1 + y2 + y3 + y4;
|
||||
var year = parseInt(yRes);
|
||||
var mRes = m1 + m2;
|
||||
var month = parseInt(mRes);
|
||||
var dRes = d1 + d2;
|
||||
var day = parseInt(dRes);
|
||||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
|
||||
|
||||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||||
|
||||
|
||||
if (isValid) {
|
||||
inputField.style.backgroundColor = '#a6e9a6';
|
||||
$("button[type=submit]").attr('disabled', false);
|
||||
validCheck = true;
|
||||
|
||||
} else {
|
||||
inputField.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
$("button[type=submit]").attr('disabled', true);
|
||||
validCheck = false;
|
||||
|
||||
}
|
||||
return validCheck;
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.Leave.EditLeave
|
||||
@{
|
||||
//int i = 1;
|
||||
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
}
|
||||
@{
|
||||
<style>
|
||||
@@ -226,409 +227,12 @@
|
||||
background-color: #ffb9b9 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
if (IsAcceptedCheck) {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
$('#descriptionAcceptedCheck').addClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', true);
|
||||
} else {
|
||||
$('#descriptionAcceptedCheck').removeClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(
|
||||
function() {
|
||||
computeHourse();
|
||||
const saati = $('input:radio[class="saati"]');
|
||||
const roozane = $('input:radio[class="roozane"]');
|
||||
if ($(roozane).is(':checked') && $(roozane).val() == 'روزانه') {
|
||||
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$("#saati").css("visibility", "hidden");
|
||||
$('.hourses').css({
|
||||
display: "none"
|
||||
});
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
} else if ($(saati).is(':checked') && $(saati).val() == 'ساعتی') {
|
||||
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
$('.hourses').css({
|
||||
display: "flex"
|
||||
});
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('#roozaneh').hide();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
var computeLeavHourseAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavHourse")';
|
||||
var computeLeavDaysAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")';
|
||||
var checkIfValidToEditAjaxUrl = '@Url.Page("/Company/Contracts/Index", "CheckIfValidToEdit")';
|
||||
</script>
|
||||
|
||||
<script>
|
||||
computeDays();
|
||||
<script src="~/AssetsAdmin/page/Contracts/js/editPaidLeave.js?ver=@adminVersion"></script>
|
||||
|
||||
$('#save').on('click',
|
||||
function() {
|
||||
$("#descriptionAcceptedCheck").on("change",
|
||||
function() {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
const descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1 && $('.invalidTime').length < 1) {
|
||||
$('#editFinaly').click();
|
||||
}
|
||||
});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.date').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
const submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
$('#StartHoure').on("keyup",
|
||||
function() {
|
||||
const isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if (!$('#EndHours').hasClass('invalidTime') && $('#EndHours').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
$('#EndHours').on("keyup",
|
||||
function() {
|
||||
const isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if (!$('#StartHoure').hasClass('invalidTime') && $('#StartHoure').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
|
||||
function computeHourse() {
|
||||
$('.res').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavHourse")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startHours": $('#StartHoure').val(), "endHourse": $('#EndHours').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="res"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumHours').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function computeDays() {
|
||||
$('.resultDays').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="resultDays"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumDays').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
||||
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
||||
const fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
const yRes = y1 + y2 + y3 + y4;
|
||||
const year = parseInt(yRes);
|
||||
const mRes = m1 + m2;
|
||||
const month = parseInt(mRes);
|
||||
const dRes = d1 + d2;
|
||||
const day = parseInt(dRes);
|
||||
const fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
const test1 = checkEnValid(inputField1.value);
|
||||
|
||||
const isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
|
||||
window.location.hash = "##";
|
||||
},
|
||||
1000);
|
||||
});
|
||||
</script>
|
||||
@@ -1,6 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.Leave.EditLeave
|
||||
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
.panel-title {
|
||||
font-size: 14px;
|
||||
@@ -169,344 +170,8 @@
|
||||
|
||||
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
if (IsAcceptedCheck) {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
$('#descriptionAcceptedCheck').addClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', true);
|
||||
} else {
|
||||
$('#descriptionAcceptedCheck').removeClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#save').on('click',
|
||||
function() {
|
||||
$("#descriptionAcceptedCheck").on("change",
|
||||
function() {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
const descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1) {
|
||||
$('#editFinaly').click();
|
||||
}
|
||||
});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.date').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
const submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
||||
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
||||
const fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
const yRes = y1 + y2 + y3 + y4;
|
||||
const year = parseInt(yRes);
|
||||
const mRes = m1 + m2;
|
||||
const month = parseInt(mRes);
|
||||
const dRes = d1 + d2;
|
||||
const day = parseInt(dRes);
|
||||
const fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
const test1 = checkEnValid(inputField1.value);
|
||||
|
||||
const isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
var computeLeavDaysAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")';
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
computeDays();
|
||||
const saati = $('input:radio[class="saati"]');
|
||||
const roozane = $('input:radio[class="roozane"]');
|
||||
if ($(roozane).is(':checked') && $(roozane).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$("#saati").css("visibility", "hidden");
|
||||
$('.hourses').css({
|
||||
display: "none"
|
||||
});
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
}
|
||||
});
|
||||
|
||||
function computeDays() {
|
||||
$('.resultDays').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="resultDays"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumDays').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
|
||||
window.location.hash = "##";
|
||||
},
|
||||
1000);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/Contracts/js/editSickLeave.js?ver=@adminVersion"></script>
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.LeftWork.EditLeftWork
|
||||
@{
|
||||
}
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="ReloadLeftWork">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group m-b-0" dir="rtl">
|
||||
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
|
||||
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate"/>
|
||||
|
||||
<span asp-validation-for="LeftWorkDate" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id"/>
|
||||
<input type="hidden" asp-for="EmployeeId"/>
|
||||
<input type="hidden" asp-for="WorkshopId"/>
|
||||
<input type="hidden" asp-for="StartWorkDate"/>
|
||||
<input type="hidden" asp-for="WorkshopName"/>
|
||||
<input type="hidden" asp-for="EmployeeFullName"/>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = Model.EmployeeId })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function validDate(inputField) {
|
||||
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField.value;
|
||||
|
||||
var m1, m2;
|
||||
var y1, y2, y3, y4;
|
||||
var d1, d2;
|
||||
var s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
var yRes = y1 + y2 + y3 + y4;
|
||||
var year = parseInt(yRes);
|
||||
var mRes = m1 + m2;
|
||||
var month = parseInt(mRes);
|
||||
var dRes = d1 + d2;
|
||||
var day = parseInt(dRes);
|
||||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
|
||||
|
||||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||||
|
||||
|
||||
if (isValid) {
|
||||
inputField.style.backgroundColor = '#a6e9a6';
|
||||
$("button[type=submit]").attr('disabled', false);
|
||||
validCheck = true;
|
||||
|
||||
} else {
|
||||
inputField.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
$("button[type=submit]").attr('disabled', true);
|
||||
validCheck = false;
|
||||
|
||||
}
|
||||
return validCheck;
|
||||
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
|
||||
window.location.hash = "##";
|
||||
},
|
||||
1000);
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,388 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.LeftWork.CreateLeftWork
|
||||
@{
|
||||
var i = 1;
|
||||
|
||||
|
||||
}
|
||||
@{
|
||||
<style>
|
||||
.panel-title {
|
||||
font-size: 14px;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
padding: 5px 7px 5px 7px;
|
||||
}
|
||||
|
||||
.rad {
|
||||
border-radius: 8px !important;
|
||||
/* padding: 10px; */
|
||||
padding: 2px 5px 0px 5px;
|
||||
}
|
||||
|
||||
.faSize {
|
||||
font-size: 22px !important;
|
||||
}
|
||||
</style>
|
||||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
|
||||
}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="CreateLetWork" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="ReloadLeftWork">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 145px; text-align: center;"> شروع به کار / ترک کار </legend>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-12" dir="rtl" style="padding-left: 2.5%">
|
||||
<label class="sr-only" asp-for="WorkshopId"></label>
|
||||
<select class="form-control select-city" asp-for="WorkshopId" asp-items='new SelectList(Model.Workshops, "Id", "WorkshopFullName")'>
|
||||
<option value="">انتخاب کارگاه</option>
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="WorkshopId" class="error"></span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group m-b-0" dir="rtl">
|
||||
|
||||
|
||||
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" placeholder="تاریخ شروع به کار" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate"/>
|
||||
|
||||
<span asp-validation-for="StartWorkDate" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="m-t-10">
|
||||
<div class="panel panel-default" style="margin-bottom: 0px">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> سوابق شروع بکار و ترک کار(@Model.EmployeeFullName) </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="datatable" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
|
||||
<th style="font-size: 12px !important;text-align: center">#</th>
|
||||
<th style="font-size: 12px !important; text-align: center"> نام کارگاه</th>
|
||||
<th style="font-size: 12px !important; text-align: center"> تاریخ شروع</th>
|
||||
<th style="font-size: 12px !important; text-align: center"> تاریخ ترک کار </th>
|
||||
|
||||
<th style="font-size: 12px !important; width: 10%; text-align: center">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.LeftWorkSearch)
|
||||
{
|
||||
<tr>
|
||||
|
||||
<td style="font-size: 12px !important; text-align: center">@i </td>
|
||||
<td style="font-size: 12px !important; text-align: center">@item.WorkshopName </td>
|
||||
<td style="font-size: 12px !important; text-align: center">@item.StartWorkDate </td>
|
||||
|
||||
|
||||
@if (item.LeftWorkDate == "1500/01/01")
|
||||
{
|
||||
<td style="text-align: center">
|
||||
|
||||
<a class="btn btn-block btn-success pull-right m-rl-5 rad" style="max-width: -webkit-fill-available; padding: 3px"
|
||||
href="#showmodal=@Url.Page("/Company/Contracts/Index", "EnterLeftWork", new { item.Id, employeeName = Model.EmployeeFullName })">
|
||||
<span style="font-size: 16px !important"> <i class="fa fa-sign-out"></i> ثبت ترک کار </span>
|
||||
</a>
|
||||
|
||||
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
|
||||
@item.LeftWorkDate
|
||||
|
||||
</td>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@{
|
||||
i++;
|
||||
}
|
||||
<td>
|
||||
|
||||
@*<a class="btn btn-warning pull-right m-rl-5 rad"
|
||||
href="#showmodal=@Url.Page("/Company/Contracts/Index", "EditLeftWork", new { Id = item.Id })">
|
||||
<i class="fa faSize fa-edit"></i>
|
||||
</a>*@
|
||||
|
||||
|
||||
<a href="#" class="btn btn-danger pull-right m-rl-5 fff rad RemoveLeftWork">
|
||||
<i class="fa faSize fa-trash"></i>
|
||||
</a>
|
||||
<div style="display: none">
|
||||
<input type="hidden" name="LeftworkId" value="@item.Id"/>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" asp-for="EmployeeId"/>
|
||||
<input type="hidden" id="emp" asp-for="EmployeeFullName"/>
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
|
||||
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="RemoveLeftWork" autocomplete="off" id="sub"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="DeletLeftWork">
|
||||
|
||||
|
||||
<div style="display: none">
|
||||
<input type="hidden" id="LeftId" name="id"/>
|
||||
<input type="hidden" id="empName" name="employeeName"/>
|
||||
|
||||
<input type="hidden" asp-for="EmployeeId"/>
|
||||
<input type="hidden" asp-for="WorkshopId"/>
|
||||
<input type="hidden" asp-for="EmployeeFullName"/>
|
||||
|
||||
@*<input type="hidden" asp-for="id" value="id"/>*@
|
||||
<div class="modal-footer" style="margin-bottom: 10px">
|
||||
|
||||
|
||||
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none"/>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$('.RemoveLeftWork').on("click",
|
||||
function() {
|
||||
const id = $(this).closest("div").find("input[name='LeftworkId']").val();
|
||||
const emp = $('#emp').val();
|
||||
$('#LeftId').val(id);
|
||||
$('#empName').val(emp);
|
||||
|
||||
|
||||
swal({
|
||||
title: "آیا حذف این سابقه ترک کار اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$('#sendFinaly').click();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function validDate(inputField) {
|
||||
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField.value;
|
||||
|
||||
var m1, m2;
|
||||
var y1, y2, y3, y4;
|
||||
var d1, d2;
|
||||
var s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
var yRes = y1 + y2 + y3 + y4;
|
||||
var year = parseInt(yRes);
|
||||
var mRes = m1 + m2;
|
||||
var month = parseInt(mRes);
|
||||
var dRes = d1 + d2;
|
||||
var day = parseInt(dRes);
|
||||
var FixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
|
||||
|
||||
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
|
||||
|
||||
|
||||
if (isValid) {
|
||||
inputField.style.backgroundColor = '#a6e9a6';
|
||||
$("button[type=submit]").attr('disabled', false);
|
||||
validCheck = true;
|
||||
|
||||
} else {
|
||||
inputField.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
$("button[type=submit]").attr('disabled', true);
|
||||
validCheck = false;
|
||||
|
||||
}
|
||||
return validCheck;
|
||||
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.select-city').select2({
|
||||
language: "fa",
|
||||
dir: "rtl"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
|
||||
window.location.hash = "##";
|
||||
},
|
||||
1000);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
@*function EditLeft(id) {
|
||||
|
||||
|
||||
const leftId = id.value;
|
||||
|
||||
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "EditLeftWork")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": leftId },
|
||||
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.stat == false) {
|
||||
|
||||
$("button[type=submit]").attr('disabled', true)
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
|
||||
//swal("", response.message, "error");
|
||||
}
|
||||
else {
|
||||
$("button[type=submit]").attr('disabled', false)
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response)
|
||||
alert("خطایی رخ داده است. لطفا با مدیر سیستم تماس بگیرید");
|
||||
}
|
||||
});
|
||||
|
||||
}*@
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.Leave.CreateLeave
|
||||
@{
|
||||
var i = 1;
|
||||
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
}
|
||||
@{
|
||||
@@ -353,503 +353,11 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on("change",
|
||||
"#IsAccepted",
|
||||
function() {
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
if (IsAcceptedCheck) {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
$('#descriptionAcceptedCheck').addClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', true);
|
||||
} else {
|
||||
$('#descriptionAcceptedCheck').removeClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#save').on('click',
|
||||
function() {
|
||||
|
||||
$("#descriptionAcceptedCheck").on("change",
|
||||
function() {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
const descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1) {
|
||||
$('#saveFinaly').click();
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا خطاها را برطرف کنید");
|
||||
}
|
||||
});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.date').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
const submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
||||
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
||||
const fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
const yRes = y1 + y2 + y3 + y4;
|
||||
const year = parseInt(yRes);
|
||||
const mRes = m1 + m2;
|
||||
const month = parseInt(mRes);
|
||||
const dRes = d1 + d2;
|
||||
const day = parseInt(dRes);
|
||||
const fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
const test1 = checkEnValid(inputField1.value);
|
||||
|
||||
const isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
var computeLeavHourseAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavHourse")';
|
||||
var computeLeavDaysAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")';
|
||||
var checkIfValidToEditAjaxUrl = '@Url.Page("/Company/Contracts/Index", "CheckIfValidToEdit")';
|
||||
</script>
|
||||
<script>
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
|
||||
$('input:radio[name="PaidLeaveType"]').change(
|
||||
function() {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoure').removeClass("invalidTime");
|
||||
$('#StartHoure').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.hourses').css({
|
||||
display: "none"
|
||||
});
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
} else if ($(this).is(':checked') && $(this).val() == 'ساعتی') {
|
||||
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
|
||||
$('.hourses').css({
|
||||
display: "flex"
|
||||
});
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
$('#StartHoure').on("keyup",
|
||||
function() {
|
||||
const isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if ($('#EndHours').hasClass('validTime') && $('#EndHours').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
$('#EndHours').on("keyup",
|
||||
function() {
|
||||
const isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test($(this).val());
|
||||
if (isValid) {
|
||||
$(this).addClass("validTime");
|
||||
$(this).removeClass("invalidTime");
|
||||
if ($('#StartHoure').hasClass('validTime') && $('#StartHoure').val() != null) {
|
||||
computeHourse();
|
||||
}
|
||||
} else {
|
||||
$(this).removeClass("validTime");
|
||||
$(this).addClass("invalidTime");
|
||||
}
|
||||
});
|
||||
|
||||
function computeHourse() {
|
||||
$('.res').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavHourse")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startHours": $('#StartHoure').val(), "endHourse": $('#EndHours').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="res"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumHours').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function computeDays() {
|
||||
$('.resultDays').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="resultDays"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumDays').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
// function validateHM(inputField) {
|
||||
// /*var isValid = /^\d{1}?\d{1}:\d{1}?\d{1}$/.test(inputField.value);*/
|
||||
// var isValid = /^([2][0-3]|[1][0-9]|[0-9]|[0][0-9])([:][0-5][0-9])$/.test(inputField.value);
|
||||
// let isEmpty = inputField.value;
|
||||
|
||||
// if (isValid || isEmpty == "") {
|
||||
// if (isEmpty != "") {
|
||||
// inputField.style.backgroundColor = '#a6e9a6';
|
||||
// } else {
|
||||
// inputField.style.backgroundColor = '#fff';
|
||||
// }
|
||||
<script src="~/AssetsAdmin/page/Contracts/js/paidLeave.js?ver=@adminVersion"></script>
|
||||
|
||||
|
||||
// timeValid = true;
|
||||
|
||||
|
||||
// } else {
|
||||
// inputField.style.backgroundColor = '#f94c4c';
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا ساعت را بصورت صحیح وارد کنید");
|
||||
// timeValid = false;
|
||||
// }
|
||||
// return isValid;
|
||||
|
||||
// }
|
||||
</script>
|
||||
<script>
|
||||
//Edit Leave
|
||||
function checkIfValidToEdit(id) {
|
||||
var leaveId = Number(id);
|
||||
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
// async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "CheckIfValidToEdit")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": leaveId },
|
||||
success: function(response) {
|
||||
if (response.validToEdit) {
|
||||
|
||||
const goTo = `#showmodal=/Admin/Company/Contracts?id=${leaveId}&handler=EditPaidLeave`;
|
||||
console.log(goTo);
|
||||
window.location.href = goTo;
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "در بازه زمانی این مرخصی و یا بعد از آن فیش حقوقی وجود دارد");
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//remove Leave
|
||||
$('.RemoveLeftWork').on("click",
|
||||
function() {
|
||||
const id = $(this).closest("div").find("input[name='LeftworkId']").val();
|
||||
$('#LeftId').val(id);
|
||||
|
||||
|
||||
swal({
|
||||
title: "آیا حذف این سابقه مرخصی اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$('#sendFinaly').click();
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
// $(document).ready(function () {
|
||||
// setTimeout(function () {
|
||||
|
||||
// window.location.hash = "##";
|
||||
// }, 1000);
|
||||
// });
|
||||
</script>
|
||||
@@ -447,6 +447,14 @@
|
||||
بر اساس ماده 190 قانون کار جمهوری اسلامی ایران ، پرسنل اقرار مینماید کلیه مبالغ پیش بینی شده در قانون کار را وفق قرارداد منعقده دریافت مینماید. این مبالغ قسمتی بصورت مستقیم از سوی کارفرما و قسمتی بر اساس شرایط کارگاه از محل درآمد حاصله از مشتری اخذ میگردد . با توجه به شرایط کارگاه کلیه مبالغ بصورت واریز به حساب و وجه نقد رایج کشور ، تواما به پرسنل پرداخت میگردد. امضا تصفیه حساب دارای مبالغ ، توسط پرسنل نشانگر تصفیه قطعی ایشان میباشد.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
break;
|
||||
case 683 or 687:
|
||||
|
||||
<div class="row m-t-5" style="padding: 0px 24px 10px">
|
||||
<p style="text-align: justify;">
|
||||
در صورتی که طرف دوم قرارداد (پرسنل) اقدام به امضای این قرارداد نمود در صورت عدم ایفای تعهدات خود علی الخصوص عدم حضور در محل کارگاه مبلغ 200,000,000 ریال بعنوان خسارت می بایست به کارفرما پرداخت نماید
|
||||
|
||||
</div>
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.Leave.CreateLeave
|
||||
@{
|
||||
var i = 1;
|
||||
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
}
|
||||
@{
|
||||
@@ -281,363 +281,8 @@
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script>
|
||||
$('.RemoveLeftWork').on("click",
|
||||
function() {
|
||||
const id = $(this).closest("div").find("input[name='LeftworkId']").val();
|
||||
$('#LeftId').val(id);
|
||||
|
||||
swal({
|
||||
title: "آیا حذف این سابقه مرخصی اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('#sendFinaly').click();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var computeLeavDaysAjaxUrl = '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")';
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on("change",
|
||||
"#IsAccepted",
|
||||
function() {
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
if (IsAcceptedCheck) {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
$('#descriptionAcceptedCheck').addClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', true);
|
||||
} else {
|
||||
$('#descriptionAcceptedCheck').removeClass('disable-input');
|
||||
$("#descriptionAcceptedCheck").prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
<script src="~/AssetsAdmin/page/Contracts/js/sickLeave.js?ver=@adminVersion"></script>
|
||||
|
||||
$('#save').on('click',
|
||||
function() {
|
||||
|
||||
$("#descriptionAcceptedCheck").on("change",
|
||||
function() {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
const descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1) {
|
||||
$('#saveFinaly').click();
|
||||
}
|
||||
});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.date').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
const submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
||||
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
||||
const fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
}
|
||||
const yRes = y1 + y2 + y3 + y4;
|
||||
const year = parseInt(yRes);
|
||||
const mRes = m1 + m2;
|
||||
const month = parseInt(mRes);
|
||||
const dRes = d1 + d2;
|
||||
const day = parseInt(dRes);
|
||||
const fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
const test1 = checkEnValid(inputField1.value);
|
||||
|
||||
const isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
} else {
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
}
|
||||
return start1valid;
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$('input:radio[name="PaidLeaveType"]').change(function() {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoure').removeClass("invalidTime");
|
||||
$('#StartHoure').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.hourses').css({
|
||||
display: "none"
|
||||
});
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
}
|
||||
});
|
||||
|
||||
function computeDays() {
|
||||
$('.resultDays').remove();
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
|
||||
success: function(response) {
|
||||
const res = ` <span class="resultDays"><span> </span><span>:</span> <span> </span><span>${response.res}</span></span>`;
|
||||
$('.sumDays').append(res);
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
setTimeout(function() {
|
||||
|
||||
window.location.hash = "##";
|
||||
},
|
||||
1000);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1248,6 +1248,8 @@
|
||||
var includeStatus = Number($(this).attr('data-includeStatus')) == 1 ? true : false;
|
||||
|
||||
var leftWorkDate = $(this).find('td:eq(1)').attr("data-leftworkdate");
|
||||
var overTimePay = $(this).find('td:eq(1)').attr("data-OverTimePay");
|
||||
var familyAllowance = $(this).find('td:eq(1)').attr("data-FamilyAllowance");
|
||||
var nationality = $(this).attr("data-nationality");
|
||||
//console.log(leftWorkDate);
|
||||
var startWorkDate = $(this).find('td:eq(2)').attr("data-startworkdate");
|
||||
@@ -1343,6 +1345,10 @@
|
||||
}].MarriedAllowance" id="EmployeeInsurancListDataList_${i}__MarriedAllowance" value="${marriedAllowance}" />`);
|
||||
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="EmployeeInsurancListDataList[${i
|
||||
}].BaseYears" id="EmployeeInsurancListDataList_${i}__BaseYears" value="${baseYears}" />`);
|
||||
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="EmployeeInsurancListDataList[${i
|
||||
}].OverTimePay" id="EmployeeInsurancListDataList_${i}__OverTimePay" value="${overTimePay}" />`);
|
||||
$("#divEmployeeInsurancListData").append(`<input type="hidden" name="EmployeeInsurancListDataList[${i
|
||||
}].FamilyAllowance" id="EmployeeInsurancListDataList_${i}FamilyAllowance" value="${familyAllowance}" />`);
|
||||
});
|
||||
$("#form").submit();
|
||||
} else {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{
|
||||
var index = 1;
|
||||
|
||||
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet))
|
||||
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet || !x.EmployeeHasCheckout))
|
||||
{
|
||||
<script>
|
||||
|
||||
@@ -51,12 +51,12 @@
|
||||
<th colspan="4">
|
||||
|
||||
<p style="color: red">
|
||||
ابتدا وضعیت تاهل پرسنل در لیست زیر را مشخص نمایید
|
||||
ابتدا خطاهای پرسنل در لیست زیر را برطرف نمایید
|
||||
</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نوع خطا </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
|
||||
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
|
||||
@@ -69,10 +69,24 @@
|
||||
<tbody>
|
||||
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
|
||||
{
|
||||
if (!item.IsMaritalStatusSet)
|
||||
if (!item.IsMaritalStatusSet || !item.EmployeeHasCheckout)
|
||||
{
|
||||
<tr>
|
||||
<td class="td-ellipsis emptyTR" >
|
||||
|
||||
@{
|
||||
if (!item.IsMaritalStatusSet)
|
||||
{
|
||||
<span style="color: #ff00ce"> وضعیت تاهل ندارد </span>
|
||||
<br />
|
||||
}
|
||||
|
||||
if (!item.EmployeeHasCheckout)
|
||||
{
|
||||
<span style="color: red">فیش حقوقی ندارد</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
|
||||
<td class="td-ellipsis emptyTR">@item.LName</td>
|
||||
<td class="td-ellipsis emptyTR">@item.FName</td>
|
||||
@@ -153,6 +167,8 @@
|
||||
|
||||
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
|
||||
{
|
||||
<input type="hidden" id="familyAllownce" value="@item.FamilyAllowance" asp-for="@item.FamilyAllowance"/>
|
||||
<input type="hidden" value="@item.OverTimePay" asp-for="@item.OverTimePay"/>
|
||||
if (item.LeftWorkDate == item.StartMonthCurrent)
|
||||
{
|
||||
<tr data-hasconfilictjobs="@item.HasConfilictJobs" data-nationality="@item.Nationality" data-yearlySalaryItem="@item.YearlySalaryItem" data-IncludeStatus="@Convert.ToInt32(item.IncludeStatus)" class="leftwork" data-employeeId="@item.EmployeeId" data-insuranceEmployeeInformationId="@item.InsuranceEmployeeInformationId" data-DateOfIssue="@item.DateOfIssue">
|
||||
@@ -162,7 +178,7 @@
|
||||
<i class="fa faSize fa-sign-out"></i>
|
||||
</a>*@
|
||||
</td>
|
||||
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
|
||||
<td data-OverTimePay="@item.OverTimePay" data-FamilyAllowance="@item.FamilyAllowance" data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
|
||||
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
|
||||
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR" id="JobName">@item.JobName</td>
|
||||
<td data-InsuranceShare="0" data-EmployerShare="0" data-UnemploymentInsurance="0" class="small-font td-ellipsis emptyTR">0</td>
|
||||
@@ -195,7 +211,7 @@
|
||||
<i class="fa faSize fa-sign-out"></i>
|
||||
</a>*@
|
||||
</td>
|
||||
<td data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
|
||||
<td data-OverTimePay="@item.OverTimePay" data-FamilyAllowance="@item.FamilyAllowance" data-LeftWorkDate="@item.LeftWorkDateGr" class="small-font td-ellipsis ">@item.LeftWorkDate</td>
|
||||
<td data-StartWorkDate="@item.StartWorkDateGr" class="small-font td-ellipsis emptyTR">@item.StartWorkDate</td>
|
||||
<td data-Id="@item.JobId" data-jobcode="@item.JobCode" class="@(item.HasConfilictJobs && item.JobId != 10 ? "blink" : "") small-font td-ellipsis emptyTR jobName">@item.JobName</td>
|
||||
<td data-InsuranceShare="@item.InsuranceShare" data-EmployerShare="@item.EmployerShare" data-UnemploymentInsurance="@item.UnEmploymentInsurance" class="small-font td-ellipsis emptyTR">@item.InsuranceShare.ToMoney()</td>
|
||||
@@ -216,6 +232,7 @@
|
||||
<td class="td-ellipsis emptyTR">@item.LName</td>
|
||||
<td class="td-ellipsis emptyTR">@item.FName</td>
|
||||
<td class="td-ellipsis emptyTR">@item.InsuranceCode</td>
|
||||
|
||||
<td class="td-ellipsis ">@index</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
@if (Model.EmployeeDetailsForInsuranceList != null)
|
||||
{
|
||||
var index = 1;
|
||||
|
||||
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet))
|
||||
|
||||
if (Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet || !x.EmployeeHasCheckout))
|
||||
{
|
||||
<script>
|
||||
|
||||
@@ -51,12 +51,12 @@
|
||||
<th colspan="4">
|
||||
|
||||
<p style="color: red">
|
||||
ابتدا وضعیت تاهل پرسنل در لیست زیر را مشخص نمایید
|
||||
ابتدا خطاهای پرسنل در لیست زیر را برطرف نمایید
|
||||
</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نوع خطا </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
|
||||
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
|
||||
@@ -69,10 +69,24 @@
|
||||
<tbody>
|
||||
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
|
||||
{
|
||||
if (!item.IsMaritalStatusSet)
|
||||
if (!item.IsMaritalStatusSet || !item.EmployeeHasCheckout)
|
||||
{
|
||||
<tr>
|
||||
<td class="td-ellipsis emptyTR">
|
||||
|
||||
@{
|
||||
if (!item.IsMaritalStatusSet)
|
||||
{
|
||||
<span style="color: #ff00ce"> وضعیت تاهل ندارد </span>
|
||||
<br />
|
||||
}
|
||||
|
||||
if (!item.EmployeeHasCheckout)
|
||||
{
|
||||
<span style="color: red">فیش حقوقی ندارد</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
|
||||
<td class="td-ellipsis emptyTR">@item.LName</td>
|
||||
<td class="td-ellipsis emptyTR">@item.FName</td>
|
||||
@@ -85,12 +99,69 @@
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else if (Model.EmployeeDetailsForInsuranceList.Any(x=>x.FamilyAllowanceIsSet == false || x.OverTimeIsSet == false))
|
||||
{
|
||||
<script>
|
||||
$('#maritalStatusErr').val(true);
|
||||
</script>
|
||||
|
||||
<table id="DSKWOR" class="table table-bordered table-striped dataTable" style="min-width: 473px;">
|
||||
<colgroup>
|
||||
|
||||
<col class="colgp-4">
|
||||
<col class="colgp-3">
|
||||
<col class="colgp-2">
|
||||
<col class="colgp-1">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
|
||||
<p style="color: red">
|
||||
<span> محاسبات اضافه کار یا حق اولاد پرسنل زیر در لیست بیمه وجود ندارد </span>
|
||||
<br/>
|
||||
<span>لطفا لیست بیمه را حذف و مجددا ایجاد نمایید</span>
|
||||
</p>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> کدملی </th>
|
||||
<th class="header-styledit-btn sorting_asc_disabled sorting_desc_disabled"> نام خانوادگی </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled"> نام </th>
|
||||
<th class="header-style sorting_asc_disabled sorting_desc_disabled">#</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach (var item in Model.EmployeeDetailsForInsuranceList)
|
||||
{
|
||||
if (!item.OverTimeIsSet || !item.FamilyAllowanceIsSet)
|
||||
{
|
||||
<tr>
|
||||
|
||||
<td class="td-ellipsis @(item.Nationality == "ایرانی" ? "emptyTR" : "")">@item.NationalCode</td>
|
||||
<td class="td-ellipsis emptyTR">@item.LName</td>
|
||||
<td class="td-ellipsis emptyTR">@item.FName</td>
|
||||
<td class="td-ellipsis ">@index</td>
|
||||
</tr>
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<script>
|
||||
<script>
|
||||
|
||||
$('#maritalStatusErr').val(false);
|
||||
</script>
|
||||
|
||||
|
||||
}
|
||||
|
||||
<div class="col-md-6 @(Model.EmployeeDetailsForInsuranceList.Any(x => !x.IsMaritalStatusSet) ? "hideDataTable" : "")" style="float: left;">
|
||||
|
||||
@@ -719,8 +719,7 @@ public class IndexModel : PageModel
|
||||
|
||||
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
|
||||
{
|
||||
var employee = createInsuranceList.EmployeeDetailsForInsuranceList
|
||||
.Where(p => p.EmployeeId == item.EmployeeId).FirstOrDefault();
|
||||
var employee = createInsuranceList.EmployeeDetailsForInsuranceList.FirstOrDefault(p => p.EmployeeId == item.EmployeeId);
|
||||
|
||||
//var employeeObj = _employeeApplication.GetDetails(item.EmployeeId);
|
||||
|
||||
@@ -785,7 +784,7 @@ public class IndexModel : PageModel
|
||||
dswrec[20] = item.MonthlyBenefits.ToString();
|
||||
//دستمزد و مزایای ماهانه مشمول
|
||||
dswrec[21] = item.MonthlyBenefitsIncluded.ToString();
|
||||
//جمع کل دستمزد و مزایای ماهانه مسمول غیرمشمول
|
||||
//جمع کل دستمزد و مزایای ماهانه مشمول غیرمشمول
|
||||
dswrec[22] = item.IncludedAndNotIncluded.ToString();
|
||||
//حق بیمه سهم بیمه شده
|
||||
dswrec[23] = item.InsuranceShare.ToString();
|
||||
|
||||
@@ -449,7 +449,7 @@
|
||||
}
|
||||
var i = 1;
|
||||
var zeropscode = "zero-ps-code tooltip-container";
|
||||
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
|
||||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
|
||||
}
|
||||
@@ -848,9 +848,12 @@
|
||||
var alertModalAjax = '@Url.Page("./AutoExtension", "AlertModal")';
|
||||
var clockAjax = '@Url.Page("./AutoExtension", "Clock")';
|
||||
var createContractAjax = '@Url.Page("./AutoExtension", "CreateContract")';
|
||||
var EmployeesStartedWorkInSelectedPeriodAjaxUrl = '@Url.Page("./AutoExtension", "EmployeesStartedWorkInSelectedPeriod")';
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script src="~/AssetsAdmin/page/Workshop/js/AutoExtension.js"></script>
|
||||
<script src="~/AssetsAdmin/page/Workshop/js/AutoExtension.js?ver=@adminVersion"></script>
|
||||
|
||||
|
||||
}
|
||||
@@ -167,6 +167,50 @@ public class AutoExtensionModel : PageModel
|
||||
//Correction();
|
||||
}
|
||||
|
||||
public IActionResult OnPostEmployeesStartedWorkInSelectedPeriod(long workshopId, string startDate, string endDate, bool manualDate)
|
||||
{
|
||||
var start = startDate.ToGeorgianDateTime();
|
||||
var end = ($"{startDate.FindeEndOfMonth()}").ToGeorgianDateTime();
|
||||
if (manualDate)
|
||||
end = endDate.ToGeorgianDateTime();
|
||||
if (start >= end)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
founded = false,
|
||||
error = true
|
||||
});
|
||||
}
|
||||
var leftWorkSerchModel = new LeftWorkSearchModel
|
||||
{
|
||||
WorkshopId = workshopId
|
||||
};
|
||||
var leftWorkList = _leftWorkApplication.search(leftWorkSerchModel);
|
||||
|
||||
if (leftWorkList.Count > 0)
|
||||
{
|
||||
var res = leftWorkList.Where(x => x.StartWorkDateGr <= end && x.StartWorkDateGr > start).ToList();
|
||||
if (res.Count > 0)
|
||||
{
|
||||
return new JsonResult(new
|
||||
{
|
||||
founded = true,
|
||||
leftWorkList = res,
|
||||
error = false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
founded = false,
|
||||
error = false
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
public IActionResult OnGetContractStatus(long employeeId, long workshopId, string employeeName, string workshopname)
|
||||
{
|
||||
var command = new ContractStatusViewModel();
|
||||
|
||||
@@ -1,507 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.Workshop.CreateWorkshop
|
||||
@{
|
||||
<link href="~/AdminTheme/amirb/jspc-peach.css" rel="stylesheet"/>
|
||||
|
||||
@*<link href="~/lib/select2/css/select2.css" rel="stylesheet" />*@
|
||||
|
||||
<style>
|
||||
.modal-dialog {
|
||||
width: 94% !important;
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
||||
border: solid #9d9a9a 1px;
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
background-color: white;
|
||||
border: 1px solid #aaa;
|
||||
border-radius: 10px;
|
||||
cursor: text;
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<fieldset style="border: 1px solid #999797; height: 615px; border-radius: 10px; padding: revert">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> مشخصات کارگاه</legend>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-12" dir="rtl" style="padding-left: 2.5%">
|
||||
<label asp-for="@Model.EmployerIdList">
|
||||
انتخاب کارفرما <span style="color: red">*</span>
|
||||
</label>
|
||||
<select id="copy" class="form-control select-city" multiple asp-for="@Model.EmployerIdList" asp-items='new SelectList(Model.Employers, "Id", "FullName")'>
|
||||
@*<option value="@Model.EmployerIdList"> انتخاب کارفرما </option*@>
|
||||
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="Employers" class="error"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkshopName" class="control-label">
|
||||
نام کارگاه <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="WorkshopName">
|
||||
<span asp-validation-for="WorkshopName" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkshopSureName" class="control-label"> نام مستعار کارگاه </label>
|
||||
<input type="text" class="form-control" asp-for="WorkshopSureName">
|
||||
<span asp-validation-for="WorkshopSureName" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="ArchiveCode" class="control-label">
|
||||
شماره بایگانی <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="ArchiveCode">
|
||||
<span asp-validation-for="ArchiveCode" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="InsuranceCode" class="control-label">کد کارگاهی بیمه </label>
|
||||
<input type="text" class="form-control" asp-for="InsuranceCode">
|
||||
<span asp-validation-for="InsuranceCode" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="TypeOfOwnership" class="control-label"> نوع مالکیت </label>
|
||||
<input type="text" class="form-control" asp-for="TypeOfOwnership">
|
||||
<span asp-validation-for="TypeOfOwnership" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="AgentName" class="control-label">
|
||||
نام و نام خانوادگی نماینده <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="AgentName">
|
||||
<span asp-validation-for="AgentName" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
|
||||
<input type="text" class="form-control" asp-for="AgentPhone">
|
||||
<span asp-validation-for="AgentPhone" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" dir="rtl">
|
||||
|
||||
<label asp-for="State" class="control-label"> نام استان</label>
|
||||
@*<input type="text" value="" id="pcal1" class="pdate form-control" />
|
||||
<input type="hidden" value="" id="hide" asp-for="DateOfBirth">
|
||||
<span asp-validation-for="DateOfBirth" class="error"></span>*@
|
||||
|
||||
|
||||
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
|
||||
<option value="">انتخاب استان</option>
|
||||
<option value="تهران"> تهران </option>
|
||||
<option value="گیلان"> گیلان </option>
|
||||
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
|
||||
<option value="خوزستان"> خوزستان </option>
|
||||
<option value="فارس"> فارس</option>
|
||||
<option value="اصفهان"> اصفهان</option>
|
||||
<option value="خراسان رضوی">خراسان رضوی </option>
|
||||
<option value="قزوین"> قزوین</option>
|
||||
<option value="سمنان"> سمنان </option>
|
||||
<option value="قم"> قم</option>
|
||||
<option value="مرکزی"> مرکزی</option>
|
||||
<option value="زنجان"> زنجان</option>
|
||||
<option value="مازندران"> مازندران</option>
|
||||
<option value="گلستان"> گلستان</option>
|
||||
<option value="اردبیل"> اردبیل </option>
|
||||
<option value="آذربایجان غربی"> آذربایجان غربی</option>
|
||||
<option value="همدان"> همدان </option>
|
||||
<option value="کردستان"> کردستان </option>
|
||||
<option value="کرمانشاه"> کرمانشاه </option>
|
||||
<option value="لرستان"> لرستان</option>
|
||||
<option value="بوشهر"> بوشهر</option>
|
||||
<option value="کرمان"> کرمان</option>
|
||||
<option value="هرمزگان"> هرمزگان</option>
|
||||
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
|
||||
<option value="یزد"> یزد</option>
|
||||
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
|
||||
<option value="ایلام"> ایلام</option>
|
||||
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
|
||||
<option value="خراسان شمالی"> خراسان شمالی</option>
|
||||
<option value="خراسان جنوبی"> خراسان جنوبی</option>
|
||||
<option value="البرز"> البرز</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" dir="rtl">
|
||||
|
||||
|
||||
<label class="control-label"> نام شهر</label>
|
||||
<select class="form-control select-city" name="cityy" id="city">
|
||||
<option value="" placeholder="انتخاب شهر"> </option>
|
||||
</select>
|
||||
<input type="hidden" value="" id="hide2" asp-for="City">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="AgreementNumber" class="control-label"> ردیف پیمان </label>
|
||||
<input type="text" class="form-control text-center" value="000" asp-for="AgreementNumber">
|
||||
<span asp-validation-for="AgreementNumber" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12" style="padding-left: 3%;">
|
||||
@*<label asp-for="Address">آدرس</label>*@
|
||||
<textarea class="form-control" asp-for="Address" placeholder="آدرس"></textarea>
|
||||
<span asp-validation-for="Address" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div style="padding-right: 5px">
|
||||
<p class="pull-right">
|
||||
<a href="#showmodal=@Url.Page("/Company/Employers/Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px ">
|
||||
<i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i>
|
||||
</a>
|
||||
|
||||
</p>
|
||||
<p class="pull-right">
|
||||
<a href="#showmodal=@Url.Page("/Company/Employers/Index", "InsertLegal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #1d92e5; font-family: 'Web_Yekan' !important; color: #1d92e5 !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px ">
|
||||
<i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i>
|
||||
</a>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 185px; text-align: center;"> نحوه انجام امور قرارداد </legend>
|
||||
<div class="row m-b-10">
|
||||
|
||||
<div class="col-md-12">
|
||||
<label asp-for="@Model.AccountsList">
|
||||
تعیین دسترسی
|
||||
</label>
|
||||
<select class="form-control select-city2" multiple asp-for="@Model.AccountIdsList" asp-items='new SelectList(Model.AccountsList, "Id", "Fullname")'>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span asp-validation-for="TypeOfContract" class="error"></span>
|
||||
<fieldset style="border: 1px solid #c9c9c9; border-radius: 5px; margin-bottom: 10px; padding: revert;">
|
||||
<p>
|
||||
<label> مدت قرارداد </label>
|
||||
<div class="row" dir="ltr">
|
||||
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">1 ماهه</span> <input type="radio" value="1" asp-for="ContractTerm" checked>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">2 ماهه</span> <input type="radio" value="2" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">3 ماهه</span> <input type="radio" value="3" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">6 ماهه</span> <input type="radio" value="6" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">1 ساله</span> <input type="radio" value="12" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
</p>
|
||||
</fieldset>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بصورت استاندارد <input type="radio" value="a" asp-for="TypeOfContract" checked>
|
||||
</p>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه سنوات <input type="radio" value="b" asp-for="TypeOfContract">
|
||||
</p>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه عیدی <input type="radio" value="c" asp-for="TypeOfContract">
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه عیدی و سنوات <input type="radio" value="d" asp-for="TypeOfContract">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 195px; text-align: center;"> نحوه انجام امور بیمه ای</legend>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<input class="checkboxtitle" type="checkbox" asp-for="FixedSalary" id="checkSelect" onclick="selectori(this)"/>
|
||||
<span> این کارگاه شامل دستمزد مقطوع می باشد</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1" dir="rtl">
|
||||
|
||||
</div>
|
||||
@* <div class="form-group col-md-6" dir="rtl">
|
||||
<label id="jobsLable" asp-for="JobCode">انتخاب شغل با کد مربوطه</label>
|
||||
<select id="jobs" class="form-control select-city" asp-for="JobCode" asp-items='new SelectList(Model.JobCodeViewModels, "Code", "JobName")'>
|
||||
<option value=""></option>
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="JobCode" class="error"></span>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group col-md-4" dir="rtl">
|
||||
<label id="populationLable" asp-for="Population"> جمعیت شهر</label>
|
||||
<select id="population" class="form-control select-city" asp-for="Population">
|
||||
<option value=""></option>
|
||||
<option value="MoreThan500">بالای 500 هزار نفر</option>
|
||||
<option value="LessThan500"> پایین 500 هزار نفر</option>
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="Population" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<span asp-validation-for="TypeOfInsuranceSend" class="error"></span>
|
||||
<p>
|
||||
ارسال لیست بیمه عادی <input type="radio" value="ارسال لیست بیمه عادی" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
<p>
|
||||
ارسال لیست بیمه بصورت کمک دولت <input type="radio" value="ارسال لیست بیمه بصورت کمک دولت" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
<p>
|
||||
ارسال لیست بیمه کارگاه خانوادگی <input type="radio" value="ارسال لیست بیمه کارگاه خانوادگی" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@*<input type="hidden" asp-for="id" value="id"/>*@
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" onclick="sum()">ذخیره</button>
|
||||
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
<script>
|
||||
function sum() {
|
||||
|
||||
|
||||
const y = document.getElementById('city');
|
||||
const City = y.options[y.selectedIndex].text;
|
||||
|
||||
document.getElementById('hide2').value = City;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked) {
|
||||
document.getElementById("population").removeAttribute("disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobs").removeAttribute("disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobsLable").removeAttribute("style");
|
||||
document.getElementById("populationLable").removeAttribute("style");
|
||||
} else {
|
||||
document.getElementById("population").setAttribute("disabled", "disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("population").options.selectedIndex = 0;
|
||||
|
||||
document.getElementById("jobs").setAttribute("disabled", "disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("jobs").options.selectedIndex = 0;
|
||||
|
||||
document.getElementById("jobsLable").style.color = "#9b9b9b";
|
||||
document.getElementById("populationLable").style.color = "#9b9b9b";
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function selectori() {
|
||||
if (document.getElementById("checkSelect").checked) {
|
||||
document.getElementById("population").removeAttribute("disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobs").removeAttribute("disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobsLable").removeAttribute("style");
|
||||
document.getElementById("populationLable").removeAttribute("style");
|
||||
} else {
|
||||
document.getElementById("population").setAttribute("disabled", "disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("population").options.selectedIndex = 0;
|
||||
document.getElementById("select2-population-container").innerHTML = "";
|
||||
document.getElementById("jobs").setAttribute("disabled", "disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("jobs").options.selectedIndex = 0;
|
||||
document.getElementById("select2-jobs-container").innerHTML = "";
|
||||
document.getElementById("jobsLable").style.color = "#9b9b9b";
|
||||
document.getElementById("populationLable").style.color = "#9b9b9b";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@*<script type="text/javascript">
|
||||
var listArray = [];
|
||||
async function show() {
|
||||
var myArray = document.getElementById('copy');
|
||||
let intext = myArray.options[myArray.selectedIndex].value;
|
||||
|
||||
|
||||
|
||||
@foreach (var items in Model.Employers)
|
||||
{
|
||||
|
||||
@:listArray.push({ LName: "@items.LName", Id: @items.Id });
|
||||
|
||||
|
||||
|
||||
}
|
||||
for (var i = 0; i < listArray.length; i++) {
|
||||
if (listArray[i].Id == intext) {
|
||||
document.getElementById("past").innerHTML = listArray[i].LName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>*@
|
||||
@*<script src="~/lib/select2/js/select2.js"></script>
|
||||
<script src="~/lib/select2/js/i18n/fa.js"></script>*@
|
||||
@@ -1,828 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.Workshop.CreateWorkshop
|
||||
|
||||
<link href="@Href("~/admintheme/css/createWorkshop.css")" rel="stylesheet"/>
|
||||
<div id="createWorkshop">
|
||||
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="container">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="main-title">فرم ایجاد کارگاه</div>
|
||||
<div class="box">
|
||||
<div class="steps col-md-12">
|
||||
<div id="progress"></div>
|
||||
<div class="step">مشخصات کارگاه</div>
|
||||
<div class="step">امور قرارداد </div>
|
||||
<div class="step">امور بیمه ای </div>
|
||||
</div>
|
||||
<div class="row form" id="form1">
|
||||
<div class="col-md-12 col-xs-12 inputs EmployerIdList ">
|
||||
<label class="input-label">انتخاب کارفرما <span style="color: red;">*</span></label>
|
||||
<select class="select-city" multiple asp-for="@Model.EmployerIdList" onchange="getEmployer(this.value)" asp-items='new SelectList(Model.Employers, "Id", "FullName")'>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام کارگاه <span style="color: red;">*</span></label>
|
||||
<input asp-for="WorkshopName" type="text" placeholder="" class="form-control notEmptyWorkshop">
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label"> نام مستعار کارگاه</label>
|
||||
<input asp-for="WorkshopSureName" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2 col-xs-12 inputs">
|
||||
<label class="input-label"> نوع تملک </label>
|
||||
<select asp-for="TypeOfOwnership" class="form-control">
|
||||
<option value="" selected class="form-control"> </option>
|
||||
<option value="">مالکیت</option>
|
||||
<option value="">استیجاری</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2 col-xs-12 inputs">
|
||||
<label class="input-label">شماره بایگانی <span style="color: red;">*</span></label>
|
||||
<input asp-for="ArchiveCode" type="text" placeholder="" class="form-control notEmptyArchive">
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام و نام خانوادگی نماینده کارگاه </label>
|
||||
<input asp-for="AgentName" type="text" placeholder="" class="form-control">
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label"> سمت </label>
|
||||
<select name="job" class="form-control select-city">
|
||||
<option value=""> </option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">شماره تماس نماینده کارگاه </label>
|
||||
<input asp-for="AgentPhone" type="text" placeholder="" class="form-control">
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام استان </label>
|
||||
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
|
||||
<option value=""> استان</option>
|
||||
<option value="تهران"> تهران </option>
|
||||
<option value="گیلان"> گیلان </option>
|
||||
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
|
||||
<option value="خوزستان"> خوزستان </option>
|
||||
<option value="فارس"> فارس</option>
|
||||
<option value="اصفهان"> اصفهان</option>
|
||||
<option value="خراسان رضوی">خراسان رضوی </option>
|
||||
<option value="قزوین"> قزوین</option>
|
||||
<option value="سمنان"> سمنان </option>
|
||||
<option value="قم"> قم</option>
|
||||
<option value="مرکزی"> مرکزی</option>
|
||||
<option value="زنجان"> زنجان</option>
|
||||
<option value="مازندران"> مازندران</option>
|
||||
<option value="گلستان"> گلستان</option>
|
||||
<option value="اردبیل"> اردبیل </option>
|
||||
<option value="آذربایجان غربی"> آذربایجان غربی</option>
|
||||
<option value="همدان"> همدان </option>
|
||||
<option value="کردستان"> کردستان </option>
|
||||
<option value="کرمانشاه"> کرمانشاه </option>
|
||||
<option value="لرستان"> لرستان</option>
|
||||
<option value="بوشهر"> بوشهر</option>
|
||||
<option value="کرمان"> کرمان</option>
|
||||
<option value="هرمزگان"> هرمزگان</option>
|
||||
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
|
||||
<option value="یزد"> یزد</option>
|
||||
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
|
||||
<option value="ایلام"> ایلام</option>
|
||||
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
|
||||
<option value="خراسان شمالی"> خراسان شمالی</option>
|
||||
<option value="خراسان جنوبی"> خراسان جنوبی</option>
|
||||
<option value="البرز"> البرز</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام شهر </label>
|
||||
<select class="form-control select-city" name="cityy" id="city">
|
||||
<option value="" placeholder=" شهرستان"> </option>
|
||||
</select>
|
||||
<input type="hidden" value="" id="hide2" asp-for="City">
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام محله </label>
|
||||
@* <div class="select-wrapper">
|
||||
<input type="text" asp-for="ZoneName" class="col-md-10 input"/>
|
||||
<a class="addNeighbor col-md-2">
|
||||
<i class="fa fa-plus addNeighbor-address"></i>
|
||||
</a>
|
||||
</div>*@
|
||||
<div class="neighborField">
|
||||
<input type="text" class="neighborInput form-control">
|
||||
<a class="addNeighbor">
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xs-12 inputs">
|
||||
<label class="input-label">جزئیات نشانی </label>
|
||||
<input asp-for="Address" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
|
||||
<div class="modal-dialoge" role="document">
|
||||
<div class="modal-content2">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
|
||||
×
|
||||
</button>
|
||||
<div class="modal-title">افزودن نشانی جدید</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<select class="form-control">
|
||||
<option value="استان 1" selected>نام استان </option>
|
||||
<option value="استان 2" class="form-control">استان 2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<select class="form-control">
|
||||
<option value="شهر 1" selected>نام شهر </option>
|
||||
<option value="شهر 2" class="form-control">شهر 2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs wrapper">
|
||||
<input type="text" required/>
|
||||
<label>نام محله </label>
|
||||
</div>
|
||||
<div class="w-100">
|
||||
<div class="panel panel-default" id="city-table">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<div>
|
||||
<table id="datatable" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="font-size: 12px !important;text-align: center">#</th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام استان</th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام محله </th>
|
||||
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
|
||||
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form" id="form2">
|
||||
@if (Model.PermissionIds != null && Model.PermissionIds.Contains(10323))
|
||||
{
|
||||
<div class="col-xs-12 inputs">
|
||||
<label class="input-label">تعیین سطح دسترسی برای قرارداد </label>
|
||||
<select class="form-control select-city" multiple asp-for="@Model.AccountIdsList" asp-items='new SelectList(Model.AccountsList, "Id", "Fullname")'>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex-box">
|
||||
<div class="input-boxes col-md-6 col-sm-12 col-xs-12">
|
||||
<fieldset class="right content-fieldset contract-box">
|
||||
<div class="form2-title">لطفا مدت قرارداد خود را انتخاب کنید :</div>
|
||||
<div class="col-md-1 blank-div"></div>
|
||||
<div class="flexible-div flexible-radio col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">1 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">2 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">3 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">6 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">1 ساله</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">دائمی</span>
|
||||
</div>
|
||||
<input type="hidden" id="asp-contract-hidden" asp-for="ContractTerm"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="input-boxes col-md-6 col-sm-12 col-xs-12">
|
||||
<fieldset class="right content-fieldset contract-box">
|
||||
<div class="form2-title">در صورت تمایل به محاسبه ی عناوین ذیل در فیش حقوقی، گزینه های موردنظر را فعال نمایید</div>
|
||||
<div class="payTitles">
|
||||
<div class="flexible-div paymentDiv">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddLeavePayInput')" data-value="AddLeavePay" class="btn bonusActive btn-rounded waves-effect waves-light bonusSpan"> مزد و مرخصی </span>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddYearsPayInput')" class="btn bonusActive btn-rounded waves-effect waves-light bonusSpan"> سنوات </span>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddBonusesPayInput')" class="btn bonusActive btn-rounded waves-effect waves-light bonusSpan"> عیدی و پاداش </span>
|
||||
</div>
|
||||
<input type="checkbox" class="hiddenCheckbox" checked="checked" asp-for="AddLeavePay" id="AddLeavePayInput"/>
|
||||
<input type="checkbox" class="hiddenCheckbox" checked="checked" asp-for="AddYearsPay" id="AddYearsPayInput"/>
|
||||
<input type="checkbox" class="hiddenCheckbox" checked="checked" asp-for="AddBonusesPay" id="AddBonusesPayInput"/>
|
||||
</div>
|
||||
<div class="paymentDiv">
|
||||
<span onclick="addBonus(this, 'totalPayment')" data-value="totalPayment" class="totalPayment btn bonusActive waves-effect waves-light bonusSpan"> نمایش جمع تصفیه حساب </span>
|
||||
<input type="checkbox" asp-for="TotalPaymentHide" checked="checked" class="hiddenCheckbox" id="totalPayment"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="row inputs">
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
|
||||
<div class="optional-wages d-flex">
|
||||
<div class="d-flex single-checkbox">
|
||||
<span class="options-type" style="width: 100%;">مجموع مبالغ تصفیه حساب در ذیل فرم نمایش داده شود</span>
|
||||
<a onclick="addPayment(this)" class="totalActive" style="font-size: 30px;">
|
||||
<i class="ion-checkmark-circled" style="color: #20b723;"></i>
|
||||
</a>
|
||||
<input type="checkbox" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment" checked="checked" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex-box w-100">
|
||||
<h4 style="margin: auto;margin-top: 10%;" class="text-danger">
|
||||
شما مجوز دسترسی به این بخش را ندارید.
|
||||
</h4>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row form" id="form3">
|
||||
|
||||
@if (Model.PermissionIds != null && Model.PermissionIds.Contains(10324))
|
||||
{
|
||||
<div class="col-md-12 form3-boxes">
|
||||
<div class="col-md-6">
|
||||
<label class="input-label"><input type="checkbox" value="NormalList" asp-for="TypeOfInsuranceSend" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه عادی</label>
|
||||
<label class="input-label"><input type="checkbox" value="Govermentlist" asp-for="TypeOfInsuranceSend" class="myCheckbox checkboxes sendList">ارسال لیست بیمه کارگاه کمک دولت </label>
|
||||
<label class="input-label"><input type="checkbox" value="Familylist" asp-for="TypeOfInsuranceSend" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه خانوادگی</label>
|
||||
</div>
|
||||
<div class="col-md-3 disabled" id="myDiv4">
|
||||
<label class="input-label">کد کارگاهی بیمه</label>
|
||||
<input asp-for="InsuranceCode" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3 disabled" id="myDiv2">
|
||||
<label class="input-label"> ردیف پیمان</label>
|
||||
<input type="text" value="000" asp-for="AgreementNumber" class="form-control" id="zeros">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 form3-boxes disabled" id="myDiv">
|
||||
<div class="col-md-12" style="margin-bottom: 10px;">
|
||||
<label class="input-label"><input type="checkbox" asp-for="FixedSalary" class="myCheckbox2 checkboxes"> این کارگاه مشمول دستمزد مقطوع می باشد</label>
|
||||
</div>
|
||||
<div class="disabled" id="myDiv3">
|
||||
<div class="col-md-8">
|
||||
<label class="input-label"> عنوان صنف و درجه / کد اقتصادی </label>
|
||||
<select class="select-city" id="jobName" asp-for="InsuranceJobId" asp-items='@Model.InsuranceJobViewModels'>
|
||||
<option value="" disabled selected> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="input-label"> جمعیت شهر </label>
|
||||
<select class="form-control" id="population" asp-for="Population">
|
||||
<option value="" disabled selected> </option>
|
||||
<option value="LessThan500">کمتر از 500000 نفر </option>
|
||||
<option value="MoreThan500">بیشتر از 500000 نفر</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex-box w-100">
|
||||
<h4 style="margin: auto;margin-top: 10%;" class="text-danger">
|
||||
شما مجوز دسترسی به این بخش را ندارید.
|
||||
</h4>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-footer-btns">
|
||||
<a class="btn btn-rounded" id="pre">مرحله قبل</a>
|
||||
<a class="btn btn-rounded" id="next">مرحله بعد</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-footer">
|
||||
<button class="btn btn-rounded" id="close" data-dismiss="modal">بستن</button>
|
||||
<a href="#" class="btn btn-rounded" id="save">ذخیره</a>
|
||||
<a href="#" class="btn btn-rounded" id="fakeSave">ذخیره</a>
|
||||
<button style="display: none;" type="submit" id="sendFinaly"></button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="isLegal"/>
|
||||
</form>
|
||||
</div>
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
|
||||
<script>
|
||||
$('#fakeSave').hide();
|
||||
$("#save").click(function() {
|
||||
|
||||
$('#save').hide();
|
||||
$('#fakeSave').show();
|
||||
var allInputsFilled = true;
|
||||
var selectElement = $('.EmployerIdList .select-city');
|
||||
var selectedOption = selectElement.find('option:selected');
|
||||
var selectedText = selectedOption.text();
|
||||
console.log(selectedText);
|
||||
|
||||
var selectCity = $('#city.select-city');
|
||||
var selectedCityOption = selectCity.find('option:selected');
|
||||
$('#hide2').val(selectedCityOption.text());
|
||||
|
||||
if (selectedText === "" || $(".notEmptyWorkshop").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$('.EmployerIdList .select2-container').addClass('errored');
|
||||
$(".notEmptyWorkshop").addClass('errored');
|
||||
$('#fakeSave').hide();
|
||||
$('#save').show();
|
||||
} else {
|
||||
$(".notEmptyWorkshop").removeClass('errored');
|
||||
$('.EmployerIdList .select2-container').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
|
||||
if ($(".notEmptyArchive").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$(".notEmptyArchive").addClass('errored');
|
||||
$('#save').show();
|
||||
$('#fakeSave').hide();
|
||||
// return;
|
||||
} else {
|
||||
$(".notEmptyArchive").removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
|
||||
}
|
||||
if ($('.myCheckbox2').is(':checked') && $('#isLegal').val() == "false") {
|
||||
if ($('#population').val() == '' || $('#population').val() == null) {
|
||||
$('#population').addClass('errored');
|
||||
allInputsFilled = false;
|
||||
// return;
|
||||
} else {
|
||||
$('#population').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
if ($('#jobName').val() == null || $('#jobName').val() == '') {
|
||||
$('#jobName').next('span').addClass('errored');
|
||||
allInputsFilled = false;
|
||||
// return;
|
||||
} else {
|
||||
$('#jobName').next('span').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// var criteria = [true, false];
|
||||
// var hasError=false;
|
||||
// let found = containsAll(criteria,isLegalList);
|
||||
// if(found){
|
||||
// $('#EmployerIdList').next('span').addClass('errored');
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد");
|
||||
// }
|
||||
//else
|
||||
if ($('.errored').length > 0) {
|
||||
// console.log(allInputsFilled);
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
$('#save').show();
|
||||
$('#fakeSave').hide();
|
||||
} else {
|
||||
|
||||
$('#sendFinaly').click();
|
||||
setTimeout(function() {
|
||||
|
||||
$('#save').show();
|
||||
$('#fakeSave').hide();
|
||||
},
|
||||
3000);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function getZone() {
|
||||
const y = document.getElementById('city');
|
||||
const cityValue = y.options[y.selectedIndex].text;
|
||||
|
||||
document.getElementById('hide2').value = cityValue;
|
||||
|
||||
const cityId = document.getElementById("city").value;
|
||||
$('#select-button').empty().append('<option selected="selected" value="0" >انتخاب محله</option>');
|
||||
if (cityId != null) {
|
||||
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "ZonelistLoad")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "cityId": cityId },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$.each(response.zoneList,
|
||||
function(i, item) {
|
||||
$('#select-button').append($('<option>',
|
||||
{
|
||||
value: item.zoneName,
|
||||
text: item.zoneName
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#asp-contract-hidden").val(1);
|
||||
$('span.contractDuration:contains("1 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
contractDuration();
|
||||
checkContractDuration();
|
||||
|
||||
$(".EmployerIdList .select2-container").addClass('notEmpty ');
|
||||
$('.activated').prop('checked', true);
|
||||
|
||||
$(function() {
|
||||
$('#edit-modal [data-parent-modal]').on('click',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const parentModalId = $(this).data('parent-modal');
|
||||
$(parentModalId).modal('hide');
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
$('.addNeighbor').on('click',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
$('#edit-modal').modal('show');
|
||||
});
|
||||
});
|
||||
|
||||
$("#edit-modal").on('hidden.bs.modal',
|
||||
function() {
|
||||
$('body').addClass('modal-open');
|
||||
});
|
||||
|
||||
$('.sendList').click(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('.sendList').not(this).prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
const myCheckbox = $('.myCheckbox');
|
||||
const myCheckbox2 = $('.myCheckbox2');
|
||||
const myDiv = $('#myDiv');
|
||||
const myDiv2 = $('#myDiv2');
|
||||
const myDiv3 = $('#myDiv3');
|
||||
const myDiv4 = $('#myDiv4');
|
||||
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked') && $('#isLegal').val() == "false") {
|
||||
myDiv.removeClass('disabled');
|
||||
} else {
|
||||
myDiv.addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv2.removeClass('disabled');
|
||||
} else {
|
||||
myDiv2.addClass('disabled');
|
||||
}
|
||||
});
|
||||
myCheckbox2.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv3.removeClass('disabled');
|
||||
} else {
|
||||
myDiv3.addClass('disabled');
|
||||
}
|
||||
});
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv4.removeClass('disabled');
|
||||
} else {
|
||||
myDiv4.addClass('disabled');
|
||||
}
|
||||
});
|
||||
$(".myCheckbox").on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$("#asp-hidden").val($(this).val());
|
||||
console.log($("#asp-hidden").val());
|
||||
} else {
|
||||
$("#asp-hidden").val('');
|
||||
$("#InsuranceCode").val('');
|
||||
}
|
||||
});
|
||||
|
||||
$("#pre").css({ 'box-shadow': 'none' });
|
||||
$("#next").click(function() {
|
||||
|
||||
var allInputsFilled = true;
|
||||
const selectElement = $('.EmployerIdList .select-city');
|
||||
const selectedOption = selectElement.find('option:selected');
|
||||
const selectedText = selectedOption.text();
|
||||
console.log(selectedText);
|
||||
|
||||
if (selectedText === "" || $(".notEmptyWorkshop").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$('.EmployerIdList .select2-container').addClass('errored');
|
||||
$(".notEmptyWorkshop").addClass('errored');
|
||||
$('#fakeSave').hide();
|
||||
$('#save').show();
|
||||
return;
|
||||
} else {
|
||||
$(".notEmptyWorkshop").removeClass('errored');
|
||||
$('.EmployerIdList .select2-container').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
|
||||
if ($(".notEmptyArchive").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$(".notEmptyArchive").addClass('errored');
|
||||
return;
|
||||
} else {
|
||||
$(".notEmptyArchive").removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
|
||||
//var criteria = [true, false];
|
||||
//var hasError=false;
|
||||
//let found = containsAll(criteria,isLegalList);
|
||||
//if(found){
|
||||
// $('#EmployerIdList').next('span').addClass('errored');
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد");
|
||||
//}
|
||||
//else
|
||||
if (!allInputsFilled) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
if ($('#form3').css('right') == '0px') {
|
||||
$("#next").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
} else if ($('#form2').css('left') == '1200px') {
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#progress").css({
|
||||
'width': '66.66%'
|
||||
|
||||
});
|
||||
$("#form1").css({
|
||||
right: '1200px'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '0'
|
||||
});
|
||||
|
||||
} else if ($('#form2').css('left') == '0px') {
|
||||
$("#next").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#progress").css({
|
||||
'width': '100%',
|
||||
'border-top-right-radius': '7px'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '1200px'
|
||||
});
|
||||
$("#form3").css({
|
||||
right: '0'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#pre").click(function() {
|
||||
$("#next").css({
|
||||
'background-color': "white",
|
||||
'color': '#1763b1'
|
||||
});
|
||||
if ($('#form2').css('left') == '1200px' && $('#form3').css('right') == '1200px') {
|
||||
$("#pre").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
|
||||
} else if ($('#form2').css('left') == '0px') {
|
||||
$("#progress").css({
|
||||
'width': '33.33%',
|
||||
'border-top-right-radius': '0px'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
console.log(1);
|
||||
$("#form2").css({
|
||||
left: '1200px'
|
||||
});
|
||||
$("#form1").css({
|
||||
right: 'initial'
|
||||
});
|
||||
|
||||
} else if ($('#form3').css('right') == '0px') {
|
||||
$("#progress").css({
|
||||
'width': '66.66%',
|
||||
'border-top-right-radius': '0px'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '0'
|
||||
});
|
||||
$("#form3").css({
|
||||
right: '1200px'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
//مدت قرارداد
|
||||
$(".contractDuration").on('click',
|
||||
function() {
|
||||
if (!$(this).hasClass('contActive')) {
|
||||
$(".contractDuration").removeClass('contActive');
|
||||
$(this).removeClass('btn-deactive').addClass('contActive');
|
||||
}
|
||||
contractDuration();
|
||||
});
|
||||
|
||||
function contractDuration() {
|
||||
if ($(".contActive").text() == '1 ماهه') {
|
||||
$("#asp-contract-hidden").val(1);
|
||||
} else if ($(".contActive").text() == '2 ماهه') {
|
||||
$("#asp-contract-hidden").val(2);
|
||||
} else if ($(".contActive").text() == '3 ماهه') {
|
||||
$("#asp-contract-hidden").val(3);
|
||||
} else if ($(".contActive").text() == '6 ماهه') {
|
||||
$("#asp-contract-hidden").val(6);
|
||||
} else if ($(".contActive").text() == '1 ساله') {
|
||||
$("#asp-contract-hidden").val(12);
|
||||
} else if ($(".contActive").text() == 'دائمی') {
|
||||
$("#asp-contract-hidden").val("ForEver");
|
||||
}
|
||||
}
|
||||
|
||||
function checkContractDuration() {
|
||||
const aspValueContract = $("#asp-contract-hidden").val();
|
||||
console.log(aspValueContract);
|
||||
if (aspValueContract != '' || aspValueContract != undefined) {
|
||||
if (aspValueContract == '1') {
|
||||
$('span.contractDuration:contains("1 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '2') {
|
||||
$('span.contractDuration:contains("2 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '3') {
|
||||
$('span.contractDuration:contains("3 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '6') {
|
||||
$('span.contractDuration:contains("6 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '12') {
|
||||
$('span.contractDuration:contains("12 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == 'ForEver') {
|
||||
$('span.contractDuration:contains("دائمی")').removeClass('btn-deactive').addClass("contActive");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//عناوین فیش حقوقی
|
||||
function addBonus(element, id) {
|
||||
if ($(element).hasClass('bonusActive')) {
|
||||
$(element).addClass('bonusDeactive').removeClass('bonusActive');
|
||||
$(`#${id}`).removeAttr("checked");
|
||||
} else {
|
||||
$(element).removeClass('bonusDeactive').addClass('bonusActive');
|
||||
$(`#${id}`).attr("checked", "checked");
|
||||
}
|
||||
$(`#${id}`).change();
|
||||
}
|
||||
//مجموع مبالغ
|
||||
//function addPayment(element) {
|
||||
// if ($(element).hasClass('totalActive')) {
|
||||
// $(element).addClass('totalDeactive').removeClass('totalActive');
|
||||
// $("#totalPayment").prop("checked", false);
|
||||
// $(element).children().replaceWith('<i class="ion-close-circled" style="color: #dd3632"></i>');
|
||||
// } else {
|
||||
// $(element).removeClass('totalDeactive').addClass('totalActive');
|
||||
// $("#totalPayment").prop("checked", true);
|
||||
// $(element).children().replaceWith('<i class="ion-checkmark-circled" style="color: #20b723"></i>');
|
||||
|
||||
// }
|
||||
// $("#totalPayment").change();
|
||||
//}
|
||||
|
||||
|
||||
var isLegalList = [];
|
||||
|
||||
function getEmployer(employerId) {
|
||||
|
||||
if (employerId !== null && employerId != '') {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/Workshops/Index", "GetEmployerName")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "employerId": employerId },
|
||||
success: function(response) {
|
||||
//console.log(response.isLegal);
|
||||
if ((response.isLegal && response.nationalId == '') || (!response.isLegal && response.nationalcode == '')) {
|
||||
swal({
|
||||
title: (response.isLegal ? "کارفرمای انتخاب شده شناسه ملی ندارد." : " کارفرمای انتخاب شده کد ملی ندارد."),
|
||||
text: (response.isLegal ? "در صورت تمایل به درج شناسه ملی به منوی کارفرما مراجعه نمایید." : "در صورت تمایل به درج کد ملی به منوی کارفرما مراجعه نمایید."),
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
$('#EmployerIdList option').filter(`[value="${employerId}"]`).remove();
|
||||
const option = new Option(response.lName, employerId);
|
||||
$("#EmployerIdList").append(option);
|
||||
$("#EmployerIdList").trigger("change");
|
||||
} else {
|
||||
$('#isLegal').val(response.isLegal);
|
||||
isLegalList.push(response.isLegal);
|
||||
}
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function containsAll(needles, haystack) {
|
||||
for (let i = 0; i < needles.length; i++) {
|
||||
if ($.inArray(needles[i], haystack) == -1) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -874,6 +874,19 @@
|
||||
@if (Model.Command.PermissionIds != null && Model.Command.PermissionIds.Contains(10324))
|
||||
{
|
||||
<div class="col-md-12 col-xs-12">
|
||||
<div class="row card m-b-10">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<h4>محاسبه اضافه کار و حق عائله مندی در لیست بیمه کارگاه</h4>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row card">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<h4>ارسال لیست بیمه کارگاه</h4>
|
||||
|
||||
@@ -1,464 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.Workshop.EditWorkshop
|
||||
@{
|
||||
<link href="~/AdminTheme/amirb/jspc-peach.css" rel="stylesheet"/>
|
||||
|
||||
@*<link href="~/lib/select2/css/select2.css" rel="stylesheet" />*@
|
||||
|
||||
<style>
|
||||
.modal-dialog {
|
||||
width: 94% !important;
|
||||
}
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
p{
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor:pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
||||
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<fieldset style="border: 1px solid #999797; height: 615px; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> مشخصات کارگاه</legend>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="form-group col-md-12" dir="rtl" style="padding-left: 2.5%">
|
||||
<label asp-for="@Model.EmployerIdList">
|
||||
انتخاب کارفرما <span style="color: red">*</span>
|
||||
</label>
|
||||
<select id="copy" class="form-control select-city" multiple asp-for="@Model.EmployerIdList" asp-items='new SelectList(Model.Employers, "Id", "FullName")'>
|
||||
<option value="@Model.EmployerIdList"> انتخاب کارفرما </option>
|
||||
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="Employers" class="error"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkshopName" class="control-label">
|
||||
نام کارگاه <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="WorkshopName">
|
||||
<span asp-validation-for="WorkshopName" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="WorkshopSureName" class="control-label"> نام مستعار کارگاه </label>
|
||||
<input type="text" class="form-control" asp-for="WorkshopSureName">
|
||||
<span asp-validation-for="WorkshopSureName" class="error"></span>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label asp-for="ArchiveCode" class="control-label">
|
||||
شماره بایگانی <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="ArchiveCode">
|
||||
<span asp-validation-for="ArchiveCode" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="InsuranceCode" class="control-label">کد کارگاهی بیمه </label>
|
||||
<input type="text" class="form-control" asp-for="InsuranceCode">
|
||||
<span asp-validation-for="InsuranceCode" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="TypeOfOwnership" class="control-label"> نوع مالکیت </label>
|
||||
<input type="text" class="form-control" asp-for="TypeOfOwnership">
|
||||
<span asp-validation-for="TypeOfOwnership" class="error"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="AgentName" class="control-label">
|
||||
نام و نام خانوادگی نماینده <span style="color: red">*</span>
|
||||
</label>
|
||||
<input type="text" class="form-control" asp-for="AgentName">
|
||||
<span asp-validation-for="AgentName" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
|
||||
<input type="text" class="form-control" asp-for="AgentPhone">
|
||||
<span asp-validation-for="AgentPhone" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" dir="rtl">
|
||||
|
||||
<label asp-for="State" class="control-label"> نام استان</label>
|
||||
|
||||
<select id="state" class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
|
||||
<option value="">انتخاب استان</option>
|
||||
<option value="تهران"> تهران </option>
|
||||
<option value="گیلان"> گیلان </option>
|
||||
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
|
||||
<option value="خوزستان"> خوزستان </option>
|
||||
<option value="فارس"> فارس</option>
|
||||
<option value="اصفهان"> اصفهان</option>
|
||||
<option value="خراسان رضوی">خراسان رضوی </option>
|
||||
<option value="قزوین"> قزوین</option>
|
||||
<option value="سمنان"> سمنان </option>
|
||||
<option value="قم"> قم</option>
|
||||
<option value="مرکزی"> مرکزی</option>
|
||||
<option value="زنجان"> زنجان</option>
|
||||
<option value="مازندران"> مازندران</option>
|
||||
<option value="گلستان"> گلستان</option>
|
||||
<option value="اردبیل"> اردبیل </option>
|
||||
<option value="آذربایجان غربی"> آذربایجان غربی</option>
|
||||
<option value="همدان"> همدان </option>
|
||||
<option value="کردستان"> کردستان </option>
|
||||
<option value="کرمانشاه"> کرمانشاه </option>
|
||||
<option value="لرستان"> لرستان</option>
|
||||
<option value="بوشهر"> بوشهر</option>
|
||||
<option value="کرمان"> کرمان</option>
|
||||
<option value="هرمزگان"> هرمزگان</option>
|
||||
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
|
||||
<option value="یزد"> یزد</option>
|
||||
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
|
||||
<option value="ایلام"> ایلام</option>
|
||||
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
|
||||
<option value="خراسان شمالی"> خراسان شمالی</option>
|
||||
<option value="خراسان جنوبی"> خراسان جنوبی</option>
|
||||
<option value="البرز"> البرز</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" dir="rtl">
|
||||
|
||||
|
||||
<label class="control-label"> نام شهر</label>
|
||||
<select class="form-control select-city" asp-for="City" name="cityy" id="city">
|
||||
<option value=""> @Model.City</option>
|
||||
</select>
|
||||
|
||||
<input type="hidden" value="@Model.City" id="hide2" asp-for="City">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12" style="padding-left: 3%;">
|
||||
@*<label asp-for="Address">آدرس</label>*@
|
||||
<textarea class="form-control" asp-for="Address" placeholder="آدرس"></textarea>
|
||||
<span asp-validation-for="Address" class="text-danger"></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 m-r-10">
|
||||
<div class="m-r-20" style="padding-right: 20px">
|
||||
<p class="pull-right">
|
||||
<a href="#showmodal=@Url.Page("/Company/Employers/Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px ">
|
||||
<i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i>
|
||||
</a>
|
||||
|
||||
</p>
|
||||
<p class="pull-right">
|
||||
<a href="#showmodal=@Url.Page("/Company/Employers/Index", "InsertLegal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #1d92e5; font-family: 'Web_Yekan' !important; color: #1d92e5 !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px ">
|
||||
<i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #1d92e5 !important "></i>
|
||||
</a>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 185px; text-align: center;"> نحوه انجام امور قرارداد </legend>
|
||||
<div class="row m-b-10">
|
||||
<div class="col-md-12">
|
||||
<label asp-for="@Model.AccountsList">
|
||||
تعیین دسترسی
|
||||
</label>
|
||||
<select class="form-control select-city2" multiple asp-for="@Model.AccountIdsList" asp-items='new SelectList(Model.AccountsList, "Id", "Fullname")'>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span asp-validation-for="TypeOfContract" class="error"></span>
|
||||
<fieldset style="border: 1px solid #c9c9c9; border-radius: 5px; margin-bottom: 10px; padding: revert;">
|
||||
<p>
|
||||
<label> مدت قرارداد </label>
|
||||
<div class="row" dir="ltr">
|
||||
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">1 ماهه</span> <input type="radio" value="1" asp-for="ContractTerm" checked>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">2 ماهه</span> <input type="radio" value="2" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">3 ماهه</span> <input type="radio" value="3" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">6 ماهه</span> <input type="radio" value="6" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<span>
|
||||
<span dir="rtl">1 ساله</span> <input type="radio" value="12" asp-for="ContractTerm">
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
</p>
|
||||
</fieldset>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بصورت استاندارد <input type="radio" value="a" asp-for="TypeOfContract" checked>
|
||||
</p>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه سنوات <input type="radio" value="b" asp-for="TypeOfContract">
|
||||
</p>
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه عیدی <input type="radio" value="c" asp-for="TypeOfContract">
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
قرارداد و تصفیه حساب بدون محاسبه عیدی و پاداش <input type="radio" value="d" asp-for="TypeOfContract">
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 195px; text-align: center;"> نحوه انجام امور بیمه ای</legend>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<input class="checkboxtitle" type="checkbox" asp-for="FixedSalary" id="checkSelect" onclick="selectori(this)"/>
|
||||
<span> این کارگاه شامل دستمزد مقطوع می باشد</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-1" dir="rtl">
|
||||
|
||||
</div>
|
||||
@* <div class="form-group col-md-6" dir="rtl">
|
||||
<label id="jobsLable" asp-for="JobCode">انتخاب شغل با کد مربوطه</label>
|
||||
<select id="jobs" class="form-control select-city" asp-for="JobCode" asp-items='new SelectList(Model.JobCodeViewModels, "Code", "JobName")'>
|
||||
<option value=""></option>
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="JobCode" class="error"></span>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group col-md-4" dir="rtl">
|
||||
<label id="populationLable" asp-for="Population"> جمعیت شهر</label>
|
||||
<select id="population" class="form-control select-city" asp-for="Population">
|
||||
<option value=""></option>
|
||||
<option value="MoreThan500">بالای 500 هزار نفر</option>
|
||||
<option value="LessThan500"> پایین 500 هزار نفر</option>
|
||||
|
||||
</select>
|
||||
<span asp-validation-for="Population" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group">
|
||||
<span asp-validation-for="TypeOfInsuranceSend" class="error"></span>
|
||||
<p>
|
||||
ارسال لیست بیمه عادی <input type="radio" value="ارسال لیست بیمه عادی" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
<p>
|
||||
ارسال لیست بیمه بصورت کمک دولت <input type="radio" value="ارسال لیست بیمه بصورت کمک دولت" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
<p>
|
||||
ارسال لیست بیمه کارگاه خانوادگی <input type="radio" value="ارسال لیست بیمه کارگاه خانوادگی" asp-for="TypeOfInsuranceSend">
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id"/>
|
||||
<div class="modal-footer">
|
||||
|
||||
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" onclick="sum()">ذخیره</button>
|
||||
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
<script type="text/javascript">
|
||||
function sum() {
|
||||
|
||||
|
||||
const y = document.getElementById('city');
|
||||
const City = y.options[y.selectedIndex].text;
|
||||
|
||||
document.getElementById('hide2').value = City;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked) {
|
||||
document.getElementById("population").removeAttribute("disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobs").removeAttribute("disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobsLable").removeAttribute("style");
|
||||
document.getElementById("populationLable").removeAttribute("style");
|
||||
} else {
|
||||
document.getElementById("population").setAttribute("disabled", "disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("population").options.selectedIndex = 0;
|
||||
|
||||
document.getElementById("jobs").setAttribute("disabled", "disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("jobs").options.selectedIndex = 0;
|
||||
|
||||
document.getElementById("jobsLable").style.color = "#9b9b9b";
|
||||
document.getElementById("populationLable").style.color = "#9b9b9b";
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function selectori() {
|
||||
if (document.getElementById("checkSelect").checked) {
|
||||
document.getElementById("population").removeAttribute("disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobs").removeAttribute("disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#fff";
|
||||
document.getElementById("jobsLable").removeAttribute("style");
|
||||
document.getElementById("populationLable").removeAttribute("style");
|
||||
} else {
|
||||
document.getElementById("population").setAttribute("disabled", "disabled");
|
||||
document.getElementById("population").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("population").options.selectedIndex = 0;
|
||||
document.getElementById("select2-population-container").innerHTML = "";
|
||||
document.getElementById("jobs").setAttribute("disabled", "disabled");
|
||||
document.getElementById("jobs").style.backgroundColor = "#e7e7e7";
|
||||
document.getElementById("jobs").options.selectedIndex = 0;
|
||||
document.getElementById("select2-jobs-container").innerHTML = "";
|
||||
document.getElementById("jobsLable").style.color = "#9b9b9b";
|
||||
document.getElementById("populationLable").style.color = "#9b9b9b";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
const state = document.getElementById('state').value;
|
||||
const city = document.getElementById('hide2').value;
|
||||
|
||||
iranwebsv(state);
|
||||
|
||||
$('#city option:contains("شهرستان")').text(city);
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -1,905 +0,0 @@
|
||||
@model CompanyManagment.App.Contracts.Workshop.EditWorkshop
|
||||
|
||||
<link href="@Href("~/admintheme/css/createWorkshop.css")" rel="stylesheet"/>
|
||||
|
||||
<div id="editWorkshop">
|
||||
<form asp-page="./Index" asp-page-handler="Edit" id="workshops" autocomplete="off"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-callback=""
|
||||
data-action="Refresh"
|
||||
enctype="multipart/form-data">
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id"/>
|
||||
<div class="container">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<div class="main-title">فرم ویرایش کارگاه</div>
|
||||
<div class="box">
|
||||
<div class="steps col-md-12">
|
||||
<div id="progress"></div>
|
||||
<div class="step">مشخصات کارگاه</div>
|
||||
<div class="step">امور قرارداد </div>
|
||||
<div class="step">امور بیمه ای </div>
|
||||
</div>
|
||||
|
||||
<div class="row form" id="form1">
|
||||
<div class="col-md-12 col-xs-12 inputs EmployerIdList ">
|
||||
<label class="form-control-label">انتخاب کارفرما <span style="color: red;">*</span></label>
|
||||
<select class="select-city" multiple asp-for="@Model.EmployerIdList" onchange="getEmployer(this.value)" asp-items='new SelectList(Model.Employers, "Id", "FullName")'>
|
||||
<option value="@Model.EmployerIdList"> انتخاب کارفرما </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label">نام کارگاه <span style="color: red;">*</span></label>
|
||||
<input asp-for="WorkshopName" type="text" placeholder="" class="form-control notEmptyWorkshop">
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label"> نام مستعار کارگاه</label>
|
||||
<input asp-for="WorkshopSureName" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2 col-xs-12 inputs">
|
||||
<label class="form-control-label"> نوع تملک </label>
|
||||
<select asp-for="TypeOfOwnership" class="form-control">
|
||||
<option value="" selected class="form-control"> </option>
|
||||
<option value="">مالکیت</option>
|
||||
<option value="">استیجاری</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-2 col-xs-12 inputs">
|
||||
<label class="form-control-label">شماره بایگانی <span style="color: red;">*</span></label>
|
||||
<input asp-for="ArchiveCode" type="text" placeholder="" class="form-control notEmptyArchive">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label">نام و نام خانوادگی نماینده کارگاه </label>
|
||||
<input asp-for="AgentName" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label"> سمت </label>
|
||||
<select name="job" class="form-control select-city">
|
||||
<option value=""> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label">شماره تماس نماینده کارگاه </label>
|
||||
<input asp-for="AgentPhone" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label">نام استان </label>
|
||||
<select class="form-control select-city" asp-for="State" id="state" name="state" onChange="iranwebsv(this.value);">
|
||||
<option value=""> استان</option>
|
||||
<option value="تهران"> تهران </option>
|
||||
<option value="گیلان"> گیلان </option>
|
||||
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
|
||||
<option value="خوزستان"> خوزستان </option>
|
||||
<option value="فارس"> فارس</option>
|
||||
<option value="اصفهان"> اصفهان</option>
|
||||
<option value="خراسان رضوی">خراسان رضوی </option>
|
||||
<option value="قزوین"> قزوین</option>
|
||||
<option value="سمنان"> سمنان </option>
|
||||
<option value="قم"> قم</option>
|
||||
<option value="مرکزی"> مرکزی</option>
|
||||
<option value="زنجان"> زنجان</option>
|
||||
<option value="مازندران"> مازندران</option>
|
||||
<option value="گلستان"> گلستان</option>
|
||||
<option value="اردبیل"> اردبیل </option>
|
||||
<option value="آذربایجان غربی"> آذربایجان غربی</option>
|
||||
<option value="همدان"> همدان </option>
|
||||
<option value="کردستان"> کردستان </option>
|
||||
<option value="کرمانشاه"> کرمانشاه </option>
|
||||
<option value="لرستان"> لرستان</option>
|
||||
<option value="بوشهر"> بوشهر</option>
|
||||
<option value="کرمان"> کرمان</option>
|
||||
<option value="هرمزگان"> هرمزگان</option>
|
||||
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
|
||||
<option value="یزد"> یزد</option>
|
||||
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
|
||||
<option value="ایلام"> ایلام</option>
|
||||
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
|
||||
<option value="خراسان شمالی"> خراسان شمالی</option>
|
||||
<option value="خراسان جنوبی"> خراسان جنوبی</option>
|
||||
<option value="البرز"> البرز</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="form-control-label">نام شهر </label>
|
||||
<select class="form-control select-city" name="cityy" id="city">
|
||||
</select>
|
||||
<input type="hidden" id="hide2" asp-for="City">
|
||||
<input type="hidden" value="@Model.City" id="hide3">
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<label class="input-label">نام محله </label>
|
||||
<div class="neighborField">
|
||||
<input type="text" asp-for="ZoneName" class="neighborInput form-control">
|
||||
<a class="addNeighbor">
|
||||
<i class="fa fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xs-12 inputs">
|
||||
<label class="form-control-label">جزئیات نشانی </label>
|
||||
<input asp-for="Address" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px); background-color: #0000005c;">
|
||||
<div class="modal-dialoge" role="document">
|
||||
<div class="modal-content2">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto; right: auto; margin-top: 20px; margin-right: 20px;">
|
||||
×
|
||||
</button>
|
||||
<div class="modal-title">افزودن نشانی جدید</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<select class="form-control">
|
||||
<option value="استان 1" selected>نام استان </option>
|
||||
<option value="استان 2" class="form-control">استان 2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs">
|
||||
<select class="form-control">
|
||||
<option value="شهر 1" selected>نام شهر </option>
|
||||
<option value="شهر 2" class="form-control">شهر 2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-4 col-xs-12 inputs wrapper">
|
||||
<input type="text" required/>
|
||||
<label>نام محله </label>
|
||||
</div>
|
||||
<div class="w-100">
|
||||
<div class="panel panel-default" id="city-table">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div>
|
||||
<div>
|
||||
<table id="datatable" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="font-size: 12px !important; text-align: center">#</th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام استان</th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
|
||||
<th style="font-size: 12px !important; text-align: center">نام محله </th>
|
||||
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
|
||||
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form" id="form2">
|
||||
@if (Model.PermissionIds != null && Model.PermissionIds.Contains(10323))
|
||||
{
|
||||
<div class="col-xs-12 inputs">
|
||||
<label class="form-control-label">تعیین سطح دسترسی برای قرارداد </label>
|
||||
<select class="form-control select-city" multiple asp-for="@Model.AccountIdsList" asp-items='new SelectList(Model.AccountsList, "Id", "Fullname")'>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex-box">
|
||||
<div class="input-boxes col-md-6 col-sm-12 col-xs-12">
|
||||
<fieldset class="right content-fieldset contract-box">
|
||||
<div class="form2-title">لطفا مدت قرارداد خود را انتخاب کنید :</div>
|
||||
<div class="col-md-1 blank-div"></div>
|
||||
<div class="flexible-div flexible-radio col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">1 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">2 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">3 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">6 ماهه</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">1 ساله</span>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-xs-6 spanBox">
|
||||
<span class="btn btn-deactive btn-rounded waves-effect waves-light contractDuration">دائمی</span>
|
||||
</div>
|
||||
<input type="hidden" id="asp-contract-hidden" asp-for="ContractTerm"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="input-boxes col-md-6 col-sm-12 col-xs-12">
|
||||
<fieldset class="right content-fieldset contract-box">
|
||||
<div class="form2-title" style="font-size: 12px;margin-bottom: 15px;">در صورت تمایل به محاسبه ی عناوین ذیل در فیش حقوقی، گزینه های موردنظر را فعال نمایید</div>
|
||||
<div class="payTitles">
|
||||
<div class="flexible-div paymentDiv">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddLeavePayInput')" data-value="AddLeavePay" class="AddLeavePay btn bonusActive waves-effect waves-light bonusSpan"> مزد و مرخصی </span>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddYearsPayInput')" class="AddYearsPay btn bonusActive waves-effect waves-light bonusSpan"> سنوات </span>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 spanBox">
|
||||
<span onclick="addBonus(this, 'AddBonusesPayInput')" class="AddBonusesPay btn bonusActive waves-effect waves-light bonusSpan"> عیدی و پاداش </span>
|
||||
</div>
|
||||
<input type="checkbox" class="hiddenCheckbox" asp-for="AddLeavePay" id="AddLeavePayInput"/>
|
||||
<input type="checkbox" class="hiddenCheckbox" asp-for="AddYearsPay" id="AddYearsPayInput"/>
|
||||
<input type="checkbox" class="hiddenCheckbox" asp-for="AddBonusesPay" id="AddBonusesPayInput"/>
|
||||
</div>
|
||||
<div class="paymentDiv">
|
||||
<span onclick="addBonus(this, 'totalPayment')" data-value="totalPayment" class="totalPayment btn bonusActive waves-effect waves-light bonusSpan"> نمایش جمع تصفیه حساب </span>
|
||||
<input type="checkbox" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment"/>
|
||||
@* <div class="optional-wages d-flex">
|
||||
<div class="d-flex single-checkbox">
|
||||
<span class="options-type" style="width: 100%;">مجموع مبالغ تصفیه حساب در ذیل فرم نمایش داده شود</span>
|
||||
<a onclick="addPayment(this)" class="paymentTag totalActive" style="font-size: 30px;">
|
||||
<i class="ion-checkmark-circled" style="color: #20b723;"></i>
|
||||
</a>
|
||||
@if (Model.TotalPaymentHide)
|
||||
{
|
||||
<input type="checkbox" checked="checked" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment" />
|
||||
}
|
||||
</div>
|
||||
</div>*@
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="row inputs">
|
||||
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
|
||||
<div class="optional-wages d-flex">
|
||||
<div class="d-flex single-checkbox">
|
||||
<span class="options-type" style="width: 100%;">مجموع مبالغ تصفیه حساب در ذیل فرم نمایش داده شود</span>
|
||||
<a onclick="addPayment(this)" class="paymentTag totalActive" style="font-size: 30px;">
|
||||
<i class="ion-checkmark-circled" style="color: #20b723;"></i>
|
||||
</a>
|
||||
@if(Model.TotalPaymentHide){
|
||||
<input type="checkbox" checked="checked" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="checkbox" asp-for="TotalPaymentHide" class="hiddenCheckbox" id="totalPayment" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>*@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex-box w-100">
|
||||
<h4 style="margin: auto;margin-top: 10%;" class="text-danger">
|
||||
شما مجوز دسترسی به این بخش را ندارید.
|
||||
</h4>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row form" id="form3">
|
||||
@if (Model.PermissionIds != null && Model.PermissionIds.Contains(10324))
|
||||
{
|
||||
<div class="col-md-12 form3-boxes">
|
||||
<div class="col-md-6">
|
||||
<label class="form-control-label"><input type="checkbox" value="NormalList" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه عادی</label>
|
||||
<label class="form-control-label"><input type="checkbox" value="Govermentlist" class="myCheckbox checkboxes sendList">ارسال لیست بیمه کارگاه کمک دولت </label>
|
||||
<label class="form-control-label"><input type="checkbox" value="Familylist" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه خانوادگی</label>
|
||||
<input type="hidden" asp-for="TypeOfInsuranceSend" id="asp-hidden"/>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 disabled" id="myDiv4">
|
||||
<label class="form-control-label">کد کارگاهی بیمه</label>
|
||||
<input asp-for="InsuranceCode" type="text" placeholder="" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 disabled" id="myDiv2">
|
||||
<label class="form-control-label"> ردیف پیمان</label>
|
||||
<input type="text" value="000" asp-for="AgreementNumber" class="form-control" id="zeros">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 form3-boxes disabled" id="myDiv">
|
||||
<div class="col-md-12" style="margin-bottom: 10px;">
|
||||
<label class="form-control-label"><input type="checkbox" asp-for="FixedSalary" class="myCheckbox2 checkboxes"> این کارگاه مشمول دستمزد مقطوع می باشد</label>
|
||||
</div>
|
||||
|
||||
<div class="disabled" id="myDiv3">
|
||||
<div class="col-md-8">
|
||||
<label class="form-control-label"> عنوان صنف و درجه / کد اقتصادی </label>
|
||||
<select class="select-city" id="jobName" asp-for="InsuranceJobId" asp-items='@Model.InsuranceJobViewModels'>
|
||||
<option value="" disabled selected> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-control-label"> جمعیت شهر </label>
|
||||
<select class="form-control" id="population" asp-for="Population">
|
||||
<option value="" disabled selected> </option>
|
||||
<option value="LessThan500">کمتر از 500000 نفر </option>
|
||||
<option value="MoreThan500">بیشتر از 500000 نفر</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex-box w-100">
|
||||
<h4 style="margin: auto;margin-top: 10%;" class="text-danger">
|
||||
شما مجوز دسترسی به این بخش را ندارید.
|
||||
</h4>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="form-footer-btns">
|
||||
<a class="btn btn-rounded" id="pre">مرحله قبل</a>
|
||||
<a class="btn btn-rounded" id="next">مرحله بعد</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-footer">
|
||||
<button class="btn btn-rounded" id="close" data-dismiss="modal">بستن</button>
|
||||
<button class=" btn btn-rounded" id="save">ذخیره</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<input type="hidden" id="isLegal"/>
|
||||
</form>
|
||||
</div>
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
contractDuration();
|
||||
checkContractDuration();
|
||||
checkBonus();
|
||||
|
||||
var aspValue = $("#asp-hidden").val();
|
||||
if (aspValue != "" || aspValue != undefined) {
|
||||
var checkbox = $(`input.myCheckbox[value="${aspValue}"]`);
|
||||
checkbox.prop("checked", true);
|
||||
}
|
||||
const myCheckbox = $('.myCheckbox');
|
||||
const myCheckbox2 = $('.myCheckbox2');
|
||||
const myDiv = $('#myDiv');
|
||||
const myDiv2 = $('#myDiv2');
|
||||
const myDiv3 = $('#myDiv3');
|
||||
const myDiv4 = $('#myDiv4');
|
||||
|
||||
if (myCheckbox.is(':checked')) {
|
||||
myDiv.removeClass('disabled');
|
||||
myDiv2.removeClass('disabled');
|
||||
myDiv4.removeClass('disabled');
|
||||
} else {
|
||||
myDiv.addClass('disabled');
|
||||
myDiv2.addClass('disabled');
|
||||
myDiv4.addClass('disabled');
|
||||
}
|
||||
if (myCheckbox2.is(':checked')) {
|
||||
myDiv3.removeClass('disabled');
|
||||
} else {
|
||||
myDiv3.addClass('disabled');
|
||||
}
|
||||
|
||||
|
||||
var aspValue = $("#asp-hidden").val();
|
||||
if (aspValue != "" || aspValue != undefined) {
|
||||
var checkbox = $(`input.myCheckbox[value="${aspValue}"]`);
|
||||
checkbox.prop("checked", true);
|
||||
}
|
||||
const aspValueContract = $("#asp-contract-hidden").val();
|
||||
if (aspValue != "" || aspValue != undefined) {
|
||||
const checkspan = $(`span.contractDuration[text="${aspValueContract}"]`);
|
||||
checkspan.addClass("contActive");
|
||||
}
|
||||
|
||||
const state = document.getElementById('state').value;
|
||||
const city = document.getElementById('hide3').value;
|
||||
iranwebsv(state);
|
||||
$(`#city option:contains("${city}")`).attr("selected", true);
|
||||
//$('#city option:contains(" ")').text(city);
|
||||
|
||||
|
||||
});
|
||||
|
||||
//مدت قرارداد
|
||||
$(".contractDuration").on('click',
|
||||
function() {
|
||||
if (!$(this).hasClass('contActive')) {
|
||||
$(".contractDuration").removeClass('contActive');
|
||||
$(this).removeClass('btn-deactive').addClass('contActive');
|
||||
}
|
||||
contractDuration();
|
||||
});
|
||||
|
||||
function contractDuration() {
|
||||
if ($(".contActive").text() == '1 ماهه') {
|
||||
$("#asp-contract-hidden").val(1);
|
||||
} else if ($(".contActive").text() == '2 ماهه') {
|
||||
$("#asp-contract-hidden").val(2);
|
||||
} else if ($(".contActive").text() == '3 ماهه') {
|
||||
$("#asp-contract-hidden").val(3);
|
||||
} else if ($(".contActive").text() == '6 ماهه') {
|
||||
$("#asp-contract-hidden").val(6);
|
||||
} else if ($(".contActive").text() == '1 ساله') {
|
||||
$("#asp-contract-hidden").val(12);
|
||||
} else if ($(".contActive").text() == 'دائمی') {
|
||||
$("#asp-contract-hidden").val("ForEver");
|
||||
}
|
||||
}
|
||||
|
||||
function checkContractDuration() {
|
||||
const aspValueContract = $("#asp-contract-hidden").val();
|
||||
if (aspValueContract != '' || aspValueContract != undefined) {
|
||||
if (aspValueContract == '1') {
|
||||
$('span.contractDuration:contains("1 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '2') {
|
||||
$('span.contractDuration:contains("2 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '3') {
|
||||
$('span.contractDuration:contains("3 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '6') {
|
||||
$('span.contractDuration:contains("6 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == '12') {
|
||||
$('span.contractDuration:contains("12 ماهه")').removeClass('btn-deactive').addClass("contActive");
|
||||
} else if (aspValueContract == 'ForEver') {
|
||||
$('span.contractDuration:contains("دائمی")').removeClass('btn-deactive').addClass("contActive");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//عناوین فیش حقوقی
|
||||
function addBonus(element, id) {
|
||||
if ($(element).hasClass('bonusActive')) {
|
||||
$(element).addClass('bonusDeactive').removeClass('bonusActive');
|
||||
$(`#${id}`).removeAttr("checked");
|
||||
|
||||
} else {
|
||||
$(element).removeClass('bonusDeactive').addClass('bonusActive');
|
||||
$(`#${id}`).attr("checked", "checked");
|
||||
}
|
||||
$(`#${id}`).change();
|
||||
}
|
||||
|
||||
function checkBonus() {
|
||||
const AddLeavePay = $("#AddLeavePayInput").prop("checked");
|
||||
const AddYearsPay = $("#AddYearsPayInput").prop("checked");
|
||||
const AddBonusesPay = $("#AddBonusesPayInput").prop("checked");
|
||||
const totalPayment = $("#totalPayment").prop("checked");
|
||||
|
||||
if (AddLeavePay) {
|
||||
$(".AddLeavePay").removeClass('bonusDeactive').addClass('bonusActive');
|
||||
} else {
|
||||
$(".AddLeavePay").addClass('bonusDeactive').removeClass('bonusActive');
|
||||
}
|
||||
if (AddYearsPay) {
|
||||
$(".AddYearsPay").removeClass('bonusDeactive').addClass('bonusActive');
|
||||
} else {
|
||||
$(".AddYearsPay").addClass('bonusDeactive').removeClass('bonusActive');
|
||||
}
|
||||
if (AddBonusesPay) {
|
||||
$(".AddBonusesPay").removeClass('bonusDeactive').addClass('bonusActive');
|
||||
} else {
|
||||
$(".AddBonusesPay").addClass('bonusDeactive').removeClass('bonusActive');
|
||||
}
|
||||
if (totalPayment) {
|
||||
$(".totalPayment").removeClass('bonusDeactive').addClass('bonusActive');
|
||||
|
||||
} else {
|
||||
$(".totalPayment").addClass('bonusDeactive').removeClass('bonusActive');
|
||||
}
|
||||
//if (totalPayment) {
|
||||
// $(".paymentTag").removeClass('totalDeactive').addClass('totalActive');
|
||||
// $(".paymentTag").children().replaceWith('<i class="ion-checkmark-circled" style="color: #20b723"></i>');
|
||||
// // addPayment($(".paymentTag"));
|
||||
//} else {
|
||||
// $(".paymentTag").children().replaceWith('<i class="ion-close-circled" style="color: #dd3632"></i>');
|
||||
// $(".paymentTag").addClass('totalDeactive').removeClass('totalActive');
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
//مجموع مبالغ
|
||||
//function addPayment(element) {
|
||||
// if ($(element).hasClass('totalActive')) {
|
||||
// $(element).addClass('totalDeactive').removeClass('totalActive');
|
||||
// $("#totalPayment").prop("checked", false);
|
||||
// $(element).children().replaceWith('<i class="ion-close-circled" style="color: #dd3632"></i>');
|
||||
// } else {
|
||||
// $(element).removeClass('totalDeactive').addClass('totalActive');
|
||||
// $("#totalPayment").prop("checked", true);
|
||||
// $(element).children().replaceWith('<i class="ion-checkmark-circled" style="color: #20b723"></i>');
|
||||
// }
|
||||
// $("#totalPayment").change();
|
||||
//}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$("#save").click(function() {
|
||||
|
||||
var allInputsFilled = true;
|
||||
const selectElement = $('.EmployerIdList .select-city');
|
||||
const selectedOption = selectElement.find('option:selected');
|
||||
const selectedText = selectedOption.text();
|
||||
|
||||
const selectCity = $('#city.select-city');
|
||||
const selectedCityOption = selectCity.find('option:selected');
|
||||
$('#hide2').val(selectedCityOption.text());
|
||||
if (selectedText === "" || $(".notEmptyWorkshop").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$('.EmployerIdList .select2-container').addClass('errored');
|
||||
$(".notEmptyWorkshop").addClass('errored');
|
||||
$('#fakeSave').hide();
|
||||
$('#save').show();
|
||||
} else {
|
||||
$(".notEmptyWorkshop").removeClass('errored');
|
||||
$('.EmployerIdList .select2-container').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
|
||||
if ($(".notEmptyArchive").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$(".notEmptyArchive").addClass('errored');
|
||||
return;
|
||||
} else {
|
||||
$(".notEmptyArchive").removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
if ($('.myCheckbox2').is(':checked') && $('#isLegal').val() == "false") {
|
||||
if ($('#population').val() == '' || $('#population').val() == null) {
|
||||
$('#population').addClass('errored');
|
||||
allInputsFilled = false;
|
||||
} else {
|
||||
$('#population').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
if ($('#jobName').val() == null || $('#jobName').val() == '') {
|
||||
$('#jobName').next('span').addClass('errored');
|
||||
allInputsFilled = false;
|
||||
} else {
|
||||
$('#jobName').next('span').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//var criteria = [true, false];
|
||||
//var hasError=false;
|
||||
//let found = containsAll(criteria,isLegalList);
|
||||
//if(found){
|
||||
// $('#EmployerIdList').next('span').addClass('errored');
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد");
|
||||
//}
|
||||
//else
|
||||
if ($('.errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function getZone() {
|
||||
const y = document.getElementById('city');
|
||||
const cityValue = y.options[y.selectedIndex].text;
|
||||
|
||||
document.getElementById('hide2').value = cityValue;
|
||||
|
||||
const cityId = document.getElementById("city").value;
|
||||
$('#select-button').empty().append('<option selected="selected" value="0" >انتخاب محله</option>');
|
||||
if (cityId != null) {
|
||||
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "ZonelistLoad")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "cityId": cityId },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$.each(response.zoneList,
|
||||
function(i, item) {
|
||||
$('#select-button').append($('<option>',
|
||||
{
|
||||
value: item.zoneName,
|
||||
text: item.zoneName
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".EmployerIdList .select2-container").addClass('notEmpty ');
|
||||
$('.activated').prop('checked', true);
|
||||
|
||||
$(function() {
|
||||
$('#edit-modal [data-parent-modal]').on('click',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const parentModalId = $(this).data('parent-modal');
|
||||
$(parentModalId).modal('hide');
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
$('.addNeighbor').on('click',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
$('#edit-modal').modal('show');
|
||||
});
|
||||
});
|
||||
$("#edit-modal").on('hidden.bs.modal',
|
||||
function() {
|
||||
$('body').addClass('modal-open');
|
||||
});
|
||||
|
||||
$('.sendList').click(function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$('.sendList').not(this).prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
const myCheckbox = $('.myCheckbox');
|
||||
const myCheckbox2 = $('.myCheckbox2');
|
||||
const myDiv = $('#myDiv');
|
||||
const myDiv2 = $('#myDiv2');
|
||||
const myDiv3 = $('#myDiv3');
|
||||
const myDiv4 = $('#myDiv4');
|
||||
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked') && $('#isLegal').val() == "false") {
|
||||
myDiv.removeClass('disabled');
|
||||
} else {
|
||||
myDiv.addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv2.removeClass('disabled');
|
||||
} else {
|
||||
myDiv2.addClass('disabled');
|
||||
}
|
||||
});
|
||||
myCheckbox2.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv3.removeClass('disabled');
|
||||
} else {
|
||||
myDiv3.addClass('disabled');
|
||||
}
|
||||
});
|
||||
myCheckbox.on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
myDiv4.removeClass('disabled');
|
||||
} else {
|
||||
myDiv4.addClass('disabled');
|
||||
}
|
||||
});
|
||||
$(".myCheckbox").on('change',
|
||||
function() {
|
||||
if ($(this).is(':checked')) {
|
||||
$("#asp-hidden").val($(this).val());
|
||||
} else {
|
||||
$("#asp-hidden").val('');
|
||||
$("#InsuranceCode").val('');
|
||||
}
|
||||
});
|
||||
|
||||
$("#pre").css({ 'box-shadow': 'none' });
|
||||
$("#next").click(function() {
|
||||
|
||||
var allInputsFilled = true;
|
||||
const selectElement = $('.EmployerIdList .select-city');
|
||||
const selectedOption = selectElement.find('option:selected');
|
||||
const selectedText = selectedOption.text();
|
||||
|
||||
if (selectedText === "" || $(".notEmptyWorkshop").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$('.EmployerIdList .select2-container').addClass('errored');
|
||||
$(".notEmptyWorkshop").addClass('errored');
|
||||
$('#fakeSave').hide();
|
||||
$('#save').show();
|
||||
return;
|
||||
} else {
|
||||
$(".notEmptyWorkshop").removeClass('errored');
|
||||
$('.EmployerIdList .select2-container').removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
|
||||
if ($(".notEmptyArchive").val() === '') {
|
||||
allInputsFilled = false;
|
||||
$(".notEmptyArchive").addClass('errored');
|
||||
return;
|
||||
} else {
|
||||
$(".notEmptyArchive").removeClass('errored');
|
||||
allInputsFilled = true;
|
||||
}
|
||||
|
||||
if (!allInputsFilled) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
if ($('#form3').css('right') == '0px') {
|
||||
$("#next").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
} else if ($('#form2').css('left') == '1200px') {
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#progress").css({
|
||||
'width': '66.66%'
|
||||
|
||||
});
|
||||
$("#form1").css({
|
||||
right: '1200px'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '0'
|
||||
});
|
||||
|
||||
} else if ($('#form2').css('left') == '0px') {
|
||||
$("#next").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#progress").css({
|
||||
'width': '100%',
|
||||
'border-top-right-radius': '7px'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '1200px'
|
||||
});
|
||||
$("#form3").css({
|
||||
right: '0'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#pre").click(function() {
|
||||
$("#next").css({
|
||||
'background-color': "white",
|
||||
'color': '#1763b1'
|
||||
});
|
||||
if ($('#form2').css('left') == '1200px' && $('#form3').css('right') == '1200px') {
|
||||
$("#pre").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
|
||||
} else if ($('#form2').css('left') == '0px') {
|
||||
$("#progress").css({
|
||||
'width': '33.33%',
|
||||
'border-top-right-radius': '0px'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "#c7c0c0ba",
|
||||
'color': '#000000b8',
|
||||
'box-shadow': 'none'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '1200px'
|
||||
});
|
||||
$("#form1").css({
|
||||
right: 'initial'
|
||||
});
|
||||
|
||||
} else if ($('#form3').css('right') == '0px') {
|
||||
$("#progress").css({
|
||||
'width': '66.66%',
|
||||
'border-top-right-radius': '0px'
|
||||
});
|
||||
$("#pre").css({
|
||||
'background-color': "white",
|
||||
'color': '#0f9500',
|
||||
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
|
||||
});
|
||||
$("#form2").css({
|
||||
left: '0'
|
||||
});
|
||||
$("#form3").css({
|
||||
right: '1200px'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
getEmployer(@Model.EmployerIdList[0]);
|
||||
});
|
||||
|
||||
|
||||
var isLegalList = [];
|
||||
|
||||
function getEmployer(employerId) {
|
||||
//console.log(employerId);
|
||||
if (employerId !== null && employerId != '') {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/Workshops/Index", "GetEmployerName")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "employerId": employerId },
|
||||
success: function(response) {
|
||||
|
||||
if ((response.isLegal && response.nationalId == '') || (!response.isLegal && response.nationalcode == '')) {
|
||||
swal({
|
||||
title: (response.isLegal ? "کارفرمای انتخاب شده شناسه ملی ندارد." : " کارفرمای انتخاب شده کد ملی ندارد."),
|
||||
text: (response.isLegal ? "در صورت تمایل به درج شناسه ملی به منوی کارفرما مراجعه نمایید." : "در صورت تمایل به درج کد ملی به منوی کارفرما مراجعه نمایید."),
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
$('#EmployerIdList option').filter(`[value="${employerId}"]`).remove();
|
||||
const option = new Option(response.lName, employerId);
|
||||
$("#EmployerIdList").append(option);
|
||||
$("#EmployerIdList").trigger("change");
|
||||
} else {
|
||||
$('#isLegal').val(response.isLegal);
|
||||
isLegalList.push(response.isLegal);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function containsAll(needles, haystack) {
|
||||
for (let i = 0; i < needles.length; i++) {
|
||||
if ($.inArray(needles[i], haystack) == -1) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -876,6 +876,19 @@
|
||||
<input type="hidden" id="PermissionInsurance" asp-for="@Model.HasPermissionInsurance" value="@Model.HasPermissionInsurance" />
|
||||
<div style="@(Model.HasPermissionInsurance ? "" : "display: none;")">
|
||||
<div class="col-md-12 col-xs-12">
|
||||
<div class="row card m-b-10">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<h4>محاسبه اضافه کار و حق عائله مندی در لیست بیمه کارگاه</h4>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row card">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<h4>ارسال لیست بیمه کارگاه</h4>
|
||||
@@ -888,7 +901,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>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using AccountManagement.Domain.AccountLeftWorkAgg;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
@@ -63,13 +64,16 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
public IActionResult OnPostShiftDateNew()
|
||||
{
|
||||
var startRollCall = new DateTime(2025, 3, 21);
|
||||
var startRollCall = new DateTime(2025, 4, 21);
|
||||
//var employees = _context.CustomizeWorkshopEmployeeSettings
|
||||
// .Where(x => x.WorkshopShiftStatus == WorkshopShiftStatus.Rotating).Select(x => x.EmployeeId).ToList();
|
||||
|
||||
var rollCalls = _context.RollCalls.Where(x => x.ShiftDate >= startRollCall && x.EndDate != null).ToList();
|
||||
var r1 = rollCalls.Take(10000).ToList();
|
||||
var r1 = rollCalls.ToList();
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine("endStep 1 ============");
|
||||
SetRollCall(r1);
|
||||
SetBreakTime(r1);
|
||||
|
||||
|
||||
ViewData["message"] = "تومام یک";
|
||||
@@ -220,14 +224,28 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
//Console.WriteLine("endStep 1 ============");
|
||||
//SetRollCall(r1);
|
||||
|
||||
await RefactorEmployeeDocumentItem();
|
||||
await ChangeIsConfirmed();
|
||||
await RemoveEmployeeClientTemps();
|
||||
|
||||
await SetCalculationDateInSalaryAid();
|
||||
ViewData["message"] = "تومام دو";
|
||||
return Page();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task SetCalculationDateInSalaryAid()
|
||||
{
|
||||
var salaryAids = await _context.SalaryAids.ToListAsync();
|
||||
foreach (var salaryAid in salaryAids)
|
||||
{
|
||||
var calculationDate = salaryAid.SalaryAidDateTime;
|
||||
|
||||
var calculationMonth = Convert.ToInt32(calculationDate.ToFarsiMonth());
|
||||
var calculationYear = Convert.ToInt32(calculationDate.ToFarsiYear());
|
||||
|
||||
salaryAid.Edit(salaryAid.Amount,salaryAid.SalaryAidDateTime,0,UserType.Anonymous,calculationMonth, calculationYear);
|
||||
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async System.Threading.Tasks.Task RemoveEmployeeClientTemps()
|
||||
{
|
||||
var employeeDocuments = _context.EmployeeDocuments
|
||||
@@ -426,15 +444,29 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
}
|
||||
|
||||
private void SetBreakTime(List<global::Company.Domain.RollCallAgg.RollCall> r1)
|
||||
{
|
||||
foreach (var rollCall in r1)
|
||||
{
|
||||
}
|
||||
|
||||
_context.SaveChanges();
|
||||
}
|
||||
private void SetRollCall(List<global::Company.Domain.RollCallAgg.RollCall> r1)
|
||||
{
|
||||
|
||||
var endedRollCalls2 = r1.Where(x => x.EndDate != null).ToList();
|
||||
var countSetTDRollCall = endedRollCalls2.Count;
|
||||
var stepSetTDRollCal = 1;
|
||||
|
||||
foreach (var rollCall in endedRollCalls2)
|
||||
{
|
||||
rollCall.ClearTimeDiff();
|
||||
}
|
||||
_context.SaveChanges();
|
||||
foreach (var endedRollCall in endedRollCalls2)
|
||||
{
|
||||
endedRollCall.SetShiftDate(_rollCallDomainService);
|
||||
endedRollCall.Edit(endedRollCall.StartDate.Value, endedRollCall.EndDate.Value, _rollCallDomainService);
|
||||
Console.WriteLine($"{stepSetTDRollCal} - {countSetTDRollCall} ended Set Time Differences{endedRollCall.id}");
|
||||
stepSetTDRollCal += 1;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<div class="bottom"></div>
|
||||
</div>
|
||||
|
||||
<li class="active" data-menu="WorkshopDocumentRejectedForAdmin">
|
||||
<li class="active" data-menu="WorkshopDocumentRejectedForAdmin" permission="10011">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickWorkshopDocumentRejectedForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
عدم تایید توسط ناظر(ادمین)
|
||||
@@ -96,7 +96,7 @@
|
||||
</li>
|
||||
@if (StaticWorkshopAccounts.EmployeeDocumentWorkFlowRoleIds.Any(x => x == AuthHelper.GetUserTypeWithId().roleId))
|
||||
{
|
||||
<li class="" data-menu="CreatedEmployeesWorkshopDocumentForAdmin">
|
||||
<li class="" data-menu="CreatedEmployeesWorkshopDocumentForAdmin" permission="10012">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickCreatedEmployeesWorkshopDocumentForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
آپلود مدارک پرسنل جدید
|
||||
@@ -109,7 +109,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="" data-menu="ClientRejectedDocumentWorkshopsForAdmin">
|
||||
<li class="" data-menu="ClientRejectedDocumentWorkshopsForAdmin" permission="10013">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickClientRejectedDocumentWorkshopsForAdminTab">
|
||||
<a href="javascript:void(0);">
|
||||
عدم تایید توسط ناظر (کلاینت)
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<div class="row p-2">
|
||||
<div class="d-grid card-area-workflow gap-2 p-0">
|
||||
|
||||
<div class="gwb-card">
|
||||
<div class="gwb-card" permission="1001">
|
||||
<a asp-page="/Company/WorkFlow/EmployeesDocuments" class="click loadingButton">
|
||||
<div class="d-flex align-items-center justify-content-between p-1 w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
@@ -84,13 +84,13 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="gwb-card">
|
||||
<div class="gwb-card" permission="1002">
|
||||
<a asp-page="/Company/WorkFlow/EmployeesNew" class="click loadingButton">
|
||||
<div class="d-flex align-items-center justify-content-between p-1 w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="~/AssetsClient/images/insuranceList.png" alt="" class="img-fluid mx-1" width="50px" />
|
||||
<div class="text-start ms-1">
|
||||
<div class="card-title">اعلام شروع بکار توسط کافرما</div>
|
||||
<div class="card-title"> اعلام شروع بکار توسط کافرما</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countNumber" id="StartWorkCount">
|
||||
@@ -104,13 +104,13 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="gwb-card">
|
||||
<div class="gwb-card" permission="1003">
|
||||
<a asp-page="/Company/WorkFlow/EmployeesLeftWork" class="click loadingButton">
|
||||
<div class="d-flex align-items-center justify-content-between p-1 w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="~/AssetsClient/images/insuranceList.png" alt="" class="img-fluid mx-1" width="50px" />
|
||||
<div class="text-start ms-1">
|
||||
<div class="card-title">اعلام ترک کار توسط کافرما</div>
|
||||
<div class="card-title"> اعلام ترک کار توسط کافرما</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countNumber" id="leftWorkCount">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,601 +0,0 @@
|
||||
@using _0_Framework.Application
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
|
||||
@{
|
||||
|
||||
<style>
|
||||
.sendSelectDate {
|
||||
border-color: #ff4e4e !important;
|
||||
background-color: #ffe4e4 !important;
|
||||
}
|
||||
.modal-dialog {
|
||||
width: 40% !important;
|
||||
}
|
||||
.modal-header{
|
||||
border-bottom: 0;
|
||||
}
|
||||
.panel-default > .panel-heading {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.modal .modal-dialog .modal-content {
|
||||
height: auto !important;
|
||||
min-height: auto !important;
|
||||
}
|
||||
@@media (min-width: 1500px) {
|
||||
.modal-dialog {
|
||||
width: 35% !important;
|
||||
}
|
||||
}
|
||||
@@media (max-width: 1200px) {
|
||||
.modal-dialog {
|
||||
width: 60% !important;
|
||||
}
|
||||
}
|
||||
@@media (max-width: 768px) {
|
||||
.modal-dialog {
|
||||
width: 90% !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@media (max-width: 500px) {
|
||||
#thh th, td {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#datatable.changeCode th{
|
||||
font-size: 13px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
border-top: unset !important;
|
||||
}
|
||||
|
||||
.modal .modal-dialog .modal-content .modal-footer {
|
||||
padding-top: unset !important;
|
||||
}
|
||||
|
||||
/* p {
|
||||
direction: ltr !important;
|
||||
text-align: right !important;
|
||||
}*/
|
||||
|
||||
input[type=radio]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #dfdfdf;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: brown;
|
||||
border-radius: 5px;
|
||||
}
|
||||
/* .se .select2-container {
|
||||
width: 75% !important;
|
||||
}*/
|
||||
|
||||
/* .se .select2-container--default .select2-selection--single {
|
||||
border-radius: 0px 22px 22px 0px !important;
|
||||
border: 1px solid #a5a3a3 !important;
|
||||
}*/
|
||||
|
||||
hr {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-top: 1px solid #d3d3d3;
|
||||
}
|
||||
|
||||
.checkbox + .checkbox, .radio + .radio {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.radio {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
/* .radio {
|
||||
margin: 5px 20px 5px 20px !important;
|
||||
}*/
|
||||
/* .form-control {
|
||||
width: 75% !important;
|
||||
display: inline-block;
|
||||
}
|
||||
*/
|
||||
/*----------------------------*/
|
||||
#EmployerFullName table {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#EmployerFullName th, td {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
#EmployerFullName td:nth-child(odd) {
|
||||
border-bottom: 1px solid #fff;
|
||||
background-color: #bed3ca;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#EmployerFullName tr:hover {
|
||||
background-color: rgb(108, 186, 250);
|
||||
}
|
||||
#datatable.changeCode {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
border-collapse: separate;
|
||||
table-layout: fixed;
|
||||
overflow-y: scroll;
|
||||
max-width: 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#datatable.changeCode thead tr th:nth-child(1) {
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
|
||||
#datatable.changeCode thead tr th:last-child {
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
|
||||
#datatable.changeCode tbody td.last-row-last-child {
|
||||
border-bottom-left-radius: 10px;
|
||||
}
|
||||
#datatable.changeCode tbody td.last-row-first-child {
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
|
||||
#datatable.changeCode th, td {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
#datatable.changeCode td {
|
||||
font-weight: normal;
|
||||
color: black;
|
||||
border: 1px solid #c7c7c7;
|
||||
}
|
||||
|
||||
#datatable.changeCode th {
|
||||
background-color: #5a5959;
|
||||
color: white;
|
||||
text-align: center;
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
||||
#datatable.changeCode td:nth-child(odd) {
|
||||
border-left: 1px solid #fff;
|
||||
width: 40%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#datatable.changeCode td:nth-child(even) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#datatable.changeCode th {
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
#datatable.changeCode tr:nth-child(even) {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.pCode {
|
||||
text-align: center;
|
||||
border-radius: 7px;
|
||||
background-color: #e9e9e9;
|
||||
border: 2px solid #bfbfbf;
|
||||
color: #444444;
|
||||
height: 24px;
|
||||
width: 50% !important;
|
||||
margin: auto;
|
||||
}
|
||||
#datatable.changeCode tr {
|
||||
background-color: rgb(224, 227, 228);
|
||||
}
|
||||
|
||||
#datatable.changeCode tr:hover {
|
||||
background-color: rgb(152 154 155);
|
||||
}
|
||||
.buttonInside {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#btnOk {
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
top: 32px;
|
||||
padding: 6px;
|
||||
color: #464646 !important;
|
||||
border-radius: 8px 0px 0px 8px;
|
||||
border-top: 0px;
|
||||
border-bottom: 0px;
|
||||
border-left: 0px;
|
||||
background-color: #ededed;
|
||||
border-color: #c9c4c4;
|
||||
font-size: 11px;
|
||||
font-family: 'IranSans' !important;
|
||||
}
|
||||
|
||||
.final {
|
||||
background: #0f9500;
|
||||
border: #0f9500;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
@{
|
||||
|
||||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script src="~/lib/select2/js/select2.js"></script>
|
||||
<script src="~/lib/select2/js/i18n/fa.js"></script>
|
||||
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="~/lib/select2/css/select2.css" rel="stylesheet" />
|
||||
}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true"><span style="font-size: 24px">×</span></button>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
|
||||
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 150px; text-align: center;"> ویرایش کد پرسنلی </legend>
|
||||
|
||||
<form id="my_form" asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off"
|
||||
method="get"
|
||||
data-ajax="true"
|
||||
data-ajax-method="get"
|
||||
data-ajax-update="#panel"
|
||||
data-ajax-mode="replace"
|
||||
data-ajax-url="@Url.Page("./Index","LoadContracts")">
|
||||
|
||||
<div id="progress-bar" class="progress" style="display: none;">
|
||||
<div style="background-color: #28a711" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 right">
|
||||
<div class="col-md-6 col-sm-6 col-lg-6 col-xs-12">
|
||||
<label> نام کارگاه </label>
|
||||
<div class="form-group se" dir="rtl">
|
||||
<div class="form-control"> @Model.WorkshopName</div>
|
||||
<input type="hidden" asp-for="WorkshopId" value="@Model.WorkshopId"/>
|
||||
@*<a class="btn btn-info btn-rounded waves-effect waves-light" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #257212; border-color: #545353; font-size: 14px; margin-right: -3px; font-family: 'IranSans' !important;" onclick="show()">تایید</a>*@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 col-lg-6 col-xs-12">
|
||||
<label>نام پرسنل</label>
|
||||
<div id="person">
|
||||
<div class="form-group se person" dir="rtl">
|
||||
<select id="getPersonnel" class="form-control select-city" asp-for="EmployeeId" >
|
||||
<option value="0"> انتخاب پرسنل </option>
|
||||
@foreach (var item in Model.EmployeeList)
|
||||
{
|
||||
<option value="@item.Id"> @item.EmployeeFullName </option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<span asp-validation-for="EmployeeId" class="error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" dir="rtl">
|
||||
<div class="col-md-1 pull-left">
|
||||
@* <a class="btn btn-success btn-rounded waves-effect waves-light" onclick="sendData()" style="float: left;">انتخاب</a>*@
|
||||
<input type="submit" form="my_form" value="Search" name="Search" id="select" style="display: none" />
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<span id="montAndYearError"></span>
|
||||
</div>
|
||||
</div>
|
||||
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
|
||||
</form>
|
||||
<form asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off" id="changeCodeForm"
|
||||
method="post"
|
||||
data-ajax="true"
|
||||
data-ajax-method="post"
|
||||
data-ajax-url="@Url.Page("./Index","Check")"
|
||||
data-callback=""
|
||||
data-action="Refresh">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default" style="border-radius: 10px;">
|
||||
<div class="panel-heading" style="border-radius: 10px;">
|
||||
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست شماره پرسنلی </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12">
|
||||
<table id="datatable" class="table table-striped changeCode" style="direction: rtl">
|
||||
<thead style="background-color: #ecefee">
|
||||
<tr>
|
||||
<th style="width: 20px;" class="sizeSet">#</th>
|
||||
<th class="sizeSet decorCheckbox">
|
||||
<input class="checkboxtitle" type="checkbox" id="checkSelect1" disabled="disabled" />
|
||||
</th>
|
||||
<th class="sizeSet">شماره پرسنلی</th>
|
||||
<th class="sizeSet"> پرسنل </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="panel">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="sendWId" name="workshopId" />
|
||||
<div id="listOfContract" style="display: none">
|
||||
</div>
|
||||
@*<input type="hidden" asp-for="id" value="id"/>*@
|
||||
<div class="modal-footer m-b-10">
|
||||
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light pull-left final">ثبت نهایی</a>
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" data-dismiss="modal">بستن</button>
|
||||
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none" />
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
@Html.AntiForgeryToken()
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".select-city2").select2({
|
||||
language: "fa",
|
||||
dir: "rtl"
|
||||
});
|
||||
$('.final').attr('disabled', 'disabled');
|
||||
$('.final').css("background-color", "gray");
|
||||
$('.byStep').attr('disabled', 'disabled');
|
||||
$('.byStep').css("background-color", "unset");
|
||||
$('.byStepButton').attr('disabled', 'disabled');
|
||||
$('.byStepButton').css("background-color", "gray");
|
||||
sendData();
|
||||
});
|
||||
function sendData() {
|
||||
$('.formStep').remove();
|
||||
$('.ConvertErr').remove();
|
||||
$('#convertError').append(
|
||||
|
||||
'<input type="hidden" class="formStep" value="select" name="FormStep"/>'
|
||||
);
|
||||
$('#select').click();
|
||||
$('.byStep').removeAttr('disabled');
|
||||
$('.byStepButton').removeAttr('disabled');
|
||||
$('.byStep').css({ 'background-color': '' });
|
||||
$('.byStepButton').css({ 'background-color': '' });
|
||||
$('.final').removeAttr('disabled');
|
||||
$('.final').css({ "background-color": '' });
|
||||
|
||||
//} else {
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " انتخاب کارگاه اجباری است ");
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function final() {
|
||||
|
||||
//$('.final').attr('disabled', 'disabled');
|
||||
//$('.final').css("background-color", "gray");
|
||||
//$('.byStep').attr('disabled', 'disabled');
|
||||
//$('.byStep').css("background-color", "unset");
|
||||
//$('.byStepButton').attr('disabled', 'disabled');
|
||||
//$('.byStepButton').css("background-color", "gray");
|
||||
//$('#sub').on('submit', function(e) {
|
||||
// e.preventDefault();
|
||||
//});
|
||||
$('.item1').remove();
|
||||
const wId =@Model.WorkshopId; //document.getElementById("getWorkshopWithName").value;
|
||||
var checkboxId = document.getElementsByName("cheking");
|
||||
var personnelCodeChange = document.getElementsByClassName("pCode");
|
||||
//var listArray = [];
|
||||
//for (var j = 0, p = personnelCodeChange[j].length; j < p; j++) {
|
||||
// console.log(personnelCodeChange[j].name);
|
||||
//}
|
||||
$('#panel tr td').append(
|
||||
'<input class="item1" type="hidden" value="' + wId + '" name="WorkshopId"/>'
|
||||
);
|
||||
for (var i = 0, n = checkboxId.length; i < n; i++) {
|
||||
if (checkboxId[i].checked) {
|
||||
|
||||
let pname = checkboxId[i].value;
|
||||
let inputElement = document.querySelector('input[name="' + pname + '"]');
|
||||
|
||||
$('#panel tr td').append(
|
||||
|
||||
'<input class="item1" type="hidden" value="' + pname + '" name="Contracts[' + i + '].EmployeeId"/>'
|
||||
+ '<input class="item1" type="hidden" value="' + inputElement.value + '" name="Contracts[' + i + '].PersonnelCode"/>'
|
||||
);
|
||||
|
||||
} else {
|
||||
$('#panel tr td').append(
|
||||
|
||||
'<input class="item1" type="hidden" value="' + 0 + '" name="Contracts[' + i + '].EmployeeId"/>'
|
||||
+ '<input class="item1" type="hidden" value="' + 0 + '" name="Contracts[' + i + '].PersonnelCode"/>'
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
if (checkboxId.length > 0) {
|
||||
|
||||
$('#changeCodeForm').submit();
|
||||
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ پرسنلی برای ویرایش انتخاب نشده است");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$('#changeCodeForm').submit(function (e) {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: $(this).attr('action'),
|
||||
data: $(this).serialize(),
|
||||
success: function (response) {
|
||||
if (response.isSuccedded == true) {
|
||||
$.Notification.autoHideNotify('success', 'top right', response.message);
|
||||
$('#select').click();
|
||||
getEmployeeList();
|
||||
$("#MainModal").modal('hide');
|
||||
}
|
||||
else {
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
function loadWorkshopWithName() {
|
||||
/* loadPersonnel();*/
|
||||
const nameId = document.getElementById("getWorkshopWithName").value;
|
||||
const nameIndex = document.getElementById("getWorkshopWithName");
|
||||
|
||||
|
||||
var myArray = document.getElementById('getWorkshopWithName').options.selectedIndex;
|
||||
//document.getElementById("getWorkshopWithCode").options.selectedIndex = myArray;
|
||||
//var codeId = document.getElementById("getWorkshopWithCode");
|
||||
//var archiveCodee = codeId.options[codeId.selectedIndex];
|
||||
|
||||
//document.getElementById("select2-getWorkshopWithCode-container").innerHTML = archiveCodee.text;
|
||||
|
||||
|
||||
$('#getPersonnel').empty().append('<option selected="selected" value="0" >انتخاب پرسنل</option>');
|
||||
|
||||
// $('#archiveCode').val(archiveCodee.text);
|
||||
|
||||
|
||||
if (nameId != "WorkshopIds") {
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "LoadWorkshops")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": nameId },
|
||||
|
||||
success: function(response) {
|
||||
var items2 = [];
|
||||
|
||||
$.each(response,
|
||||
function(key, val) {
|
||||
items2.push({ id: key, vall: val });
|
||||
|
||||
});
|
||||
|
||||
|
||||
//document.getElementById("InsurancCode").innerHTML = items2[1].vall;
|
||||
|
||||
|
||||
$.each(response.employeeList, function(i, item)
|
||||
{
|
||||
$('#getPersonnel').append($('<option>',
|
||||
{
|
||||
value: item.id,
|
||||
text: item.employeeFullName
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadWorkshopWithCode() {
|
||||
|
||||
var myArray = document.getElementById('getWorkshopWithCode').options.selectedIndex;
|
||||
document.getElementById("getWorkshopWithName").options.selectedIndex = myArray;
|
||||
var getNameId = document.getElementById("getWorkshopWithName");
|
||||
var getWithName = getNameId.options[getNameId.selectedIndex];
|
||||
|
||||
document.getElementById("select2-getWorkshopWithName-container").innerHTML = getWithName.text;
|
||||
|
||||
loadWorkshopWithName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function loadPersonnel() {
|
||||
const id = document.getElementById("getPersonnel").value;
|
||||
const workshopId = document.getElementById("getWorkshopWithName").value;
|
||||
|
||||
if (workshopId == "WorkshopIds") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا کارگاه را انتخاب نمایید");
|
||||
}
|
||||
|
||||
if (id > 0 && workshopId != "WorkshopIds") {
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/Contracts/Index", "LoadPersonel")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": id, "workshopId": workshopId },
|
||||
|
||||
success: function (response) {
|
||||
var items2 = [];
|
||||
$.each(response, function (key, val) {
|
||||
items2.push({ id: key, vall: val });
|
||||
|
||||
});
|
||||
//if (items2[8].vall == "")
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
|
||||
//document.getElementById("FatherName").innerHTML = items2[1].vall;
|
||||
//document.getElementById("PersonnelNationalCode").innerHTML = items2[2].vall;
|
||||
|
||||
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user