Compare commits
22 Commits
Feature/Ex
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| 75ea35596b | |||
| 6045153865 | |||
| 5d16020c6a | |||
| af1388f0d7 | |||
| ed5681256d | |||
| 7a58423eb3 | |||
| 70164ae498 | |||
| db225fea18 | |||
| 2bbe616127 | |||
| f64e6ac176 | |||
| 9095ed28e1 | |||
| 04ec2ed5a4 | |||
|
|
c7f5310c56 | ||
| 7b3d1f527c | |||
| dbbee73e2a | |||
| 21df40af3b | |||
|
|
f50fdd7f91 | ||
|
|
87cde91ad0 | ||
|
|
55f62da928 | ||
|
|
5a7f233568 | ||
|
|
9d83de947f | ||
|
|
f4c3aa1889 |
@@ -5,14 +5,14 @@ namespace _0_Framework.InfraStructure;
|
||||
|
||||
public static class QueryableExtensions
|
||||
{
|
||||
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> query, int page, int pageSize)
|
||||
public static IQueryable<T> ApplyPagination<T>(this IQueryable<T> query, int page, int pageSize = 30)
|
||||
{
|
||||
if (page <= 0) page = 1;
|
||||
if (pageSize <= 0) pageSize = 10;
|
||||
|
||||
return query.Skip((page - 1) * pageSize).Take(pageSize);
|
||||
}
|
||||
public static IEnumerable<T> ApplyPagination<T>(this IEnumerable<T> source, int page, int pageSize)
|
||||
public static IEnumerable<T> ApplyPagination<T>(this IEnumerable<T> source, int page, int pageSize = 30)
|
||||
{
|
||||
if (page <= 0) page = 1;
|
||||
if (pageSize <= 0) pageSize = 10;
|
||||
|
||||
@@ -67,6 +67,8 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface ILeaveRepository : IRepository<long, Leave>
|
||||
|
||||
bool CheckContractExist(DateTime myDate,long employeeId, long workshopId);
|
||||
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId);
|
||||
LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId,bool isInvalid);
|
||||
LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId);
|
||||
List<LeaveMainViewModel> searchClient(LeaveSearchModel searchModel);
|
||||
LeavePrintViewModel PrintOne(long id);
|
||||
|
||||
@@ -8,7 +8,9 @@ public class Leave: EntityBase
|
||||
{
|
||||
public Leave(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName, bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration, bool hasShiftDuration)
|
||||
string paidLeaveType, string leaveType, string employeeFullName, string workshopName,
|
||||
bool isAccepted, string decription, int year, int month, TimeSpan shiftDuration,
|
||||
bool hasShiftDuration,bool isInvalid)
|
||||
{
|
||||
StartLeave = startLeave;
|
||||
EndLeave = endLeave;
|
||||
@@ -25,6 +27,7 @@ public class Leave: EntityBase
|
||||
Month = month;
|
||||
ShiftDuration = shiftDuration;
|
||||
HasShiftDuration = hasShiftDuration;
|
||||
IsInvalid = isInvalid;
|
||||
}
|
||||
|
||||
public DateTime StartLeave { get; private set; }
|
||||
@@ -43,6 +46,10 @@ public class Leave: EntityBase
|
||||
|
||||
public TimeSpan ShiftDuration { get; private set; }
|
||||
public bool HasShiftDuration { get; private set; }
|
||||
/// <summary>
|
||||
///آیا فاقد اعتبار است. فاقد اعتبار ها فقط برای فیش های غیررسمی مورد استفاده قرار میگیرند
|
||||
/// </summary>
|
||||
public bool IsInvalid { get; private set; }
|
||||
|
||||
public void Edit(DateTime startLeave, DateTime endLeave,
|
||||
string leaveHourses, long workshopId, long employeeId,
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
@@ -47,4 +48,6 @@ public interface IInsuranceListApplication
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel);
|
||||
}
|
||||
@@ -37,4 +37,5 @@ public class CreateLeave
|
||||
public List<CustomizeRotatingShiftsViewModel> RotatingShifts { get; set; }
|
||||
public bool HasRollCall { get; set; }
|
||||
public CustomizeRotatingShiftsViewModel SelectedShift { get; set; }
|
||||
public bool IsInvallid { get; set; }
|
||||
}
|
||||
@@ -27,4 +27,5 @@ public class LeavePrintViewModel
|
||||
public string MonthGr { get; set; }
|
||||
public int PrintCounter { get; set; }
|
||||
public List<EmprViewModel> EmployerList { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
|
||||
@@ -20,4 +20,5 @@ public class LeaveSearchModel
|
||||
public int Year { get; set; }
|
||||
public int Month { get; set; }
|
||||
public int PageIndex { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
@@ -27,4 +27,5 @@ public class LeaveViewModel
|
||||
|
||||
public TimeSpan ShiftDuration { get; set; }
|
||||
public bool HasShiftDuration { get; set; }
|
||||
public bool IsInvalid { get; set; }
|
||||
}
|
||||
@@ -164,18 +164,26 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
|
||||
if (!command.HasRollCall && command.ShiftWork != "4")
|
||||
mandatoryDays = totalDays - command.FridayStarttoEnd;
|
||||
var monthlyWage = command.DailySalaryAffected * mandatoryDays;
|
||||
var monthlyWage = command.DailySalaryAffected * totalDays;
|
||||
|
||||
//پایه سنوات
|
||||
var bacicYears = command.BaseYearAffected * mandatoryDays;
|
||||
var bacicYears = command.BaseYearAffected * totalDays;
|
||||
#endregion
|
||||
|
||||
//سنوات
|
||||
var years = command.YearsPay;
|
||||
//عیدی و پاداش
|
||||
var bunos = command.BonusesPay;
|
||||
|
||||
var sumOfWorkingDays = $"{totalDays}";
|
||||
|
||||
//فاطمه احمدژاد === موقت عیدی و پاداش و سنوات حساب نشه
|
||||
if (command.EmployeeId == 45104 && command.WorkshopId == 315)
|
||||
{
|
||||
years = 0;
|
||||
|
||||
bunos = 0;
|
||||
}
|
||||
|
||||
var sumOfWorkingDays = $"{totalDays}";
|
||||
if (command.friday > 0)
|
||||
{
|
||||
var fridayPercent = dayliWage * 40 / 100;
|
||||
|
||||
@@ -179,8 +179,13 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
else
|
||||
{
|
||||
|
||||
nationalCodValid = false;
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
|
||||
|
||||
nationalCodValid = false;
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -313,8 +318,15 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
else
|
||||
{
|
||||
|
||||
nationalCodValid = false;
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
if (command.Nationality == "ایرانی")
|
||||
{
|
||||
nationalCodValid = false;
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
else
|
||||
{
|
||||
nationalCodValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
@@ -2366,5 +2366,10 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
return _insuranceListRepositpry.GetTabCounts(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<InsuranceListViewModel>> GetNotCreatedWorkshop(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
return await _insuranceListRepositpry.GetNotCreatedWorkshop(searchModel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class LeaveApplication : ILeaveApplication
|
||||
|
||||
var end = command.PaidLeaveType == "ساعتی" ? start : command.EndLeave.ToGeorgianDateTime();
|
||||
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId,command.IsInvallid);
|
||||
|
||||
// start = new DateTime(start.Year, start.Month, start.Day, startH.Hours, startH.Minutes, startH.Seconds);
|
||||
//end = new DateTime(end.Year, end.Month, end.Day, endH.Hours, endH.Minutes, endH.Seconds);
|
||||
@@ -96,10 +96,10 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed(checkErr.ContractErrMessage);
|
||||
if (checkErr.HasLeftWork)
|
||||
return op.Failed(checkErr.LeftWorlErrMessage);
|
||||
if (checkErr.HasHolidayError)
|
||||
return op.Failed(checkErr.HolidayErrorMessage);
|
||||
//if (checkErr.HasHolidayError)
|
||||
// return op.Failed(checkErr.HolidayErrorMessage);
|
||||
|
||||
if (start > end)
|
||||
if (start > end)
|
||||
return op.Failed("تارخ شروع از پایان بزرگتر است");
|
||||
|
||||
|
||||
@@ -182,29 +182,30 @@ public class LeaveApplication : ILeaveApplication
|
||||
shiftDuration = shiftEndDateTime - shiftStartDateTime;
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
}
|
||||
else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular })
|
||||
{
|
||||
if ((end - start).TotalDays > 1)
|
||||
else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular })
|
||||
{
|
||||
return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید");
|
||||
}
|
||||
|
||||
var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start);
|
||||
if (isActive)
|
||||
{
|
||||
shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch
|
||||
if ((end - start).TotalDays > 1)
|
||||
{
|
||||
WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24),
|
||||
WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24),
|
||||
_ => new TimeSpan()
|
||||
};
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید");
|
||||
}
|
||||
|
||||
var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start);
|
||||
if (isActive)
|
||||
{
|
||||
shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch
|
||||
{
|
||||
WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12),
|
||||
WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24),
|
||||
WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24),
|
||||
_ => new TimeSpan()
|
||||
};
|
||||
hasShiftDuration = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -237,7 +238,8 @@ public class LeaveApplication : ILeaveApplication
|
||||
var employeeFullName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var workshopName = _workshopRepository.GetDetails(command.WorkshopId).WorkshopName;
|
||||
var leave = new Leave(start, end, totalhourses, command.WorkshopId, command.EmployeeId
|
||||
, command.PaidLeaveType, command.LeaveType, employeeFullName, workshopName, command.IsAccepted, command.Decription, year, month, shiftDuration, hasShiftDuration);
|
||||
, command.PaidLeaveType, command.LeaveType, employeeFullName, workshopName, command.IsAccepted, command.Decription,
|
||||
year, month, shiftDuration, hasShiftDuration,command.IsInvallid);
|
||||
_leaveRepository.Create(leave);
|
||||
_leaveRepository.SaveChanges();
|
||||
|
||||
@@ -299,7 +301,7 @@ public class LeaveApplication : ILeaveApplication
|
||||
return op.Failed("لطفا تاریخ پایان را وارد کنید");
|
||||
var start = command.StartLeave.ToGeorgianDateTime();
|
||||
var end = command.PaidLeaveType == "ساعتی" ? start : command.EndLeave.ToGeorgianDateTime();
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId);
|
||||
var checkErr = _leaveRepository.CheckErrors(start, end, command.EmployeeId, command.WorkshopId,command.IsInvallid);
|
||||
|
||||
|
||||
if (checkErr.HasChekout)
|
||||
|
||||
@@ -20,6 +20,7 @@ public class LeaveMapping : IEntityTypeConfiguration<Leave>
|
||||
builder.Property(x => x.IsAccepted);
|
||||
builder.Property(x => x.Decription).HasMaxLength(255);
|
||||
builder.Property(x => x.ShiftDuration).HasTimeSpanConversion();
|
||||
builder.HasQueryFilter(x => !x.IsInvalid);
|
||||
|
||||
}
|
||||
}
|
||||
10239
CompanyManagment.EFCore/Migrations/20251006134511_add isInvalid to leave.Designer.cs
generated
Normal file
10239
CompanyManagment.EFCore/Migrations/20251006134511_add isInvalid to leave.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addisInvalidtoleave : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsInvalid",
|
||||
table: "Leave",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsInvalid",
|
||||
table: "Leave");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3740,6 +3740,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool>("IsAccepted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsInvalid")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("LeaveHourses")
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,12 +6,14 @@ using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LeaveAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
public LeaveRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
@@ -20,24 +22,24 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
public EditLeave GetDetails(long id)
|
||||
{
|
||||
return _context.LeaveList.Select(x => new EditLeave()
|
||||
{
|
||||
Id = x.id,
|
||||
StartLeave = x.StartLeave.ToFarsi(),
|
||||
EndLeave = x.EndLeave.ToFarsi(),
|
||||
StartLeaveGr = x.StartLeave,
|
||||
EndLeaveGr = x.EndLeave,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
LeaveHourses = x.LeaveHourses,
|
||||
PaidLeaveType = x.PaidLeaveType,
|
||||
LeaveType = x.LeaveType,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
IsAccepted = x.IsAccepted,
|
||||
Decription = x.Decription,
|
||||
Year = x.Year,
|
||||
Month = x.Month,
|
||||
HasRollCall = x.HasShiftDuration,
|
||||
{
|
||||
Id = x.id,
|
||||
StartLeave = x.StartLeave.ToFarsi(),
|
||||
EndLeave = x.EndLeave.ToFarsi(),
|
||||
StartLeaveGr = x.StartLeave,
|
||||
EndLeaveGr = x.EndLeave,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
LeaveHourses = x.LeaveHourses,
|
||||
PaidLeaveType = x.PaidLeaveType,
|
||||
LeaveType = x.LeaveType,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
IsAccepted = x.IsAccepted,
|
||||
Decription = x.Decription,
|
||||
Year = x.Year,
|
||||
Month = x.Month,
|
||||
HasRollCall = x.HasShiftDuration,
|
||||
}).FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
@@ -63,16 +65,20 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
Month = x.Month,
|
||||
HasShiftDuration = x.HasShiftDuration,
|
||||
ShiftDuration = x.ShiftDuration,
|
||||
IsInvalid = x.IsInvalid
|
||||
});
|
||||
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
if (searchModel.IsInvalid)
|
||||
{
|
||||
query = query.IgnoreQueryFilters().Where(x => x.IsInvalid);
|
||||
}
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.LeaveType))
|
||||
query = query.Where(x => x.LeaveType == searchModel.LeaveType);
|
||||
query = query.Where(x => x.LeaveType == searchModel.LeaveType);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.PaidLeaveType))
|
||||
query = query.Where(x => x.PaidLeaveType == searchModel.PaidLeaveType);
|
||||
query = query.Where(x => x.PaidLeaveType == searchModel.PaidLeaveType);
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave))
|
||||
{
|
||||
DateTime startSearch = searchModel.StartLeave.ToGeorgianDateTime();
|
||||
@@ -81,21 +87,29 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
(startSearch <= x.EndLeaveGr.Date && endSearch >= x.EndLeaveGr.Date) ||
|
||||
(startSearch >= x.StartLeaveGr.Date && startSearch <= x.EndLeaveGr.Date) ||
|
||||
(endSearch >= x.StartLeaveGr.Date && endSearch <= x.EndLeaveGr.Date));
|
||||
}else if (searchModel.StartLeaveGr != null && searchModel.EndLeaveGr != null)
|
||||
}
|
||||
else if (searchModel.StartLeaveGr != null && searchModel.EndLeaveGr != null)
|
||||
{
|
||||
query = query.Where(x => (searchModel.StartLeaveGr <= x.StartLeaveGr.Date && searchModel.EndLeaveGr >= x.StartLeaveGr.Date) ||
|
||||
(searchModel.StartLeaveGr <= x.EndLeaveGr.Date && searchModel.EndLeaveGr >= x.EndLeaveGr.Date) ||
|
||||
(searchModel.StartLeaveGr >= x.StartLeaveGr.Date && searchModel.StartLeaveGr <= x.EndLeaveGr.Date) ||
|
||||
(searchModel.EndLeaveGr >= x.StartLeaveGr.Date && searchModel.EndLeaveGr <= x.EndLeaveGr.Date));
|
||||
}
|
||||
if(searchModel.IsAccepted)
|
||||
query = query.Where(x => x.IsAccepted == true);
|
||||
return query.OrderByDescending(x => x.Id).ToList();
|
||||
query = query.Where(x =>
|
||||
(searchModel.StartLeaveGr <= x.StartLeaveGr.Date && searchModel.EndLeaveGr >= x.StartLeaveGr.Date) ||
|
||||
(searchModel.StartLeaveGr <= x.EndLeaveGr.Date && searchModel.EndLeaveGr >= x.EndLeaveGr.Date) ||
|
||||
(searchModel.StartLeaveGr >= x.StartLeaveGr.Date && searchModel.StartLeaveGr <= x.EndLeaveGr.Date) ||
|
||||
(searchModel.EndLeaveGr >= x.StartLeaveGr.Date && searchModel.EndLeaveGr <= x.EndLeaveGr.Date));
|
||||
}
|
||||
|
||||
if (searchModel.IsAccepted)
|
||||
query = query.Where(x => x.IsAccepted == true);
|
||||
return query.OrderByDescending(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public List<LeaveMainViewModel> searchClient(LeaveSearchModel searchModel)
|
||||
{
|
||||
var leaveMainList = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
var leaveMainList = _context.LeaveList.Where(x =>
|
||||
x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.IsInvalid)
|
||||
{
|
||||
leaveMainList = leaveMainList.IgnoreQueryFilters().Where(x => x.IsInvalid);
|
||||
}
|
||||
|
||||
if (searchModel.LeaveType == "paidLeave")
|
||||
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استحقاقی");
|
||||
@@ -135,7 +149,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
EndLeaveGr = item.EndLeave,
|
||||
WorkshopId = item.WorkshopId,
|
||||
EmployeeId = item.EmployeeId,
|
||||
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType,item.LeaveHourses),
|
||||
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType, item.LeaveHourses),
|
||||
PaidLeaveType = item.PaidLeaveType,
|
||||
LeaveType = item.LeaveType,
|
||||
IsAccepted = item.IsAccepted,
|
||||
@@ -150,7 +164,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
public LeavePrintViewModel PrintOne(long id)
|
||||
{
|
||||
var leave = _context.LeaveList.Select(x => new LeavePrintViewModel()
|
||||
var leave = _context.LeaveList.IgnoreQueryFilters().Select(x => new LeavePrintViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = "",
|
||||
@@ -169,17 +183,21 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
IsAccepted = x.IsAccepted,
|
||||
Decription = x.Decription,
|
||||
EmployerList = new List<EmprViewModel>(),
|
||||
IsInvalid = x.IsInvalid
|
||||
}).SingleOrDefault(x => x.Id == id);
|
||||
|
||||
//leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd > leave.StartLeaveGr
|
||||
// && x.ContarctStart < leave.EndLeaveGr && x.ContractEnd > leave.EndLeaveGr
|
||||
// && x.WorkshopIds == leave.WorkshopId && x.EmployeeId == leave.EmployeeId).ContractNo;
|
||||
leave.ContractNo = _context.Contracts.FirstOrDefault(x=>x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd >= leave.StartLeaveGr && x.EmployeeId == leave.EmployeeId && x.WorkshopIds == leave.WorkshopId)?.ContractNo;
|
||||
leave.ContractNo = _context.Contracts.FirstOrDefault(x =>
|
||||
x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd >= leave.StartLeaveGr &&
|
||||
x.EmployeeId == leave.EmployeeId && x.WorkshopIds == leave.WorkshopId)?.ContractNo;
|
||||
|
||||
var Employee = _context.Employees.SingleOrDefault(x => x.id == leave.EmployeeId);
|
||||
leave.NationalCode = Employee.NationalCode;
|
||||
|
||||
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId).ToList();
|
||||
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId)
|
||||
.ToList();
|
||||
var employerlist = _context.Employers.Select(x => new EmprViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -204,7 +222,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
foreach (var item in id)
|
||||
{
|
||||
var leave = _context.LeaveList.Select(x => new LeavePrintViewModel
|
||||
var leave = _context.LeaveList.IgnoreQueryFilters().Select(x => new LeavePrintViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = "",
|
||||
@@ -225,21 +243,24 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
Year = x.Year,
|
||||
Month = x.Month,
|
||||
MonthGr = Tools.ToFarsiMonthByIntNumber(x.Month),
|
||||
EmployerList = new List<EmprViewModel>()
|
||||
EmployerList = new List<EmprViewModel>(),
|
||||
IsInvalid = x.IsInvalid
|
||||
}).SingleOrDefault(x => x.Id == item);
|
||||
|
||||
//leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr && x.ContractEnd > leave.StartLeaveGr
|
||||
// && x.ContarctStart < leave.EndLeaveGr && x.ContractEnd > leave.EndLeaveGr
|
||||
// && x.WorkshopIds == leave.WorkshopId && x.EmployeeId == leave.EmployeeId).ContractNo;
|
||||
|
||||
leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr
|
||||
&& x.ContractEnd >= leave.StartLeaveGr && x.EmployeeId == leave.EmployeeId
|
||||
leave.ContractNo = _context.Contracts.FirstOrDefault(x => x.ContarctStart <= leave.StartLeaveGr
|
||||
&& x.ContractEnd >= leave.StartLeaveGr &&
|
||||
x.EmployeeId == leave.EmployeeId
|
||||
&& x.WorkshopIds == leave.WorkshopId)?.ContractNo;
|
||||
|
||||
var Employee = _context.Employees.SingleOrDefault(x => x.id == leave.EmployeeId);
|
||||
leave.NationalCode = Employee.NationalCode;
|
||||
|
||||
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId).ToList();
|
||||
var emp = _context.WorkshopEmployers.Where(x => x.WorkshopId == leave.WorkshopId).Select(x => x.EmployerId)
|
||||
.ToList();
|
||||
var employerlist = _context.Employers.Select(x => new EmprViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -254,8 +275,10 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
{
|
||||
leave.EmployerList = new List<EmprViewModel>();
|
||||
}
|
||||
|
||||
query.Add(leave);
|
||||
}
|
||||
|
||||
query = query.OrderBy(x => x.Year).ThenBy(x => x.Month).ToList();
|
||||
int printNumer = 0;
|
||||
foreach (var rec in query)
|
||||
@@ -263,6 +286,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
printNumer += 1;
|
||||
rec.PrintCounter = printNumer;
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
@@ -281,6 +305,11 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
if (searchModel.LeaveType == "sickLeave")
|
||||
leaveMainList = leaveMainList.Where(x => x.LeaveType == "استعلاجی");
|
||||
|
||||
if (searchModel.IsInvalid)
|
||||
{
|
||||
leaveMainList = leaveMainList.IgnoreQueryFilters().Where(x => x.IsInvalid);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave))
|
||||
{
|
||||
var start = searchModel.StartLeave.ToGeorgianDateTime();
|
||||
@@ -297,41 +326,43 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
}
|
||||
|
||||
|
||||
var leaveList = leaveMainList.Where(x => x.WorkshopId == searchModel.WorkshopId).Select(item => new LeaveViewModel()
|
||||
{
|
||||
Id = item.id,
|
||||
StartLeave = item.StartLeave.ToFarsi(),
|
||||
EndLeave = item.EndLeave.ToFarsi(),
|
||||
StartLeaveGr = item.StartLeave,
|
||||
EndLeaveGr = item.EndLeave,
|
||||
WorkshopId = item.WorkshopId,
|
||||
EmployeeId = item.EmployeeId,
|
||||
EmployeeFullName = item.EmployeeFullName,
|
||||
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType, item.LeaveHourses),
|
||||
PaidLeaveType = item.PaidLeaveType,
|
||||
LeaveType = item.LeaveType,
|
||||
IsAccepted = item.IsAccepted,
|
||||
Decription = item.Decription,
|
||||
Year = item.Year,
|
||||
Month = item.Month,
|
||||
MonthStr = item.Month.ToFarsiMonthByIntNumber(),
|
||||
CreationDate = item.CreationDate,
|
||||
}).OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).ToList();
|
||||
var leaveList = leaveMainList.Where(x => x.WorkshopId == searchModel.WorkshopId).Select(item =>
|
||||
new LeaveViewModel()
|
||||
{
|
||||
Id = item.id,
|
||||
StartLeave = item.StartLeave.ToFarsi(),
|
||||
EndLeave = item.EndLeave.ToFarsi(),
|
||||
StartLeaveGr = item.StartLeave,
|
||||
EndLeaveGr = item.EndLeave,
|
||||
WorkshopId = item.WorkshopId,
|
||||
EmployeeId = item.EmployeeId,
|
||||
EmployeeFullName = item.EmployeeFullName,
|
||||
LeaveHourses = Tools.CalculateLeaveHoursAndDays(item.PaidLeaveType, item.LeaveHourses),
|
||||
PaidLeaveType = item.PaidLeaveType,
|
||||
LeaveType = item.LeaveType,
|
||||
IsAccepted = item.IsAccepted,
|
||||
Decription = item.Decription,
|
||||
Year = item.Year,
|
||||
Month = item.Month,
|
||||
MonthStr = item.Month.ToFarsiMonthByIntNumber(),
|
||||
CreationDate = item.CreationDate,
|
||||
IsInvalid = item.IsInvalid
|
||||
}).OrderByDescending(x => x.CreationDate).Skip(searchModel.PageIndex).Take(30).ToList();
|
||||
|
||||
return leaveList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public bool CheckIfValidToEdit(long id)
|
||||
{
|
||||
var leave = _context.LeaveList.FirstOrDefault(x => x.id == id);
|
||||
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == leave.WorkshopId && x.EmployeeId == leave.EmployeeId)
|
||||
var checkoutExist = _context.CheckoutSet
|
||||
.Where(x => x.WorkshopId == leave.WorkshopId && x.EmployeeId == leave.EmployeeId)
|
||||
.Where(x => leave.StartLeave <= x.ContractEnd).ToList();
|
||||
if (checkoutExist.Count > 0)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -346,37 +377,38 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
var item = _context.LeaveList.FirstOrDefault(x => x.id == id);
|
||||
if (item != null)
|
||||
{
|
||||
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId)
|
||||
var checkoutExist = _context.CheckoutSet
|
||||
.Where(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId)
|
||||
.Where(x => item.StartLeave <= x.ContractEnd).ToList();
|
||||
if (checkoutExist.Count > 0)
|
||||
{
|
||||
|
||||
return op.Failed("در بازه زمانی این مرخصی و یا بعد از آن فیش حقوقی وجود دارد");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
_context.LeaveList.Remove(item);
|
||||
|
||||
_context.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return op.Failed("موردی یافت نشد");
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
public bool HasDailyLeave(long employeeId, long workshopId, DateTime date)
|
||||
{
|
||||
return _context.LeaveList
|
||||
.Where(x => (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه") ||
|
||||
x.LeaveType == "استعلاجی")
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
|
||||
x.StartLeave.Date <= date.Date && x.EndLeave.Date >= date.Date) != null;
|
||||
|
||||
.Where(x => (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه") ||
|
||||
x.LeaveType == "استعلاجی")
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
|
||||
x.StartLeave.Date <= date.Date && x.EndLeave.Date >= date.Date) != null;
|
||||
}
|
||||
public List<LeaveViewModel> GetByWorkshopIdEmployeeIdInDates(long workshopId, long employeeId, DateTime start, DateTime end)
|
||||
|
||||
public List<LeaveViewModel> GetByWorkshopIdEmployeeIdInDates(long workshopId, long employeeId, DateTime start,
|
||||
DateTime end)
|
||||
{
|
||||
return _context.LeaveList.Where(x => x.EmployeeId == employeeId && x.EndLeave >= start && x.StartLeave <= end)
|
||||
.Select(x => new LeaveViewModel
|
||||
@@ -389,28 +421,32 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
EndLeaveGr = x.EndLeave,
|
||||
LeaveHourses = x.LeaveHourses
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
public bool CheckContractExist(DateTime myDate, long employeeId, long workshopId)
|
||||
{
|
||||
var result = _context.Contracts.Any(x => x.ContarctStart <= myDate
|
||||
&& x.ContractEnd >= myDate && x.EmployeeId == employeeId &&
|
||||
x.WorkshopIds == workshopId && x.IsActiveString=="true");
|
||||
x.WorkshopIds == workshopId && x.IsActiveString == "true");
|
||||
return result;
|
||||
}
|
||||
|
||||
public LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId)
|
||||
public LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId,
|
||||
bool invalidCheckout)
|
||||
{
|
||||
var res = new LeavErrorViewModel();
|
||||
|
||||
#region Check iF Has Checkout
|
||||
|
||||
//var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
// .Where(x => (startLeav >= x.ContractStart && startLeav <= x.ContractEnd && endLeav > x.ContractEnd) ||
|
||||
// (startLeav >= x.ContractStart && endLeav <= x.ContractEnd) ||
|
||||
// (startLeav < x.ContractStart && endLeav <= x.ContractEnd && endLeav >= x.ContractStart) ||
|
||||
// (startLeav < x.ContractStart && endLeav > x.ContractEnd)).ToList();
|
||||
var checkoutExist = _context.CheckoutSet.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && startLeav <= x.ContractEnd).ToList();
|
||||
var checkoutExist = _context.CheckoutSet.Where(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId && startLeav <= x.ContractEnd).ToList();
|
||||
if (checkoutExist.Count > 0)
|
||||
{
|
||||
res.HasChekout = true;
|
||||
@@ -433,6 +469,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
res.ContractErrMessage = "در بازه تاریخ مرخصی وارد شده قراردادی وجود ندارد";
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Check LeftWork
|
||||
@@ -445,22 +482,32 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
if (leftCheck.Count < 1)
|
||||
{
|
||||
|
||||
res.HasLeftWork = true;
|
||||
res.LeftWorlErrMessage = " پرسنل در بازه تاریخ وارد شده شروع بکار ندارد";
|
||||
return res;
|
||||
|
||||
res.HasLeftWork = true;
|
||||
res.LeftWorlErrMessage = " پرسنل در بازه تاریخ وارد شده شروع بکار ندارد";
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region HolidayError
|
||||
|
||||
var hasCustomizeCheckout =
|
||||
_context.RollCallServices.FirstOrDefault(x => x.WorkshopId == workshopId && x.IsActiveString == "true")
|
||||
?.HasCustomizeCheckoutService == "true";
|
||||
|
||||
if (_context.HolidayItems.Any(x => startLeav.Date == x.Holidaydate.Date) ||
|
||||
startLeav.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
res.HasHolidayError = true;
|
||||
res.HolidayErrorMessage = "شما نمیتوانید در روز های تعطیل مرخصی ثبت کنید";
|
||||
if (!hasCustomizeCheckout)
|
||||
{
|
||||
res.HasHolidayError = true;
|
||||
res.HolidayErrorMessage = "شما نمیتوانید در روز های تعطیل مرخصی ثبت کنید";
|
||||
}
|
||||
else if (!invalidCheckout)
|
||||
{
|
||||
res.HasHolidayError = true;
|
||||
res.HolidayErrorMessage = "شما نمیتوانید در روز های مرخصی دارای اعتبار ثبت کنید";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -470,7 +517,7 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
|
||||
public LeaveViewModel LeavOnChekout(DateTime starContract, DateTime endContract, long employeeId, long workshopId)
|
||||
{
|
||||
return _context.LeaveList.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x =>
|
||||
return _context.LeaveList.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x =>
|
||||
new LeaveViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -483,10 +530,9 @@ public class LeaveRepository : RepositoryBase<long, Leave>, ILeaveRepository
|
||||
LeaveType = x.LeaveType,
|
||||
IsAccepted = x.IsAccepted,
|
||||
Decription = x.Decription
|
||||
|
||||
}).FirstOrDefault(x =>
|
||||
(starContract <= x.StartLeaveGr && endContract >= x.StartLeaveGr) ||
|
||||
(starContract <= x.EndLeaveGr && endContract >= x.EndLeaveGr) ||
|
||||
(starContract <= x.EndLeaveGr && endContract >= x.EndLeaveGr) ||
|
||||
(starContract >= x.StartLeaveGr && starContract <= x.EndLeaveGr) ||
|
||||
(endContract >= x.StartLeaveGr && endContract <= x.EndLeaveGr));
|
||||
}
|
||||
|
||||
@@ -3547,6 +3547,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
StartLeaveGr = contractStart,
|
||||
EndLeaveGr = contractEnd,
|
||||
IsAccepted = true,
|
||||
|
||||
};
|
||||
List<LeaveViewModel> leaveList = _leaveRepository.search(leaveHourseSearch);
|
||||
|
||||
|
||||
@@ -102,7 +102,20 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
//اگر قرداد و فیش حقوی از یک مقادیر سالانه استفاده کرده اند
|
||||
//مزد روزانه قرارداد رو میگیره
|
||||
if (contractYearlySalary.id == checkoutYearlySalary.id)
|
||||
return contract.DailySalaryUnAffected;
|
||||
{
|
||||
if (contract.DailySalaryUnAffected > 0)
|
||||
{
|
||||
return contract.DailySalaryUnAffected;
|
||||
}
|
||||
else
|
||||
{
|
||||
var normalDailyWage = checkoutYearlySalary
|
||||
.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه").Select(x => x.ItemValue).FirstOrDefault();
|
||||
return normalDailyWage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (contract.DailyWageType == "NormalDailyWage")
|
||||
{
|
||||
|
||||
@@ -992,7 +992,7 @@ public class IndexModel : PageModel
|
||||
officialHoliday, totalHoursH, totalHoursM, consumableItemDouble, housingAllowanceDouble,
|
||||
familyAllowanceDouble, marriedAllowanceDouble, workshop.IsOldContract);
|
||||
|
||||
|
||||
|
||||
var command = new CreateCheckout
|
||||
{
|
||||
EmployeeFullName = employee.EmployeeFullName,
|
||||
|
||||
@@ -320,6 +320,11 @@
|
||||
<div class="mb-2 tw-flex tw-flex-col">
|
||||
<div class="custom-scrollbar-x tw-w-full tw-overflow-x-auto">
|
||||
<div class="tab-bar tw-flex tw-w-max tw-gap-3 tw-whitespace-nowrap">
|
||||
|
||||
<button permission="80217" data-permission="80217" type="button" class="tab-bar__tab u-tactile tab-bar__tab--active js-document-click" value="4">
|
||||
<span class="tab-bar__tab-label">ایجاد نشده</span>
|
||||
<span class="" id="notCreated"></span>
|
||||
</button>
|
||||
<button permission="80217" data-permission="80217" type="button" class="tab-bar__tab u-tactile tab-bar__tab--active js-document-click" value="0">
|
||||
<span class="tab-bar__tab-label"> انجام نشده</span>
|
||||
<span class="tab-bar__tab-badge" id="notStarted"></span>
|
||||
@@ -539,6 +544,7 @@
|
||||
|
||||
var ajaxGetTabCountsUrl = `@Url.Page("/Company/InsuranceList/Index", "TabCounts")`;
|
||||
var ajaxSearchNewUrl = `@Url.Page("/Company/InsuranceList/Index", "SearchNew")`;
|
||||
var ajaxNotCreatedUrl = `@Url.Page("/Company/InsuranceList/Index", "NotCreatedWorkshops")`;
|
||||
var openOperationsModalUrl = `@Url.Page("/Company/InsuranceList/Index", "OperationsModal")`;
|
||||
var editUrl = `#showmodal=@Url.Page("/Company/InsuranceList/Index", "Edit")`;
|
||||
var insuranceSummaryUrl = `#showmodal=@Url.Page("/Company/InsuranceList/Index", "InsuranceSummary")`;
|
||||
|
||||
@@ -1162,6 +1162,17 @@ public class IndexModel : PageModel
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetNotCreatedWorkshops(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
var result =await _insuranceListApplication.GetNotCreatedWorkshop(searchModel);
|
||||
return new JsonResult(new
|
||||
{
|
||||
data = result
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetTabCounts(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
data-action="ReloadLeave">
|
||||
|
||||
<input type="hidden" asp-for="@Model.WorkshopId" />
|
||||
<input type="hidden" asp-for="@Model.IsInvallid" id="isInvalid" />
|
||||
|
||||
<div class="modal-content">
|
||||
<div class="modal-header d-block text-center position-relative">
|
||||
@@ -208,6 +209,8 @@
|
||||
var computeLeaveDailyAjax = `@Url.Page("/Company/Employees/Leave", "ComputeLeaveDaily")`;
|
||||
var employeeListAjax = `@Url.Page("Index", "EmployeeList")`;
|
||||
var hasRotatingShiftAjax = `@Url.Page("/Company/Employees/Leave", "HasRotatingShift")`;
|
||||
var checkCanCreateInvalidUrl = `@Url.Page("/Company/Employees/Leave","CheckIsInvalidLeave")`;
|
||||
|
||||
</script>
|
||||
|
||||
<script src="~/assetsclient/pages/employees/js/createleave.js?ver=@clientVersion"></script>
|
||||
|
||||
@@ -252,6 +252,8 @@
|
||||
<input type="hidden" name="leaveType" id="leaveType" asp-for="SearchModel.LeaveType" />
|
||||
<input type="hidden" name="start" id="start" asp-for="SearchModel.StartLeave" />
|
||||
<input type="hidden" name="end" id="end" asp-for="SearchModel.EndLeave" />
|
||||
<input type="hidden" name="isInvalid" id="isInvalid" asp-for="SearchModel.IsInvalid" />
|
||||
|
||||
|
||||
<div class="container-fluid d-none d-lg-block">
|
||||
<div class="row px-2">
|
||||
@@ -260,64 +262,80 @@
|
||||
<div class="col-12">
|
||||
<div class="d-grid search-section gap-2">
|
||||
|
||||
<div class="d-grid grid-cols-3 gap-2 col-span-4">
|
||||
@{
|
||||
var gridCols = Model.HasCustomizeCheckout ? "4" : "3";
|
||||
}
|
||||
<div class="d-grid grid-cols-@gridCols gap-2 col-span-4">
|
||||
|
||||
<div class="wrapper-dropdown-normal btn-dropdown" id="dropdown-normal">
|
||||
<span class="selected-display" id="destination-normal">هر دو</span>
|
||||
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-normal boxes">
|
||||
<li class="item" value-data-normal="both">هر دو</li>
|
||||
<li class="item" value-data-normal="paidLeave">استحقاقی</li>
|
||||
<li class="item" value-data-normal="sickLeave">استعلاجی</li>
|
||||
</ul>
|
||||
<input type="hidden" id="sendSorting" asp-for="SearchModel.LeaveType"/>
|
||||
</div>
|
||||
|
||||
<div class="wrapper-dropdown-year btn-dropdown" id="dropdown-year">
|
||||
<span class="selected-display" id="destination-year">سال</span>
|
||||
<svg class="arrow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="transition-all ml-auto rotate-180">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-year boxes" id="my-scrollbar">
|
||||
<li class="item" value-data-year="0">سال</li>
|
||||
@foreach (string year in @Model.YearlyList)
|
||||
{
|
||||
<li class="item" value-data-year="@year">@year</li>
|
||||
}
|
||||
</ul>
|
||||
<input type="hidden" id="sendDropdownYear" asp-for="SearchModel.Year"/>
|
||||
</div>
|
||||
|
||||
<div class="wrapper-dropdown-month btn-dropdown" id="dropdown-month">
|
||||
<span class="selected-display" id="destination-month">ماه</span>
|
||||
<svg class="arrow" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="transition-all ml-auto rotate-180">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-month boxes">
|
||||
<li class="item" value-data-month="0">ماه</li>
|
||||
<li class="item" value-data-month="01">فروردین</li>
|
||||
<li class="item" value-data-month="02">اردیبهشت</li>
|
||||
<li class="item" value-data-month="03">خرداد</li>
|
||||
<li class="item" value-data-month="04">تیر</li>
|
||||
<li class="item" value-data-month="05">مرداد</li>
|
||||
<li class="item" value-data-month="06">شهریور</li>
|
||||
<li class="item" value-data-month="07">مهر</li>
|
||||
<li class="item" value-data-month="08">آبان</li>
|
||||
<li class="item" value-data-month="09">آذر</li>
|
||||
<li class="item" value-data-month="10">دی</li>
|
||||
<li class="item" value-data-month="11">بهمن</li>
|
||||
<li class="item" value-data-month="12">اسفند</li>
|
||||
</ul>
|
||||
<input type="hidden" id="sendDropdownMonth" asp-for="SearchModel.Month"/>
|
||||
<span class="selected-display" id="destination-normal">هر دو</span>
|
||||
<svg id="drp-arrow" class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-normal boxes">
|
||||
<li class="item" value-data-normal="both">هر دو</li>
|
||||
<li class="item" value-data-normal="paidLeave">استحقاقی</li>
|
||||
<li class="item" value-data-normal="sickLeave">استعلاجی</li>
|
||||
</ul>
|
||||
<input type="hidden" id="sendSorting" asp-for="SearchModel.LeaveType"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-span-2 md-col-span-2"><input type="text" class="form-control date start-date" asp-for="SearchModel.StartLeave" placeholder="تاریخ شروع"></div>
|
||||
<div class="wrapper-dropdown-year btn-dropdown" id="dropdown-year">
|
||||
<span class="selected-display" id="destination-year">سال</span>
|
||||
<svg class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-year boxes" id="my-scrollbar">
|
||||
<li class="item" value-data-year="0">سال</li>
|
||||
@foreach (string year in @Model.YearlyList)
|
||||
{
|
||||
<li class="item" value-data-year="@year">@year</li>
|
||||
}
|
||||
</ul>
|
||||
<input type="hidden" id="sendDropdownYear" asp-for="SearchModel.Year"/>
|
||||
</div>
|
||||
|
||||
<div class="wrapper-dropdown-month btn-dropdown" id="dropdown-month">
|
||||
<span class="selected-display" id="destination-month">ماه</span>
|
||||
<svg class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-month boxes">
|
||||
<li class="item" value-data-month="0">ماه</li>
|
||||
<li class="item" value-data-month="01">فروردین</li>
|
||||
<li class="item" value-data-month="02">اردیبهشت</li>
|
||||
<li class="item" value-data-month="03">خرداد</li>
|
||||
<li class="item" value-data-month="04">تیر</li>
|
||||
<li class="item" value-data-month="05">مرداد</li>
|
||||
<li class="item" value-data-month="06">شهریور</li>
|
||||
<li class="item" value-data-month="07">مهر</li>
|
||||
<li class="item" value-data-month="08">آبان</li>
|
||||
<li class="item" value-data-month="09">آذر</li>
|
||||
<li class="item" value-data-month="10">دی</li>
|
||||
<li class="item" value-data-month="11">بهمن</li>
|
||||
<li class="item" value-data-month="12">اسفند</li>
|
||||
</ul>
|
||||
<input type="hidden" id="sendDropdownMonth" asp-for="SearchModel.Month"/>
|
||||
</div>
|
||||
@if (Model.HasCustomizeCheckout)
|
||||
{
|
||||
<div class="wrapper-dropdown-invalid btn-dropdown" id="dropdown-invalid">
|
||||
<span class="selected-display" id="destination-invalid">دارای اعتبار</span>
|
||||
<svg class="arrow transition-all ml-auto rotate-180" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7 14.5l5-5 5 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</svg>
|
||||
<ul class="dropdown-invalid boxes">
|
||||
<li class="item" value-data-invalid="false">دارای اعتبار</li>
|
||||
<li class="item" value-data-invalid="true">فاقد اعتبار</li>
|
||||
</ul>
|
||||
<input type="hidden" id="sendDropdownInvalid" asp-for="SearchModel.IsInvalid"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-span-1 md-col-span-2"><input type="text" class="form-control date start-date" asp-for="SearchModel.StartLeave" placeholder="تاریخ شروع"></div>
|
||||
<div class="col-span-2 md-col-span-2"><input type="text" class="form-control date end-date" asp-for="SearchModel.EndLeave" placeholder="تاریخ پایان"></div>
|
||||
|
||||
<div class="col-span-2 md-col-span-3">
|
||||
<div class="employeeSelect">
|
||||
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="SearchModel.EmployeeId" id="employeeSelect">
|
||||
@@ -888,13 +906,20 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<select class="form-select" asp-for="SearchModel.LeaveType">
|
||||
<option value="both" selected>هر دو</option>
|
||||
<option value="paidLeave">استحقاقی</option>
|
||||
<option value="sickLeave">استعلاجی</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<select class="form-select" asp-for="SearchModel.LeaveType">
|
||||
<option value="both" selected>هر دو</option>
|
||||
<option value="paidLeave">استحقاقی</option>
|
||||
<option value="sickLeave">استعلاجی</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<select class="form-select" asp-for="SearchModel.IsInvalid">
|
||||
<option value="false">دارای اعتبار</option>
|
||||
<option value="true">فاقد اعتبار</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span class="form-control text-center persianDateInputStartDate" id="start-date">تاریخ شروع</span>
|
||||
@@ -1219,6 +1244,12 @@
|
||||
$('#sendDropdownMonth').val(dataVal);
|
||||
});
|
||||
|
||||
$('.dropdown-invalid .item').on("click", function () {
|
||||
let dataVal = $(this).attr("value-data-invalid");
|
||||
$('#sendDropdownInvalid').val(dataVal === 'both' ? '' : dataVal);
|
||||
$('#isInvalid').val(dataVal === 'both' ? '' : dataVal)
|
||||
});
|
||||
|
||||
var sendDropdownNormal = $("#sendSorting").val();
|
||||
if (sendDropdownNormal) {
|
||||
let itemDropdownNormal = $(".dropdown-normal").find(".item[value-data-normal='" + sendDropdownNormal + "']");
|
||||
@@ -1243,6 +1274,21 @@
|
||||
selectedMonthDisplay.text(itemDropdownMonth.text());
|
||||
}
|
||||
|
||||
// Initialize invalid dropdown display
|
||||
var sendDropdownInvalid = $("#sendDropdownInvalid").val();
|
||||
if (!sendDropdownInvalid) {
|
||||
let itemInvalidBoth = $(".dropdown-invalid").find(".item[value-data-invalid='both']");
|
||||
itemInvalidBoth.addClass("active");
|
||||
var selectedInvalidDisplay = $(".wrapper-dropdown-invalid").find(".selected-display");
|
||||
selectedInvalidDisplay.text(itemInvalidBoth.text());
|
||||
} else {
|
||||
let invalidVal = sendDropdownInvalid.toString().toLowerCase();
|
||||
let itemInvalid = $(".dropdown-invalid").find(".item[value-data-invalid='" + invalidVal + "']");
|
||||
itemInvalid.addClass("active");
|
||||
var selectedInvalidDisplay = $(".wrapper-dropdown-invalid").find(".selected-display");
|
||||
selectedInvalidDisplay.text(itemInvalid.text());
|
||||
}
|
||||
|
||||
// check if anything else ofther than the dropdown is clicked
|
||||
window.addEventListener("click", function (e) {
|
||||
if (e.target.closest(".wrapper-dropdown") === null) {
|
||||
@@ -2752,7 +2798,8 @@
|
||||
'searchModel.LeaveType': $('#leaveType').val(),
|
||||
'searchModel.StartLeave': $('#start').val(),
|
||||
'searchModel.EndLeave': $('#end').val(),
|
||||
'searchModel.PageIndex': $('#pageIndex').val()
|
||||
'searchModel.PageIndex': $('#pageIndex').val(),
|
||||
'searchModel.IsInvalid': $('#isInvalid').val(),
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ using System.Text.RegularExpressions;
|
||||
using _0_Framework.Infrastructure;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using CompanyManagment.App.Contracts.RollCallService;
|
||||
|
||||
namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
{
|
||||
@@ -49,10 +51,13 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
private readonly long _workshopId;
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
private readonly IRollCallServiceApplication _rollCallServiceApplication;
|
||||
public int PageIndex;
|
||||
public bool HasCustomizeCheckout { get; set; }
|
||||
|
||||
#region Initial Data
|
||||
public LeaveModel(IWorkshopApplication workshopApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ILeaveApplication leaveApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, IHttpContextAccessor contextAccessor, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication)
|
||||
#region Initial Data
|
||||
public LeaveModel(IWorkshopApplication workshopApplication, IEmployeeApplication employeeApplication, IAuthHelper authHelper, ILeaveApplication leaveApplication, IYearlySalaryApplication yearlySalaryApplication, IPasswordHasher passwordHasher, IHttpContextAccessor contextAccessor, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IHolidayItemApplication holidayItemApplication, IRollCallServiceApplication rollCallServiceApplication)
|
||||
{
|
||||
_workshopApplication = workshopApplication;
|
||||
_employeeApplication = employeeApplication;
|
||||
@@ -62,6 +67,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
_contextAccessor = contextAccessor;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
_rollCallServiceApplication = rollCallServiceApplication;
|
||||
_authHelper = authHelper;
|
||||
|
||||
|
||||
@@ -80,6 +87,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
{
|
||||
//long employeeId = _passwordHasher.SlugDecrypt(employeeHash);
|
||||
long employeeId = searchModel.EmployeeId;
|
||||
var rollCallServiceViewModel = _rollCallServiceApplication.GetActiveServiceByWorkshopId(_workshopId);
|
||||
HasCustomizeCheckout = rollCallServiceViewModel is { HasCustomizeCheckoutService: "true" };
|
||||
if (employeeId >= 0)
|
||||
{
|
||||
var workshop = _workshopApplication.GetDetails(_workshopId);
|
||||
@@ -91,7 +100,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
Year = searchModel.Year,
|
||||
Month = searchModel.Month,
|
||||
StartLeave = searchModel.StartLeave,
|
||||
EndLeave = searchModel.EndLeave
|
||||
EndLeave = searchModel.EndLeave,
|
||||
IsInvalid = searchModel.IsInvalid
|
||||
};
|
||||
Year = searchModel.Year;
|
||||
Month = searchModel.Month;
|
||||
@@ -166,6 +176,35 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
PrintID = result.SendId
|
||||
});
|
||||
}
|
||||
|
||||
public IActionResult OnPostCheckIsInvalidLeave(string startDate)
|
||||
{
|
||||
bool isInHoliday = false;
|
||||
bool canCreateInvalid = false;
|
||||
var dateTimeGr = startDate.ToGeorgianDateTime();
|
||||
if (dateTimeGr.DayOfWeek == DayOfWeek.Friday)
|
||||
{
|
||||
isInHoliday = true;
|
||||
}else if (_holidayItemApplication.IsHoliday(dateTimeGr))
|
||||
{
|
||||
isInHoliday = true;
|
||||
};
|
||||
|
||||
if (isInHoliday)
|
||||
{
|
||||
var rollCallService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(_workshopId);
|
||||
if (rollCallService != null)
|
||||
{
|
||||
canCreateInvalid =rollCallService.HasCustomizeCheckoutService == "true";
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isInHoliday,
|
||||
canCreateInvalid
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check If Valide To Edit
|
||||
|
||||
@@ -329,7 +329,8 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(item.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (item.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<div class="row">
|
||||
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @item.ContractNo</fieldset></div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(item.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (item.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -298,7 +298,7 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(Model.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (Model.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
<div class="row">
|
||||
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
|
||||
<div class="col-6 d-inline-block text-center">
|
||||
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
|
||||
<p class="m-0" style="font-size: 15px; font-weight: bold">برگ مرخصی @(Model.IsInvalid?"(فاقداعتبار)":"")</p>
|
||||
</div>
|
||||
<div class="col-3 d-inline-block" style="text-align: left;">
|
||||
@if (Model.PaidLeaveType == "روزانه")
|
||||
|
||||
@@ -117,9 +117,13 @@ $(document).ready(function () {
|
||||
case "3":
|
||||
loadSearchNew(3);
|
||||
break;
|
||||
default:
|
||||
case "4":
|
||||
loadNotCreatedData();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.btn-search-click').click(function () {
|
||||
urlParamsSearch
|
||||
@@ -144,7 +148,10 @@ $(document).ready(function () {
|
||||
$("#load-data-html-mobile").html('');
|
||||
$('#load-data-html').html('');
|
||||
loadGetTabCounts();
|
||||
loadSearchNew(activeValue);
|
||||
if(activeValue==="4")
|
||||
loadNotCreatedData();
|
||||
else
|
||||
loadSearchNew(activeValue);
|
||||
|
||||
$('.btn-clear-filter').removeClass('disable');
|
||||
});
|
||||
@@ -165,13 +172,274 @@ $(document).ready(function () {
|
||||
$(this).addClass("tab-bar__tab--active");
|
||||
|
||||
var status = parseInt($(this).val());
|
||||
loadSearchNew(status);
|
||||
if (status === 4)
|
||||
loadNotCreatedData();
|
||||
else
|
||||
loadSearchNew(status);
|
||||
|
||||
found = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
function loadNotCreatedData() {
|
||||
var pageIndex = pageIndexJs;
|
||||
|
||||
var html = "";
|
||||
var htmlMobile = "";
|
||||
|
||||
var paramsUrl = UrlParamsBuilder.readParams([
|
||||
"year",
|
||||
"month",
|
||||
"workshop-code",
|
||||
"employee-id",
|
||||
"workshop-id",
|
||||
"type-of-insurance",
|
||||
//"branch",
|
||||
//"city",
|
||||
"fixed-salary"
|
||||
]);
|
||||
|
||||
var searchModel = {
|
||||
Year: paramsUrl['year'] !== "" ? paramsUrl['year'] : year,
|
||||
Month: paramsUrl['month'] !== "" ? paramsUrl['month'] : month,
|
||||
WorkShopCode: paramsUrl['workshop-code'],
|
||||
EmployerId: paramsUrl['employee-id'],
|
||||
WorkshopId: paramsUrl['workshop-id'],
|
||||
TypeOfInsuranceSend: paramsUrl['type-of-insurance'],
|
||||
//Branch: paramsUrl['branch'],
|
||||
//City: paramsUrl['city'],
|
||||
FixedSalary: paramsUrl['fixed-salary'],
|
||||
PageIndex: pageIndex
|
||||
};
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
if (b === 0 && hasMoreData) {
|
||||
ajaxService.get(ajaxNotCreatedUrl, searchModel, false)
|
||||
.then(response => {
|
||||
var responseData = response.data;
|
||||
|
||||
if (responseData.length > 0) {
|
||||
responseData.forEach(function (item) {
|
||||
|
||||
var n = pageIndexJs + 1;
|
||||
var pathDSKKAR00 = item.workShopId + "\\" + item.year + "_" + item.month + "\\DSKKAR00.dbf";
|
||||
var pathDSKWOR00 = item.workShopId + "\\" + item.year + "_" + item.month + "\\DSKWOR00.dbf";
|
||||
|
||||
const rowBgClass = item.isBlockCantracingParty === "true"
|
||||
? "tw-bg-[#b1c3c3] hover:tw-bg-[#bbc6c6]"
|
||||
: item.confirmSentlist
|
||||
? "tw-bg-[#d8f5d2] hover:tw-bg-[#c7ebc0]"
|
||||
: (n % 2 === 0
|
||||
? "tw-bg-[#ecffff] hover:tw-bg-[#C9F0F0]"
|
||||
: "tw-bg-[#ddf4f4] hover:tw-bg-[#C9F0F0]");
|
||||
|
||||
html += `
|
||||
<div class="insurance-table__container">
|
||||
<div class="insurance-table__row tw-transition-all tw-font-[400] tw-flex tw-h-[35px] tw-items-center tw-rounded-[5px] ${rowBgClass} tw-px-2 tw-text-[12px]">
|
||||
<div class="insurance-table__cell tw-w-[3%]">
|
||||
<div class="insurance-table__cell-card insurance-table__cell-card--small ${item.isBlockCantracingParty === "true" ? `` : item.confirmSentlist ? `!tw-bg-[#a3d798]` : ``} ${item.isBlockCantracingParty === "true" ? `!tw-bg-[#9b9d9d] !tw-text-white` : ``}">
|
||||
${n++}
|
||||
</div>
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[4%] tw-text-center">${item.year}</div>
|
||||
<div class="insurance-table__cell tw-w-[5%] tw-text-center">${convertMonthToString(item.month)}</div>
|
||||
<div class="insurance-table__cell tw-w-[5%] tw-text-center">${item.archiveCode}</div>
|
||||
|
||||
<div class="insurance-table__cell tw-w-[10%] tw-text-center">${item.workShopCode}</div>
|
||||
<div class="insurance-table__cell tw-w-[13%] tw-text-right">
|
||||
<div class="tooltip-container tw-text-right">
|
||||
<div class="tooltip__trigger tw-truncate tw-text-right">${item.employerName}</div>
|
||||
<div class="tooltip-container__text">
|
||||
${item.employerName}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[13%] tw-text-right">
|
||||
<div class="tooltip-container tw-text-right">
|
||||
<div class="tooltip__trigger tw-truncate tw-text-right">${item.workShopName}</div>
|
||||
<div class="tooltip-container__text">
|
||||
${item.workShopName}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[7%] tw-text-center">${item.typeOfInsuranceSend}</div>
|
||||
<div class="insurance-table__cell tw-w-[7%] tw-text-center tw-flex tw-justify-center">
|
||||
${booleanSvgResponse(item.inspectionDone)}
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[7%] tw-text-center tw-flex tw-justify-center">
|
||||
${booleanSvgResponse(item.debtDone)}
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[7%] tw-text-center tw-flex tw-justify-center">
|
||||
${booleanSvgResponse(item.employerApproved)}
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[7%] tw-text-center tw-flex tw-justify-center">
|
||||
${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[12%] tw-text-end">
|
||||
<div class="tw-flex tw-justify-end tw-gap-2">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- toggle content -->
|
||||
<div class="insurance-table__toggle tw-mx-auto tw-flex tw-w-[97%] tw-flex-col tw-gap-2 tw-px-2">
|
||||
<div class="insurance-table__toggle-row tw-flex tw-gap-2">
|
||||
<div class="insurance-table__toggle-item tw-mb-2 tw-flex tw-w-[20%]">
|
||||
<span class="insurance-table__toggle-label tw-w-[30%]">شعبه تامین اجتماعی:</span>
|
||||
<span class="insurance-table__toggle-value tw-w-[50%]">${item.branch === `` ? `-` : item.branch}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-mb-2 tw-flex tw-flex tw-w-[20%] tw-gap-40 tw-gap-2">
|
||||
<span class="insurance-table__toggle-label tw-w-[30%]">شهرستان:</span>
|
||||
<span class="insurance-table__toggle-value tw-w-[50%]">${item.city === `` ? `-` : item.city}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-mb-2 tw-flex tw-flex tw-w-[20%] tw-gap-40 tw-gap-2">
|
||||
<span class="insurance-table__toggle-label tw-w-[30%]">لیست مقطوع:</span>
|
||||
<span class="insurance-table__toggle-value tw-w-[50%]">${item.strFixedSalary}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-mb-2 tw-flex tw-flex tw-w-[20%] tw-gap-40 tw-gap-2">
|
||||
<span class="insurance-table__toggle-label tw-w-[30%]"></span>
|
||||
<span class="insurance-table__toggle-value tw-w-[50%]"></span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-mb-2 tw-flex tw-flex tw-w-[20%] tw-gap-40 tw-gap-2">
|
||||
<span class="insurance-table__toggle-label tw-w-[30%]"></span>
|
||||
<span class="insurance-table__toggle-value tw-w-[50%]"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
htmlMobile += `<div class="insurance-table__container tw-cursor-pointer">
|
||||
<div class="insurance-table__row tw-font-[500] tw-flex tw-h-[35px] tw-items-center tw-rounded-[5px] ${rowBgClass} tw-px-2 tw-text-[12px] md:tw-font-[400] md:tw-text-[14px]">
|
||||
<div class="insurance-table__cell tw-w-[10%]">
|
||||
<div class="insurance-table__cell-card insurance-table__cell-card--small tw-text-center ${item.isBlockCantracingParty === "true" ? `` : item.confirmSentlist ? `!tw-bg-[#a3d798]` : ``} ${item.isBlockCantracingParty === "true" ? `!tw-bg-[#9b9d9d] !tw-text-white` : ``}">
|
||||
${n++}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[15%] tw-text-center">${item.year}</div>
|
||||
<div class="insurance-table__cell tw-w-[20%] tw-text-center">${convertMonthToString(item.month)}</div>
|
||||
<div class="insurance-table__cell tw-w-[10%] tw-text-center">${item.archiveCode}</div>
|
||||
|
||||
<div class="insurance-table__cell tw-w-[40%] tw-text-center">
|
||||
<div class="tooltip-container tw-text-center">
|
||||
<div class="tooltip__trigger tw-truncate tw-text-center">${item.workShopName}</div>
|
||||
<div class="tooltip-container__text">
|
||||
${item.employerName}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__cell tw-flex tw-w-[10%] tw-justify-end tw-gap-2">
|
||||
<button class="u-tactile">
|
||||
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="21" height="21" rx="3" fill="#23bab9"/>
|
||||
<path d="M10.4375 14.1484C11.3436 14.1484 12.0781 14.8891 12.0781 15.8028C12.0781 16.7166 11.3436 17.4573 10.4375 17.4573C9.53141 17.4573 8.79688 16.7166 8.79688 15.8028C8.79688 14.8891 9.53141 14.1484 10.4375 14.1484Z" fill="white"/>
|
||||
<path d="M10.4375 9.07031C11.3436 9.07031 12.0781 9.81102 12.0781 10.7247C12.0781 11.6384 11.3436 12.3791 10.4375 12.3791C9.53141 12.3791 8.79688 11.6384 8.79688 10.7247C8.79688 9.81102 9.53141 9.07031 10.4375 9.07031Z" fill="white"/>
|
||||
<path d="M12.0781 5.65441C12.0781 4.7407 11.3436 4 10.4375 4C9.53141 4 8.79688 4.74071 8.79688 5.65441C8.79688 6.56812 9.53141 7.30882 10.4375 7.30882C11.3436 7.30882 12.0781 6.56812 12.0781 5.65441Z" fill="white"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- toggle content -->
|
||||
<div class="insurance-table__toggle tw-mx-auto tw-flex tw-w-[95%] tw-flex-col tw-gap-2 tw-px-2">
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex">
|
||||
<div class="insurance-table__toggle-item tw-flex tw-items-center tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">بازرسی: </span>
|
||||
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.inspectionDone)}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-flex tw-items-center tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">بدهی: </span>
|
||||
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.debtDone)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex">
|
||||
<div class="insurance-table__toggle-item tw-flex tw-items-center tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">تاییده کارفرما: </span>
|
||||
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.employerApproved)}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-flex tw-items-center tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">ارسال لیست: </span>
|
||||
<span class="insurance-table__toggle-value">${booleanSvgResponse(item.confirmSentlist, item.employerApprovalStatus)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex">
|
||||
<div class="insurance-table__toggle-item tw-flex tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">شعبه تامین اجتماعی: </span>
|
||||
<span class="insurance-table__toggle-value">${item.branch === `` ? `-` : item.branch}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-flex tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">لیست مقطوع: </span>
|
||||
<span class="insurance-table__toggle-value">${item.strFixedSalary}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex ">
|
||||
<div class="insurance-table__toggle-item tw-flex tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">شهرستان: </span>
|
||||
<span class="insurance-table__toggle-value">${item.city === `` ? `-` : item.city}</span>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-item tw-flex tw-w-[50%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">نوع ارسال لیست: </span>
|
||||
<span class="insurance-table__toggle-value">${item.typeOfInsuranceSend}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex ">
|
||||
<div class="insurance-table__toggle-item tw-flex tw-w-[100%] tw-gap-2">
|
||||
<span class="insurance-table__toggle-label">نام کافرما:</span>
|
||||
<span class="insurance-table__toggle-value">${item.employerName}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="insurance-table__toggle-row tw-flex ">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
pageIndexJs++;
|
||||
});
|
||||
} else {
|
||||
var emptyHtml = ``;
|
||||
if (pageIndexJs === responseData.length) {
|
||||
emptyHtml = `
|
||||
<div class="text-center bg-white card py-5 d-flex align-items-center justify-content-center">
|
||||
<div class="tw-w-full text-center">
|
||||
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" style="margin: auto;" />
|
||||
<h5>اطلاعاتی وجود ندارد.</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
html += emptyHtml;
|
||||
htmlMobile += emptyHtml;
|
||||
hasMoreData = false;
|
||||
}
|
||||
|
||||
$("#load-data-html").append(html);
|
||||
$("#load-data-html-mobile").append(htmlMobile);
|
||||
});
|
||||
}
|
||||
}
|
||||
function removeSearch() {
|
||||
window.location.href = baseUrl;
|
||||
}
|
||||
@@ -207,6 +475,7 @@ async function loadGetTabCounts() {
|
||||
try {
|
||||
var response = await ajaxService.get(ajaxGetTabCountsUrl, searchModel, true);
|
||||
|
||||
|
||||
updateStatus('notStarted', response.notStarted);
|
||||
updateStatus('inProgress', response.inProgress);
|
||||
updateStatus('readyToSendList', response.readyToSendList);
|
||||
@@ -234,7 +503,10 @@ $(window).scroll(function () {
|
||||
if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) {
|
||||
var $activeTab = $('.tab-bar__tab--active');
|
||||
var activeValue = $activeTab.val();
|
||||
loadSearchNew(activeValue);
|
||||
if (activeValue==="4")
|
||||
loadNotCreatedData();
|
||||
else
|
||||
loadSearchNew(activeValue);
|
||||
}
|
||||
|
||||
if ($(this).scrollTop() > 100) {
|
||||
@@ -249,7 +521,7 @@ function loadSearchNew(status = 0) {
|
||||
|
||||
var html = "";
|
||||
var htmlMobile = "";
|
||||
|
||||
|
||||
var paramsUrl = UrlParamsBuilder.readParams([
|
||||
"year",
|
||||
"month",
|
||||
@@ -277,25 +549,26 @@ function loadSearchNew(status = 0) {
|
||||
};
|
||||
|
||||
var b = pageIndexJs % 30;
|
||||
|
||||
|
||||
if (b === 0 && hasMoreData) {
|
||||
ajaxService.get(ajaxSearchNewUrl, searchModel, false)
|
||||
.then(response => {
|
||||
var responseData = response.data;
|
||||
|
||||
if (responseData.length > 0) {
|
||||
if (responseData.length > 0) {
|
||||
responseData.forEach(function (item) {
|
||||
|
||||
var n = pageIndexJs + 1;
|
||||
var pathDSKKAR00 = item.workShopId + "\\" + item.year + "_" + item.month + "\\DSKKAR00.dbf";
|
||||
var pathDSKWOR00 = item.workShopId + "\\" + item.year + "_" + item.month + "\\DSKWOR00.dbf";
|
||||
|
||||
|
||||
const rowBgClass = item.isBlockCantracingParty === "true"
|
||||
? "tw-bg-[#b1c3c3] hover:tw-bg-[#bbc6c6]"
|
||||
: item.confirmSentlist
|
||||
? "tw-bg-[#d8f5d2] hover:tw-bg-[#c7ebc0]"
|
||||
: (n % 2 === 0
|
||||
? "tw-bg-[#ecffff] hover:tw-bg-[#C9F0F0]"
|
||||
: "tw-bg-[#ddf4f4] hover:tw-bg-[#C9F0F0]");
|
||||
? "tw-bg-[#d8f5d2] hover:tw-bg-[#c7ebc0]"
|
||||
: (n % 2 === 0
|
||||
? "tw-bg-[#ecffff] hover:tw-bg-[#C9F0F0]"
|
||||
: "tw-bg-[#ddf4f4] hover:tw-bg-[#C9F0F0]");
|
||||
|
||||
html += `
|
||||
<div class="insurance-table__container">
|
||||
@@ -307,7 +580,8 @@ function loadSearchNew(status = 0) {
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[4%] tw-text-center">${item.year}</div>
|
||||
<div class="insurance-table__cell tw-w-[5%] tw-text-center">${convertMonthToString(item.month)}</div>
|
||||
<div class="insurance-table__cell tw-w-[5%] tw-text-center">${item.archiveCode}</div>
|
||||
<div class="insurance-table__cell tw-w-[5%] tw-text-center">${item.archiveCode}</div>
|
||||
|
||||
<div class="insurance-table__cell tw-w-[10%] tw-text-center">${item.workShopCode}</div>
|
||||
<div class="insurance-table__cell tw-w-[13%] tw-text-right">
|
||||
<div class="tooltip-container tw-text-right">
|
||||
@@ -389,8 +663,9 @@ function loadSearchNew(status = 0) {
|
||||
|
||||
</div>
|
||||
<div class="insurance-table__cell tw-w-[15%] tw-text-center">${item.year}</div>
|
||||
<div class="insurance-table__cell tw-w-[20%] tw-text-center">${convertMonthToString(item.month)}</div>
|
||||
<div class="insurance-table__cell tw-w-[10%] tw-text-center">${item.archiveCode}</div>
|
||||
<div class="insurance-table__cell tw-w-[20%] tw-text-center">${convertMonthToString(item.month)}</div>
|
||||
<div class="insurance-table__cell tw-w-[10%] tw-text-center">${item.archiveCode}</div>
|
||||
|
||||
<div class="insurance-table__cell tw-w-[40%] tw-text-center">
|
||||
<div class="tooltip-container tw-text-center">
|
||||
<div class="tooltip__trigger tw-truncate tw-text-center">${item.workShopName}</div>
|
||||
@@ -505,7 +780,7 @@ function loadSearchNew(status = 0) {
|
||||
function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
|
||||
var html = '';
|
||||
var htmlMobile = '';
|
||||
|
||||
|
||||
var canShowActions = (currentAccountId === 1 && item.confirmSentlist) || !item.confirmSentlist;
|
||||
var isDisabled = item.isBlockCantracingParty === 'true' ? 'disable' : '';
|
||||
|
||||
@@ -548,11 +823,11 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
|
||||
}
|
||||
|
||||
//if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) {
|
||||
//if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// Confirm List and Print Button
|
||||
if (hasPermission_80215) {
|
||||
html += `
|
||||
<a href="${insuranceConfirmUrl + `&id=` + item.id}" class="printModal tw-flex tw-items-center tw-justify-center tw-rounded-[5px] tw-bg-[#38BBF6] tw-w-full md:tw-w-[25px] tw-h-[25px] ${isDisabled} ">
|
||||
<a href="${insuranceConfirmUrl + `&id=` + item.id}" class="printModal tw-flex tw-items-center tw-justify-center tw-rounded-[5px] tw-bg-[#38BBF6] tw-w-full md:tw-w-[25px] tw-h-[25px] ${isDisabled}">
|
||||
<svg width="22" height="22" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="16" height="16" fill="#38BBF6"/>
|
||||
<path d="M12 9.0026H12.1111C12.6293 9.0026 12.8883 9.0026 13.0893 8.90891C13.3023 8.80955 13.4736 8.6383 13.573 8.42522C13.6666 8.2243 13.6666 7.96522 13.6666 7.44705V7.44705C13.6666 6.41071 13.6666 5.89255 13.4793 5.4907C13.2805 5.06455 12.938 4.72204 12.5119 4.52332C12.11 4.33594 11.5919 4.33594 10.5555 4.33594H6.06665C4.43893 4.33594 3.62508 4.33594 3.07467 4.78165C2.96606 4.8696 2.86697 4.96869 2.77902 5.0773C2.33331 5.6277 2.33331 6.44156 2.33331 8.06927V8.06927C2.33331 8.4762 2.33331 8.67966 2.44474 8.81726C2.46673 8.84442 2.4915 8.86919 2.51865 8.89118C2.65625 9.0026 2.85972 9.0026 3.26665 9.0026H3.99998" stroke="#FFFEFE"/>
|
||||
@@ -564,7 +839,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
|
||||
<span class="tw-flex md:tw-hidden tw-text-sm tw-text-white">پرینت</span>
|
||||
</a>`;
|
||||
}
|
||||
//}
|
||||
// }
|
||||
|
||||
if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// Summary List and Print Button
|
||||
@@ -627,7 +902,7 @@ function booleanSvgResponse(bool, employerApprovalStatus) {
|
||||
var isWrittenVerbal = employerApprovalStatus === 1;
|
||||
|
||||
var svg = ``;
|
||||
if (bool) {
|
||||
if (bool) {
|
||||
svg = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="8" fill="#A7E1C7"/>
|
||||
<path d="M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6" stroke="#00B521" stroke-width="1.2" stroke-linecap="round"/>
|
||||
@@ -687,7 +962,7 @@ function convertMonthToString(value) {
|
||||
result = "بدون ماه";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -827,8 +1102,8 @@ searchBoxWorkshop.on('keyup keypress', function (e) {
|
||||
//keyboard Arrow Key Select And Enter
|
||||
liListWorkshop = $('#empWorkshop ul li');
|
||||
mixContainerAndSerchResultWorkshop.animate({
|
||||
scrollTop: $(liListWorkshop.eq(0)).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
scrollTop: $(liListWorkshop.eq(0)).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
50);
|
||||
if (e.which === 40) {// if ArrowUp
|
||||
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
|
||||
@@ -840,8 +1115,8 @@ searchBoxWorkshop.on('keyup keypress', function (e) {
|
||||
if (countWorkshop > 4) {
|
||||
//ScrollDown
|
||||
mixContainerAndSerchResultWorkshop.animate({
|
||||
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
countWorkshop += 1;
|
||||
@@ -984,8 +1259,8 @@ searchBoxEmployer.on('keyup keypress', function (e) {
|
||||
//keyboard Arrow Key Select And Enter
|
||||
liListEmployer = $('#empEmployer ul li');
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liListEmployer.eq(0)).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
scrollTop: $(liListEmployer.eq(0)).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
if (e.which === 40) {// if ArrowUp
|
||||
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
|
||||
@@ -997,8 +1272,8 @@ searchBoxEmployer.on('keyup keypress', function (e) {
|
||||
if (countEmployer > 4) {
|
||||
//ScrollDown
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
countEmployer += 1;
|
||||
@@ -1017,8 +1292,8 @@ searchBoxEmployer.on('keyup keypress', function (e) {
|
||||
liPointerEmployer = liListEmployer.eq(countEmployer);
|
||||
//ScrollUp
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,6 +548,7 @@ svg {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.dropdown-global-item {
|
||||
padding: 4px 10px;
|
||||
cursor: pointer;
|
||||
@@ -567,4 +568,101 @@ svg {
|
||||
|
||||
.dropdown-global.active .dropdown-global-content {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
/* --------------------------------------------------------------------------------Invalid-------------------------------------------------------------------------------------- */
|
||||
|
||||
/* the code below is for the dropdown menu */
|
||||
.wrapper-dropdown-invalid {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 3px 7px;
|
||||
border-radius: 7px;
|
||||
background: #ffffff;
|
||||
color: #575a5d;
|
||||
border: 1px solid #DADADA;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 16px;
|
||||
margin-top: -2px;
|
||||
border-width: 6px 6px 0 6px;
|
||||
border-style: solid;
|
||||
border-color: #fff transparent;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid {
|
||||
transition: 0.3s;
|
||||
position: absolute;
|
||||
top: 120%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
z-index: 99;
|
||||
border-radius: 15px;
|
||||
background: inherit;
|
||||
-webkit-transform-origin: top;
|
||||
-moz-transform-origin: top;
|
||||
-ms-transform-origin: top;
|
||||
transform-origin: top;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
height: auto;
|
||||
overflow: auto;
|
||||
scrollbar-width: none;
|
||||
scrollbar-color: #dfe3ea #fff;
|
||||
border: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li {
|
||||
padding: 0 10px;
|
||||
line-height: 36px;
|
||||
overflow: hidden;
|
||||
transition: all .1s ease;
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.dropdown-invalid {
|
||||
padding: 0.5rem !important;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid li:hover {
|
||||
background-color: #3ad1d1;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid .dropdown-invalid .active {
|
||||
background-color: #3ad1d1;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.wrapper-dropdown-invalid.active .dropdown-invalid {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +215,58 @@ $(document).ready(function () {
|
||||
});
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------Invalid-------------------------------------------------------------------------------------- */
|
||||
|
||||
// dropdown invalid
|
||||
const selectedAllInvalid = document.querySelectorAll(".wrapper-dropdown-invalid");
|
||||
|
||||
selectedAllInvalid.forEach((selected) => {
|
||||
const optionsContainer = selected.children[2];
|
||||
const optionsList = selected.querySelectorAll("div.wrapper-dropdown-invalid li");
|
||||
|
||||
selected.addEventListener("click", () => {
|
||||
let arrow = selected.children[1];
|
||||
|
||||
let currentActive = document.querySelector(".wrapper-dropdown-invalid.active");
|
||||
|
||||
if (currentActive) {
|
||||
let anotherArrow = currentActive.children[1];
|
||||
handleDropdown(currentActive, anotherArrow, false);
|
||||
}
|
||||
|
||||
handleDropdown(selected, arrow, true);
|
||||
});
|
||||
|
||||
// update the display of the dropdown invalid
|
||||
for (let o of optionsList) {
|
||||
o.addEventListener("click", () => {
|
||||
selected.querySelector(".selected-display").innerHTML = o.innerHTML;
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on("click", '.dropdown-invalid .item', function (e) {
|
||||
$('.dropdown-invalid .item').removeClass("active");
|
||||
$(this).addClass("active");
|
||||
closeAllDropdownsInvalid();
|
||||
});
|
||||
});
|
||||
|
||||
// check if anything else other than the dropdown invalid is clicked
|
||||
window.addEventListener("click", function (e) {
|
||||
if (e.target.closest(".wrapper-dropdown-invalid") === null) {
|
||||
closeAllDropdownsInvalid();
|
||||
}
|
||||
});
|
||||
|
||||
// close all the dropdowns invalid
|
||||
function closeAllDropdownsInvalid() {
|
||||
const selectedInvalid = document.querySelectorAll(".wrapper-dropdown-invalid");
|
||||
selectedInvalid.forEach((selected) => {
|
||||
const optionsContainer = selected.children[2];
|
||||
let arrow = selected.children[1];
|
||||
handleDropdown(selected, arrow, false);
|
||||
});
|
||||
}
|
||||
|
||||
// open all the dropdowns
|
||||
function handleDropdown(dropdown, arrow, open) {
|
||||
|
||||
@@ -14,7 +14,7 @@ $(document).ready(function () {
|
||||
return data.text;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(".select2OptionShift").select2({
|
||||
language: "fa",
|
||||
dir: "rtl",
|
||||
@@ -27,12 +27,12 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
ajaxPersonals();
|
||||
ajaxPersonals();
|
||||
$("#cardSectionLeave div *").prop('disabled', true);
|
||||
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
document.getElementById("MainModal").style.visibility = "visible";
|
||||
|
||||
$('#employeeSelectList').on('change', function () {
|
||||
$('#employeeSelectList').on('change', function () {
|
||||
$('#rotatingShiftSection').addClass('disable');
|
||||
$('#HasRollCall').val(false);
|
||||
previousStartDate = "";
|
||||
@@ -65,7 +65,7 @@ $(document).ready(function () {
|
||||
$('#SelectedShift_EndTime').val(endTime || '');
|
||||
});
|
||||
|
||||
$('#employeeSelectList').change(function () {
|
||||
$('#employeeSelectList').change(function () {
|
||||
var selectValue = $('#employeeSelectList').val();
|
||||
|
||||
if (selectValue === '') {
|
||||
@@ -78,64 +78,64 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
$(document).on("change", ".LeaveType", function () {
|
||||
if ($('#paid').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'visible');
|
||||
rotatingShift();
|
||||
}
|
||||
|
||||
if ($('#sick').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'hidden');
|
||||
$('#daily').prop('checked', true);
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
}
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
$(document).on("change", ".LeaveType", function () {
|
||||
if ($('#paid').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'visible');
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// شرط ساعتی و روزانه
|
||||
$(document).on("change", ".LeaveTime", function () {
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
if ($('#sick').is(':checked')) {
|
||||
$('#dailyType').css('visibility', 'hidden');
|
||||
$('#daily').prop('checked', true);
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
}
|
||||
rotatingShift();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#hourly').is(':checked')) {
|
||||
$('#end_date_estehghaghi').hide();
|
||||
$('.time_paid').show();
|
||||
// شرط ساعتی و روزانه
|
||||
$(document).on("change", ".LeaveTime", function () {
|
||||
if ($('#daily').is(':checked')) {
|
||||
$('#end_date_estehghaghi').show();
|
||||
$('.time_paid').hide();
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
}
|
||||
|
||||
if ($('#hourly').is(':checked')) {
|
||||
$('#end_date_estehghaghi').hide();
|
||||
$('.time_paid').show();
|
||||
rotatingShift();
|
||||
}
|
||||
});
|
||||
//******************** شرط استحقاقی و استعلاجی ********************
|
||||
|
||||
|
||||
//******************** بلور کردن باکس ********************
|
||||
$('#IsAccepted').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
//******************** بلور کردن باکس ********************
|
||||
$('#IsAccepted').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if ($('#IsAccepted').is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
//******************** بلور کردن باکس ********************
|
||||
if ($('#IsAccepted').is(':checked')) {
|
||||
$('#blur-div').addClass('blur');
|
||||
$('#textArea').text('');
|
||||
$('#textArea').attr('disabled', true);
|
||||
} else {
|
||||
$('#blur-div').removeClass('blur');
|
||||
$('#textArea').attr('disabled', false);
|
||||
}
|
||||
//******************** بلور کردن باکس ********************
|
||||
|
||||
$(document).on("change", "#IsAccepted", function () {
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
@@ -149,7 +149,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('#save').on('click', function () {
|
||||
$('#save').on('click', function () {
|
||||
|
||||
var hasRollCallInput = $("#HasRollCall").val();
|
||||
var rotatingShiftInput = $("#rotatingShift").val();
|
||||
@@ -166,91 +166,128 @@ $(document).ready(function () {
|
||||
}
|
||||
}
|
||||
|
||||
$("#descriptionAcceptedCheck").on("change", function () {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
$("#descriptionAcceptedCheck").on("change", function () {
|
||||
$('#descriptionAcceptedCheck').removeClass('errored');
|
||||
});
|
||||
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
var descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
|
||||
var descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
|
||||
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا توضیحات در صورت عدم موافقت را پر کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
return false;
|
||||
}
|
||||
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
|
||||
$('#descriptionAcceptedCheck').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا توضیحات در صورت عدم موافقت را پر کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('.errored').length < 1) {
|
||||
$('#saveFinaly').click();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
});
|
||||
if ($('.errored').length < 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: checkCanCreateInvalidUrl,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startDate": $('#StartLeave').val()},
|
||||
success: function (response) {
|
||||
debugger;
|
||||
if (response.isInHoliday) {
|
||||
if (response.canCreateInvalid) {
|
||||
swal({
|
||||
title: "در قانون کار کشور ایجاد مرخصی در روز های تعطیل فاقد اعتبار میباشد، و فقط در فیش های حقوقی غیر رسمی قابل استفاده میباشند. آیا میخواهید ادامه دهید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$('#isInvalid').val("true");
|
||||
$('#saveFinaly').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (response.isInHoliday === false) {
|
||||
$('#saveFinaly').click();
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
//$('#saveFinaly').click();
|
||||
} else {
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
}, 3500);
|
||||
}
|
||||
});
|
||||
|
||||
$(".date").on('input', function () {
|
||||
var value = $(this).val();
|
||||
$(this).val(convertPersianNumbersToEnglish(value));
|
||||
}).mask("0000/00/00");
|
||||
$('.date').on('input', function () {
|
||||
let startDate = this.value;
|
||||
if (startDate.length === 10) {
|
||||
let submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
$(".date").on('input', function () {
|
||||
var value = $(this).val();
|
||||
$(this).val(convertPersianNumbersToEnglish(value));
|
||||
}).mask("0000/00/00");
|
||||
$('.date').on('input', function () {
|
||||
let startDate = this.value;
|
||||
if (startDate.length === 10) {
|
||||
let submitcheck = dateValidcheck(this);
|
||||
if (submitcheck) {
|
||||
|
||||
$(this).removeClass('errored');
|
||||
if ($('#StartLeave').val() != '' && $('#EndLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
$(this).removeClass('errored');
|
||||
if ($('#StartLeave').val() != '' && $('#EndLeave').val() != '') {
|
||||
computeDays();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$(this).addClass('errored');
|
||||
}
|
||||
});
|
||||
|
||||
$('input:radio[name="PaidLeaveType"]').change(function () {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoures').removeClass("invalidTime");
|
||||
$('#StartHoures').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
} else if ($(this).is(':checked') && $(this).val() == 'ساعتی') {
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
$('input:radio[name="PaidLeaveType"]').change(function () {
|
||||
if ($(this).is(':checked') && $(this).val() == 'روزانه') {
|
||||
$("#hours").val('');
|
||||
$("#hours").attr("disabled", "disabled");
|
||||
$("#endLeave").removeAttr("disabled");
|
||||
$('.endLeaveLabal').show();
|
||||
$('#StartHoures').removeClass("invalidTime");
|
||||
$('#StartHoures').val('');
|
||||
$('#EndHours').removeClass("invalidTime");
|
||||
$('#EndHours').val('');
|
||||
$("#endLeave").show();
|
||||
$('.res').remove();
|
||||
$('.validTime').removeClass("validTime");
|
||||
$('.sumHourseDiv').hide();
|
||||
$('.sumDaysDiv').show();
|
||||
} else if ($(this).is(':checked') && $(this).val() == 'ساعتی') {
|
||||
$("#endLeave").val('');
|
||||
$("#endLeave").attr("disabled", "disabled");
|
||||
$("#endLeave").hide();
|
||||
$('.endLeaveLabal').hide();
|
||||
$("#hours").removeAttr("disabled");
|
||||
$('.sumHourseDiv').show();
|
||||
$('.sumDaysDiv').hide();
|
||||
}
|
||||
});
|
||||
/////////////////Time Input Validatet/////////////////
|
||||
|
||||
|
||||
$(".dateTime").each(function () {
|
||||
$(".dateTime").each(function () {
|
||||
let element = $(this);
|
||||
element.on('input', function () {
|
||||
let value = convertPersianNumbersToEnglish(element.val());
|
||||
@@ -264,6 +301,7 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
$("#StartHoures, #EndHours").on("keyup", validateTimeOrder);
|
||||
|
||||
function parseTimeToMinutes(time) {
|
||||
const [hours, minutes] = time.split(':').map(Number);
|
||||
return hours * 60 + minutes;
|
||||
@@ -301,121 +339,122 @@ $(document).ready(function () {
|
||||
return true;
|
||||
}
|
||||
|
||||
//$('#StartHoures').on("keyup", function () {
|
||||
// var 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 () {
|
||||
// var 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 ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
//$('#StartHoures').on("keyup", function () {
|
||||
// var 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 () {
|
||||
// var 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 ($('#StartHoures').hasClass('validTime') && $('#StartHoures').val() != null) {
|
||||
// computeHourse();
|
||||
// }
|
||||
// } else {
|
||||
// $(this).removeClass("validTime");
|
||||
// $(this).addClass("invalidTime");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
//$('#employeeSelect').change(function () {
|
||||
// var selectValue = $('#employeeSelect').val();
|
||||
//
|
||||
// if (selectValue == '') {
|
||||
// $('#cardSectionLeave').addClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', true);
|
||||
// } else {
|
||||
// $('#cardSectionLeave').removeClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', false);
|
||||
// $('#descriptionAcceptedCheck').attr('disabled', true);
|
||||
// }
|
||||
//});
|
||||
|
||||
//$('#employeeSelect').change(function () {
|
||||
// var selectValue = $('#employeeSelect').val();
|
||||
//
|
||||
// if (selectValue == '') {
|
||||
// $('#cardSectionLeave').addClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', true);
|
||||
// } else {
|
||||
// $('#cardSectionLeave').removeClass('blur');
|
||||
// $("#cardSectionLeave div *").prop('disabled', false);
|
||||
// $('#descriptionAcceptedCheck').attr('disabled', true);
|
||||
// }
|
||||
//});
|
||||
|
||||
});
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
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 (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
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 (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let 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]);
|
||||
}
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let 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]);
|
||||
}
|
||||
|
||||
}
|
||||
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 fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
}
|
||||
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 fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let 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);
|
||||
let 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;
|
||||
if (isValid && test1) {
|
||||
// inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
//$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
if (inputField1.value != "") {
|
||||
// inputField1.style.backgroundColor = '#f94c4c';
|
||||
//$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
$('#StartLeave').addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا تاریخ را بصورت صحیح وارد کنید');
|
||||
@@ -424,161 +463,161 @@ function dateValidcheck(inputField1) {
|
||||
$('.alert-msg p').text("");
|
||||
$('#StartLeave').removeClass("errored");
|
||||
}, 3500);
|
||||
start1valid = false;
|
||||
}
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
}
|
||||
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 (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = 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 (var 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) {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function computeHourse() {
|
||||
@@ -588,9 +627,9 @@ function computeHourse() {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: computeLeaveHourlyAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "startHours": $('#StartHoures').val(), "endHours": $('#EndHours').val() },
|
||||
url: computeLeaveHourlyAjax,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startHours": $('#StartHoures').val(), "endHours": $('#EndHours').val()},
|
||||
success: function (response) {
|
||||
let res = `<span class="res">${response.res}</span>`;
|
||||
$('.sumHours').append(res);
|
||||
@@ -608,9 +647,9 @@ function computeDays() {
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: computeLeaveDailyAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val() },
|
||||
url: computeLeaveDailyAjax,
|
||||
headers: {"RequestVerificationToken": antiForgeryToken},
|
||||
data: {"startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val()},
|
||||
success: function (response) {
|
||||
if (response.status == false) {
|
||||
$('.sumDays').addClass("note");
|
||||
@@ -635,11 +674,11 @@ function ajaxPersonals() {
|
||||
$("#cardSectionLeave div *").prop('disabled', true);
|
||||
var employees = response.data;
|
||||
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
|
||||
employees.forEach(function (employee) {
|
||||
var black = employee.black ? "blackSelect" : "";
|
||||
employees.forEach(function (employee) {
|
||||
var black = employee.black ? "blackSelect" : "";
|
||||
employeeOptionsHtml += `<option class="${black}" value="${employee.id}">${employee.employeeFullName}</option>`;
|
||||
});
|
||||
$('#employeeSelectList').html(employeeOptionsHtml);
|
||||
$('#employeeSelectList').html(employeeOptionsHtml);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
@@ -648,15 +687,13 @@ function ajaxPersonals() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function rotatingShift() {
|
||||
var startDateValue = $('#StartLeave').val();
|
||||
$('#rotatingShiftSection').addClass('disable');
|
||||
|
||||
if ($('#paid').is(':checked') && $('#daily').is(':checked') && startDateValue.length === 10) {
|
||||
|
||||
ajaxService.get(hasRotatingShiftAjax, { employeeId: currentEmployeeId, startDateTime: startDateValue })
|
||||
ajaxService.get(hasRotatingShiftAjax, {employeeId: currentEmployeeId, startDateTime: startDateValue})
|
||||
.then(response => {
|
||||
$('#HasRollCall').val(response.hasRollCall);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user