rollcall poya version 0

This commit is contained in:
SamSys
2024-09-08 20:33:16 +03:30
parent 9c9d1cd9dd
commit 8d9cf99e5f
56 changed files with 6671 additions and 4030 deletions

View File

@@ -10,9 +10,9 @@ public static class Version
{
static Version()
{
StyleVersion = "2.12.05";
AdminVersion = "2.5.25";
CameraVersion = "1.0.3";
StyleVersion = "2.12.06";
AdminVersion = "2.5.26";
CameraVersion = "1.0.4";
}
public static string StyleVersion { get; set; }

View File

@@ -18,7 +18,9 @@ namespace Company.Domain.RollCallAgg
List<RollCallViewModel> Search(RollCallSearchModel searchModel);
CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId);
List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
long Flag(long employeeId, long workshopId);
EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex);
long Flag(long employeeId, long workshopId);
}

View File

@@ -5,6 +5,7 @@ public class AbsentEmployeeViewModel
public long EmployeeId { get; set; }
public string EmployeeFullName { get; set; }
public string PersonnelCode { get; set; }
public bool HasLeave { get; set; }
public string Reason { get; set; }
}

View File

@@ -13,8 +13,8 @@ namespace CompanyManagment.App.Contracts.RollCall
public DateTime DateTimeGr { get; set; }
//منقطع بودن شیفت کاری
public bool IsSliced { get; set; }
public TimeSpan TotalhourseSpan{ get; set; }
public string TotalWorkingHours { get; set; }
public TimeSpan TotalhourseSpan { get; set; }
public string TotalWorkingHours { get; set; }
public string DayOfWeek { get; set; }

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.RollCall
{
public class EmployeeRollCallsByMonthViewModel
{
public DateTime DateGr { get; set; }
public string PersianYear { get; set; }
public string PersianMonthName { get; set; }
public IEnumerable<RollCallViewModel> RollCalls { get; set; }
}
}

View File

@@ -13,10 +13,12 @@ namespace CompanyManagment.App.Contracts.RollCall
OperationResult Edit(long id);
EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId);
List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId,
DateTime startDate, DateTime endDate);
List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId,
string startDate, string endDate);
EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
string startDateTime, string endDateTime, string exactDateTime, string dateIndex);
EditRollCall GetById(long id);
EditRollCall GetById(long id);
List<RollCallViewModel> Search(RollCallSearchModel searchModel);
List<RollCallViewModel> GetCurrentDay(RollCallSearchModel searchModel);
List<RollCallViewModel> GetHistoryCase(RollCallSearchModel searchModel);

View File

@@ -5,23 +5,30 @@ namespace CompanyManagment.App.Contracts.RollCall;
public class RollCallViewModel
{
public long Id { get; set; }
public long WorkshopId { get; set; }
public string Reason { get; set; }
public long EmployeeId { get; set; }
public string PersonnelCode { get; set; }
public string EmployeeFullName { get; set; }
public DateTime? StartDate { get; set; }
public long Id { get; set; }
public long WorkshopId { get; set; }
public string Reason { get; set; }
public long EmployeeId { get; set; }
public string PersonnelCode { get; set; }
public string EmployeeFullName { get; set; }
public string DateFa { get; set; }
public DateTime DateGr { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? EndDate { get; set; }
public string DateFa { get; set; }
public DateTime DateGr { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public TimeSpan ShiftSpan { get; set; }
public DateTime CreationDate { get; set; }
public string StartDateFa { get; set; }
public string StartDateFa { get; set; }
public string EndDateFa { get; set; }
public IEnumerable<RollCallTimeViewModel> RollCallTimesList { get; set; }
public double TotalWorkingHours { get; set; }
public TimeSpan TotalWorkingHoursSpan { get; set; }
public string TotalWorkingHours { get; set; }
public int Year { get; set; }
public int Month { get; set; }
public bool IsAbsent { get; set; }
public bool HasLeave { get; set; }
public DateTime? DateIndex { get; set; }
public string DayOfWeekFa { get; set; }
public bool IsHoliday { get; set; }
}

View File

@@ -8,5 +8,7 @@ namespace CompanyManagment.App.Contracts.RollCall
public string DateFa { get; set; }
public DateTime DateGr { get; set; }
public IEnumerable<RollCallViewModel> ActiveEmployees { get; set; }
public string DayOfWeekFa { get; set; }
public bool IsHoliday { get; set; }
}
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using Company.Domain.RollCallAgg;
using Company.Domain.RollCallEmployeeAgg;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.RollCall;
@@ -14,11 +15,12 @@ public class RollCallApplication : IRollCallApplication
{
private readonly IRollCallRepository _rollCallRepository;
private readonly IEmployeeApplication _employeeApplication;
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication)
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository)
{
_rollCallRepository = rollCallRepository;
_employeeApplication = employeeApplication;
_rollCallEmployeeRepository = rollCallEmployeeRepository;
}
public OperationResult Create(CreateRollCall command)
@@ -52,16 +54,33 @@ public class RollCallApplication : IRollCallApplication
{
return _rollCallRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
}
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startDate, DateTime endDate)
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime,
string dateIndex)
{
DateTime? startDateTimeGr = null;
DateTime? endDateTimeGr = null;
if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime))
{
startDateTimeGr = startDateTime.ToGeorgianDateTime();
endDateTimeGr = endDateTime.ToGeorgianDateTime();
}
if (startDate >= endDate)
return new();
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDate, endDate);
DateTime? exactDateTimeGr =
!string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null;
DateTime? index;
try
{
index = DateTime.Parse(dateIndex);
}
catch
{
index = null;
}
return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index);
}
public EditRollCall GetById(long id)
{
return _rollCallRepository.GetById(id);
@@ -82,17 +101,34 @@ public class RollCallApplication : IRollCallApplication
return _rollCallRepository.GetCurrentDay(searchModel);
}
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
}
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{
return _rollCallRepository.GetWorkshopRollCallHistory(searchModel);
}
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId);
}
public List<CheckoutDailyRollCallViewModel> GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate,
string endDate)
{
if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate))
return new();
public long Flag(long employeeId, long workshopId)
var startDateGr = startDate.ToGeorgianDateTime();
var endDateGr = endDate.ToGeorgianDateTime();
if (startDateGr >= endDateGr)
return new();
//if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId &&
// x.WorkshopId == workshopId && x.IsActiveString == "true"))
// return new();
return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr);
}
public long Flag(long employeeId, long workshopId)
{
return _rollCallRepository.Flag(employeeId, workshopId);
}

View File

@@ -5,7 +5,9 @@ using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.RollCallAgg;
using CompanyManagment.App.Contracts.HolidayItem;
using CompanyManagment.App.Contracts.RollCall;
using MD.PersianDateTime.Standard;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
@@ -13,10 +15,12 @@ namespace CompanyManagment.EFCore.Repository;
public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepository
{
private readonly CompanyContext _context;
public RollCallRepository(CompanyContext context) : base(context)
{
_context = context;
}
private readonly IHolidayItemApplication _holidayItemApplication;
public RollCallRepository(CompanyContext context, IHolidayItemApplication holidayItemApplication) : base(context)
{
_context = context;
_holidayItemApplication = holidayItemApplication;
}
public EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
{
@@ -83,277 +87,439 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
{
throw new NotImplementedException();
}
#region Pooya
//حضور غیاب فیش حقوقی
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
{
#region Pooya
//حضور غیاب فیش حقوقی
public List<CheckoutDailyRollCallViewModel> GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay)
{
var rollCalls = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null &&
x.StartDate.Value.Date >= startMonthDay && x.StartDate.Value.Date <= endMonthDay).ToList();
var rollCalls = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null &&
x.StartDate.Value.Date >= startMonthDay && x.StartDate.Value.Date <= endMonthDay).ToList();
var year = Convert.ToInt32(startMonthDay.ToFarsi().Substring(0, 4));
var month = Convert.ToInt32(startMonthDay.ToFarsi().Substring(5, 2));
var firstDayOfCurrentMonth = new DateTime(year, month, 1, new PersianCalendar());
var year = Convert.ToInt32(startMonthDay.ToFarsi().Substring(0, 4));
var month = Convert.ToInt32(startMonthDay.ToFarsi().Substring(5, 2));
var firstDayOfCurrentMonth = new DateTime(year, month, 1, new PersianCalendar());
if (month == 12)
{
year += 1;
month = 1;
}
else
month += 1;
if (month == 12)
{
year += 1;
month = 1;
}
else
month += 1;
var nextMonthDate = new DateTime(year, month, 1, new PersianCalendar());
var lastDayOfCurrentMonth = nextMonthDate.AddDays(-1);
int dateRange = (int)(lastDayOfCurrentMonth - firstDayOfCurrentMonth).TotalDays + 1;
//all the dates from start to end, to be compared with present days to get absent dates
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => startMonthDay.AddDays(offset).Date);
var absentRecords = completeDaysList
.ExceptBy(rollCalls.Select(x => x.StartDate!.Value.Date), y => y.Date.Date)
.Select(x => new CheckoutDailyRollCallViewModel()
{
StartDate = null,
EndDate = null,
DateTimeGr = x.Date.Date,
DayOfWeek = x.Date.DayOfWeek.ToString(),
RollCallDateFa = x.Date.ToFarsi()
});
var presentDays = rollCalls.GroupBy(x => x.StartDate!.Value.Date).Select(x => new CheckoutDailyRollCallViewModel()
{
StartDate = x.Min(y => y.StartDate)!.Value.ToString("HH:mm"),
EndDate = x.Max(y => y.EndDate)!.Value.ToString("HH:mm"),
TotalhourseSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks)),
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
RollCallDateFa = x.Key.Date.ToFarsi(),
DateTimeGr = x.Key.Date,
IsSliced = x.Count() > 1
});
presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel
{
StartDate = x.StartDate,
EndDate = x.EndDate,
TotalWorkingHours = $"{Convert.ToInt32(x.TotalhourseSpan.TotalHours)}:{x.TotalhourseSpan.Minutes.ToString("00")}",
DayOfWeek = x.DayOfWeek,
RollCallDateFa = x.RollCallDateFa,
DateTimeGr = x.DateTimeGr,
IsSliced = x.IsSliced,
var nextMonthDate = new DateTime(year, month, 1, new PersianCalendar());
});
var lastDayOfCurrentMonth = nextMonthDate.AddDays(-1);
return presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList();
int dateRange = (int)(lastDayOfCurrentMonth - firstDayOfCurrentMonth).TotalDays + 1;
}
//all the dates from start to end, to be compared with present days to get absent dates
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => startMonthDay.AddDays(offset).Date);
//جستجوی سوابق حضور غیاب بر اساس کارمند
public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId,
DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex)
{
var absentRecords = completeDaysList
.ExceptBy(rollCalls.Select(x => x.StartDate!.Value.Date), y => y.Date.Date)
.Select(x => new CheckoutDailyRollCallViewModel()
{
StartDate = null,
EndDate = null,
DateTimeGr = x.Date.Date,
DayOfWeek = x.Date.DayOfWeek.ToString(),
RollCallDateFa = x.Date.ToFarsi()
});
var presentDays = rollCalls.GroupBy(x => x.StartDate!.Value.Date).Select(x => new CheckoutDailyRollCallViewModel()
{
StartDate = x.Min(y => y.StartDate)!.Value.ToString("HH:mm"),
EndDate = x.Max(y => y.EndDate)!.Value.ToString("HH:mm"),
TotalhourseSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate - y.StartDate)!.Value.Ticks)),
DayOfWeek = x.Key.DayOfWeek.DayOfWeeKToPersian(),
RollCallDateFa = x.Key.Date.ToFarsi(),
DateTimeGr = x.Key.Date,
IsSliced = x.Count() > 1
});
var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
if (employeeRollCallStatuses == null)
return new();
var activeMonths = new List<PersianDateTime>();
foreach (var status in employeeRollCallStatuses.EmployeesStatus)
{
var persianEndDayOfMonth = new PersianDateTime(status.EndDate.Date);
var persianStartDayOfMonth = new PersianDateTime(status.StartDate.Date);
//var persianEndFirstDayOfMonth =
// new PersianDateTime(persianEndDayOfMonth.Year, persianEndDayOfMonth.Month, 1);
var persianStartFirstDayOfMonth = new PersianDateTime(persianStartDayOfMonth.Year, persianStartDayOfMonth.Month, 1);
for (PersianDateTime start = persianStartFirstDayOfMonth; start <= persianEndDayOfMonth; start = start.AddMonths(1))
{
activeMonths.Add(start);
}
}
var activeMonthsList = activeMonths.Distinct().ToList();
PersianDateTime startSearch;
PersianDateTime endSearch;
if (startDateTime.HasValue && endDateTime.HasValue)
{
startSearch = new PersianDateTime(startDateTime.Value);
endSearch = new PersianDateTime(endDateTime.Value);
activeMonthsList = activeMonthsList.Where(x => x.Date >= startSearch && x.Date <= endSearch).ToList();
}
if (exactDateTime.HasValue)
{
startSearch = new PersianDateTime(exactDateTime.Value);
endSearch = startSearch;
}
//else
//{
// startSearch = employeeRollCallStatuses.EmployeesStatus.Max(x => x.StartDate.Date).To;
// endSearch = employeeRollCallStatuses.EmployeesStatus.Min(x => x.EndDate.Date);
//}
//var statusesByMonth =
// employeeRollCallStatuses.EmployeesStatus
// .GroupBy(x => new DateTime(Convert.ToInt32(x.StartDate.ToFarsi().Substring(0, 4)), Convert.ToInt32(x.StartDate.ToFarsi().Substring(5, 2)), 1, new PersianCalendar()).Date)
// .OrderByDescending(x => x.Key);
if (dateIndex != null)
{
var persianDateIndex = new PersianDateTime(dateIndex.Value);
var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1));
activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth == x).OrderByDescending(x => x).ToList();
}
if (!activeMonthsList.Any()) return new();
//get the last month which user was active in
PersianDateTime selectedMonthPersian = activeMonthsList.First();
DateTime selectedMonthFirstDay = selectedMonthPersian;
DateTime nextMonthFirstDay = selectedMonthPersian.AddMonths(1);
var statusesOfMonth = employeeRollCallStatuses.EmployeesStatus.Where(x => x.EndDate >= selectedMonthFirstDay &&
x.StartDate < nextMonthFirstDay);
presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel
{
StartDate = x.StartDate,
EndDate = x.EndDate,
TotalWorkingHours = $"{Convert.ToInt32(x.TotalhourseSpan.TotalHours)}:{x.TotalhourseSpan.Minutes.ToString("00")}",
DayOfWeek = x.DayOfWeek,
RollCallDateFa = x.RollCallDateFa,
DateTimeGr = x.DateTimeGr,
IsSliced = x.IsSliced,
});
return presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList();
var leavesQuery =
_context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
x.IsAccepted &&
x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId);
}
var rollCalls = _context.RollCalls.Where(x =>
!leavesQuery.Any(y =>
y.StartLeave.Date <= x.StartDate.Value.Date && y.EndLeave.Date >= x.StartDate.Value.Date) &&
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null &&
x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay);
//سوابق حضور غیاب کارگاه
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{
var rollCallsList = rollCalls.ToList();
var leavesList = leavesQuery.ToList();
//initialize
int dateRange = (int)(nextMonthFirstDay - selectedMonthFirstDay).TotalDays;
DateTime searchDurationStart = DateTime.Now.AddDays(-1).Date;
DateTime searchDurationEnd = searchDurationStart.AddDays(-16);
//all the dates from start to end, to be compared with present days to get absent dates
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => selectedMonthFirstDay.AddDays(offset).Date);
var result = completeDaysList.Where(x => statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date))
.Select(x => new RollCallViewModel()
{
DateGr = x.Date.Date,
DateFa = x.Date.Date.ToFarsi(),
RollCallTimesList = rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date).Select(y =>
new RollCallTimeViewModel()
{
StartDate = y.StartDate.Value.ToString("HH:mm"),
EndDate = y.EndDate!.Value.ToString("HH:mm")
}),
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date)
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
Reason = leavesList.FirstOrDefault(y => y.EndLeave >= x.Date.Date && y.StartLeave <= x.Date.Date)?.LeaveType ?? ""
});
result = result.Select(x => new RollCallViewModel()
{
DateGr = x.DateGr,
DateFa = x.DateFa,
DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(),
IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr),
RollCallTimesList = x.RollCallTimesList,
TotalWorkingHours = $"{Convert.ToInt32(x.TotalWorkingHoursSpan.TotalHours)}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}",
DateIndex = activeMonthsList.Count > 2 ? activeMonthsList.Skip(1).First().ToDateTime() : null
}).ToList();
return new EmployeeRollCallsByMonthViewModel()
{
PersianMonthName = selectedMonthPersian.ToString("MMMM"),
PersianYear = selectedMonthPersian.ToString("yyyy"),
DateGr = selectedMonthFirstDay,
RollCalls = result
};
}
//سوابق حضور غیاب کارگاه
//dateIndex starts at 0
public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel)
{
//initialize
DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date;
DateTime searchDurationStart = searchDurationEnd.AddDays(-16);
//override if user has entered inputs (dates must be validated in the application layer)
if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa))
{
searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date;
searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date;
}
else
if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa))
{
searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date;
searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date;
}
if (searchDurationEnd < searchDurationStart)
return new();
//override if user has entered inputs (dates must be validated in the application layer)
if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa))
{
searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().Date;
searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().AddDays(-1).Date;
}
DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date;
if (dateIndex <= searchDurationStart)
return new();
else
if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa))
{
searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().Date;
searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date;
}
//get leaves for workshop that have been activated in dateIndex date
var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex);
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
var rollCallsQuery = _context.RollCalls
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.EndDate.HasValue && x.StartDate < DateTime.Now.Date &&
x.StartDate.Value.Date == dateIndex.Date);
//get active employees of workshop in dateIndex date
var activeEmployeesQuery =
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex));
if (searchDurationStart < searchDurationEnd)
return new();
DateTime dateIndex = searchDurationStart.AddDays(-1 * (searchModel.DateIndex)).Date;
if (dateIndex <= searchDurationEnd)
return new();
if (searchModel.EmployeeId > 0)
{
rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
}
//get leaves for workshop that have been activated in dateIndex date
var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) &&
x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex);
var personnelCodeList =
_context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId));
var rollCallsList = rollCallsQuery.ToList();
var activatedEmployeesList = activeEmployeesQuery.ToList();
var leavesList = leavesQuery.ToList();
//roll calls for current workshop where shift start is in dateIndex date (filters today's shifts)
var rollCallsQuery = _context.RollCalls
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.EndDate.HasValue && x.StartDate < DateTime.Now.Date &&
x.StartDate.Value.Date == dateIndex.Date);
rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList();
var result = new RollCallsByDateViewModel()
{
DateGr = dateIndex,
DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(),
IsHoliday = _holidayItemApplication.IsHoliday(dateIndex),
DateFa = dateIndex.ToFarsi(),
ActiveEmployees = activatedEmployeesList.Select(x =>
{
var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId);
var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList();
return new RollCallViewModel()
{
EmployeeFullName = x.EmployeeFullName,
EmployeeId = x.EmployeeId,
Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}",
RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel()
{
EndDate = y.EndDate!.Value.ToString("HH:mm"),
StartDate = y.StartDate!.Value.ToString("HH:mm")
}),
HasLeave = leave != null,
IsAbsent = !employeeRollCallsForDate.Any(),
TotalWorkingHoursSpan = new TimeSpan(employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString()
};
})
};
result.ActiveEmployees = result.ActiveEmployees.Select(x => new RollCallViewModel()
{
EmployeeFullName = x.EmployeeFullName,
EmployeeId = x.EmployeeId,
Reason = x.Reason,
RollCallTimesList = x.RollCallTimesList,
HasLeave = x.HasLeave,
IsAbsent = x.IsAbsent,
PersonnelCode = x.PersonnelCode,
TotalWorkingHours = $"{Convert.ToInt32(x.TotalWorkingHoursSpan.TotalHours)}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}"
});
return result;
}
//get active employees of workshop in dateIndex date
var activeEmployeesQuery =
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex));
//گزارش آنلاین حضور غیاب کارگاه
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
var date = DateTime.Now.Date;
//get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی
var leaves = _context.LeaveList.Where(x => x.WorkshopId == workshopId && x.EndLeave.Date >= date && x.StartLeave.Date <= date &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")));
var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).ToList();
if (searchModel.EmployeeId > 0)
{
rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId);
}
//get currently working employees with leftWork table
//var workingEmployees =
// _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < date && x.LeftWorkDate.Date > date);
var personnelCodeList =
_context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId));
var rollCallsList = rollCallsQuery.ToList();
var activatedEmployeesList = activeEmployeesQuery.ToList();
var leavesList = leavesQuery.ToList();
rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList();
var result = new RollCallsByDateViewModel()
{
DateGr = dateIndex,
DateFa = dateIndex.ToFarsi(),
ActiveEmployees = activatedEmployeesList.Select(x =>
{
var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId);
var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList();
//get activated employees
var activeEmployees =
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any(y =>
y.StartDate.Date <= date &&
y.EndDate.Date >= date));
return new RollCallViewModel()
{
EmployeeFullName = x.EmployeeFullName,
EmployeeId = x.EmployeeId,
Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}",
RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel()
{
EndDate = y.EndDate!.Value.ToString("HH:mm:ss"),
StartDate = y.StartDate!.Value.ToString("HH:mm:ss")
}),
TotalWorkingHours = employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).TotalHours),
PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString()
};
})
};
//get today's roll calls
var rollCallsQuery = _context.RollCalls.Where(x =>
x.WorkshopId == workshopId && x.StartDate.Value.Date == date);
return result;
}
//var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId) &&
// workingEmployees.Any(y => y.EmployeeId == x.EmployeeId));
//گزارش آنلاین حضور غیاب کارگاه
public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId)
{
//get today's roll calls
var rollCallsQuery = _context.RollCalls.Where(x =>
x.WorkshopId == workshopId && x.StartDate.Value.Date == DateTime.Now.Date);
//get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی
var leaves = _context.LeaveList.Where(x => x.WorkshopId == workshopId && x.EndLeave.Date >= DateTime.Now.Date && x.StartLeave.Date <= DateTime.Now.Date &&
x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")));
var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId));
//filter roll calls for active and currently working employees only
// var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent
// .Any(y => x.EmployeeId == y.EmployeeId))
//.Where(x => workingEmployees.Any(y => y.EmployeeId == x.EmployeeId)).ToList();
var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent
.Any(y => x.EmployeeId == y.EmployeeId)).ToList();
//presents list is ready
var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel()
{
PersonnelCode = personnelCodes
.FirstOrDefault(y => y.EmployeeId == x.Key)?
.PersonnelCode.ToString(),
EmployeeFullName = x.FirstOrDefault()!.EmployeeFullName,
EmployeeId = x.FirstOrDefault()!.EmployeeId,
TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)),
RollCallTimesList = x.Select(y => new RollCallTimeViewModel()
{
StartDate = y.StartDate!.Value.ToString("HH:mm"),
EndDate = y.EndDate?.ToString("HH:mm")
}).ToList()
});
presentEmployees = presentEmployees.Select(x => new RollCallViewModel()
{
PersonnelCode = x.PersonnelCode,
EmployeeFullName = x.EmployeeFullName,
EmployeeId = x.EmployeeId,
TotalWorkingHours =
$"{Convert.ToInt32(x.TotalWorkingHoursSpan.TotalHours)}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}",
RollCallTimesList = x.RollCallTimesList
}).ToList();
//get currently working employees with leftWork table
var workingEmployees =
_context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < DateTime.Now.Date && x.LeftWorkDate.Date > DateTime.Now.Date);
//absent ones are those who are active and not on the roll call list
var absentsQuery = activeEmployees.AsEnumerable()
.ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList();
//get activated employees
var activeEmployees =
_context.RollCallEmployees.Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any(y =>
y.StartDate.Date <= DateTime.Now.Date &&
y.EndDate.Date >= DateTime.Now.Date));
//get today's active leaves
var employeesWithLeave = leaves.AsEnumerable()
.Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId))
.Select(x => new { x.EmployeeId, x.LeaveType }).ToList();
//join leave and absents
var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel()
{
PersonnelCode = personnelCodes
.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?
.PersonnelCode.ToString(),
EmployeeId = x.EmployeeId,
EmployeeFullName = x.EmployeeFullName,
HasLeave = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId),
Reason = employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.LeaveType
}).ToList();
return new CurrentDayRollCall()
{
AbsentEmployees = absentsViewModel.ToList(),
PresentEmployees = presentEmployees.ToList()
};
}
var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId) &&
workingEmployees.Any(y => y.EmployeeId == x.EmployeeId));
//filter roll calls for active and currently working employees only
var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent
.Any(y => x.EmployeeId == y.EmployeeId))
.Where(x => workingEmployees.Any(y => y.EmployeeId == x.EmployeeId)).ToList();
//presents list is ready
var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel()
{
EmployeeFullName = x.FirstOrDefault()!.EmployeeFullName,
EmployeeId = x.FirstOrDefault()!.EmployeeId,
TotalWorkingHours = x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).TotalHours),
RollCallTimesList = x.Select(y => new RollCallTimeViewModel()
{
StartDate = y.StartDate!.Value.ToString("HH:mm:ss"),
EndDate = y.EndDate?.ToString("HH:mm:ss")
}).ToList()
}).ToList();
//absent ones are those who are active and not on the roll call list
var absentsQuery = activeEmployees.AsEnumerable()
.ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList();
//get today's active leaves
var employeesWithLeave = _context.LeaveList.Where(x =>
x.EndLeave.Date >= DateTime.Now.Date && x.StartLeave.Date <= DateTime.Now.Date &&
x.WorkshopId == workshopId && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")))
.AsEnumerable()
.Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId))
.Select(x => new { x.EmployeeId, x.LeaveType }).ToList();
//join leave and absents
var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel()
{
PersonnelCode = _context.PersonnelCodeSet
.FirstOrDefault(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == workshopId)
!.PersonnelCode.ToString(),
EmployeeId = x.EmployeeId,
EmployeeFullName = x.EmployeeFullName,
Reason = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId)
? employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)!.LeaveType
: ""
}).ToList();
return new CurrentDayRollCall()
{
AbsentEmployees = absentsViewModel.ToList(),
PresentEmployees = presentEmployees.ToList()
};
}
#endregion
public long Flag(long employeeId, long workshopId)
#endregion
public long Flag(long employeeId, long workshopId)
{
var checkDate = DateTime.Now.AddDays(-3);
var query = _context.RollCalls

View File

@@ -687,7 +687,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
if (step2.Count > 1)// اگر تعدادشون بیش از 1 بود
{
var stDate = step2.FirstOrDefault(); // آخریی
var stDate = step2.FirstOrDefault(); // آخری
if (DayCounter < Max365)
{

View File

@@ -457,7 +457,13 @@
@foreach (var items in @Model.GroupPrintList)
{
<div class="container2">
@if (items.HasRollCall)
{
<partial name="_Partials/PrintDetailsRollCallRaw" model="items"/>
}
else
{
<div class="container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black;
@@ -2656,6 +2662,7 @@
</div>
</div>
</div>
}
}
</div>

View File

@@ -149,8 +149,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
{
var res = _checkoutApplication.PrintOne(id);
if (res.HasRollCall)
return Partial("PrintOneRollCall", res);
return Partial("PrintOne", res);
return Partial("PrintOne", res);
}
#endregion

View File

@@ -2,7 +2,6 @@
@using System.Security.Cryptography.X509Certificates
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
@{
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
@@ -332,98 +331,102 @@
height: 28cm;
margin: 3mm 5mm 0 5mm; ">
<div class="row" dir="rtl">
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
<div class="col-6 d-inline-block text-center"><p style="margin-top:10px !important;font-size: 18px; font-family: 'IranNastaliq' !important; ">بسمه تعالی</p> <p style="font-size: 15px; font-weight: bold">فیش حقوقی و رسید پرداخت حقوق</p> </div>
<div class="col-3 d-inline-block"></div>
<div class="col-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
<div class="col-6 d-inline-block text-center"><p style="margin-top:10px !important;font-size: 18px; font-family: 'IranNastaliq' !important; ">بسمه تعالی</p> <p style="font-size: 15px; font-weight: bold">فیش حقوقی و رسید پرداخت حقوق</p> </div>
<div class="col-3 d-inline-block"></div>
</div>
<div class="row" style="font-size: 14px; margin-bottom: 10px; ">
<div class="col-12">
<span style="width: 280px;padding: 0px 0px 0px 0px !important; float:right"><span>اینجانب <span>&nbsp;</span> <span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.EmployeeFullName</span> </span></span>
<span style="margin-right: 5px; float:right">
<span> نام پدر: </span>
@if (string.IsNullOrWhiteSpace(@Model.FathersName))
{
<span style="visibility: hidden">"1111111111"</span>
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.FathersName</span>
<div class="col-12">
<span style="width: 280px;padding: 0px 0px 0px 0px !important; float:right"><span>اینجانب <span>&nbsp;</span> <span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.EmployeeFullName</span> </span></span>
<span style="margin-right: 5px; float:right">
<span> نام پدر: </span>
@if (string.IsNullOrWhiteSpace(@Model.FathersName))
{
<span style="visibility: hidden">"1111111111"</span>
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.FathersName</span>
}
</span>
<span style="padding: 0px !important; float: left">
}
</span>
<span style="padding: 0px !important; float: left">
<span>به کد ملی:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{
<span style="margin-left: 15px; visibility: hidden">222333111</span>
}
else
{
<span style="margin-left: 15px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.NationalCode</span>
}
<span>به کد ملی:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{
<span style="margin-left: 15px; visibility: hidden">222333111</span>
}
else
{
<span style="margin-left: 15px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.NationalCode</span>
}
<span>متولد:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{
<span style="margin-left: 10px; visibility: hidden">1401/01/01</span>
}
else
{
<span style="margin-left: 0px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.DateOfBirth</span>
}
</span>
<span>متولد:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{
<span style="margin-left: 10px; visibility: hidden">1401/01/01</span>
}
else
{
<span style="margin-left: 0px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.DateOfBirth</span>
}
</span>
</div>
<div class="col-12" style="font-size: 14px; text-align: justify">
</div>
<div class="col-12" style="font-size: 14px; text-align: justify">
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<span> پـرسنل کارگاه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<span>&nbsp;</span>
<span>به کارفرمایی <span>&nbsp;</span> آقای/خانم</span> <span>&nbsp;</span>
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<span> پـرسنل کارگاه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<span>&nbsp;</span>
<span>به کارفرمایی <span>&nbsp;</span> آقای/خانم</span> <span>&nbsp;</span>
<span>&nbsp;</span>
if (@Model.EmployerList.Count > 1)
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span> <br />
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
<span>&nbsp;</span>
if (@Model.EmployerList.Count > 1)
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span> <br />
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
<br />
}
<br />
}
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<span> پـرسنل شرکت/موسسه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<br />
}
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<span> پـرسنل شرکت/موسسه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<br />
}
}
}
<span>کلیه حق السعی خود اعم از حقوق، کمک هزینه اقلام مصرفی خانوار، کمک هزینه مسکن </span>
<span>کلیه حق السعی خود اعم از حقوق، کمک هزینه اقلام مصرفی خانوار، کمک هزینه مسکن </span>
<span>و همچنین عیدی و پاداش، سنوات و...</span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> <span style="font-weight: bold">@Model.Month</span> ماه </span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> سال <span style="font-weight: bold">@Model.Year</span> </span>
<span> برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام. </span>
<span>و همچنین عیدی و پاداش، سنوات و...</span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> <span style="font-weight: bold">@Model.Month</span> ماه </span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> سال <span style="font-weight: bold">@Model.Year</span> </span>
<span> برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام. </span>
</div>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="col-12">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow:hidden">
@@ -3039,8 +3042,6 @@
</script>
<script>
document.getElementById("btnPrint").onclick = function () {

View File

@@ -303,44 +303,32 @@
</div>
<div style="padding: 0 12px;">
<div class="row" style="margin-top: 8px; background-color: #F6F6F6 !important; border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px;-webkit-print-color-adjust: exact;print-color-adjust: exact; grid-template-columns: repeat(2, minmax(0, 1fr));">
<div class="row" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));">
<div class="col-6 w-100" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<table style="width: 100%">
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<th style="font-size: 8px; width: 33%;padding: 2px 10px;border: 1px solid #000;border-left: 0;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">تاریخ</th>
<th style="font-size: 8px; text-align: center; width: 19%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت ورود</th>
<th style="font-size: 8px; text-align: center; width: 19%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت خروج</th>
<th style="font-size: 8px; text-align: center; width: 10%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">منقطع</th>
<th style="font-size: 8px; text-align: center; width: 19%;padding: 0 0 0 5px !important;border-width: 1px 0px 1px 1px;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت کارکرد</th>
<th style="font-size: 8px !important;width: 33%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت ورود</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت خروج</th>
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
<th style="font-size: 8px;text-align: center;width: 19%;padding: 0 0 0 5px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < 15; i++)
{
<tr style="font-size: 8px;border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px; padding: 1px 3px;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].DateTimeGr.ToFarsi() - @Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate</td>
<td style="font-size: 8px; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate</td>
<td style="font-size: 8px; text-align: center; border-width: 1px 0 1px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="@(Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian() == "جمعه" ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].DateTimeGr.ToFarsi() - @Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate</td>
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate</td>
<td style="font-size: 8px; text-align: center; border-width: 2px 0 2px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@if (@Model.MonthlyRollCall[i].IsSliced)
{
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
</svg>
}
else
{
@* <svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
<path stroke-width="2" d="M12 21C10.8181 21 9.64778 20.7672 8.55585 20.3149C7.46392 19.8626 6.47177 19.1997 5.63604 18.364C4.80031 17.5282 4.13738 16.5361 3.68508 15.4442C3.23279 14.3522 3 13.1819 3 12C3 10.8181 3.23279 9.64778 3.68508 8.55585C4.13738 7.46392 4.80031 6.47177 5.63604 5.63604C6.47177 4.80031 7.46392 4.13738 8.55585 3.68508C9.64778 3.23279 10.8181 3 12 3C13.1819 3 14.3522 3.23279 15.4442 3.68508C16.5361 4.13738 17.5282 4.80031 18.364 5.63604C19.1997 6.47177 19.8626 7.46392 20.3149 8.55585C20.7672 9.64778 21 10.8181 21 12C21 13.1819 20.7672 14.3522 20.3149 15.4442C19.8626 16.5361 19.1997 17.5282 18.364 18.364C17.5282 19.1997 16.5361 19.8626 15.4441 20.3149C14.3522 20.7672 13.1819 21 12 21L12 21Z" stroke="#222222" stroke-linecap="round" />
<path d="M9 9L15 15" stroke-width="2" stroke="#222222" stroke-linecap="round" />
<path d="M15 9L9 15" stroke-width="2" stroke="#222222" stroke-linecap="round" />
</svg> *@
<span>-</span>
<span>منقطع</span>
}
</td>
<td style="font-size: 8px; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].TotalWorkingHours</td>
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@Model.MonthlyRollCall[i].TotalWorkingHours</td>
</tr>
}
</tbody>
@@ -350,11 +338,11 @@
<table style="width: 100%">
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<th style="font-size: 8px !important; width: 33%;padding: 2px 10px !important;border: 1px solid #000;border-left: 0;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">تاریخ</th>
<th style="font-size: 8px !important; text-align: center; width: 19%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت ورود</th>
<th style="font-size: 8px !important; text-align: center; width: 19%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت خروج</th>
<th style="font-size: 8px !important; text-align: center; width: 10%;border-width: 1px 0 1px 0;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">منقطع</th>
<th style="font-size: 8px !important; text-align: center; width: 19%;padding: 0 0 0 5px !important;border-width: 1px 0px 1px 1px;border-color: #000;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">ساعت کارکرد</th>
<th style="font-size: 8px !important;width: 33%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت ورود</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت خروج</th>
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
<th style="font-size: 8px;text-align: center;width: 19%;padding: 0 0 0 5px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
</tr>
</thead>
<tbody>
@@ -363,29 +351,17 @@
}
@foreach (var day in Model.MonthlyRollCall)
{
<tr style="font-size: 8px;border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px !important; padding: 1px 3px !important;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.DateTimeGr.ToFarsi() - @day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px !important; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate</td>
<td style="font-size: 8px !important; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate</td>
<td style="font-size: 8px !important; text-align: center; border-width: 1px 0 1px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="@(day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian() == "جمعه" ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.DateTimeGr.ToFarsi() - @day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate</td>
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate</td>
<td style="font-size: 8px !important; text-align: center; border-width: 2px 0 2px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@if (day.IsSliced)
{
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
</svg>
}
else
{
@* <svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
<path stroke-width="2" d="M12 21C10.8181 21 9.64778 20.7672 8.55585 20.3149C7.46392 19.8626 6.47177 19.1997 5.63604 18.364C4.80031 17.5282 4.13738 16.5361 3.68508 15.4442C3.23279 14.3522 3 13.1819 3 12C3 10.8181 3.23279 9.64778 3.68508 8.55585C4.13738 7.46392 4.80031 6.47177 5.63604 5.63604C6.47177 4.80031 7.46392 4.13738 8.55585 3.68508C9.64778 3.23279 10.8181 3 12 3C13.1819 3 14.3522 3.23279 15.4442 3.68508C16.5361 4.13738 17.5282 4.80031 18.364 5.63604C19.1997 6.47177 19.8626 7.46392 20.3149 8.55585C20.7672 9.64778 21 10.8181 21 12C21 13.1819 20.7672 14.3522 20.3149 15.4442C19.8626 16.5361 19.1997 17.5282 18.364 18.364C17.5282 19.1997 16.5361 19.8626 15.4441 20.3149C14.3522 20.7672 13.1819 21 12 21L12 21Z" stroke="#222222" stroke-linecap="round" />
<path stroke-width="2" d="M9 9L15 15" stroke="#222222" stroke-linecap="round" />
<path stroke-width="2" d="M15 9L9 15" stroke="#222222" stroke-linecap="round" />
</svg> *@
<span>-</span>
<span>منقطع</span>
}
</td>
<td style="font-size: 8px; text-align: center;border-width: 1px 0 1px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.TotalWorkingHours</td>
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@day.TotalWorkingHours</td>
</tr>
}
</tbody>

View File

@@ -0,0 +1,445 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
<div class="container container2" id="printThis">
<div class="row">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black;
padding: revert;
border-radius: 10px;
height: 28cm;
margin: 3mm 5mm 0 5mm; ">
<div class="row" dir="rtl">
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
<div class="col-xs-6 d-inline-block text-center">
<p style="margin-top:10px !important;font-size: 18px; font-family: 'IranNastaliq' !important; ">بسمه تعالی</p>
<p style="font-size: 15px; font-weight: bold">فیش حقوقی و رسید پرداخت حقوق</p>
</div>
<div class="col-xs-3 d-inline-block"></div>
</div>
<div class="row" style="padding: 0px 12px;font-size: 14px; margin-bottom: 10px; ">
<div class="row">
<span style="width: 280px;padding: 0px 10px 0px 0px !important; float:right"><span>اینجانب <span>&nbsp;</span> <span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.EmployeeFullName</span> </span></span>
<span style="margin-right: 5px; float:right">
<span> نام پدر: </span>
@if (string.IsNullOrWhiteSpace(@Model.FathersName))
{
<span style="visibility: hidden">"1111111111"</span>
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.FathersName</span>
}
</span>
<span style="padding: 0px !important; float: left">
<span>به کد ملی:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{
<span style="margin-left: 15px; visibility: hidden">222333111</span>
}
else
{
<span style="margin-left: 15px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.NationalCode</span>
}
<span>متولد:</span> <span>&nbsp;</span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{
<span style="margin-left: 10px; visibility: hidden">1401/01/01</span>
}
else
{
<span style="margin-left: 10px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.DateOfBirth</span>
}
</span>
</div>
<div class="row">
<div class="col-xs-12" style="font-size: 14px; text-align: justify">
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<span> پـرسنل کارگاه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<span>&nbsp;</span>
<span>به کارفرمایی <span>&nbsp;</span> آقای/خانم</span>
<span>&nbsp;</span>
<span>&nbsp;</span>
if (@Model.EmployerList.Count > 1)
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span>
<br />
}
else
{
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
<br />
}
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<span> پـرسنل شرکت/موسسه<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
<br />
}
}
<span>کلیه حق السعی خود اعم از حقوق، کمک هزینه اقلام مصرفی خانوار، کمک هزینه مسکن </span>
<span>و همچنین عیدی و پاداش، سنوات و...</span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> <span style="font-weight: bold">@Model.Month</span> ماه </span>
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> سال <span style="font-weight: bold">@Model.Year</span> </span>
<span> برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام. </span>
</div>
</div>
</div>
<div class="row m-t-20">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
<table style="/* table-layout: fixed; */ width: 100%">
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th>
<th style="text-align: center; position: absolute ; right: 55mm; font-size: 13px;padding-top:4px"> مطالبات </th>
<th style="text-align: center;"> </th>
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th>
<th style="text-align: center; font-size: 13px; position: absolute; left: 50mm; padding-top: 4px;"> کسورات </th>
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 0px 0px 0px;"> </th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
</tr>
<tr style="font-size: 12px; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه اقلام مصرفی خانوار </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.OvertimePay == "0" ? "-" : Model.OvertimePay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.NightworkPay == "0" ? "-" : Model.NightworkPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FridayPay == "0" ? "-" : Model.FridayPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </td>
</tr>
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
<td style="text-align: center; padding: 2px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
</tr>
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
<td style="padding-right: 8px;"> </td>
<td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
</tr>
</table>
</fieldset>
</div>
<div style="padding: 0 10px;">
<div class="row" style="margin-top: 8px; background-color: #F6F6F6 !important; border: 1px solid #000;border-radius: 10px;display: flex;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<div class="col-xs-6" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<table style="width: 100%">
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<th style="font-size: 8px !important;width: 33%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت ورود</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت خروج</th>
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
<th style="font-size: 8px;text-align: center;width: 19%;padding: 0 0 0 5px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
</tr>
</thead>
<tbody>
@for (int i = 0; i < 15; i++)
{
<tr style="@(Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian() == "جمعه" ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].DateTimeGr.ToFarsi() - @Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate</td>
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate</td>
<td style="font-size: 8px; text-align: center; border-width: 2px 0 2px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@if (@Model.MonthlyRollCall[i].IsSliced)
{
<span>منقطع</span>
}
</td>
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@Model.MonthlyRollCall[i].TotalWorkingHours</td>
</tr>
}
</tbody>
</table>
</div>
<div class="col-xs-6" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<table style="width: 100%">
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<th style="font-size: 8px !important;width: 33%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت ورود</th>
<th style="font-size: 8px;text-align: center;width: 19%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت خروج</th>
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
<th style="font-size: 8px;text-align: center;width: 19%;padding: 0 0 0 5px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
</tr>
</thead>
<tbody>
@{
Model.MonthlyRollCall = Model.MonthlyRollCall.Skip(15).ToList();
}
@foreach (var day in Model.MonthlyRollCall)
{
<tr style="@(day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian() == "جمعه" ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;")font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.DateTimeGr.ToFarsi() - @day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate</td>
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate</td>
<td style="font-size: 8px !important; text-align: center; border-width: 2px 0 2px 0; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
@if (day.IsSliced)
{
<span>منقطع</span>
}
</td>
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@day.TotalWorkingHours</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<fieldset style="border-radius: 10px 10px 10px 10px; margin: 0px 10px;">
<div class="row" style="padding: 10px 0 0px 0;">
@{
if (Model.IsLeft)
{
<span style="float: right; margin-right: 15px; font-size: 11.2px;height: 36px;">
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span><span>&nbsp;</span>
<span>@Model.LastDayOfWork صدیقه محمدنژاداسطلخ جان</span><span>&nbsp;</span>
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span><span>&nbsp;</span>
<span>@Model.LeftWorkDate 1359/07/01</span><span>&nbsp;</span>
<span>می باشد</span>
</span>
}
}
</div>
<div class="row" style="padding: 0px 14px; font-size: 14px;">
<div class="row">
@*<div class="col-xs-3"><span>اینجانب <span>&nbsp;</span> <span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold">@Model.EmployeeFullName</span> </span></div>
<div class="col-xs-3"><span> نام پدر: <span>&nbsp;</span><span>&nbsp;</span> <span>&nbsp;</span><span style="font-weight: bold">@Model.FathersName</span></span></div>
<div class="col-xs-3"><span>به کد ملی:<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold">@Model.NationalCode</span> </span></div>
<div class="col-xs-3" style="direction: ltr"> متولد: <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold">@Model.DateOfBirth</span></div>*@
</div>
<div class="row">
<div class="col-xs-12" style="font-size: 14px; text-align: justify">
@*<span> پـرسنل شـرکت<span>&nbsp;</span><span>&nbsp;</span><span style="font-weight: bold">@Model.WorkshopName</span> </span>
<span>&nbsp;</span>
<span>به کارفرمایی <span>&nbsp;</span> آقای/خانم/شرکت</span> <span>&nbsp;</span><span>&nbsp;</span>
@{
foreach (var item in @Model.EmployerList)
{
<span style="font-weight: bold">@item.EmployerFullName </span> <span>،</span>
}
}
<span>&nbsp;</span><span>&nbsp;</span>
<span>مبلغ ............. ریال را بصورت نقدی از کارفرما دریافت نمودم. </span>*@
</div>
</div>
<div class="row">
<div classs="col-xs-12">
<div style="float: left;display: flex;position: absolute;left: 26px;bottom: 12px;">
<div style="margin-left: 15px; position: relative; width: 80px; border: 1px solid #000; height: 98px; border-radius: 10px;">
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;width: 55px;">اثر انگشت</span>
</div>
<div style="margin-left: 15px; position: relative; width: 160px; border: 1px solid #000; height: 98px; border-radius: 10px;">
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;">امضاء</span>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</fieldset>
</div>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">

View File

@@ -457,29 +457,29 @@
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel">گزارش قراردادها و فیش های حقوقی</h5>
</div>
@* <h6 class="modal-title ms-5 text-start">@Model.EmployeeName</h6> *@
<div class="col-6 ms-5 mt-2">
<div class="col-12 col-md-6 mt-2">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="EmployeeId" id="employeeSelect">
<option value="">ابتدا کارگاه را انتخاب کنید ...</option>
</select>
</div>
</div>
<div class="col-10 col-sm-6 mt-2">
<div class="d-block ms-4 align-items-center" style="font-size: 10px;">
<div class="d-flex align-items-center my-1 mx-3">
<div class="d-block ms-2 align-items-center" style="font-size: 10px;">
<div class="d-flex align-items-center my-1 mx-1">
<span style="width:15px; height:15px; border-radius:50%; background-color:#12951B"></span>
<span class="mx-1">قراردادهای تنظیم شده</span>
</div>
<div class="d-flex align-items-center my-1 mx-3">
<div class="d-flex align-items-center my-1 mx-1">
<span style="width:15px; height:15px; border-radius:50%; background-color:#0F7416"></span>
<span class="mx-1">تصفیه حساب های تنظیم شده</span>
</div>
<div class="d-flex align-items-center my-1 mx-3">
<div class="d-flex align-items-center my-1 mx-1">
<svg width="13" height="13" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 9C6.98528 9 9 6.98528 9 4.5C9 2.01472 6.98528 0 4.5 0C2.01472 0 0 2.01472 0 4.5C0 6.98528 2.01472 9 4.5 9ZM4.38411 6.32009L6.88411 3.32009L6.11589 2.67991L3.9664 5.25929L2.85355 4.14645L2.14645 4.85355L3.64645 6.35355L4.0336 6.74071L4.38411 6.32009Z" fill="#27FB0F" />
</svg>
<span class="mx-1">انجام امضاء توسط پرسنل بر روی برگه</span>
</div>
<div class="d-flex align-items-center my-1 mx-3">
<div class="d-flex align-items-center my-1 mx-1">
<svg width="13" height="13" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.5C9 6.98528 6.98528 9 4.5 9C2.01472 9 0 6.98528 0 4.5C0 2.01472 2.01472 0 4.5 0C6.98528 0 9 2.01472 9 4.5ZM4.5 5.20711L2.85355 6.85355L2.14645 6.14645L3.79289 4.5L2.14645 2.85355L2.85355 2.14645L4.5 3.79289L6.14645 2.14645L6.85355 2.85355L5.20711 4.5L6.85355 6.14645L6.14645 6.85355L4.5 5.20711Z" fill="#F87171" />
</svg>
@@ -587,7 +587,7 @@
<div id="loadingIndicator">
<div class="row p-lg-2 p-auto">
<div class="empty text-center bg-white d-flex align-items-center justify-content-center">
<div class="text-center bg-white d-flex align-items-center justify-content-center p-4">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد</h5>

View File

@@ -1,6 +1,6 @@
<div class="container-fluid">
<div class="row p-lg-2 p-auto">
<div class="empty text-center bg-white d-flex align-items-center justify-content-center">
<div class="text-center bg-white d-flex align-items-center justify-content-center w-100">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>

View File

@@ -1,8 +1,4 @@
@using Microsoft.EntityFrameworkCore
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Mvc.ModelBinding
@using System.Net.Mime
@model AccountManagement.Application.Contracts.Account.ChangePassword
@model AccountManagement.Application.Contracts.Account.ChangePassword
@{
}
@@ -114,170 +110,10 @@
</div>
</form>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var sendSmsAjax = `@Url.Page("./Profile", "SendSms")`;
var checkCodeAjax = `@Url.Page("./Profile", "CheckCode")`;
</script>
<script src="~/assetsclient/pages/profile/js/changepassword.js"></script>
$(document).ready(function () {
$('#timerCount').hide();
$('.codeInput').val('');
});
//******************** حرکت اتوماتیک اینپوت به اینپوت دیگر مربوط به کد برای ورود و انتخاب اینپوت برای انتخاب کردن ********************
//حرکت اتوماتیک
$('.codeInput').keyup(function (e) {
if (this.value.length === this.maxLength) {
let next = $(this).data('next');
$('#n' + next).focus();
$('#n' + next).select();
}
//وقتی کد ورودی وارد شد، اتوماتیک ورود میشود
if ($('#n0').val() && $('#n1').val() && $('#n2').val() && $('#n3').val() && $('#n4').val() && $('#n5').val()) {
console.log($('#n1').val());
//$('#btn-login-code').trigger('click');
confirmCodeToLogin();
}
});
//انتخاب متن هنگام کلیک کردن بر روی اینپوت
$(".codeInput").click(function () {
$(this).select();
});
//******************** حرکت اتوماتیک اینپوت به اینپوت دیگر مربوط به کد برای ورود و انتخاب اینپوت برای انتخاب کردن ********************
//******************** عملیات ورود با موبایل و دریافت کد ********************
//فقط عدد وارد کنه
$('#codeInput').on('keyup', function () {
this.value = this.value.replace(/[^\d]/, '');
});
function codeTimer() {
$('.codeInput').val('');
$('#btn-login-code').show();
$('#timerCount').show();
$('.otp').show();
$('.loading').hide();
$('#msg').hide();
$('#n0').focus();
var timer2 = "2:00";
var interval = setInterval(function () {
var timer = timer2.split(':');
//by parsing integer, I avoid all extra string processing
var minutes = parseInt(timer[0], 10);
var seconds = parseInt(timer[1], 10);
--seconds;
minutes = (seconds < 0) ? --minutes : minutes;
if (minutes < 0) clearInterval(interval);
seconds = (seconds < 0) ? 59 : seconds;
seconds = (seconds < 10) ? '0' + seconds : seconds;
//minutes = (minutes < 10) ? minutes : minutes;
$('.countdown').html(minutes + ':' + seconds);
timer2 = minutes + ':' + seconds;
// ||
if (timer2 === "0:00" && !$('#passDiv').hasClass("showPassDiv")) {
//دکمه ورود مخفی میشود
$('#btn-login-code').hide();
//اینپوت برای وارد کردن کدها خالی میشود
$('.codeInput').val('');
//دکمه برای دریافت کد باز میشود
$('#btnSmsReciver').show();
$('.loading').hide();
$('#timerCount').hide();
$('.otp').hide();
$('#msg').show();
}
}, 1000);
}
$('#btnSmsReciver').on("click", function () {
$('.loading').show();
$('#btnSmsReciver').hide();
sendVervifyCode();
});
function sendVervifyCode() {
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Profile", "SendSms")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function (response) {
if (response.isSuccess) {
codeTimer()
} else {
$('.loading').hide();
$('#btnSmsReciver').show();
}
},
failure: function (response) {
console.log(5, response);
}
});
}
function confirmCodeToLogin() {
let no0 = $('#n0').val();
let no1 = $('#n1').val();
let no2 = $('#n2').val();
let no3 = $('#n3').val();
let no4 = $('#n4').val();
let no5 = $('#n5').val();
var code = no0 + no1 + no2 + no3 + no4 + no5;
if (code.length == 6) {
$('.loading').show();
setTimeout(function () {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Profile", "CheckCode")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: {
'code': code
},
success: function (response) {
if (response.exist === true) {
$('#passDiv').show();
$('#passDiv').addClass("showPassDiv");
$('.loading').hide();
$('#timerCount').hide();
$('.otp').hide();
$('#btn-login-code').hide();
$('#submitPass').show();
$('.password').val('');
$('#msg').hide();
} else {
$('.loading').hide();
$('.alert-msg').show();
$('.alert-msg p').text('کد وارد شده صحیح نیست');
}
},
failure: function (response) {
console.log(5, response);
}
});
}, 1000);
} else {
$('.loading').hide();
$('.alert-msg').show();
$('.alert-msg p').text('کد وارد شده کمتر از 6 رقم است');
}
}
//******************** عملیات ورود با موبایل و دریافت کد ********************
</script>

View File

@@ -6,6 +6,38 @@
ViewData["Title"] = " - " + "سوابق حضور و غیاب";
int index = 1;
int i = 0;
<style>
.stickyMain {
position: sticky;
top: 5px;
z-index: 10;
}
.sticky {
position: sticky;
top: 43px;
z-index: 10;
}
.is-sticky {
position: -webkit-sticky;
position: sticky;
top: 43px;
z-index: 999;
}
@@media (max-width: 767px) {
.table-rollcall .width2 {
width: 35% !important;
overflow: hidden;
}
.sticky {
top: 48px !important;
}
}
</style>
}
@section Styles {
@@ -26,7 +58,7 @@
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col">
<h4 class="title d-flex align-items-center">سوابق حضور و غیاب</h4>
<h4 class="title d-flex align-items-center">تاریخچه حضور و غیاب</h4>
<div class="title d-flex align-items-center">@Model.WorkshopFullName</div>
</div>
<div>
@@ -51,14 +83,14 @@
<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 dropdown-days boxes">
<li class="item" value-data-normal="OneDay">تاریخ براساس یک روز</li>
<li class="item active" value-data-normal="OneDay">تاریخ براساس یک روز</li>
<li class="item" value-data-normal="RangeDays">تاریخ براساس بازه ی زمانی</li>
</ul>
</div>
</div>
<div class="">
<div class="d-flex align-items-center gap-2">
<div><input type="text" class="form-control date start-date text-center" id="StartDate" placeholder="تاریخ شروع"></div>
<div><input type="text" class="form-control date start-date text-center" id="StartDate" placeholder="تاریخ"></div>
<div class="d-flex align-items-center d-none" id="endDateRollcall">
<div class="me-2 elay">الی</div>
@@ -70,10 +102,10 @@
<div class="col-3 col-xl-2">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." id="employeeSelect">
<option value="">انتخاب پرسنل ...</option>
<option value="0">انتخاب پرسنل ...</option>
@foreach (var itemEmployee in Model.RollCallEmployeeList)
{
<option value="@itemEmployee.PersonName">@itemEmployee.PersonName</option>
<option value="@itemEmployee.EmployeeId">@itemEmployee.PersonName</option>
}
</select>
</div>
@@ -86,7 +118,7 @@
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
<a asp-page="/Company/Employees/Leave" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove" style="padding: 7px 10px;">
<a asp-page="/Company/RollCall/CaseHistory" class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable" id="filterRemove" style="padding: 7px 10px;">
<span>حذف جستجو</span>
</a>
</div>
@@ -97,166 +129,49 @@
</div>
<!-- List Items -->
<div class="container-fluid">
<div class="container-fluid" id="containerHeight">
<div class="row p-lg-2">
<div class="card">
@if (@Model.RollCallViewModels.Any())
@if (@Model.RollCallViewModels.ActiveEmployees.Any())
{
<div class="wrapper table-rollcall">
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
<div class="Rtable-row Rtable-row--head align-items-center d-flex">
<div class="Rtable-row Rtable-row--head align-items-center d-flex stickyMain d-none d-md-flex">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
<div class="Rtable-cell column-heading width3">تاریخ</div>
<div class="Rtable-cell column-heading d-md-block d-none width4 text-center">ساعت ورود</div>
<div class="Rtable-cell column-heading d-md-block d-none width5 text-center">ساعت خروج</div>
<div class="Rtable-cell column-heading d-md-none d-block width6 text-center"></div>
@* <div class="Rtable-cell column-heading d-md-block d-none width5">تاخیر در ورود</div>
<div class="Rtable-cell column-heading d-md-block d-none width5">تعجیل در خروج</div> *@
<div class="Rtable-cell column-heading width4 text-end">تاخیر در ورود</div>
<div class="Rtable-cell column-heading width5 text-center">ورود</div>
<div class="Rtable-cell column-heading width6 text-center">خروج</div>
<div class="Rtable-cell column-heading width7 text-start">تجمیع در خروج</div>
<div class="Rtable-cell column-heading width8 text-center">مجموع ساعات کاری</div>
</div>
<div class="w-100" id="caseHistoryLoadData">
</div>
@foreach (var item in Model.RollCallViewModels)
{
<div class="Rtable-row align-items-center position-relative openAction">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
@(index++)
</div>
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
@item.EmployeeFullName
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">@item.PersonnelCode</div>
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--heading d-none">تاریخ</div>
<div class="Rtable-cell--content">
@item.DateFa
</div>
</div>
<div class="Rtable-cell d-md-block d-none width4 position-relative">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت ورود</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
<div class="Rtable-cell d-md-block d-none width5 position-relative">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت خروج</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@itemTime.EndDate</div>
</div>
}
</div>
<div class="Rtable-cell d-md-none d-block width6 text-end">
<button class="btn-taskmanager-more position-relative">
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 mx-1">مشاهده</p>
</span>
</button>
@* <div class="v-line"></div> *@
</div>
</div>
<div class="operation-div d-md-none d-block w-100">
<div class="operations-btns">
<div class="row rollcall-list-mobile">
<div class="col-6">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading text-center">ساعت ورود</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
</div>
<div class="col-6">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading text-center">ساعت خروج</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.EndDate</div>
</div>
}
</div>
</div>
@* <div class="col-4">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading">تاخیر در ورود</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
</div>
<div class="col-4">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading">تعجیل در خروج</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
</div> *@
</div>
</div>
</div>
}
</div>
</div>
}
else
{
<div class="empty text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>
<partial name="Company/Partial/_EmptySection" />
}
</div>
</div>
</div>
</div>
@section Script {
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var caseHistoryAjaxLoadData = `@Url.Page("./CaseHistory", "CaseHistoryRollCallAjax")`;
// var dateIndex = 0;
</script>
<script src="~/assetsclient/pages/rollcall/js/casehistory.js"></script>
}

View File

@@ -1,4 +1,4 @@
using _0_Framework.Application;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.RollCallEmployee;
using CompanyManagment.App.Contracts.Workshop;
@@ -18,7 +18,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication;
private readonly IRollCallApplication _rollCallApplication;
public List<RollCallViewModel> RollCallViewModels { get; set; }
public RollCallsByDateViewModel RollCallViewModels { get; set; }
public EmployeeRollCallsByMonthViewModel RollCallEmployeeViewModels { get; set; }
public string WorkshopFullName { get; set; }
public List<RollCallEmployeeViewModel> RollCallEmployeeList;
@@ -42,20 +43,20 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
{
if (_rollCallEmployeeApplication.GetByWorkshopId(workshopId).Any())
{
RollCallEmployeeList = _rollCallEmployeeApplication.GetPersonnelRollCallList(workshopId);
RollCallEmployeeList = _rollCallEmployeeApplication.GetPersonnelRollCallList(workshopId);
WorkshopFullName = _workshopApplication.GetDetails(workshopId).WorkshopFullName;
var searchModel = new RollCallSearchModel()
{
WorkshopId = workshopId,
};
WorkshopId = workshopId
};
RollCallViewModels = _rollCallApplication.GetHistoryCase(searchModel);
RollCallViewModels = _rollCallApplication.GetWorkshopRollCallHistory(searchModel);
return Page();
}
else
{
return NotFound();
return Redirect("/Client/Company/RollCall");
}
}
else
@@ -64,6 +65,45 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
}
}
public IActionResult OnGetCaseHistoryRollCallAjax(int dateIndex, string exactDateFa, string startDate, string endDate, long employeeId, string dateEmployeeIndex)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
if (employeeId > 0)
{
RollCallEmployeeViewModels = _rollCallApplication.GetEmployeeRollCallsHistory(employeeId, workshopId, startDate, endDate, exactDateFa, dateEmployeeIndex);
}
else
{
var searchModel = new RollCallSearchModel()
{
WorkshopId = workshopId,
DateIndex = dateIndex,
ExactDateFa = exactDateFa,
StarDateFa = startDate,
EndDateFa = endDate,
EmployeeId = employeeId
};
RollCallViewModels = _rollCallApplication.GetWorkshopRollCallHistory(searchModel);
}
return new JsonResult(new
{
IsSuccedded = true,
data = RollCallViewModels,
dataEmployee = RollCallEmployeeViewModels,
});
}
else
{
return new JsonResult(new
{
IsSuccedded = false,
message = "داده ای یافت نشد!",
});
}
}
}
}

View File

@@ -5,6 +5,8 @@
@{
ViewData["Title"] = " - " + "لیست حضور و غیاب جاری";
int index = 1;
int indexAbsent = 1;
int indexLeave = 1;
int i = 0;
}
@@ -28,7 +30,7 @@
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col">
<h4 class="title d-flex align-items-center">ساعات حضور و غیاب جاری</h4>
<div class="title d-flex align-items-center">@Model.WorkshopFullName <span class="ms-3">تاریخ امروز @Model.NowDate</span></div>
<div class="title d-flex align-items-center">@Model.WorkshopFullName <span class="ms-3 d-none d-md-flex">تاریخ امروز @Model.NowDate</span></div>
</div>
<div>
<a asp-page="/Company/RollCall/Index" class="back-btn" type="button">
@@ -36,16 +38,15 @@
</a>
</div>
</div>
<div class="d-block text-center d-md-none">تاریخ امروز @Model.NowDate</div>
</div>
</div>
<!-- List Items -->
<div class="container-fluid">
<div class="row p-lg-2">
<div class="card">
@if (@Model.RollCallViewModels.Any())
{
<div class="col-8 ps-0 d-none d-md-block">
<div class="card" style="height: 785px;">
<div class="wrapper table-rollcall">
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
@@ -53,145 +54,265 @@
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
<div class="Rtable-cell column-heading d-md-block d-none width4 text-center">ساعت ورود</div>
<div class="Rtable-cell column-heading d-md-block d-none width5 text-center">ساعت خروج</div>
<div class="Rtable-cell column-heading d-md-none d-block width6 text-center"></div>
@* <div class="Rtable-cell column-heading d-md-block d-none width5">تاخیر در ورود</div>
<div class="Rtable-cell column-heading d-md-block d-none width5">تعجیل در خروج</div> *@
<div class="Rtable-cell column-heading width4 text-end">تاخیر در ورود</div>
<div class="Rtable-cell column-heading width5 text-center">ورود</div>
<div class="Rtable-cell column-heading width6 text-center">خروج</div>
<div class="Rtable-cell column-heading width7 text-start">تجمیع در خروج</div>
<div class="Rtable-cell column-heading width8 text-center">مجموع ساعات کاری</div>
</div>
@foreach (var item in Model.RollCallViewModels)
@if (@Model.RollCallViewModels.PresentEmployees.Any())
{
<div class="Rtable-row align-items-center position-relative openAction">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
@(index++)
@foreach (var item in Model.RollCallViewModels.PresentEmployees)
{
<div class="Rtable-row align-items-center position-relative openAction @(item.RollCallTimesList.Last().EndDate != null ? "existTimeRollCall" : "")">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
@(index++)
</div>
</div>
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
@item.EmployeeFullName
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">@item.PersonnelCode</div>
</div>
</div>
<div class="Rtable-cell d-md-block d-none width4 position-relative">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت ورود</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
@item.EmployeeFullName
</div>
}
</div>
</div>
<div class="Rtable-cell d-md-block d-none width5 position-relative">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت خروج</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@itemTime.EndDate</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">@item.PersonnelCode</div>
</div>
}
</div>
</div>
<div class="Rtable-cell d-md-none d-block width6 text-end">
<button class="btn-taskmanager-more position-relative">
<span class="mx-1 align-items-center d-flex justify-content-center">
<p class="my-0 mx-1">مشاهده</p>
</span>
</button>
@* <div class="v-line"></div> *@
</div>
</div>
<div class="Rtable-cell width4 position-relative bg-filter">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">تاخیر در ورود: </div>
<div class="d-flex ms-1">-</div>
</div>
</div>
<div class="Rtable-cell width5 position-relative text-center">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت ورود</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@(itemTime.StartDate ?? "-")</div>
</div>
}
</div>
<div class="Rtable-cell width6 position-relative text-center">
@foreach (var itemTime in item.RollCallTimesList)
{
<div class="Rtable-cell--heading">ساعت خروج</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>@(itemTime.EndDate ?? "-")</div>
</div>
}
</div>
<div class="operation-div d-md-none d-block w-100">
<div class="operations-btns">
<div class="row rollcall-list-mobile">
<div class="col-6">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading text-center">ساعت ورود</div>
@foreach (var itemTime in item.RollCallTimesList)
<div class="Rtable-cell position-relative width7 bg-filter">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">تجمیع در خروج: </div>
<div class="d-flex ms-1">-</div>
</div>
</div>
<div class="Rtable-cell position-relative width8 bg-filter">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">مجموع ساعات کاری: </div>
<div class="d-flex ms-1">
@if (item.RollCallTimesList.Last().EndDate == null)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 12L18.1254 16.1694C18.6725 16.5418 19 17.1608 19 17.8227V20.5C19 20.7761 18.7761 21 18.5 21H5.5C5.22386 21 5 20.7761 5 20.5V17.8227C5 17.1608 5.32746 16.5418 5.87462 16.1694L12 12ZM12 12L18.1254 7.83062C18.6725 7.45819 19 6.83917 19 6.17729V3.5C19 3.22386 18.7761 3 18.5 3H5.5C5.22386 3 5 3.22386 5 3.5V6.17729C5 6.83917 5.32746 7.45819 5.87462 7.83062L12 12Z" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 20.2071V20.85C15 20.9328 14.9328 21 14.85 21H9.15C9.06716 21 9 20.9328 9 20.85V20.2071C9 20.0745 9.05268 19.9473 9.14645 19.8536L11.4343 17.5657C11.7467 17.2533 12.2533 17.2533 12.5657 17.5657L14.8536 19.8536C14.9473 19.9473 15 20.0745 15 20.2071Z" fill="#13AEAE"/>
<path d="M12 11L17 8H7L12 11Z" fill="#13AEAE"/>
<path d="M12 18V12" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
}
else
{
@item.TotalWorkingHours
}
</div>
</div>
<div class="col-6">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading text-center">ساعت خروج</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.EndDate</div>
</div>
}
</div>
</div>
@* <div class="col-4">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading">تاخیر در ورود</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
</div>
<div class="col-4">
<div class="d-md-none d-block position-relative">
<div class="Rtable-cell--heading">تعجیل در خروج</div>
@foreach (var itemTime in item.RollCallTimesList)
{
<div style="direction: ltr;" class="Rtable-cell--content text-center">
<div>@itemTime.StartDate</div>
</div>
}
</div>
</div> *@
</div>
</div>
</div>
}
}
else
{
<partial name="Company/Partial/_EmptySection"></partial>
}
</div>
</div>
}
else
{
<div class="empty text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="~/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>
<div class="col-4 ps-0 d-none d-md-block">
<div class="row p-0 g-3">
<div class="col-12">
<div class="card" style="height: 384px;">
<div class="wrapper">
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
<div class="w-100 mb-1">
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
<div class="Rtable-row Rtable-row--head align-items-center d-flex absenceHeadColor">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
</div>
</div>
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => !x.HasLeave))
{
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
{
if (!item.HasLeave)
{
<div class="Rtable-row align-items-center position-relative absenceItem">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
@(indexAbsent++)
</div>
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
@item.EmployeeFullName
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">@item.PersonnelCode</div>
</div>
</div>
</div>
}
}
}
else
{
<partial name="Company/Partial/_EmptySection"></partial>
}
</div>
</div>
</div>
</div>
}
<div class="col-12">
<div class="card" style="height: 384px;">
<div class="wrapper">
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
<div class="w-100 mb-1">
<div class="leaveHeadColorTop" style="border-radius: 10px 10px 0 0;">مرخصی</div>
<div class="Rtable-row Rtable-row--head align-items-center d-flex leaveHeadColor">
<div class="Rtable-cell column-heading width1">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3">شماره پرسنلی</div>
<div class="Rtable-cell column-heading width4 text-center">نوع مرخصی</div>
</div>
</div>
@if (@Model.RollCallViewModels.AbsentEmployees.Any(x => x.HasLeave))
{
@foreach (var item in Model.RollCallViewModels.AbsentEmployees)
{
if (item.HasLeave)
{
<div class="Rtable-row align-items-center position-relative leaveItem">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
@(indexLeave++)
</div>
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
@item.EmployeeFullName
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">@item.PersonnelCode</div>
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none"></div>
<div class="d-flex ms-1">@item.Reason</div>
</div>
</div>
</div>
}
}
}
else
{
<partial name="Company/Partial/_EmptySection"></partial>
}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row p-lg-2 d-block d-md-none">
<div class="card pt-2">
<div class="col-12">
<div class="btnsRollCallOnlline">
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
</div>
</div>
<div class="wrapper">
<div class="rollcall-list-mobile Rtable Rtable--5cols Rtable--collapse px-1">
<div class="w-100" id="loadRollCallTypeAjax">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@section Script {
<script src="~/AssetsClient/js/dropdown.js?ver=@Version.StyleVersion"></script>
<script src="~/assetsclient/pages/rollcall/js/currentday.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var loadRollCallMoreAjax = "@Url.Page("./CurrentDay", "CurrentDayAjax")";
var loadRollCallAbsentLeaveCountAjax = "@Url.Page("./CurrentDay", "CurrentAjaxCount")";
</script>
}

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Security.Claims;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
@@ -7,15 +8,17 @@ using CompanyManagment.App.Contracts.RollCallEmployee;
using CompanyManagment.App.Contracts.RollCallPlan;
using CompanyManagment.App.Contracts.RollCallService;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Client.Pages.Company.RollCall
{
[Authorize]
public class CurrentDayModel : PageModel
{
public List<RollCallViewModel> RollCallViewModels;
public CurrentDayRollCall RollCallViewModels;
public string WorkshopFullName;
public string NowDate;
@@ -34,41 +37,34 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
public IActionResult OnGet()
{
if (User.Identity.IsAuthenticated)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
if (_rollCallEmployeeApplication.GetByWorkshopId(workshopId).Any())
{
WorkshopFullName = _workshopApplication.GetDetails(workshopId).WorkshopFullName;
var now = DateTime.Now.ToFarsi();
NowDate = now;
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
if (_rollCallEmployeeApplication.GetByWorkshopId(workshopId).Any())
{
WorkshopFullName = _workshopApplication.GetDetails(workshopId).WorkshopFullName;
var now = DateTime.Now.ToFarsi();
NowDate = now;
var searchModel = new RollCallSearchModel()
{
WorkshopId = workshopId,
};
var searchModel = new RollCallSearchModel()
{
WorkshopId = workshopId,
};
RollCallViewModels = _rollCallApplication.GetCurrentDay(searchModel);
return Page();
}
else
{
return NotFound();
}
RollCallViewModels = _rollCallApplication.GetWorkshopCurrentDayRollCalls(workshopId);
return Page();
}
else
{
return Redirect("/Client/Company/RollCall");
}
else
{
return NotFound();
}
}
else
{
return Forbid();
}
}
else
{
return NotFound();
}
}
public IActionResult OnGetCurrentDayPagination()
@@ -87,5 +83,74 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
list
});
}
public IActionResult OnGetCurrentDayAjax(string type)
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
RollCallViewModels = _rollCallApplication.GetWorkshopCurrentDayRollCalls(workshopId);
List<object> data = new();
switch (type)
{
case "all":
data.AddRange(RollCallViewModels.PresentEmployees);
break;
case "absent":
data.AddRange(RollCallViewModels.AbsentEmployees.Where(x => !x.HasLeave));
break;
case "leave":
data.AddRange(RollCallViewModels.AbsentEmployees.Where(x => x.HasLeave));
break;
default:
break;
}
return new JsonResult(new
{
isSuccess = true,
data = data
});
}
else
{
return new JsonResult(new
{
isSuccess = false,
message = "داده ای یافت نشده!"
});
}
}
public IActionResult OnGetCurrentAjaxCount()
{
var workshopHash = User.FindFirstValue("WorkshopSlug");
var workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (workshopId > 0)
{
RollCallViewModels = _rollCallApplication.GetWorkshopCurrentDayRollCalls(workshopId);
var absentEmployeesCount = RollCallViewModels.AbsentEmployees.Count(x => !x.HasLeave);
var leaveEmployeesCount = RollCallViewModels.AbsentEmployees.Count(x => x.HasLeave);
return new JsonResult(new
{
isSuccess = true,
absentEmployeesCount = absentEmployeesCount,
leaveEmployeesCount = leaveEmployeesCount
});
}
else
{
return new JsonResult(new
{
isSuccess = false,
message = "داده ای یافت نشده!"
});
}
}
}
}

View File

@@ -3,6 +3,7 @@ using _0_Framework.Application;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.Error;
using CompanyManagment.App.Contracts.RollCallEmployee;
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
using CompanyManagment.App.Contracts.RollCallService;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
@@ -26,8 +27,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
private readonly IRollCallServiceApplication _rollCallServiceApplication;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IPasswordHasher _passwordHasher;
public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication)
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication)
{
_workshopApplication = workshopApplication;
_passwordHasher = passwordHasher;
@@ -35,6 +36,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
_rollCallServiceApplication = rollCallServiceApplication;
_webHostEnvironment = webHostEnvironment;
_employeeApplication = employeeApplication;
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
}
public IActionResult OnGet()
@@ -182,6 +184,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
HasUploadedImage = "true",
};
result = _rollCallEmployeeApplication.Create(createCommand);
}
else
{
@@ -191,7 +195,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
Message = "عملیات با موفقیت انجام شده است"
};
}
_rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus()
{ RollCallEmployeeId = result.SendId });
if (result.IsSuccedded)
{
return new JsonResult(new

View File

@@ -179,45 +179,35 @@
</div>
<div class="row p-lg-2">
<div class="d-grid card-area-rollcall gap-2 p-0">
@if (Model.HasCameraAccount == "false")
{
<div class="gwb-card">
<a href="#showmodal=@Url.Page("./Index", "SaveCameraAccount")" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/team-users.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">ساخت حساب کاربری دوربین</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</a>
</div>
}
<div class="d-grid card-area-rollcall gap-2 p-lg-0">
@if (!Model.CheckRollCallService)
{
<div class="gwb-card">
<a asp-page="/Company/RollCall/Plans" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/team-users.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">خرید سرویس</div>
<div class="gwb-card">
<a asp-page="/Company/RollCall/Plans" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/boxes.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">
@if (!Model.CheckRollCallService)
{
<span>خرید سرویس</span>
}
else
{
<span>ارتقا یا تغییر سرویس</span>
}
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</a>
</div>
}
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</a>
</div>
<div class="gwb-card @(Model.CheckRollCallService && Model.HasCameraAccount == "true" ? "" : "disable")">
<a asp-page="/Company/RollCall/EmployeeUploadPicture" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/team-users.png" alt="" class="img-fluid mx-1" width="50px"/>
<img src="~/AssetsClient/images/icons/image-rollcall.png" alt="" class="img-fluid mx-1" width="50px" />
<div class="text-start ms-1">
<div class="card-title">آپلود عکس پرسنل</div>
</div>
@@ -247,7 +237,7 @@
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/rollcall-history.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">سوابق حضور و غیاب</div>
<div class="card-title">تاریخچه حضور و غیاب</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
@@ -305,7 +295,12 @@
</div>
@* مودال حساب کاربری *@
<script>
var hasCameraAccount = @Model.HasCameraAccount;
var saveCameraAccountUrl = `#showmodal=@Url.Page("./Index", "SaveCameraAccount")`;
</script>
@section Script {
<script src="~/assetsclient/js/site.js?ver=@Version.StyleVersion"></script>
<script src="~/assetsclient/pages/rollcall/js/index.js"></script>
}
}

View File

@@ -155,4 +155,4 @@
var checkAccountAjax = `@Url.Page("./Index", "CheckAccount")`;
var saveCameraAccountAjax = `@Url.Page("./Index", "SaveCameraAccount")`;
</script>
<script src="~/assetsclient/pages/rollcall/js/modalcameraaccount.js?ver=asdasd"></script>
<script src="~/assetsclient/pages/rollcall/js/modalcameraaccount.js"></script>

View File

@@ -180,7 +180,7 @@
</form>
<script>
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var checkCodeAjax = `@Url.Page("./Plans", "CheckCode")'`;
var checkCodeAjax = `@Url.Page("./Plans", "CheckCode")`;
var saveServiceAjax = `@Url.Page("./Plans", "SaveService")`;
var saveCameraAccountUrl = `#showmodal=@Url.Page("./ Index", "SaveCameraAccount")`;
var computeMoneyByMountAjax = `@Url.Page("Plans", "ComputeMoneyByMount")`;

View File

@@ -1,5 +1,6 @@
@page
@model ServiceHost.Areas.Client.Pages.Company.RollCall.PlansModel
@using _0_Framework.Application
@using Version = _0_Framework.Application.Version
@{
@@ -8,7 +9,8 @@
}
@section Styles {
<link href="~/AssetsClient/css/rollcall-package.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/rollcall-package.css?ver=1515" rel="stylesheet" />
<link href="~/assetsclient/css/card.css?ver=@Version.StyleVersion" rel="stylesheet" />
}
<div class="content-container">
@@ -32,72 +34,191 @@
</div>
<div class="container-fluid">
<div class="row g-3">
<div class="col-12">
<div class="card card-package">
<div class="d-flex justify-content-between align-items-center px-2 py-1">
<img src="~/AssetsClient/images/rollcall-free-limit.png" alt="" class="d-none d-md-block my-1 me-3">
<div>
<div class="d-flex justify-content-between align-items-center">
<h4>سرویس آزمایشی</h4>
<button type="button" class="btn-package mb-2 d-block d-md-none" onclick="choosePlaneFree()">شروع</button>
</div>
<p>
با انتخاب این سرویس می‌توانید بدون محدودیت تعداد پرسنل از نسخه آزمایشی استفاده نمائید. با به پایان رسیدن مدت آزمایشی در صورت تمایل یکی از سرویس‌های موجود را خریداری نمائید.
در غیر این صورت حساب کاربری حضور و غیاب پس از دوره آزمایشی غیرفعال میگردد.
</p>
<button onclick="choosePlaneFree()" id="neonShadow" type="button" class="btn-package mt-2 d-none d-md-block">
شروع
</button>
</div>
</div>
</div>
</div>
@if (!Model.HasBeforeService)
{
<div class="row g-3 mb-2">
<div class="col-12">
<div class="card card-package">
<div class="d-flex justify-content-between align-items-center px-2 py-1">
<img src="~/AssetsClient/images/rollcall-free-limit.png" alt="" class="d-none d-md-block my-1 me-3">
<div>
<div class="d-flex justify-content-between align-items-center">
<h4>سرویس آزمایشی</h4>
<button type="button" class="btn-package2 mb-2 d-block d-md-none" onclick="choosePlaneFree()">شروع</button>
</div>
<p>
با انتخاب این سرویس می‌توانید بدون محدودیت تعداد پرسنل از نسخه آزمایشی استفاده نمائید. با به پایان رسیدن مدت آزمایشی در صورت تمایل یکی از سرویس‌های موجود را خریداری نمائید.
در غیر این صورت حساب کاربری حضور و غیاب پس از دوره آزمایشی غیرفعال میگردد.
</p>
<div class="w-100">
<button onclick="choosePlaneFree()" id="neonShadow2" type="button" class="btn-package2 mt-2 mx-auto d-none d-md-block">
شروع دوره آزمایشی
</button>
</div>
</div>
</div>
</div>
</div>
</div>
}
else
{
<div class="row mb-2">
<div class="col-12">
<div class="card border">
<div class="px-2 py-1">
<div class="infoPlanPackage1">
<div class="infoPlanPackage1">
@switch (Model.ActiveService.ServiceType)
{
case "free":
<span>سرویس فعال شما: سرویس آزمایشی</span>;
break;
case "vip":
<span>سرویس فعال شما: سرویس ویژه</span>;
break;
default:
<span>سرویس فعال شما: سرویس @Model.ActiveService.MaxPersonValid نفره</span>;
break;
}
</div>
</div>
<div class="d-flex justify-content-between align-items-center">
<div class="infoPlanPackage2">تاریخ سرویس خریداری شده: @Model.ActiveService.StartServiceStr</div>
<div class="infoPlanPackage2">تاریخ مانده سرویس: @Tools.ToFarsiDuration2(Model.ActiveService.EndServiceStr)</div>
</div>
</div>
</div>
</div>
</div>
}
<div class="card-grid-package">
@foreach (var item in @Model.Plans)
{
<div class="card text-center @(item.ActivePlan ? "btn-package-card" : "border")">
<div class="btnInner">
<div class="d-flex justify-content-center align-items-center h-50px mb-2">
<div class="title-package">سرویس @item.MaxPersonValid نفره</div>
@if(item.ActivePlan)
{
<div class="offer-section">
<span class="title-package-offer">پیشنهادی</span>
</div>
}
</div>
<div class="row">
<div class="col-sm-12 col-9">
@* <div class="d-flex justify-content-center align-items-center my-1">
<div class="row p-lg-0 mb-2">
<div class="d-grid card-area-rollcall2 gap-2">
<div class="gwb-card">
<div class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/changePlan.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">
@(!Model.HasBeforeService ? "خرید سرویس" : "تغییر سرویس")
</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="gwb-card @(Model.HasBeforeService ? "" : "disable")">
<div class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/extensionplan.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">تمدید سرویس</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
<div class="gwb-card @(Model.HasBeforeService ? "" : "disable")">
<div class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/addUser.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">افزایش پرسنل</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-2" id="paymentIncDecBox" style="display: none">
<div class="col-12">
<div class="card">
<div class="px-3 py-2">
<div class="d-flex-pay-rollcall align-items-center justify-content-between mb-3">
<div class="increDecreTxt">شما می‌توانید تعداد پرسنل سرویس فعلی را افزایش دهید. برای این کار از دکمه مربوطه استفاده کنید.</div>
</div>
<div class="d-flex-pay-rollcall align-items-center justify-content-end gap-3">
<div>
<span style="font-size: 12px">تعداد پرسنل قابل استفاده در پنل خریداری شده : <span id="addMaxPerson">@Model.ActiveService.MaxPersonValid</span></span>
</div>
<div class="d-flex align-items-center justify-content-center">
<button class="increment" fill="currentColor">
+
</button>
<input class="text-center m-0 increDecreInput" value="0"/>
<button class="decrement">
-
</button>
</div>
</div>
<div class="d-flex-pay-rollcall justify-content-between align-items-center">
<button class="payIncDec my-1">
پرداخت
</button>
<div class="d-flex justify-content-end align-items-center my-1">
<div class="increDecreTxt2 mx-3">مبلغ کل پرداخت:</div>
<div class="increDecreTxt3">350,000 <span>تومان</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-grid-package" style="display: none">
@foreach (var item in @Model.Plans)
{
<div class="card text-center @(item.ActivePlan ? "btn-package-card" : "border")">
<div class="btnInner">
<div class="d-flex justify-content-center align-items-center h-50px mb-2">
<div class="title-package">سرویس @item.MaxPersonValid نفره</div>
@if (item.ActivePlan)
{
<div class="offer-section">
<span class="title-package-offer">پیشنهادی</span>
</div>
}
</div>
<div class="row">
<div class="col-sm-12 col-9">
@* <div class="d-flex justify-content-center align-items-center my-1">
<span class="span-package"></span>
</div> *@
<div class="d-flex justify-content-center align-items-center mb-1">
<span class="span-package">@item.FinalAmountRoundStr تومان</span>
</div>
</div>
<div class="d-flex justify-content-center align-items-center mb-1">
<span class="span-package">@item.FinalAmountRoundStr تومان</span>
</div>
</div>
<div class="col-sm-12 col-3 btn-my-auto">
<button onclick="choosePlane(@item.MaxPersonValid)" type="button" class="btn-buy" data-bs-toggle="modal" data-bs-target="#accountModal">خرید</button>
</div>
</div>
<div class="col-sm-12 col-3 btn-my-auto">
<button onclick="choosePlane(@item.MaxPersonValid)" type="button" class="btn-buy" data-bs-toggle="modal" data-bs-target="#accountModal">خرید</button>
</div>
</div>
</div>
</div>
</div>
}
</div>
}
</div>
</div>
</div>
</div>
</div>
<div id="MainModal" class="modal fade personalListModal" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-xxl modal-dialog-centered">
<div class="modal-content" id="ModalContent">

View File

@@ -28,6 +28,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
public int EmployeeCount { get; set; }
public List<RollCallPlanViewModel> Plans { get; set; }
public ErrorViewModel test { get; set; }
public RollCallServiceViewModel ActiveService;
public bool HasBeforeService;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
@@ -58,32 +60,29 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
{
if (_workshopApplication.CheckAccountWorkshop(workshopId))
{
if (_rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId) == null)
{
var workshop = _workshopApplication.GetWorkshopInfo(workshopId);
WorkshopFullName = workshop.WorkshopFullName;
WorkshopId = workshopId;
HasBeforeService = _rollCallServiceApplication.GetAllServiceByWorkshopId(workshopId).Any();
EmployeeCount = _workshopApplication.PersonnelCount(workshopId);
//EmployeeCount = _rollCallEmployeeApplication.GetPersonnelRollCallList(workshopId).Count();
ActiveService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
var serviceList = _rollCallPlanAppllication.GetSelectedPlans();
Plans = serviceList;
var suggestPlan = Plans.Where(x => x.MaxPersonValid > EmployeeCount)
.OrderBy(x => x.MaxPersonValid)
.First();
suggestPlan.ActivePlan = true;
var oldPlan = Plans.First(x => x.MaxPersonValid == suggestPlan.MaxPersonValid);
Plans.Remove(oldPlan);
Plans.Add(suggestPlan);
var workshop = _workshopApplication.GetWorkshopInfo(workshopId);
WorkshopFullName = workshop.WorkshopFullName;
WorkshopId = workshopId;
Plans = Plans.OrderBy(x => x.MaxPersonValid).ToList();
return Page();
}
else
{
return Redirect("/Client/Company/RollCall");
}
EmployeeCount = _workshopApplication.PersonnelCount(workshopId);
//EmployeeCount = _rollCallEmployeeApplication.GetPersonnelRollCallList(workshopId).Count();
var serviceList = _rollCallPlanAppllication.GetSelectedPlans();
Plans = serviceList;
var suggestPlan = Plans.Where(x => x.MaxPersonValid > EmployeeCount)
.OrderBy(x => x.MaxPersonValid)
.First();
suggestPlan.ActivePlan = true;
var oldPlan = Plans.First(x => x.MaxPersonValid == suggestPlan.MaxPersonValid);
Plans.Remove(oldPlan);
Plans.Add(suggestPlan);
Plans = Plans.OrderBy(x => x.MaxPersonValid).ToList();
return Page();
}
else
{

View File

@@ -76,7 +76,7 @@
<div class="container">
<div class="row align-items-center">
<div class="col-3 col-md-2">
<div class="col-3 col-md-2 p-0">
<input type="hidden" asp-for="Id" />
<div class="message-input-div">
<button type="button" class="btn-sendTi" id="saveClientResponseTicket">
@@ -101,7 +101,7 @@
</div>
</div>
<div class="col-9 col-md-10">
<div class="col-9 col-md-10 p-0">
<div class="upload-voice-containerTi align-items-center justify-content-center" style="display: none">
<div id="upload-voice-recording" class="text-center">

View File

@@ -1,12 +1,7 @@
@page
@using Version = _0_Framework.Application.Version
@model ServiceHost.Areas.Client.Pages.IndexModel
@{
<style>
</style>
}
<!-- MAIN CONTENT -->
@@ -51,26 +46,7 @@
</div>
</div>
</div>
@* <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-4 mt-3">
<div class="card p-0">
<div class="card-btn">
<img src="~/AssetsClient/images/btn-image/leave.jpg" class="img-fluid">
<div class="content">
<div class="title-btn">ثبت مرخصی</div>
</div>
<div class="content-bottom">
<button onclick="location.href='#showmodal=@Url.Page("./Index", "LeaveCreate")';">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 6L12 18" stroke="#0f8e9f" stroke-width="2" stroke-linecap="round" />
<path d="M18 12L6 12" stroke="#0f8e9f" stroke-width="2" stroke-linecap="round" />
</svg>
</button>
</div>
</div>
</div>
</div> *@
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-4 mt-3">
<div class="card p-0">
<div class="card-section-btn" id="btnCardLeaveIntro">
@@ -125,24 +101,6 @@
</div>
</div> *@
<!--
<div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-4 mt-3">
<div class="card p-0">
@* <div class="card-section-btn" style="background-image: url('AssetsClient/images/btn-image/leave.jpg');background-position: center;background-repeat: no-repeat;background-size: cover;"> *@
<div class="card-section-btn" style="background: linear-gradient(270deg, #30C2C2 0%, #15a2a2 100%);">
<div class="content">
<button class="btn me-3" onclick="location.href='#showmodal=@Url.Page("./Index", "LeaveCreate")';">
<span class="btn-title text-nowrap">ثبت مرخصی</span>
</button>
<button class="btn" onclick="location.href='#showmodal=@Url.Page("./Index", "LeaveList")';">
<span class="btn-title text-nowrap">لیست مرخصی</span>
</button>
</div>
</div>
</div>
</div>
-->
</div>
</div>

View File

@@ -11,7 +11,6 @@
#printSection {
display: none;
}
</style>
}
@@ -161,652 +160,28 @@
</form>
@section Script {
}
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<style>
.validTime {
color: #4d7c0f !important;
}
.validTime {
color: #4d7c0f !important;
}
.invalidTime {
color: #b91c1c !important;
}
.invalidTime {
color: #b91c1c !important;
}
.blackSelect {
background-color: #cbd5e1;
}
.blackSelect {
background-color: #cbd5e1;
}
</style>
<script>
$(document).ready(function () {
$('.loading').hide();
document.getElementById("MainModal").style.visibility = "visible";
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
//******************** شرط استحقاقی و استعلاجی ********************
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
}
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", ".LeaveTime", function () {
if ($('#daily').is(':checked')) {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
if ($('#hourly').is(':checked')) {
$('#end_date_estehghaghi').hide();
$('.time_paid').show();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
//******************** بلور کردن باکس ********************
$('#IsAccepted').on('change', function () {
if ($(this).is(':checked')) {
$('#blur-div').addClass('blur');
$('#descriptionAcceptedCheck').text('');
$('#descriptionAcceptedCheck').attr('disabled', true);
} else {
$('#blur-div').removeClass('blur');
$('#descriptionAcceptedCheck').attr('disabled', false);
}
});
if ($('#IsAccepted').is(':checked')) {
$('#blur-div').addClass('blur');
$('#descriptionAcceptedCheck').text('');
$('#descriptionAcceptedCheck').attr('disabled', true);
} else {
$('#blur-div').removeClass('blur');
$('#descriptionAcceptedCheck').attr('disabled', false);
}
//******************** بلور کردن باکس ********************
$(document).ready(function () {
$(document).on("change", "#IsAccepted", function () {
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
if (IsAcceptedCheck) {
$('#descriptionAcceptedCheck').removeClass('errored');
$('#descriptionAcceptedCheck').addClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', true);
} else {
$('#descriptionAcceptedCheck').removeClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', false);
}
})
});
$('#save').on('click', function () {
var workshopSelect = $("#workshopSelect").val();
var employeeSelect = $("#employeeSelect").val();
console.log(workshopSelect);
if(workshopSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا کارگاه را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
if (employeeSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا پرسنل را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
$("#descriptionAcceptedCheck").on("change", function () {
$('#descriptionAcceptedCheck').removeClass('errored');
});
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 ($('.errored').length < 1) {
// $('#saveFinaly').click();
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: '@Url.Page("/Index", "LeaveSave")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: $('#create-leave-form').serialize(),
success: function (response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 3500);
$('#printSingleID').val(response.printID);
$('#printSingle').show();
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
} else {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
});
$('#printSingle').on('click', function () {
var id = $('#printSingleID').val();
var parametr = '&id=' + id;
var url = '#showmodal=@Url.Page("/Company/Employees/Leave", "PrintOneMobile")';
location.href = url + parametr;
});
// $(".date").mask("0000/00/00");
$(".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();
}
} else {
$(this).addClass('errored');
}
} else {
$(this).addClass('errored');
}
});
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 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 isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
if (isValid && test1) {
// inputField1.style.backgroundColor = '#a6e9a6';
start1valid = true;
} else {
if (inputField1.value != "") {
// inputField1.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
start1valid = false;
}
}
return start1valid;
}
function checkEnValid(fixDate1) {
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (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) {
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;
}
}
$('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/////////////////
$('#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");
}
});
function computeHourse() {
$('.res').remove();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Employees/Leave", "ComputeLeaveHourly")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "startHours": $('#StartHoures').val(), "endHours": $('#EndHours').val() },
success: function (response) {
let res = `<span class="res">${response.res}</span>`;
$('.sumHours').append(res);
},
failure: function (response) {
console.log(5, response);
}
});
}
function computeDays() {
$('.resultDays').remove();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Employees/Leave", "ComputeLeaveDaily")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val() },
success: function (response) {
if (response.status == false) {
$('.sumDays').addClass("note");
} else {
$('.sumDays').removeClass("note");
}
let res = `<span class="resultDays">${response.res}</span>`;
$('.sumDays').append(res);
},
failure: function (response) {
console.log(5, response);
}
});
}
});
var antiForgeryToken = $('@Html.AntiForgeryToken()').val();
var leaveSaveAjax = `@Url.Page("/Index", "LeaveSave")`;
var PrintOneMobileUrl = `#showmodal=@Url.Page("/Company/Employees/Leave", "PrintOneMobile")`;
var computeLeaveHourlyAjax = `@Url.Page("/Company/Employees/Leave", "ComputeLeaveHourly")`;
var computeLeaveDailyAjax = `@Url.Page("/Company/Employees/Leave", "ComputeLeaveDaily")`;
var employeeListAjax = `@Url.Page("Index", "EmployeeList")`;
</script>
<script>
$(document).ready(function () {
$("#cardSectionLeave div *").prop('disabled', true);
ajaxPersonals();
// Fetch workshops on page load
// $.ajax({
// url: '@Url.Page("/Index", "WorkshopList")',
// type: 'GET',
// success: function (response) {
// var workshops = response.workshops;
// var workshopOptionsHtml = '';
// if (workshops.length != 1) {
// workshopOptionsHtml += '<option value="">انتخاب کارگاه ...</option>';
// }
// workshops.forEach(function (workshop) {
// workshopOptionsHtml += '<option value="' + workshop.id + '">' + workshop.workshopFullName + '</option>';
// });
// $('#workshopSelect').html(workshopOptionsHtml);
// if (workshops.length == 1) {
// ajaxPersonals(workshops[0].id);
// }
// },
// error: function (xhr, status, error) {
// console.error(xhr.responseText);
// }
// });
// Handle workshop selection
// $('#workshopSelect').change(function () {
// var workshopId = $(this).val();
// if (workshopId) {
// ajaxPersonals(workshopId);
// }
// });
var selectEmployeeValue = $('#employeeSelect').val();
if (selectEmployeeValue == '') {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
}
var selectWorkshopValue = $('#workshopSelect').val();
if (selectWorkshopValue == '') {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('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);
}
});
// $('#workshopSelect').change(function () {
// var selectValue = $('#workshopSelect').val();
// if (selectValue == '') {
// var employeeOptionsHtmlEmpty = `<option value="" > ابتدا کارگاه را انتخاب کنید ...</option>`;
// $('#employeeSelect').html(employeeOptionsHtmlEmpty);
// $('#cardSectionLeave').addClass('blur');
// $("#cardSectionLeave div *").prop('disabled', true);
// }
// });
});
function ajaxPersonals() {
$.ajax({
url: '@Url.Page("Index", "EmployeeList")',
type: 'GET',
success: function (response) {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
var employees = response.employees.connectedPersonnelViewModels;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}">${employee.personName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
</script>
<script src="~/assetsclient/pages/index/js/leavecreate.js"></script>

View File

@@ -1,11 +1,6 @@
@using Version = _0_Framework.Application.Version
@model CompanyManagment.App.Contracts.Leave.CreateLeave
@section Styles
{
}
@{
<link href="~/AssetsClient/css/table-style.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-responsive.css?ver=@Version.StyleVersion" rel="stylesheet" />
@@ -13,129 +8,22 @@
<link href="~/assetsclient/css/operation-button.css?ver=@Version.StyleVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@Version.StyleVersion" rel="stylesheet" />
<style>
.errored {
color: #FF3A3A !important;
border: 1px solid #FF3A3A !important
}
.personal-paid-leave-scroll {
height: 330px;
overflow-y: scroll;
overflow-x: hidden;
scrollbar-width: thin;
}
#printSection {
display: none;
}
.personal-paid-leave-grid-list .Rtable-row .Rtable-cell .Rtable-cell--content .badge.badge-paid-leave span,
.personal-paid-leave-grid-list .Rtable-row .Rtable-cell .Rtable-cell--content .badge.sick span {
font-size: 12px;
font-weight: 500;
}
.Rtable .Rtable-row .Rtable-cell {
font-size: 12px;
}
@@media (max-width: 992px) {
.list-box {
padding: 4px 10px 4px 10px !important;
}
.Rtable--collapse .Rtable-row {
padding: 4px 10px;
margin: 3px 0px 0;
font-size: 11px;
}
.leaveDiv {
font-size: 11px;
}
.openAction-mobile1 {
height: 46px;
}
}
.tooltipfull-container {
cursor: pointer;
position: relative;
}
.tooltipfull {
opacity: 0;
z-index: 99;
color: #fff;
display: grid;
font-size: 12px;
padding: 5px 10px;
border-radius: 8px;
background: #23a8a8;
border: 1px solid #23a8a8;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -2px;
bottom: 30px;
white-space: nowrap;
}
.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull:before, .tooltipfull:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #23a8a8;
position: absolute;
bottom: -10px;
right: 20px;
}
</style>
<link href="~/assetsclient/pages/index/css/leavelist.css" rel="stylesheet" />
}
<div class="modal-content">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel">لیست مرخصی</h5>
</div>
<div class="modal-body">
<div class="modal-content">
<div class="modal-header d-block text-center position-relative">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="morakhasiEstehghaghiModalLabel">لیست مرخصی</h5>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
@* form-morakhasi-estehghaghi *@
<div class="container-fluid">
<div class="row mb-3">
@* <div class="col-lg-6 col-12 my-1">
<select class="form-select select2Option" aria-label="انتخاب کارگاه ..." asp-for="WorkshopId" id="workshopSelect">
<option value="">انتخاب کارگاه ...</option>
</select>
</div>
<div class="col-lg-6 col-12 my-1">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="EmployeeId" id="employeeSelect">
<option value="">ابتدا کارگاه را انتخاب کنید ...</option>
</select>
</div>
</div> *@
<div id="cardSectionLeave" class="card border p-0">
@@ -214,371 +102,6 @@
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script>
$(document).ready(function () {
$('.loading').hide();
$(document).ready(function () {
$(document).on('click', '.loadingButtonModal', function () {
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();
});
});
document.getElementById("MainModal").style.visibility = "visible";
$("#personalLeaveGridSection").hide();
$("#personalLeaveEmptySection").show();
let pageIndex = Number($('#pageIndex').val());
var b = pageIndex % 30;
if (b === 0) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Index", "LastLeave")',
data: {
pageIndex: pageIndex
},
success: function (response) {
if (response.pageIndex > 0) {
var n = pageIndex + 1;
$.each(response.data, function (i, item) {
const html = `
<div class="personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="col-span-12 position-relative">
<div class="Rtable-row align-items-center w-100 ">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading">
ردیف
</div>
<label for="${n}" class="Rtable-cell--content prevent-select">
<span class="d-flex justify-content-center align-items-center justify-content-between">
<input id="${n}" type="checkbox" class="form-check-input foo" name="" value="${item.id}">
${n}
</span>
</label>
</div>
<div class="Rtable-cell width4" style="width: 12%;">
<div class="Rtable-cell--content">
${item.employeeFullName}
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--content">
${item.year}
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
${item.monthStr}
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<div>
${item.leaveType == "استحقاقی" ?
`<span class="badge badge-paid-leave badge-secondary">
<span>
استحقاقی
</span>
</span>`
:
`<span class="badge sick badge-secondary">
<span>
استعلاجی
</span>
</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<div>${item.startLeave}</div>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
<div>
${item.paidLeaveType == "ساعتی" ?
`<span>-</span>`
:
`<span>${item.endLeave}</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content">
<div>
${item.paidLeaveType == "ساعتی" ?
`<span>${time_format(item.startLeaveGr)} الی ${time_format(item.endLeaveGr)}</span>`
:
`<span>-</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width8">
<div class="Rtable-cell--content">
<div>${item.leaveHourses}</div>
</div>
</div>
<div class="Rtable-cell width9 d-xl-block d-none">
<div class="Rtable-cell--content">
<div>
${item.isAccepted ?
`<span class="badge badge-secondary d-flex align-items-center justify-content-start">
<svg class="me-1" width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.625" y="2.625" width="11.75" height="11.75" rx="2.5" stroke-width="1.3" stroke="#65A30D" />
<path d="M5.66659 8.5L7.79159 10.625L11.3333 6.375" stroke-width="1.3" stroke="#65A30D" stroke-linecap="round" />
</svg>
<span class="text-clear-md">موافقت</span>
</span>`
:
`<span class="badge disagree badge-secondary d-flex align-items-center justify-content-start">
<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.625" y="2.625" width="11.75" height="11.75" rx="2.5" stroke-width="1.3" stroke="#DC2626" />
<path d="M6.375 6.375L10.625 10.625" stroke="#DC2626" stroke-width="1.3" stroke-linecap="round" />
<path d="M10.625 6.375L6.375 10.625" stroke="#DC2626" stroke-width="1.3" stroke-linecap="round" />
</svg>
<span class="text-clear-md">عدم موافقت</span>
</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width10">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end editButtonFind">
<button type="button" class="btn-print" onclick="printOne(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
</svg>
</button>
<button onclick="checkIfValidToEdit(${item.id})" data-desktop-leaveid="${item.id}" class="btn-edit position-relative">
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
</svg>
<span class="mx-1">ویرایش</span>
</button>
<button type="button" class="btn-delete" onclick="removeLeaveConfirm(${item.id}, ${item.workshopId}, ${item.employeeId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
`;
$('#EmployeesLeaveList').append(html);
const htmlMobile = `
<div class="Rtable-row align-items-center position-relative openAction">
<div class="w-100 d-flex align-items-center justify-content-between">
<div class="d-flex justify-content-center align-items-center justify-content-between">
<div class="Rtable-cell--content">
<span class="mx-sm-2">
${item.employeeFullName}
</span>
</div>
<div class="Rtable-cell--content">
<span class="mx-sm-2">
${item.year}
</span>
</div>
<div class="Rtable-cell--content ">
<span class="mx-sm-2">
${item.monthStr}
</span>
</div>
</div>
<div class="Rtable-cell--content d-flex justify-content-end align-items-center">
<div class="Rtable-cell--heading d-block text-center">
<button class="btn-details" type="button">
<svg width="22" height="22" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.39779 5.55805C9.46429 5.63785 9.56279 5.68398 9.66667 5.68398H10.3333C10.8041 5.68398 11.1396 5.68417 11.4038 5.7022C11.6649 5.72002 11.8307 5.75407 11.9648 5.80958C12.3691 5.97705 12.6903 6.29826 12.8577 6.70256C12.9132 6.83657 12.9473 7.0024 12.9651 7.2635C12.9831 7.52773 12.9833 7.86325 12.9833 8.33398C12.9833 8.80471 12.9831 9.14023 12.9651 9.40447C12.9473 9.66556 12.9132 9.8314 12.8577 9.96541C12.6903 10.3697 12.3691 10.6909 11.9648 10.8584C11.8307 10.9139 11.6649 10.948 11.4038 10.9658C11.1396 10.9838 10.8041 10.984 10.3333 10.984H7.2C6.63417 10.984 6.23085 10.9837 5.9149 10.9579C5.60305 10.9324 5.40726 10.8838 5.25092 10.8041C4.94045 10.646 4.68803 10.3935 4.52984 10.0831C4.45018 9.92672 4.40157 9.73094 4.37609 9.41908C4.35027 9.10313 4.35 8.69981 4.35 8.13398V6.05808C4.35 5.35995 4.35354 5.08568 4.41626 4.8711C4.57419 4.33073 4.99674 3.90818 5.53711 3.75024C5.75169 3.68753 6.02596 3.68398 6.7241 3.68398C7.06744 3.68398 7.20079 3.68501 7.32383 3.70469C7.62934 3.75355 7.91497 3.88733 8.14809 4.09076C8.24197 4.17268 8.32814 4.27446 8.54793 4.53822L9.39779 5.55805Z" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round"/>
<path d="M11.3333 10.6673V10.934C11.3333 11.7741 11.3333 12.1941 11.1698 12.515C11.026 12.7972 10.7966 13.0267 10.5143 13.1705C10.1935 13.334 9.77341 13.334 8.93333 13.334H4.4C3.55992 13.334 3.13988 13.334 2.81901 13.1705C2.53677 13.0267 2.3073 12.7972 2.16349 12.515C2 12.1941 2 11.7741 2 10.934V7.73398C2 6.89391 2 6.47387 2.16349 6.153C2.3073 5.87076 2.53677 5.64128 2.81901 5.49747C3.13988 5.33398 3.55992 5.33398 4.4 5.33398H4.66667" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round"/>
</svg>
<span>نمایش جزئیات</span>
</button>
</div>
</div>
</div>
</div>
<div class="operation-div w-100">
<div class="operations-btns">
<div class="container-fluid px-0">
<div class="row">
<div class="col-12">
<div class="leaveDiv">
<div class="d-flex align-items-center justify-content-between">
<div>نوع مرخصی (${item.paidLeaveType})</div>
<div class="">${item.leaveType}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>تاریخ شروع</div>
<div class="">${item.startLeave}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>تاریخ پایان</div>
<div class="">${item.endLeave}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>مدت مرخصی</div>
<div class="">
${item.paidLeaveType == "ساعتی" ?
`<span>${time_format(item.startLeaveGr)}</span>
<span>الی</span>
<span>${time_format(item.endLeaveGr)}</span>`
:
`<span>${item.leaveHourses}</span>`
}
</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>وضعیت موافقت</div>
${item.isAccepted ?
`<div>موافقت</div>`
:
`<div>عدم موافقت</div>`
}
</div>
<div class="row">
<div class="col-4">
<button type="button" class="btn-print lessThan992" onclick="printOneMobile(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008"/>
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z"/>
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round"/>
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round"/>
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732"/>
</svg>
<span class="mx-1">پرینت</span>
</button>
</div>
<div class="col-4 editButtonFind">
<button onclick="checkIfValidToEdit(${item.id})" data-mobile-leaveid="${item.id}" class="btn-edit position-relative">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1">ویرایش</span>
</button>
</div>
<div class="col-4">
<button type="button" class="btn-delete" onclick="removeLeaveConfirm(${item.id}, ${item.workshopId}, ${item.employeeId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>
<div class="lineMobile mt-3 mb-2"></div>
</div>
</div>
</div>
</div>
</div>
`;
$('#EmployeesLeaveMobileList').append(htmlMobile);
n += 1;
});
var newPageIndex = pageIndex + response.pageIndex;
$('#pageIndex').val(newPageIndex);
}
$('.loading').hide();
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function time_format(date) {
var d = new Date(date);
hours = format_two_digits(d.getHours());
minutes = format_two_digits(d.getMinutes());
return hours + ":" + minutes;
}
function format_two_digits(n) {
return n < 10 ? '0' + n : n;
}
});
function redirectLeavePage() {
var workshopSelect = $('#workshopSelect').val();
var employeeSelect = $('#employeeSelect').val();
if (workshopSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا کارگاه را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
if (employeeSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا پرسنل را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
window.location.href = "/Client/Company/Employees/Leave?workshopId=" + workshopSelect + "&employeeId=" + employeeSelect;
}
function EditLeaveRedirect(id) {
var workshopSelect = $('#workshopSelect').val();
var employeeSelect = $('#employeeSelect').val();
var parametr = '&editId=' + id;
var url = "/Client/Company/Employees/Leave?workshopId=" + workshopSelect + "&employeeId=" + employeeSelect;
window.location.href = url + parametr;
}
function goToLeaveWorkshop(slug) {
var url = "/Client/Company/Employees/Leave/" +slug+"/";
window.location.href = url;
}
</script>
var lastLeaveAjax = `@Url.Page("/Index", "LastLeave")`;
</script>
<script src="~/assetsclient/pages/index/js/leavelist.js"></script>

View File

@@ -46,25 +46,6 @@
<None Remove="wwwroot\webcamjs\flash\**" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\AssetsClient\css\bootstrap-grid.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-grid.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-grid.rtl.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-grid.rtl.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-reboot.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-reboot.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-reboot.rtl.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-reboot.rtl.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-utilities.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-utilities.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-utilities.rtl.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap-utilities.rtl.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap.min.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap.rtl.css.map" />
<Content Remove="wwwroot\AssetsClient\css\bootstrap.rtl.min.css.map" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
<ProjectReference Include="..\backService\backService.csproj" />
@@ -132,6 +113,7 @@
<None Include="Areas\Client\Pages\Company\Checkouts\PrintAll.cshtml" />
<None Include="Areas\Client\Pages\Company\Checkouts\PrintOne.cshtml" />
<None Include="Areas\Client\Pages\Company\Checkouts\PrintOneMobile.cshtml" />
<None Include="Areas\Client\Pages\Company\Checkouts\PrintOneRollCall.cshtml" />
<None Include="Areas\Client\Pages\Company\Contracts\AutoExtension.cshtml" />
<None Include="Areas\Client\Pages\Company\Contracts\clock.cshtml" />
<None Include="Areas\Client\Pages\Company\Contracts\ContractList.cshtml" />
@@ -184,6 +166,7 @@
<None Include="Areas\Client\Pages\Company\Employers\Legal.cshtml" />
<None Include="Areas\Client\Pages\Company\Employers\LegalEdit.cshtml" />
<None Include="Areas\Client\Pages\Company\Employers\LegalList.cshtml" />
<None Include="Areas\Client\Pages\Company\Error\_ErrorModal.cshtml" />
<None Include="Areas\Client\Pages\Company\InsuranceList\Create.cshtml" />
<None Include="Areas\Client\Pages\Company\InsuranceList\Edit.cshtml" />
<None Include="Areas\Client\Pages\Company\InsuranceList\EmployeeDatatable.cshtml" />
@@ -194,6 +177,7 @@
<None Include="Areas\Client\Pages\Company\InsuranceList\PrintOne.cshtml" />
<None Include="Areas\Client\Pages\Company\InsuranceList\PrintOneMobile.cshtml" />
<None Include="Areas\Client\Pages\Company\InsuranceList\WorkshopList.cshtml" />
<None Include="Areas\Client\Pages\Company\Partial\_EmptySection.cshtml" />
<None Include="Areas\Client\Pages\Company\PaymentToEmployee\Create.cshtml" />
<None Include="Areas\Client\Pages\Company\PaymentToEmployee\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\PaymentToEmployee\PrintAllWithCheckout.cshtml" />
@@ -203,13 +187,21 @@
<None Include="Areas\Client\Pages\Company\Reports\CheckoutReport.cshtml" />
<None Include="Areas\Client\Pages\Company\Reports\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\Reports\PrintAllCheckoutReport.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\CaseHistory.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\CurrentDay.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\EmployeeUploadPic.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\EmployeeUploadPicture.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\History.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\List.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\ModalCameraAccount.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\ModalOTPAction.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\ModalOTPActionFree.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\ModalTakeImages.cshtml" />
<None Include="Areas\Client\Pages\Company\RollCall\Plans.cshtml" />
<None Include="Areas\Client\Pages\Company\Ticket\DetailTicketModal.cshtml" />
<None Include="Areas\Client\Pages\Company\Ticket\DetailTicketModalOld.cshtml" />
<None Include="Areas\Client\Pages\Company\Ticket\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\Workshop\ConnectedPersonnels.cshtml" />
<None Include="Areas\Client\Pages\Company\Workshop\ContractCheckoutYearlyStatus.cshtml" />
<None Include="Areas\Client\Pages\Company\Workshop\Create.cshtml" />
@@ -224,6 +216,7 @@
<None Include="Areas\Client\Pages\LeaveCreate.cshtml" />
<None Include="Areas\Client\Pages\LeaveList.cshtml" />
<None Include="Areas\Client\Pages\PaymentToPersonnelCreate.cshtml" />
<None Include="Areas\Client\Pages\Shared\_BtnCreateTicket.cshtml" />
<None Include="Areas\Client\Pages\Shared\_ClientLayout.cshtml" />
<None Include="Areas\Client\Pages\Shared\_headerAndFooter.cshtml" />
<None Include="Areas\Client\Pages\Shared\_Menu.cshtml" />
@@ -550,6 +543,10 @@
<None Include="wwwroot\AssetsClient\libs\select2\js\select2.full.min.js" />
<None Include="wwwroot\AssetsClient\libs\select2\js\select2.js" />
<None Include="wwwroot\AssetsClient\libs\select2\js\select2.min.js" />
<None Include="wwwroot\AssetsClient\pages\Checkouts\js\PrintOneRollCall.js" />
<None Include="wwwroot\AssetsClient\pages\Index\js\LeaveCreate.js" />
<None Include="wwwroot\AssetsClient\pages\Index\js\LeaveList.js" />
<None Include="wwwroot\AssetsClient\pages\Profile\js\ChangePassword.js" />
<None Include="wwwroot\AssetsClient\pages\RollCall\js\CaseHistory.js" />
<None Include="wwwroot\AssetsClient\pages\RollCall\js\CurrentDay.js" />
<None Include="wwwroot\AssetsClient\pages\RollCall\js\EmployeeUploadPicture.js" />

View File

@@ -169,6 +169,10 @@
.card-area-rollcall2 .gwb-card:last-child {
grid-column: span 2 / span 2;
}
.card-area-rollcall {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
/************************* End Responsive *************************/

View File

@@ -6,6 +6,24 @@
padding: 0;
}
.rollcall-list.Rtable .Rtable-row .Rtable-cell {
font-size: 10px;
font-weight: 700;
}
.Rtable .Rtable-row:nth-child(even) {
background-color: #ddf4f4;
border: 1px solid #eee;
}
.Rtable .Rtable-row.existTimeRollCall {
background-color: #9EE2E2;
}
.Rtable .Rtable-row.garyHolidy {
background-color: #bdbdbd;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > .table-number {
border-radius: 5px;
background: rgba(87, 227, 227, 0.25);
@@ -15,7 +33,8 @@
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 12px;
font-size: 10px;
font-weight:700;
color: #0B5959;
white-space: nowrap;
height: 30px;
@@ -24,34 +43,72 @@
justify-content: center;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content div {
z-index:5;
}
.table-rollcall .width1 {
width: 5% !important;
}
.table-rollcall .width2 {
width: 10% !important;
width: 20% !important;
}
.table-rollcall .width3 {
width: 30% !important;
width: 10% !important;
}
.table-rollcall .width4 {
width: 15% !important;
width: 10% !important;
}
.rollcall-list.Rtable .Rtable-row .Rtable-cell.width4 .Rtable-cell--content {
/*justify-content: end;*/
padding: 0 15px 0 0;
}
.table-rollcall .width5 {
width: 10% !important;
text-align: center;
}
.table-rollcall .width6 {
width: 10% !important;
text-align: center;
}
.table-rollcall .width7 {
width: 10% !important;
}
.rollcall-list.Rtable .Rtable-row .Rtable-cell.width7 .Rtable-cell--content {
/*justify-content: start;*/
padding: 0 0 0 15px;
}
.table-rollcall .width8 {
width: 15% !important;
}
.table-rollcall .width4.bg-filter,
.table-rollcall .width7.bg-filter,
.table-rollcall .width8.bg-filter {
top: 0;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
/*padding: 0 35px 0 0;*/
}
.Rtable .Rtable-row .Rtable-cell.width3 {
text-align: center;
}
.Rtable .Rtable-row .Rtable-cell.width1 .Rtable-cell--content,
.Rtable .Rtable-row .Rtable-cell.width2 .Rtable-cell--content {
font-size: 12px;
font-size: 10px;
color: #0B5959;
white-space: nowrap;
height: 30px;
@@ -62,9 +119,13 @@
.table-rollcall .column-heading.width4:before,
.table-rollcall .column-heading.width5:before {
.table-rollcall .column-heading.width5:before,
.table-rollcall .column-heading.width6:before,
.table-rollcall .column-heading.width7:before,
.table-rollcall .column-heading.width8:before {
content: "";
position: relative;
z-index: 4;
}
/*.table-rollcall .Rtable-cell.width4:nth-child(n+1):before {
@@ -81,26 +142,62 @@
position: absolute;
top: 0;
left: 0%;
width: 90%;
width: 85%;
height: 100%;
background-color: #aeeaeab8
border-radius: 0 7px 7px 0;
/*background-color: #aeeaeab8;*/
background-color: rgba(0, 0, 0, 0.1);
}
.table-rollcall .width5:before {
content: "";
position: absolute;
top: 0;
left: 0%;
width: 95%;
height: 100%;
border-radius: 0 7px 7px 0;
/*background-color: #aeeaeab8;*/
background-color: rgba(0, 0, 0, 0.1);
}
.table-rollcall .width6:before {
content: "";
position: absolute;
top: 0;
right: 0%;
width: 95%;
height: 100%;
border-radius: 7px 0 0 7px;
/*background-color: #aeeaeab8;*/
background-color: rgba(0, 0, 0, 0.1);
}
.table-rollcall .width7:before {
content: "";
position: absolute;
top: 0;
right: 0%;
width: 85%;
height: 100%;
border-radius: 7px 0 0 7px;
/*background-color: #aeeaeab8;*/
background-color: rgba(0, 0, 0, 0.1);
}
.table-rollcall .width8:before {
content: "";
position: absolute;
top: 0;
right: 0%;
width: 90%;
height: 100%;
background-color: #aeeaeab8
border-radius: 7px 7px 7px 7px;
/*background-color: #aeeaeab8;*/
background-color: rgba(0, 0, 0, 0.1);
}
.Rtable .Rtable-row:nth-child(even), .table-workshop .Rtable .Rtable-row:nth-child(4n+2), .table-personals .Rtable .Rtable-row:nth-child(4n+2) {
background-color: #ddf4f4;
border: 1px solid #eee;
}
.table-rollcall .Rtable .Rtable-row .Rtable-cell .Rtable-cell--content > span {
color: #0B5959;
@@ -180,7 +277,111 @@
.elay {
color: #797979;
font-size: 12px;
font-size: 10px;
}
.Rtable .Rtable-row.absenceHeadColor,
.Rtable .Rtable-row.leaveHeadColor {
margin: 0 auto;
border-radius: 0 0 10px 10px;
border: 0;
}
/* RollCall - Absence */
.absenceHeadColorTop {
background: #DD6363 !important;
color: #ffffff;
width: 100%;
padding: 3px;
text-align: center;
}
.absenceHeadColor {
background: #F87171 !important;
}
.Rtable .Rtable-row.absenceItem {
background-color: #FEE2E2;
color: #716969;
}
.Rtable .Rtable-row.absenceItem .Rtable-cell .Rtable-cell--content > .table-number {
background-color: #FCA5A5;
color: #716969;
}
.Rtable .Rtable-row.absenceItem .Rtable-cell .Rtable-cell--content {
color: #716969;
}
.Rtable .Rtable-row.absenceItem:hover {
background-color: #FBDBDB;
}
/* RollCall - Leave */
.leaveHeadColorTop {
background: #FCD34D !important;
color: #ffffff;
width: 100%;
padding: 3px;
text-align: center;
}
.leaveHeadColor {
background: #FBDE82 !important;
}
.Rtable .Rtable-row.leaveItem {
background-color: #FEF3C7;
color: #716969;
}
.Rtable .Rtable-row.leaveItem .Rtable-cell .Rtable-cell--content {
color: #716969;
}
.Rtable .Rtable-row.leaveItem .Rtable-cell .Rtable-cell--content > .table-number {
background-color: #FCD34D;
color: #716969;
}
.Rtable .Rtable-row.leaveItem:hover {
background-color: #FFEEB9;
}
.btnsRollCallOnlline {
display:flex;
justify-content:space-between;
align-items:center;
}
.btnRollCallStatus {
border-radius: 6px;
padding: 5px 6px;
width: 100%;
margin: auto 3px;
color: #ffffff;
border: 2px solid transparent;
}
.btnRollCallStatus:nth-child(1){
background-color: #9AD9D9;
}
.btnRollCallStatus:nth-child(2){
background-color: #FBBF24;
}
.btnRollCallStatus:nth-child(3){
background-color: #F87171;
}
.btnRollCallStatus.active {
border:2px solid #48B8B8;
}
@media (max-width: 767px) {
@@ -191,13 +392,13 @@
.title-mobile {
font-weight: 600;
font-size: 13px;
font-size: 12px;
color: #0B5959;
}
.content-mobile {
font-weight: 400;
font-size: 11px;
font-size: 10px;
color: #0B5959;
}
@@ -257,7 +458,7 @@
text-align: end !important;
}
.btn-taskmanager-more {
.btn-rollcall-more {
background: #B6F2E1;
border: 0.2px solid #0596691c;
border-radius: 6px;
@@ -271,7 +472,6 @@
font-weight: 400;
line-height: normal;
white-space: nowrap;
width: 70px;
}
.v-line {
@@ -287,10 +487,36 @@
margin: 2px auto 10px;
}
.rollcall-list-mobile.Rtable .Rtable-row .Rtable-cell {
width: auto;
}
.rollcall-list-mobile .Rtable-cell--content {
color: #0B5959;
font-size: 12px;
font-weight: 500;
margin: 2px auto;
}
.operations-btns.rollcall-operations-mobile {
background: #F5F5F5 !important;
}
.table-rollcall .column-heading.width4:before,
.table-rollcall .column-heading.width5:before,
.table-rollcall .column-heading.width6:before,
.table-rollcall .column-heading.width7:before,
.table-rollcall .column-heading.width8:before {
display:none;
}
.table-rollcall .width4:before,
.table-rollcall .width5:before,
.table-rollcall .width6:before,
.table-rollcall .width7:before,
.table-rollcall .width8:before {
display: none;
}
}

View File

@@ -493,6 +493,9 @@
border-right: 1px solid rgb(108,117,125);
}
.d-flex-pay-rollcall {
display: flex;
}
@@ -538,6 +541,11 @@
height: 30px;
}
.increDecreTxt {
font-size: 13px;
font-weight: 600;
}
.btn-buy {
padding: 5px 20px;
margin: 6px auto 0px;
@@ -591,6 +599,10 @@
padding: 2px 1px;
}
.increDecreTxt {
font-size: 12px;
}
.card-grid-package {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
@@ -627,6 +639,14 @@
.service-invoice-table p {
font-size: 13px;
}
.d-flex-pay-rollcall {
flex-direction: column
}
.payIncDec {
order: 1
}
}

View File

@@ -416,7 +416,7 @@ ul {
margin-right: -300px;
background-color: #100901;
/*overflow: hidden;*/
z-index: 101 !important;
z-index: 1011 !important;
transition: ease .4s;
}
@@ -574,7 +574,7 @@ ul {
}
.static-menu {
z-index: 10;
z-index: 1010;
}
/* Top Header */
@@ -1429,7 +1429,7 @@ button.btn-more span:nth-child(4) {
height: 100vh !important;
/* max-height: 300vh !important; */
/* width:100vw; */
z-index: 100;
z-index: 1011;
transition: background-color 0.3s, transform 0.3s;
}

View File

@@ -75,6 +75,7 @@
box-shadow: 0px 3px 5px rgba(22, 52, 80, 0.15);
border-radius: 16px;
transform: rotate(0.12deg);
z-index: 1000;
}
.screenshot-border-global {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -124,7 +124,7 @@ function loadMessages() {
html += `<div style="padding-left: 3px;" class="${responseTickets.mediaViewModels.length > 0 ? `col-9` : `col-12`}">
<div class="header-message">
</div>
<p>
<p style="word-break: break-word;">
${responseTickets.description === "$GOzaReshgirMediaVoIce@" ? "" : responseTickets.description}
</p>
</div>`;
@@ -239,7 +239,7 @@ function loadMessages() {
<div class="ticket-message-sender">
<div class="header-message">
</div>
<p>
<p style="word-break: break-word;">
${itemResponse.responseMessage === "$GOzaReshgirMediaVoIce@" ? "" : itemResponse.responseMessage}
</p>`;
@@ -322,7 +322,7 @@ function loadMessages() {
<div class="header-message">
<span>پشتیبانی</span>
</div>
<p>
<p style="word-break: break-word;">
${itemResponse.responseMessage === "$GOzaReshgirMediaVoIce@" ? "" : itemResponse.responseMessage}
</p>`;

View File

@@ -0,0 +1,313 @@
.modal .modal-dialog .modal-content {
background-color: white !important;
}
.modal-dialog {
max-width: 100%;
width: 22.4cm;
}
/* @page {
size: 7in 9.25in;
margin: 27mm 16mm 27mm 16mm;
}*/
@page {
size: A4;
margin: 0mm;
page-break-after: auto;
}
@media screen {
#printSection {
display: none;
}
}
.print * {
font-family: IranSans !important;
}
.print:last-child {
page-break-after: auto !important;
}
@media print {
body * {
visibility: hidden;
page-break-after: auto;
}
html, body {
height: 100%;
margin: 0 !important;
padding: 0 !important;
overflow: hidden;
}
#printSection, #printSection * {
visibility: visible;
page-break-after: auto;
}
footer {
page-break-after: auto;
display: none;
}
header {
display: none;
}
#printSection {
position: absolute;
left: 0;
page-break-after: auto;
top: 0;
}
.head {
background-color: #cdcdcd !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.week {
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.radio-info input[type="radio"]:checked + label::after {
background-color: black !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.mt-30 {
margin: 30px 0 0 0 !important;
}
.restActive, .rest {
pointer-events: none;
font-size: 8px !important;
width: 46px !important;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
text-align: center;
}
.signSection {
left: 24px !important;
}
}
.col-4, .col-3, .col-9,
.col-2, .col-10, .col-6,
.col-8, .col-5, .col-7,
.col-offset-1 {
float: right !important;
}
h5, h6 {
margin: 5px 0px !important;
}
body .modal {
font-size: 11px;
}
label .modal {
margin-bottom: 2px;
}
.radio {
display: inline-block;
margin-top: -10px !important;
}
.radio input[type=radio] {
position: unset !important;
}
textarea.form-control {
height: 100px !important;
}
.fontBold {
font-family: IranSans !important;
}
.fontNumber {
font-family: IranText !important;
}
.modal-body {
height: 99%;
}
.row {
margin-right: -10px !important;
margin-left: -10px !important;
}
div span.week {
/* border-radius: 5px;
padding: 2px 8px;
margin-right: 32px;
pointer-events: none;*/
}
#shanbeh, #yekshanbeh, #doshanbeh, #seshanbeh, #cheharshanbeh, #panjshanbeh, #jomeh {
width: 80px;
}
#Sh1, #Sh2, #Sh3, #Sh4, #Sh5, #Sh6, #Sh7, #Sh8 {
width: 80px;
margin-right: 21%;
border-radius: 15px;
font-size: 8px !important;
}
.week {
width: 48px !important;
border-radius: 5px;
padding: 1px !important;
font-size: 8px !important;
pointer-events: none;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.time {
width: 8%;
text-align: center;
padding: 0px !important;
direction: ltr;
border-radius: 5px;
border: 1px solid #47c848 !important;
pointer-events: none;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
font-size: 8px !important;
}
.time2 {
width: 8%;
text-align: center;
direction: ltr;
border-radius: 5px;
border: 1px solid #47c848 !important;
pointer-events: none;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
font-size: 8px !important;
}
.fild {
border: 1px solid #878686 !important;
background-color: #f7f7f7 !important;
border-radius: 10px;
// margin: 5px 10px;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.fild2 {
border: 1px solid #878686 !important;
background-color: #d9d9d9 !important;
border-radius: 10px;
padding: 10px 0 10px 0;
display: inline;
float: left;
width: 80%;
margin-left: 15px;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.fild3 {
border: 1px solid #878686 !important;
background-color: #e7e7e7 !important;
border-radius: 10px;
display: inline;
float: left;
width: 100%;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.call {
background-color: #d2dbd2 !important;
border-radius: 5px;
margin-bottom: 3px;
margin-left: 10px;
margin-right: 10px;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.rest {
pointer-events: none;
font-size: 8px !important;
width: 49px !important;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
text-align: center;
}
.shiftDisplayNone {
display: none;
}
.fildeWeek {
height: 136px !important;
width: 48% !important;
display: inline-block;
border: 1px solid #cfcfcf !important;
background-color: #e7e5e5 !important;
border-radius: 12px 0px 12px 12px;
padding: 2px 15px !important;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.fildeWeek .row {
height: 16px;
margin: 1px 0;
}
.weekName {
margin-bottom: -18px !important;
top: -18px;
position: relative;
margin-right: -16px;
padding-right: 5px !important;
font-size: 10px !important;
border-bottom: 0px;
color: #505458 !important;
background-color: #bdd1be !important;
border-radius: 15px 5px 0px 0px;
width: 57px;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
.btn-deactive {
background-color: #bbbbbb !important;
-webkit-print-color-adjust: exact;
}
.btn-active {
background-color: #3ac53c !important;
-webkit-print-color-adjust: exact;
}
.input-deactive {
background-color: #dbd8d8 !important;
-webkit-print-color-adjust: exact !important;
}

View File

@@ -0,0 +1,20 @@
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("printThis"));
}
function printElement(elem) {
var domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}

View File

@@ -0,0 +1,95 @@
.errored {
color: #FF3A3A !important;
border: 1px solid #FF3A3A !important
}
.personal-paid-leave-scroll {
height: 330px;
overflow-y: scroll;
overflow-x: hidden;
scrollbar-width: thin;
}
#printSection {
display: none;
}
.personal-paid-leave-grid-list .Rtable-row .Rtable-cell .Rtable-cell--content .badge.badge-paid-leave span,
.personal-paid-leave-grid-list .Rtable-row .Rtable-cell .Rtable-cell--content .badge.sick span {
font-size: 12px;
font-weight: 500;
}
.Rtable .Rtable-row .Rtable-cell {
font-size: 12px;
}
@media (max-width: 992px) {
.list-box {
padding: 4px 10px 4px 10px !important;
}
.Rtable--collapse .Rtable-row {
padding: 4px 10px;
margin: 3px 0px 0;
font-size: 11px;
}
.leaveDiv {
font-size: 11px;
}
.openAction-mobile1 {
height: 46px;
}
}
.tooltipfull-container {
cursor: pointer;
position: relative;
}
.tooltipfull {
opacity: 0;
z-index: 99;
color: #fff;
display: grid;
font-size: 12px;
padding: 5px 10px;
border-radius: 8px;
background: #23a8a8;
border: 1px solid #23a8a8;
-webkit-transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-o-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
right: -2px;
bottom: 30px;
white-space: nowrap;
}
.tooltipfull-container:hover .tooltipfull, a:hover .tooltipfull {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
.tooltipfull:before, .tooltipfull:after {
content: '';
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #23a8a8;
position: absolute;
bottom: -10px;
right: 20px;
}

View File

@@ -0,0 +1,630 @@
$(document).ready(function () {
$('.loading').hide();
document.getElementById("MainModal").style.visibility = "visible";
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
//******************** شرط استحقاقی و استعلاجی ********************
$(document).on("change", ".LeaveType", function () {
if ($('#paid').is(':checked')) {
$('#dailyType').css('visibility', 'visible');
}
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", ".LeaveTime", function () {
if ($('#daily').is(':checked')) {
$('#end_date_estehghaghi').show();
$('.time_paid').hide();
}
if ($('#hourly').is(':checked')) {
$('#end_date_estehghaghi').hide();
$('.time_paid').show();
}
});
//******************** شرط استحقاقی و استعلاجی ********************
//******************** بلور کردن باکس ********************
$('#IsAccepted').on('change', function () {
if ($(this).is(':checked')) {
$('#blur-div').addClass('blur');
$('#descriptionAcceptedCheck').text('');
$('#descriptionAcceptedCheck').attr('disabled', true);
} else {
$('#blur-div').removeClass('blur');
$('#descriptionAcceptedCheck').attr('disabled', false);
}
});
if ($('#IsAccepted').is(':checked')) {
$('#blur-div').addClass('blur');
$('#descriptionAcceptedCheck').text('');
$('#descriptionAcceptedCheck').attr('disabled', true);
} else {
$('#blur-div').removeClass('blur');
$('#descriptionAcceptedCheck').attr('disabled', false);
}
//******************** بلور کردن باکس ********************
$(document).ready(function () {
$(document).on("change", "#IsAccepted", function () {
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
if (IsAcceptedCheck) {
$('#descriptionAcceptedCheck').removeClass('errored');
$('#descriptionAcceptedCheck').addClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', true);
} else {
$('#descriptionAcceptedCheck').removeClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', false);
}
})
});
$('#save').on('click', function () {
var workshopSelect = $("#workshopSelect").val();
var employeeSelect = $("#employeeSelect").val();
console.log(workshopSelect);
if(workshopSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا کارگاه را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
if (employeeSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا پرسنل را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
$("#descriptionAcceptedCheck").on("change", function () {
$('#descriptionAcceptedCheck').removeClass('errored');
});
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 ($('.errored').length < 1) {
// $('#saveFinaly').click();
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: leaveSaveAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: $('#create-leave-form').serialize(),
success: function (response) {
if (response.isSuccedded) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 3500);
$('#printSingleID').val(response.printID);
$('#printSingle').show();
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
} else {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا خطاها را برطرف کنید.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
});
$('#printSingle').on('click', function () {
var id = $('#printSingleID').val();
var parametr = '&id=' + id;
var url = printOneMobileUrl;
location.href = url + parametr;
});
// $(".date").mask("0000/00/00");
$(".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();
}
} else {
$(this).addClass('errored');
}
} else {
$(this).addClass('errored');
}
});
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 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 isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
if (isValid && test1) {
// inputField1.style.backgroundColor = '#a6e9a6';
start1valid = true;
} else {
if (inputField1.value != "") {
// inputField1.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
start1valid = false;
}
}
return start1valid;
}
function checkEnValid(fixDate1) {
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (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) {
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;
}
}
$('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/////////////////
$('#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");
}
});
function computeHourse() {
$('.res').remove();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
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);
},
failure: function (response) {
console.log(5, response);
}
});
}
function computeDays() {
$('.resultDays').remove();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: computeLeaveDailyAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { "startDay": $('#StartLeave').val(), "endDay": $('#EndLeave').val() },
success: function (response) {
if (response.status == false) {
$('.sumDays').addClass("note");
} else {
$('.sumDays').removeClass("note");
}
let res = `<span class="resultDays">${response.res}</span>`;
$('.sumDays').append(res);
},
failure: function (response) {
console.log(5, response);
}
});
}
});
$(document).ready(function () {
$("#cardSectionLeave div *").prop('disabled', true);
ajaxPersonals();
// Fetch workshops on page load
// $.ajax({
// url: '@Url.Page("/Index", "WorkshopList")',
// type: 'GET',
// success: function (response) {
// var workshops = response.workshops;
// var workshopOptionsHtml = '';
// if (workshops.length != 1) {
// workshopOptionsHtml += '<option value="">انتخاب کارگاه ...</option>';
// }
// workshops.forEach(function (workshop) {
// workshopOptionsHtml += '<option value="' + workshop.id + '">' + workshop.workshopFullName + '</option>';
// });
// $('#workshopSelect').html(workshopOptionsHtml);
// if (workshops.length == 1) {
// ajaxPersonals(workshops[0].id);
// }
// },
// error: function (xhr, status, error) {
// console.error(xhr.responseText);
// }
// });
// Handle workshop selection
// $('#workshopSelect').change(function () {
// var workshopId = $(this).val();
// if (workshopId) {
// ajaxPersonals(workshopId);
// }
// });
var selectEmployeeValue = $('#employeeSelect').val();
if (selectEmployeeValue == '') {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
}
var selectWorkshopValue = $('#workshopSelect').val();
if (selectWorkshopValue == '') {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('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);
}
});
// $('#workshopSelect').change(function () {
// var selectValue = $('#workshopSelect').val();
// if (selectValue == '') {
// var employeeOptionsHtmlEmpty = `<option value="" > ابتدا کارگاه را انتخاب کنید ...</option>`;
// $('#employeeSelect').html(employeeOptionsHtmlEmpty);
// $('#cardSectionLeave').addClass('blur');
// $("#cardSectionLeave div *").prop('disabled', true);
// }
// });
});
function ajaxPersonals() {
$.ajax({
url: employeeListAjax,
type: 'GET',
success: function (response) {
$('#cardSectionLeave').addClass('blur');
$("#cardSectionLeave div *").prop('disabled', true);
var employees = response.employees.connectedPersonnelViewModels;
var employeeOptionsHtml = '<option value="">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
var black = employee.black ? "blackSelect" : "";
employeeOptionsHtml += `<option class="${black}" value="${employee.employeeId}">${employee.personName}</option>`;
});
$('#employeeSelect').html(employeeOptionsHtml);
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}

View File

@@ -0,0 +1,368 @@
$(document).ready(function () {
$('.loading').hide();
$(document).ready(function () {
$(document).on('click', '.loadingButtonModal', function () {
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();
});
});
document.getElementById("MainModal").style.visibility = "visible";
$("#personalLeaveGridSection").hide();
$("#personalLeaveEmptySection").show();
let pageIndex = Number($('#pageIndex').val());
var b = pageIndex % 30;
if (b === 0) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: lastLeaveAjax,
data: {
pageIndex: pageIndex
},
success: function (response) {
if (response.pageIndex > 0) {
var n = pageIndex + 1;
$.each(response.data, function (i, item) {
const html = `
<div class="personal-grid-row d-grid gap-2 grid-cols-12 w-100">
<div class="col-span-12 position-relative">
<div class="Rtable-row align-items-center w-100 ">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading">
ردیف
</div>
<label for="${n}" class="Rtable-cell--content prevent-select">
<span class="d-flex justify-content-center align-items-center justify-content-between">
<input id="${n}" type="checkbox" class="form-check-input foo" name="" value="${item.id}">
${n}
</span>
</label>
</div>
<div class="Rtable-cell width4" style="width: 12%;">
<div class="Rtable-cell--content">
${item.employeeFullName}
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--content">
${item.year}
</div>
</div>
<div class="Rtable-cell width3">
<div class="Rtable-cell--content">
${item.monthStr}
</div>
</div>
<div class="Rtable-cell width4">
<div class="Rtable-cell--content">
<div>
${item.leaveType == "استحقاقی" ?
`<span class="badge badge-paid-leave badge-secondary">
<span>
استحقاقی
</span>
</span>`
:
`<span class="badge sick badge-secondary">
<span>
استعلاجی
</span>
</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content">
<div>${item.startLeave}</div>
</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content">
<div>
${item.paidLeaveType == "ساعتی" ?
`<span>-</span>`
:
`<span>${item.endLeave}</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width7">
<div class="Rtable-cell--content">
<div>
${item.paidLeaveType == "ساعتی" ?
`<span>${time_format(item.startLeaveGr)} الی ${time_format(item.endLeaveGr)}</span>`
:
`<span>-</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width8">
<div class="Rtable-cell--content">
<div>${item.leaveHourses}</div>
</div>
</div>
<div class="Rtable-cell width9 d-xl-block d-none">
<div class="Rtable-cell--content">
<div>
${item.isAccepted ?
`<span class="badge badge-secondary d-flex align-items-center justify-content-start">
<svg class="me-1" width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.625" y="2.625" width="11.75" height="11.75" rx="2.5" stroke-width="1.3" stroke="#65A30D" />
<path d="M5.66659 8.5L7.79159 10.625L11.3333 6.375" stroke-width="1.3" stroke="#65A30D" stroke-linecap="round" />
</svg>
<span class="text-clear-md">موافقت</span>
</span>`
:
`<span class="badge disagree badge-secondary d-flex align-items-center justify-content-start">
<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="2.625" y="2.625" width="11.75" height="11.75" rx="2.5" stroke-width="1.3" stroke="#DC2626" />
<path d="M6.375 6.375L10.625 10.625" stroke="#DC2626" stroke-width="1.3" stroke-linecap="round" />
<path d="M10.625 6.375L6.375 10.625" stroke="#DC2626" stroke-width="1.3" stroke-linecap="round" />
</svg>
<span class="text-clear-md">عدم موافقت</span>
</span>`
}
</div>
</div>
</div>
<div class="Rtable-cell width10">
<div class="Rtable-cell--content">
<div class="Rtable-cell--content align-items-center d-flex justify-content-end editButtonFind">
<button type="button" class="btn-print" onclick="printOne(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" />
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" />
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round" />
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round" />
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" />
</svg>
</button>
<button onclick="checkIfValidToEdit(${item.id})" data-desktop-leaveid="${item.id}" class="btn-edit position-relative">
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
</svg>
<span class="mx-1">ویرایش</span>
</button>
<button type="button" class="btn-delete" onclick="removeLeaveConfirm(${item.id}, ${item.workshopId}, ${item.employeeId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
`;
$('#EmployeesLeaveList').append(html);
const htmlMobile = `
<div class="Rtable-row align-items-center position-relative openAction">
<div class="w-100 d-flex align-items-center justify-content-between">
<div class="d-flex justify-content-center align-items-center justify-content-between">
<div class="Rtable-cell--content">
<span class="mx-sm-2">
${item.employeeFullName}
</span>
</div>
<div class="Rtable-cell--content">
<span class="mx-sm-2">
${item.year}
</span>
</div>
<div class="Rtable-cell--content ">
<span class="mx-sm-2">
${item.monthStr}
</span>
</div>
</div>
<div class="Rtable-cell--content d-flex justify-content-end align-items-center">
<div class="Rtable-cell--heading d-block text-center">
<button class="btn-details" type="button">
<svg width="22" height="22" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.39779 5.55805C9.46429 5.63785 9.56279 5.68398 9.66667 5.68398H10.3333C10.8041 5.68398 11.1396 5.68417 11.4038 5.7022C11.6649 5.72002 11.8307 5.75407 11.9648 5.80958C12.3691 5.97705 12.6903 6.29826 12.8577 6.70256C12.9132 6.83657 12.9473 7.0024 12.9651 7.2635C12.9831 7.52773 12.9833 7.86325 12.9833 8.33398C12.9833 8.80471 12.9831 9.14023 12.9651 9.40447C12.9473 9.66556 12.9132 9.8314 12.8577 9.96541C12.6903 10.3697 12.3691 10.6909 11.9648 10.8584C11.8307 10.9139 11.6649 10.948 11.4038 10.9658C11.1396 10.9838 10.8041 10.984 10.3333 10.984H7.2C6.63417 10.984 6.23085 10.9837 5.9149 10.9579C5.60305 10.9324 5.40726 10.8838 5.25092 10.8041C4.94045 10.646 4.68803 10.3935 4.52984 10.0831C4.45018 9.92672 4.40157 9.73094 4.37609 9.41908C4.35027 9.10313 4.35 8.69981 4.35 8.13398V6.05808C4.35 5.35995 4.35354 5.08568 4.41626 4.8711C4.57419 4.33073 4.99674 3.90818 5.53711 3.75024C5.75169 3.68753 6.02596 3.68398 6.7241 3.68398C7.06744 3.68398 7.20079 3.68501 7.32383 3.70469C7.62934 3.75355 7.91497 3.88733 8.14809 4.09076C8.24197 4.17268 8.32814 4.27446 8.54793 4.53822L9.39779 5.55805Z" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round"/>
<path d="M11.3333 10.6673V10.934C11.3333 11.7741 11.3333 12.1941 11.1698 12.515C11.026 12.7972 10.7966 13.0267 10.5143 13.1705C10.1935 13.334 9.77341 13.334 8.93333 13.334H4.4C3.55992 13.334 3.13988 13.334 2.81901 13.1705C2.53677 13.0267 2.3073 12.7972 2.16349 12.515C2 12.1941 2 11.7741 2 10.934V7.73398C2 6.89391 2 6.47387 2.16349 6.153C2.3073 5.87076 2.53677 5.64128 2.81901 5.49747C3.13988 5.33398 3.55992 5.33398 4.4 5.33398H4.66667" stroke="#4DA9D1" stroke-width="0.7" stroke-linejoin="round"/>
</svg>
<span>نمایش جزئیات</span>
</button>
</div>
</div>
</div>
</div>
<div class="operation-div w-100">
<div class="operations-btns">
<div class="container-fluid px-0">
<div class="row">
<div class="col-12">
<div class="leaveDiv">
<div class="d-flex align-items-center justify-content-between">
<div>نوع مرخصی (${item.paidLeaveType})</div>
<div class="">${item.leaveType}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>تاریخ شروع</div>
<div class="">${item.startLeave}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>تاریخ پایان</div>
<div class="">${item.endLeave}</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>مدت مرخصی</div>
<div class="">
${item.paidLeaveType == "ساعتی" ?
`<span>${time_format(item.startLeaveGr)}</span>
<span>الی</span>
<span>${time_format(item.endLeaveGr)}</span>`
:
`<span>${item.leaveHourses}</span>`
}
</div>
</div>
<div class="d-flex align-items-center justify-content-between">
<div>وضعیت موافقت</div>
${item.isAccepted ?
`<div>موافقت</div>`
:
`<div>عدم موافقت</div>`
}
</div>
<div class="row">
<div class="col-4">
<button type="button" class="btn-print lessThan992" onclick="printOneMobile(${item.id})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008"/>
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z"/>
<path d="M7.91675 11.25L11.2501 11.25" stroke-linecap="round"/>
<path d="M7.91675 13.75L12.0834 13.75" stroke-linecap="round"/>
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732"/>
</svg>
<span class="mx-1">پرینت</span>
</button>
</div>
<div class="col-4 editButtonFind">
<button onclick="checkIfValidToEdit(${item.id})" data-mobile-leaveid="${item.id}" class="btn-edit position-relative">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M12.0433 6.49955L12.0214 6.52145L5.53808 13.0047C5.52706 13.0158 5.51612 13.0267 5.50525 13.0375C5.34278 13.1996 5.19895 13.3432 5.09758 13.5222L5.5266 13.7651L5.09758 13.5222C4.99622 13.7012 4.94714 13.8984 4.89171 14.1211C4.88801 14.136 4.88427 14.151 4.88049 14.1662L4.30029 16.4869L4.78351 16.6077L4.30029 16.4869C4.29808 16.4958 4.29585 16.5047 4.29361 16.5136C4.25437 16.6703 4.21246 16.8377 4.19871 16.9782C4.18357 17.1329 4.1871 17.394 4.39651 17.6034C4.60592 17.8128 4.86698 17.8163 5.02171 17.8012C5.16225 17.7875 5.32958 17.7456 5.48627 17.7063C5.49521 17.7041 5.50411 17.7018 5.51297 17.6996L7.83376 17.1194C7.84888 17.1156 7.86388 17.1119 7.87878 17.1082C8.10151 17.0528 8.29868 17.0037 8.47772 16.9023C8.65675 16.801 8.80027 16.6571 8.9624 16.4947C8.97324 16.4838 8.98416 16.4729 8.99519 16.4618L15.4785 9.97855L15.5004 9.95666C15.796 9.6611 16.0507 9.40638 16.2296 9.17534C16.4208 8.9284 16.5695 8.65435 16.5843 8.31531C16.5862 8.27179 16.5862 8.22821 16.5843 8.18469C16.5695 7.84565 16.4208 7.5716 16.2296 7.32466C16.0507 7.09362 15.796 6.8389 15.5004 6.54334L15.4785 6.52145L15.4566 6.49954C15.161 6.20396 14.9063 5.94922 14.6753 5.77034C14.4283 5.57917 14.1543 5.43041 13.8152 5.41564C13.7717 5.41374 13.7281 5.41374 13.6846 5.41564C13.3456 5.43041 13.0715 5.57917 12.8246 5.77034C12.5935 5.94922 12.3388 6.20396 12.0433 6.49955Z"/>
<path d="M11.4583 6.87484L14.2083 5.0415L16.9583 7.7915L15.1249 10.5415L11.4583 6.87484Z"/>
</svg>
<span class="mx-1">ویرایش</span>
</button>
</div>
<div class="col-4">
<button type="button" class="btn-delete" onclick="removeLeaveConfirm(${item.id}, ${item.workshopId}, ${item.employeeId})">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-linecap="round"/>
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-linecap="round"/>
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-linecap="round"/>
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-linecap="round"/>
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>
<div class="lineMobile mt-3 mb-2"></div>
</div>
</div>
</div>
</div>
</div>
`;
$('#EmployeesLeaveMobileList').append(htmlMobile);
n += 1;
});
var newPageIndex = pageIndex + response.pageIndex;
$('#pageIndex').val(newPageIndex);
}
$('.loading').hide();
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function time_format(date) {
var d = new Date(date);
hours = format_two_digits(d.getHours());
minutes = format_two_digits(d.getMinutes());
return hours + ":" + minutes;
}
function format_two_digits(n) {
return n < 10 ? '0' + n : n;
}
});
function redirectLeavePage() {
var workshopSelect = $('#workshopSelect').val();
var employeeSelect = $('#employeeSelect').val();
if (workshopSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا کارگاه را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
if (employeeSelect == '') {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا پرسنل را انتخاب کنید ...');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return false;
}
window.location.href = "/Client/Company/Employees/Leave?workshopId=" + workshopSelect + "&employeeId=" + employeeSelect;
}
function EditLeaveRedirect(id) {
var workshopSelect = $('#workshopSelect').val();
var employeeSelect = $('#employeeSelect').val();
var parametr = '&editId=' + id;
var url = "/Client/Company/Employees/Leave?workshopId=" + workshopSelect + "&employeeId=" + employeeSelect;
window.location.href = url + parametr;
}
function goToLeaveWorkshop(slug) {
var url = "/Client/Company/Employees/Leave/" +slug+"/";
window.location.href = url;
}

View File

@@ -0,0 +1,163 @@
$(document).ready(function () {
$('#timerCount').hide();
$('.codeInput').val('');
});
//******************** حرکت اتوماتیک اینپوت به اینپوت دیگر مربوط به کد برای ورود و انتخاب اینپوت برای انتخاب کردن ********************
//حرکت اتوماتیک
$('.codeInput').keyup(function (e) {
if (this.value.length === this.maxLength) {
let next = $(this).data('next');
$('#n' + next).focus();
$('#n' + next).select();
}
//وقتی کد ورودی وارد شد، اتوماتیک ورود میشود
if ($('#n0').val() && $('#n1').val() && $('#n2').val() && $('#n3').val() && $('#n4').val() && $('#n5').val()) {
console.log($('#n1').val());
//$('#btn-login-code').trigger('click');
confirmCodeToLogin();
}
});
//انتخاب متن هنگام کلیک کردن بر روی اینپوت
$(".codeInput").click(function () {
$(this).select();
});
//******************** حرکت اتوماتیک اینپوت به اینپوت دیگر مربوط به کد برای ورود و انتخاب اینپوت برای انتخاب کردن ********************
//******************** عملیات ورود با موبایل و دریافت کد ********************
//فقط عدد وارد کنه
$('#codeInput').on('keyup', function () {
this.value = this.value.replace(/[^\d]/, '');
});
function codeTimer() {
$('.codeInput').val('');
$('#btn-login-code').show();
$('#timerCount').show();
$('.otp').show();
$('.loading').hide();
$('#msg').hide();
$('#n0').focus();
var timer2 = "2:00";
var interval = setInterval(function () {
var timer = timer2.split(':');
//by parsing integer, I avoid all extra string processing
var minutes = parseInt(timer[0], 10);
var seconds = parseInt(timer[1], 10);
--seconds;
minutes = (seconds < 0) ? --minutes : minutes;
if (minutes < 0) clearInterval(interval);
seconds = (seconds < 0) ? 59 : seconds;
seconds = (seconds < 10) ? '0' + seconds : seconds;
//minutes = (minutes < 10) ? minutes : minutes;
$('.countdown').html(minutes + ':' + seconds);
timer2 = minutes + ':' + seconds;
// ||
if (timer2 === "0:00" && !$('#passDiv').hasClass("showPassDiv")) {
//دکمه ورود مخفی میشود
$('#btn-login-code').hide();
//اینپوت برای وارد کردن کدها خالی میشود
$('.codeInput').val('');
//دکمه برای دریافت کد باز میشود
$('#btnSmsReciver').show();
$('.loading').hide();
$('#timerCount').hide();
$('.otp').hide();
$('#msg').show();
}
}, 1000);
}
$('#btnSmsReciver').on("click", function () {
$('.loading').show();
$('#btnSmsReciver').hide();
sendVervifyCode();
});
function sendVervifyCode() {
$.ajax({
dataType: 'json',
type: 'POST',
url: sendSmsAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
if (response.isSuccess) {
codeTimer()
} else {
$('.loading').hide();
$('#btnSmsReciver').show();
}
},
failure: function (response) {
console.log(5, response);
}
});
}
function confirmCodeToLogin() {
let no0 = $('#n0').val();
let no1 = $('#n1').val();
let no2 = $('#n2').val();
let no3 = $('#n3').val();
let no4 = $('#n4').val();
let no5 = $('#n5').val();
var code = no0 + no1 + no2 + no3 + no4 + no5;
if (code.length == 6) {
$('.loading').show();
setTimeout(function () {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: checkCodeAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: {
'code': code
},
success: function (response) {
if (response.exist === true) {
$('#passDiv').show();
$('#passDiv').addClass("showPassDiv");
$('.loading').hide();
$('#timerCount').hide();
$('.otp').hide();
$('#btn-login-code').hide();
$('#submitPass').show();
$('.password').val('');
$('#msg').hide();
} else {
$('.loading').hide();
$('.alert-msg').show();
$('.alert-msg p').text('کد وارد شده صحیح نیست');
}
},
failure: function (response) {
console.log(5, response);
}
});
}, 1000);
} else {
$('.loading').hide();
$('.alert-msg').show();
$('.alert-msg p').text('کد وارد شده کمتر از 6 رقم است');
}
}
//******************** عملیات ورود با موبایل و دریافت کد ********************

View File

@@ -1,30 +1,53 @@
$(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl"
});
var dateIndex = 0;
var width = $(document).width();
var height = $(document).height();
var hasData = true;
$('.loadingButton').on('click', function () {
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();
});
$(document).ready(function () {
$(".select2Option").select2({
language: "fa",
dir: "rtl"
});
$(document).on('click', ".openAction", function () {
$(this).next().find(".operations-btns").slideToggle(500);
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
});
$('.loadingButton').on('click', function () {
var button = $(this);
var loadingDiv = button.find('.loading');
loadingDiv.show();
});
$(document).on('click', ".openAction", function () {
$(this).next().find(".operations-btns").slideToggle(500);
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
});
var filterEmployeeId = $('#AccountId').val();
var filterStart = $('#StartDate').val().trim();
var filterEnd = $('#EndDate').val().trim();
var filterEmployeeId = $('#employeeSelect').val();
var filterStart = $('#StartDate').val().trim();
var filterEnd = $('#EndDate').val().trim();
if (filterEmployeeId != 0 || filterStart != '' || filterEnd != '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
}
if (filterEmployeeId != 0 || filterStart != '' || filterEnd != '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
}
});
$(document).ready(function () {
var stickyMain = $('.stickyMain');
var stickyElements = $('.sticky');
$(window).scroll(function () {
stickyElements.each(function () {
var scrollTop = $(window).scrollTop();
var elementOffset = $(this).offset().top;
if (scrollTop >= elementOffset - stickyMain.outerHeight()) {
$(this).addClass('is-sticky');
} else {
$(this).removeClass('is-sticky');
}
});
});
});
@@ -35,80 +58,370 @@ const selectedAll = document.querySelectorAll(".wrapper-dropdown");
var wrapperDropdown = $(".wrapper-dropdown");
$(document).ready(function () {
wrapperDropdown.on("click", function () {
var dropdown = $(this);
var optionsContainer = dropdown.children(".dropdown");
var optionsList = optionsContainer.find(".item");
wrapperDropdown.on("click", function () {
var dropdown = $(this);
var optionsContainer = dropdown.children(".dropdown");
var optionsList = optionsContainer.find(".item");
dropdown.toggleClass("active");
dropdown.toggleClass("active");
if (dropdown.hasClass("active")) {
wrapperDropdown.not(this).removeClass("active");
}
if (dropdown.hasClass("active")) {
wrapperDropdown.not(this).removeClass("active");
}
optionsList.on("click", function () {
var selectedOption = $(this);
var valueData = selectedOption.data("value");
optionsList.on("click", function () {
var selectedOption = $(this);
var valueData = selectedOption.data("value");
dropdown.removeClass("active");
dropdown.find(".selected-display").text(selectedOption.text());
$("#sendSorting").val(valueData);
dropdown.removeClass("active");
dropdown.find(".selected-display").text(selectedOption.text());
$("#sendSorting").val(valueData);
optionsList.removeClass("active");
selectedOption.addClass("active");
});
});
optionsList.removeClass("active");
selectedOption.addClass("active");
});
});
var defaultValue = $("#sendSorting").val();
if (defaultValue) {
var defaultValue = $("#sendSorting").val();
if (defaultValue) {
let defaultItem = $(".dropdown").find(".item[value-data='" + defaultValue + "']");
defaultItem.addClass("active");
var selectedDisplay = wrapperDropdown.find(".selected-display");
selectedDisplay.text(defaultItem.text());
}
let defaultItem = $(".dropdown").find(".item[value-data='" + defaultValue + "']");
defaultItem.addClass("active");
var selectedDisplay = wrapperDropdown.find(".selected-display");
selectedDisplay.text(defaultItem.text());
}
$('.btn-search-click').click(function () {
var filterEmployeeId = $('#employeeSelect').val();
var filterStart = $('#StartDate').val().trim();
var filterEnd = $('#EndDate').val().trim();
if (filterEmployeeId !== 0 || filterStart !== '' || filterEnd !== '') {
$('.btn-clear-filter').removeClass('disable');
} else {
$('.btn-clear-filter').addClass('disable');
}
hasData = true;
dateIndex = 0;
$('#caseHistoryLoadData').html('');
caseHistoryLoadAjax();
loadUntilHeightExceeds();
});
});
$('.dropdown-days .item').on("click", function () {
let dataVal = $(this).attr("value-data-normal");
console.log(dataVal);
if (dataVal === "OneDay") {
// $('#endDateRollcall').removeClass('d-flex');
$('#endDateRollcall').addClass('d-none');
} else {
// $('#endDateRollcall').addClass('d-flex');
$('#endDateRollcall').removeClass('d-none');
}
// $('#dropdown-RollcallDate').val(dataVal);
let dataVal = $(this).attr("value-data-normal");
if (dataVal === "OneDay") {
// $('#endDateRollcall').removeClass('d-flex');
$('#endDateRollcall').addClass('d-none');
$('#StartDate').attr("placeholder", "تاریخ");
$('#StartDate').val('');
$('#EndDate').val('');
} else {
// $('#endDateRollcall').addClass('d-flex');
$('#endDateRollcall').removeClass('d-none');
$('#StartDate').attr("placeholder", "تاریخ شروع");
$('#StartDate').val('');
$('#EndDate').val('');
}
// $('#dropdown-RollcallDate').val(dataVal);
});
var sendDropdownNormal = $("#sendSorting").val();
if (sendDropdownNormal) {
let itemDropdownNormal = $(".dropdown-normal").find(".item[value-data-normal='" + sendDropdownNormal + "']");
itemDropdownNormal.addClass("active");
var selectedNormalDisplay = $(".wrapper-dropdown-normal").find(".selected-display");
selectedNormalDisplay.text(itemDropdownNormal.text());
let itemDropdownNormal = $(".dropdown-normal").find(".item[value-data-normal='" + sendDropdownNormal + "']");
itemDropdownNormal.addClass("active");
var selectedNormalDisplay = $(".wrapper-dropdown-normal").find(".selected-display");
selectedNormalDisplay.text(itemDropdownNormal.text());
}
var sendDropdownYear = $("#sendDropdownYear").val();
if (sendDropdownYear) {
let itemDropdownYear = $(".dropdown-year").find(".item[value-data-year='" + sendDropdownYear + "']");
itemDropdownYear.addClass("active");
var selectedYearDisplay = $(".wrapper-dropdown-year").find(".selected-display");
selectedYearDisplay.text(itemDropdownYear.text());
let itemDropdownYear = $(".dropdown-year").find(".item[value-data-year='" + sendDropdownYear + "']");
itemDropdownYear.addClass("active");
var selectedYearDisplay = $(".wrapper-dropdown-year").find(".selected-display");
selectedYearDisplay.text(itemDropdownYear.text());
}
var sendDropdownMonth = $("#sendDropdownMonth").val();
if (sendDropdownMonth) {
let itemDropdownMonth = $(".dropdown-month").find(".item[value-data-month='" + sendDropdownMonth + "']");
itemDropdownMonth.addClass("active");
var selectedMonthDisplay = $(".wrapper-dropdown-month").find(".selected-display");
selectedMonthDisplay.text(itemDropdownMonth.text());
let itemDropdownMonth = $(".dropdown-month").find(".item[value-data-month='" + sendDropdownMonth + "']");
itemDropdownMonth.addClass("active");
var selectedMonthDisplay = $(".wrapper-dropdown-month").find(".selected-display");
selectedMonthDisplay.text(itemDropdownMonth.text());
}
$(".date").on('input', function () {
var value = $(this).val();
$(this).val(convertPersianNumbersToEnglish(value));
}).mask("0000/00/00");
var value = $(this).val();
$(this).val(convertPersianNumbersToEnglish(value));
}).mask("0000/00/00");
//setInterval(caseHistoryLoadAjax, 1000);
var dateEmployeeIndex = null;
function caseHistoryLoadAjax() {
var filterEmployeeId = $('#employeeSelect').val();
var filterStart = $('#StartDate').val().trim();
var filterEnd = $('#EndDate').val().trim();
var html = "";
var isHolidyColor = 'garyHolidy';
var data = {
dateIndex: dateIndex,
employeeId: filterEmployeeId,
startDate: filterEnd !== '' ? filterStart : '',
endDate: filterEnd,
exactDateFa: filterEnd === '' ? filterStart : '',
dateEmployeeIndex: dateEmployeeIndex
};
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: caseHistoryAjaxLoadData,
data: data,
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
var caseHistoryData = response.data;
var caseHistoryEmployeeData = response.dataEmployee;
if (response.isSuccedded) {
if (caseHistoryData == null) {
//if (caseHistoryEmployeeData) {
console.log(caseHistoryEmployeeData);
hasData = false;
//} else {
// hasData = false;
//}
} else {
if (caseHistoryData.dateFa !== null) {
html += `
<div class="Rtable-row Rtable-row--head align-items-center d-flex sticky" style="background: #58B3B3;border: none !important;">
<div class="col-4 text-start">
<div class="Rtable-cell column-heading">
${caseHistoryData.dayOfWeekFa}
${caseHistoryData.isHoliday ? `<span class="mx-1" style="">(تعطیل)</span>` : ``}
</div>
</div>
<div class="col-4 text-center">
<div class="Rtable-cell column-heading text-center">${caseHistoryData.dateFa}</div>
</div>
<div class="col-4"></div>
</div>
`;
$.each(caseHistoryData.activeEmployees,
function (i, item) {
html += `
<div class="Rtable-row align-items-center position-relative openAction ${caseHistoryData.isHoliday ? isHolidyColor : ``} ${item.hasLeave ? `leaveItem` : ``} ${!caseHistoryData.isHoliday && !item.hasLeave && item.isAbsent ? `absenceItem` : ``}">
<div class="Rtable-cell width1">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
${i + 1}
</div>
</div>
</div>
<div class="Rtable-cell width2">
<div class="Rtable-cell--heading d-none">نام پرسنل</div>
<div class="Rtable-cell--content">
${item.employeeFullName}
</div>
</div>
<div class="Rtable-cell width3 d-none d-md-block">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">شماره پرسنلی: </div>
<div class="d-flex ms-1">${item.personnelCode}</div>
</div>
</div>
<div class="Rtable-cell width4 position-relative bg-filter d-none d-md-block">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">تاخیر در ورود: </div>
<div class="d-flex ms-1">-</div>
</div>
</div>
<div class="Rtable-cell width5 position-relative bg-filter text-center d-none d-md-block">`;
if (item.rollCallTimesList.length > 0) {
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div class="Rtable-cell--heading d-md-none d-none">ساعت ورود</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>${itemTime.startDate ?? `-`}</div>
</div>`;
});
} else {
html += `<div class="Rtable-cell--heading d-md-none d-none">ساعت ورود</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>-</div>
</div>`;
}
html += `</div>
<div class="Rtable-cell width6 position-relative bg-filter text-center d-none d-md-block">`;
if (item.rollCallTimesList.length > 0) {
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div class="Rtable-cell--heading d-md-none d-none">ساعت خروج</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>${itemTime.endDate ?? `-`}</div>
</div>`;
});
} else {
html += `<div class="Rtable-cell--heading d-md-none d-none">ساعت خروج</div>
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>-</div>
</div>`;
}
html += `</div>
<div class="Rtable-cell position-relative width7 bg-filter d-none d-md-block">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">تجمیع در خروج: </div>
<div class="d-flex ms-1">-</div>
</div>
</div>
<div class="Rtable-cell position-relative width8 bg-filter d-none d-md-block">
<div class="Rtable-cell--content text-center">
<div class="d-md-none d-none">مجموع ساعات کاری: </div>
<div class="d-flex ms-1">${item.totalWorkingHours}</div>
</div>
</div>`;
html +=
`<div class="width3 d-block d-md-none" style="width:1% !important;border-right: 1px dashed #CACACA;padding: 0 20px 0 7px;">-</div>`;
if (item.rollCallTimesList.length > 0) {
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div class="width4 d-block d-md-none" style="width:18% !important">
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>${itemTime.startDate ?? "-"}</div>
</div>
</div>`;
});
} else {
html += `<div class="width4 d-block d-md-none" style="width:18% !important">
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>-</div>
</div>
</div>`;
}
if (item.rollCallTimesList.length > 0) {
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div class="width4 d-block d-md-none" style="width:18% !important">
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>${itemTime.endDate ?? "-"}</div>
</div>
</div>`;
});
} else {
html += `<div class="width4 d-block d-md-none" style="width:18% !important">
<div style="direction: ltr; z-index: 6; position: relative" class="Rtable-cell--content text-center">
<div>-</div>
</div>
</div>`;
}
html +=
`<div class="width3 d-block d-md-none" style="width:1% !important;padding: 0 0 0 20px;">-</div>`;
html += `</div>`;
if (!(!item.hasLeave && item.isAbsent)) {
html += `<div class="operation-div d-md-none d-block w-100">
<div class="operations-btns rollcall-operations-mobile">
<div class="row align-items-center">
<div class="col-6">
<div class="d-md-none d-flex align-items-center position-relative">
<div class="Rtable-cell--content">
شماره پرسنل: ${item.personnelCode}
</div>
</div>
</div>
<div class="col-6">
<div class="d-md-none d-flex align-items-center position-relative">
<div class="Rtable-cell--content">
مجموع ساعات کارکرد: ${item.totalWorkingHours}
</div>
</div>
</div>
</div>
</div>
</div>
</div>`;
}
});
dateIndex++;
$('#caseHistoryLoadData').append(html);
} else {
hasData = false;
}
}
} else {
hasData = false;
}
},
failure: function (response) {
console.log(response);
hasData = false;
}
});
}
function loadUntilHeightExceeds() {
var heightCard = $('#containerHeight').height();
while (heightCard < height && hasData) {
caseHistoryLoadAjax();
heightCard = $('#containerHeight').height();
}
}
if (hasData) {
loadUntilHeightExceeds();
}
//$(window).on('scroll', function () {
// if ($(window).scrollTop() + $(window).height() >= $(document).height()) {
// caseHistoryLoadAjax();
// }
//});
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) {
caseHistoryLoadAjax();
}
//if ($(this).scrollTop() > 100) {
// $('.goToTop').show().fadeIn();
//} else {
// $('.goToTop').fadeOut().hide();
//}
});

View File

@@ -9,4 +9,194 @@
$(this).next().find(".operations-btns").slideToggle(500);
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
});
});
$(document).on('click', ".btnRollCallStatus", function () {
var index = $(this).index();
$('.btnRollCallStatus').removeClass('active');
$(this).addClass('active');
});
loadRollCallStatus('all');
loadRollCallCount();
});
function loadRollCallCount() {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: `${loadRollCallAbsentLeaveCountAjax}`,
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
success: function (response) {
$('#leaveCount').text(response.leaveEmployeesCount);
$('#absentCount').text(response.absentEmployeesCount);
},
failure: function (response) {
console.log(response);
}
});
}
function loadRollCallStatus(type) {
console.log(type);
var index = 1;
var html = '';
let colorDivStyle = '';
switch (type) {
case "leave":
colorDivStyle = "leaveItem";
break;
case "absent":
colorDivStyle = "absenceItem";
break;
default:
colorDivStyle = "";
}
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: `${loadRollCallMoreAjax}`,
data: {
type: type
},
headers: { "RequestVerificationToken": `${antiForgeryToken}` },
success: function (response) {
console.log(response);
var responseData = response.data;
if (responseData.length > 0) {
responseData.forEach(function (item) {
// html += `<div class="Rtable-row Rtable-row--head align-items-center">
// <div class="Rtable-cell column-heading d-block width1">ردیف</div>
// <div class="Rtable-cell column-heading d-block width6">تاریخ ایجاد</div>
// <div class="Rtable-cell column-heading d-block width3">تاریخ سررسید</div>
// <div class="Rtable-cell column-heading d-block width4">طرف حساب</div>
// <div class="Rtable-cell column-heading d-block width5">عنوان وظیفه</div>
// <div class="Rtable-cell column-heading d-block width7 text-end">عملیات</div>
//</div>`;
html += `<div></div>
<div class="Rtable-row align-items-center position-relative openAction ${colorDivStyle}">
<div class="Rtable-cell width1" style="width:5%">
<div class="Rtable-cell--heading d-none">
ردیف
</div>
<div class="Rtable-cell--content">
<div class="d-flex justify-content-center align-items-center table-number">
${index++}
</div>
</div>
</div>
<div class="Rtable-cell width2" style="width:30%">
<div class="Rtable-cell--content text-start" style="overflow:hidden; display: inline; text-overflow: ellipsis; white-space: nowrap; line-height: 30px;">
${item.employeeFullName}
</div>
</div>`;
if (type !== "all") {
html += `<div class="Rtable-cell width2" style="width:5%">
<div class="Rtable-cell--content text-start" style="overflow:hidden; display: inline; text-overflow: ellipsis; white-space: nowrap; line-height: 30px;">
<div class="">شماره پرسنلی: ${item.personnelCode}</div>
</div>
</div>`;
}
if (type === "all") {
html += `<div class="width3" style="width:1%;border-right: 1px dashed #CACACA;padding: 7px;">-</div>`;
html += `<div class="width3" style="width:18%">`;
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div style="direction: ltr;" class="Rtable-cell--content d-block text-center">
<div>${itemTime.startDate}</div>
</div>`;
});
html += `</div>`;
html += `<div class="width4" style="width:18%">`;
item.rollCallTimesList.forEach(function (itemTime) {
html += `<div style="direction: ltr;" class="Rtable-cell--content d-block text-center">
<div>${itemTime.endDate == null ? "-" : itemTime.endDate}</div>
</div>`;
});
html += `</div>`;
html += `<div class="width3" style="width:1%;border-left: 1px dashed #CACACA;padding: 7px;">-</div>`;
html += `<div class="Rtable-cell d-md-none d-block width6 text-end" style="width:10%">
<button class="btn-rollcall-more position-relative">
<span class="align-items-center d-flex justify-content-center">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
</svg>
</span>
</button>
</div>`;
}
html += `</div>`;
if (type === "all") {
const hasLastEndDate = item.rollCallTimesList.map(itemTime => itemTime.endDate).filter(endDate => endDate === null).pop() !== undefined;
html += `<div class="operation-div d-md-none d-block w-100">
<div class="operations-btns rollcall-operations-mobile">
<div class="row align-items-center">
<div class="col-6">
<div class="d-md-none d-flex align-items-center position-relative">
<div class="Rtable-cell--content">
شماره پرسنل: ${item.personnelCode}
</div>
</div>
</div>
<div class="col-6">
<div class="d-md-none d-flex align-items-center position-relative">
<div class="Rtable-cell--content">
مجموع ساعات کارکرد: ${hasLastEndDate
? `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 12L18.1254 16.1694C18.6725 16.5418 19 17.1608 19 17.8227V20.5C19 20.7761 18.7761 21 18.5 21H5.5C5.22386 21 5 20.7761 5 20.5V17.8227C5 17.1608 5.32746 16.5418 5.87462 16.1694L12 12ZM12 12L18.1254 7.83062C18.6725 7.45819 19 6.83917 19 6.17729V3.5C19 3.22386 18.7761 3 18.5 3H5.5C5.22386 3 5 3.22386 5 3.5V6.17729C5 6.83917 5.32746 7.45819 5.87462 7.83062L12 12Z" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M15 20.2071V20.85C15 20.9328 14.9328 21 14.85 21H9.15C9.06716 21 9 20.9328 9 20.85V20.2071C9 20.0745 9.05268 19.9473 9.14645 19.8536L11.4343 17.5657C11.7467 17.2533 12.2533 17.2533 12.5657 17.5657L14.8536 19.8536C14.9473 19.9473 15 20.0745 15 20.2071Z" fill="#13AEAE"/>
<path d="M12 11L17 8H7L12 11Z" fill="#13AEAE"/>
<path d="M12 18V12" stroke="#13AEAE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>`
: `${item.totalWorkingHours}`
}
</div>
</div>
</div>
</div>
</div>
</div>
</div>`;
}
});
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>`;
}
$('#loadRollCallTypeAjax').html(html);
},
failure: function (response) {
console.log(response);
}
});
}

View File

@@ -7,6 +7,10 @@ $(document).ready(function () {
});
$(document).ready(function () {
if (!hasCameraAccount) {
window.location.href = saveCameraAccountUrl;
}
$('.loadingButton').on('click', function () {
var button = $(this);
var loadingDiv = button.find('.loading');

View File

@@ -16,4 +16,58 @@ function choosePlaneFree() {
$('.alert-msg p').text('');
}, 3500);
}
}
}
$(document).on('click', '.gwb-card', function () {
var index = $(this).index();
var $clickedCard = $(this).find('.click');
$('.click').removeClass('active');
$clickedCard.addClass('active');
var isPaymentBoxVisible = $('#paymentIncDecBox').is(':visible');
var isPackageVisible = $('.card-grid-package').is(':visible');
$('.card-grid-package').slideUp("slow");
$('#paymentIncDecBox').slideUp("slow");
if (index === 2) {
if (!isPaymentBoxVisible) {
$('#paymentIncDecBox').slideDown("slow");
}
} else {
if (!isPackageVisible) {
$('.card-grid-package').slideDown("slow");
}
}
})
$(document).ready(function () {
$(document).on('click', '.increment', function () {
var $input = $(this).siblings('.increDecreInput');
var currentValue = parseInt($input.val());
$input.val(currentValue + 1);
updateTotalAmount(currentValue + 1);
$('#addMaxPerson').text(Number($('#addMaxPerson').text()) + 1);
});
$(document).on('click', '.decrement', function () {
var $input = $(this).siblings('.increDecreInput');
var currentValue = parseInt($input.val());
if (currentValue > 0) {
$input.val(currentValue - 1);
updateTotalAmount(currentValue - 1);
$('#addMaxPerson').text(Number($('#addMaxPerson').text()) - 1);
}
});
function updateTotalAmount(quantity) {
var pricePerPerson = 350000;
var totalAmount = quantity * pricePerPerson;
$('.increDecreTxt3').text(totalAmount.toLocaleString() + ' تومان');
}
});