Compare commits

..

55 Commits

Author SHA1 Message Date
b2cb3ae173 finish employee unauthorized 2025-06-22 15:05:38 +03:30
a6c25ec8e8 complete front but backend still not finished 2025-06-19 13:51:05 +03:30
7b2eefa954 create employee without auth for client p1 - not finished 2025-06-18 15:31:13 +03:30
3303d4b54a Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-17 13:47:41 +03:30
dba28b4d89 add move task changer in tester 2025-06-16 21:47:28 +03:30
SamSys
41ec3fb9cf InsuranceDeduction OverTime added for checkout 2025-06-16 17:58:55 +03:30
SamSys
7f98cf8f12 Create checkou bug fixed 2025-06-16 13:22:14 +03:30
SamSys
6c8385061e change 2025-06-15 21:02:26 +03:30
SamSys
a49467ee44 EmployeeComputeOption and Workshop new options merged 2025-06-15 21:02:07 +03:30
e9907650e9 fix - connected personnel on get to show the create and sign options for contract and checkout 2025-06-15 20:05:54 +03:30
SamSys
0e66c5e1a0 SaveRollcall checkout merged 2025-06-15 19:16:44 +03:30
SamSys
27a92f5796 changes 2025-06-15 14:32:48 +03:30
6e5788074c fix goverment list calculation for insurance 2025-06-12 00:27:42 +03:30
831b426f9f initialize options for create and sign in checkout and contract 2025-06-11 21:07:36 +03:30
b29b1335d3 finish saving rollcall to original 2025-06-11 19:00:17 +03:30
SamSys
befcc70d46 Client Sidebar bug fixed 2025-06-11 15:34:40 +03:30
SamSys
f249df5b49 RotatingShiftReport And Compute Changed - StaticWorkongHoures Interference bug fixed 2025-06-10 20:02:50 +03:30
24d41ffc68 add rollcall to checkout 2025-06-10 19:10:33 +03:30
SamSys
c6d4d7d473 add checkoutSaveData in MandatoryCompute 2025-06-09 18:46:46 +03:30
c594cbf523 change checkout application 2025-06-09 17:47:23 +03:30
996adec188 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-09 16:52:17 +03:30
6f47948e40 merge from goverment list calculation 2025-06-09 16:52:10 +03:30
SamSys
d135eb73ea Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-09 16:45:30 +03:30
SamSys
86143a044c report bug fixed 2025-06-09 16:45:23 +03:30
8a6d4e0af6 add insurance list changes 2025-06-09 16:38:46 +03:30
3b2fd137e4 fix some style bug 2025-06-09 16:37:57 +03:30
52976d8965 add calculation for create checkout 2025-06-09 16:07:22 +03:30
ec97274d5e add checkout rollcall domain to Checkout 2025-06-09 15:07:06 +03:30
c9183fb57e add goverment list calculation 2025-06-09 13:51:31 +03:30
SamSys
c4d21be4aa new inurancelist bug fixed - FiexedSalary changes added 2025-06-08 16:20:30 +03:30
SamSys
e9386708dc Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-08 16:17:16 +03:30
SamSys
d70abb60d7 guid for application download link 2025-06-08 16:17:08 +03:30
2098e843a5 fix conflict 2025-06-08 16:10:03 +03:30
f6b6dfa046 merge from team work 2025-06-08 16:04:54 +03:30
36cdde7e6a change insurance govermentlist 2025-06-08 14:32:43 +03:30
SamSys
34358a36c9 change upload apk 2025-06-07 19:21:34 +03:30
SamSys
babecda188 add new permission to InsuranceList 2025-06-07 16:09:50 +03:30
SamSys
98c3e7c821 New-Insurance-Opration Merged 2025-06-05 02:05:24 +03:30
SamSys
5d91b29f2b Create File Bug Fixed 2025-06-03 21:45:20 +03:30
SamSys
c948498307 merged changes 2025-06-03 21:27:14 +03:30
87b0d248a3 Convert checkoutPrintOne to CheckoutPrintAll for best performance 2025-06-03 19:38:18 +03:30
a410d0c216 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-03 19:11:52 +03:30
a640f91703 fix leave hours bugs 2025-06-03 19:11:44 +03:30
SamSys
99c8dcb764 add comment to InsuranceList metod 2025-06-03 16:32:12 +03:30
f35aca8e44 add migration 2025-06-02 22:48:59 +03:30
16d45c6dc4 merge from master 2025-06-02 22:21:30 +03:30
45e746b194 merge from team work 2025-06-02 22:20:04 +03:30
SamSys
d44935329f checkoutBug Fixed 2025-06-02 22:06:41 +03:30
SamSys
3a7fc7087b changesAuthHelper 2025-06-02 22:05:21 +03:30
925f43214c fix checkout bug 2025-06-02 22:02:33 +03:30
SamSys
c2fc7dabc1 print bug fixed 2025-06-02 21:38:56 +03:30
SamSys
dec5666eb7 changes 2025-06-02 21:37:27 +03:30
MahanCh
f04749043e start new insurancelist operations 2025-05-21 18:25:09 +03:30
MahanCh
e8a9a674a1 merge from job Item 2025-05-21 15:54:53 +03:30
MahanCh
d8b6b0f5e8 New Operation InsuranceList Started! 2025-05-21 15:53:05 +03:30
154 changed files with 69131 additions and 22315 deletions

View File

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

View File

@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using Microsoft.EntityFrameworkCore.Design.Internal;
@@ -14,7 +12,8 @@ public class BaseCustomizeEntity : EntityBase
}
public BaseCustomizeEntity(FridayPay fridayPay, OverTimePay overTimePay,
BaseYearsPay baseYearsPay, BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays,List<WeeklyOffDay> weeklyOffDays)
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
FridayWork fridayWork, HolidayWork holidayWork, BreakTime breakTime,int leavePermittedDays)
{
FridayPay = fridayPay;
@@ -30,10 +29,10 @@ public class BaseCustomizeEntity : EntityBase
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BreakTime = breakTime;
LeavePermittedDays = leavePermittedDays;
WeeklyOffDays = weeklyOffDays.Select(x=> new WeeklyOffDay(x.DayOfWeek)).ToList();
}
/// <summary>
@@ -118,28 +117,4 @@ public class BaseCustomizeEntity : EntityBase
public BreakTime BreakTime { get; protected set; }
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
public void FridayWorkToWeeklyDayOfWeek()
{
if (FridayWork == FridayWork.Default && !WeeklyOffDays.Any(x => x.DayOfWeek == DayOfWeek.Friday))
{
WeeklyOffDays.Add(new WeeklyOffDay(DayOfWeek.Friday));
}
}
}
public class WeeklyOffDay
{
public WeeklyOffDay(DayOfWeek dayOfWeek)
{
DayOfWeek = dayOfWeek;
}
public long Id { get; set; }
public DayOfWeek DayOfWeek { get; set; }
public long ParentId { get; set; }
}

View File

@@ -4,12 +4,13 @@ using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.Media
{
public interface IMediaApplication
{
MediaViewModel Get(long id);
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength, List<string> allowedExtensions);
OperationResult MoveFile(long mediaId, string newRelativePath);
OperationResult DeleteFile(long mediaId);
List<MediaViewModel> GetRange(IEnumerable<long> select);
}
public interface IMediaApplication
{
MediaViewModel Get(long id);
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
List<string> allowedExtensions, string category);
OperationResult MoveFile(long mediaId, string newRelativePath);
OperationResult DeleteFile(long mediaId);
List<MediaViewModel> GetRange(IEnumerable<long> select);
}
}

View File

@@ -9,147 +9,113 @@ using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application
{
public class MediaApplication:IMediaApplication
{
public class MediaApplication : IMediaApplication
{
private const string _basePath = "Medias";
private readonly IMediaRepository _mediaRepository;
private const string _basePath = "Medias";
private readonly IMediaRepository _mediaRepository;
public MediaApplication(IMediaRepository mediaRepository)
{
_mediaRepository = mediaRepository;
}
public MediaApplication(IMediaRepository mediaRepository)
{
_mediaRepository = mediaRepository;
}
/// <summary>
/// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
/// </summary>
/// <param name="file">فایل</param>
/// <param name="fileLabel">برچسب فایل که در نام فایل ظاهر می شود</param>
/// <param name="relativePath">مسیر فایل</param>
/// <param name="allowedExtensions">[.png,.jpg,.jpeg] پسوند های مجاز مثلا </param>
/// <param name="maximumFileLength">حداکثر حجم فایل به مگابایت</param>
/// <returns></returns>
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath,int maximumFileLength,List<string> allowedExtensions)
{
OperationResult op = new();
var path = Path.Combine(_basePath, relativePath);
var fileExtension = Path.GetExtension(file.FileName);
if (file == null || file.Length == 0)
return op.Failed("خطای سیستمی");
if (file.Length > (maximumFileLength * 1024 * 1024))
return op.Failed($"حجم فایل نمی تواند بیشتر از " +
$"{maximumFileLength}" +
$"مگابایت باشد");
if (!allowedExtensions.Contains(fileExtension.ToLower()))
{
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
operationMessage += "\n";
operationMessage += string.Join(" ", allowedExtensions);
return op.Failed(operationMessage);
}
/// <summary>
/// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
/// </summary>
/// <param name="file">فایل</param>
/// <param name="fileLabel">برچسب فایل که در نام فایل ظاهر می شود</param>
/// <param name="relativePath">مسیر فایل</param>
/// <param name="maximumFileLength">حداکثر حجم فایل به مگابایت</param>
/// <param name="allowedExtensions">[.png,.jpg,.jpeg] پسوند های مجاز مثلا </param>
/// <param name="category"></param>
/// <returns></returns>
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
List<string> allowedExtensions, string category)
{
return _mediaRepository.UploadFile(file, fileLabel, relativePath, maximumFileLength, allowedExtensions, category);
}
Directory.CreateDirectory(path);
/// <summary>
/// حذف فایل
/// </summary>
public OperationResult DeleteFile(long mediaId)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
if (media == null)
return op.Failed("رکورد مورد نظر یافت نشد");
try
{
if (File.Exists(media.Path))
File.Delete(media.Path);
else
return op.Failed("فایل یافت نشد");
}
catch
{
return op.Failed("خطایی در حذف فایل رخ داده است");
}
var extension = Path.GetExtension(file.FileName);
_mediaRepository.Remove(media.id);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
var filePath = Path.Combine(path, uniqueFileName);
using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
{
file.CopyTo(fileStream);
}
var mediaEntity = new Media(filePath, extension, "فایل", "EmployeeDocuments");
_mediaRepository.Create(mediaEntity);
_mediaRepository.SaveChanges();
/// <summary>
/// جابجا کردن فایل
/// </summary>
public OperationResult MoveFile(long mediaId, string newRelativePath)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine(_basePath, newRelativePath);
Directory.CreateDirectory(path);
return op.Succcedded(mediaEntity.id);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
try
{
File.Move(oldPath, filepath);
}
catch
{
return op.Failed("در جابجایی فایل خطایی رخ داده است");
}
}
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
public MediaViewModel Get(long id)
{
var media = _mediaRepository.Get(id);
if (media == null)
return new();
return new MediaViewModel()
{
Category = media.Category,
Path = media.Path,
Id = media.id,
Type = media.Type
};
}
/// <summary>
/// حذف فایل
/// </summary>
public OperationResult DeleteFile(long mediaId)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
if (media == null)
return op.Failed("رکورد مورد نظر یافت نشد");
try
{
if (File.Exists(media.Path))
File.Delete(media.Path);
else
return op.Failed("فایل یافت نشد");
}
catch
{
return op.Failed("خطایی در حذف فایل رخ داده است");
}
public List<MediaViewModel> GetRange(IEnumerable<long> ids)
{
var medias = _mediaRepository.GetRange(ids);
return medias.Select(x => new MediaViewModel()
{
Category = x.Category,
Path = x.Path,
Id = x.id,
Type = x.Type,
}).ToList();
}
_mediaRepository.Remove(media.id);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
/// <summary>
/// جابجا کردن فایل
/// </summary>
public OperationResult MoveFile(long mediaId, string newRelativePath)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine(_basePath, newRelativePath);
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
try
{
File.Move(oldPath, filepath);
}
catch
{
return op.Failed("در جابجایی فایل خطایی رخ داده است");
}
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
public MediaViewModel Get(long id)
{
var media = _mediaRepository.Get(id);
if (media == null)
return new();
return new MediaViewModel()
{
Category = media.Category,
Path = media.Path,
Id = media.id,
Type = media.Type
};
}
public List<MediaViewModel> GetRange(IEnumerable<long> ids)
{
var medias = _mediaRepository.GetRange(ids);
return medias.Select(x=>new MediaViewModel()
{
Category = x.Category,
Path = x.Path,
Id = x.id,
Type = x.Type,
}).ToList();
}
}
}
}

View File

@@ -2,6 +2,7 @@
using AccountManagement.Domain.TaskAgg;
using System;
using System.Collections.Generic;
using System.Linq;
using AccountManagement.Domain.TaskMessageAgg;
namespace AccountManagement.Domain.AssignAgg;
@@ -158,4 +159,24 @@ public class Assign : EntityBase
IsDoneRequest=isDoneRequest;
DoneDescription=doneDescription;
}
public void ChangeAssignedId(long assignedId)
{
AssignedId = assignedId;
}
public void SetAssignerId(long assignerId)
{
AssignerId = assignerId;
}
public void ChangeSender(long senderId)
{
Task.SetSender(senderId);
var taskMessageItemsEnumerable =TaskMessageList.SelectMany(m => m.TaskMessageItemsList);
foreach (var taskMessageItems in taskMessageItemsEnumerable)
{
taskMessageItems.SetSenderId(senderId);
}
}
}

View File

@@ -1,12 +1,15 @@
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using AccountManagement.Application.Contracts.Media;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Domain.MediaAgg;
public interface IMediaRepository:IRepository<long,Media>
public interface IMediaRepository : IRepository<long, Media>
{
public string BasePath { get; protected set; }
void CreateMediaWithTaskMedia(long taskId, long mediaId);
List<MediaViewModel> GetMediaByTaskId(long taskId);
void Remove(long id);
@@ -23,4 +26,6 @@ public interface IMediaRepository:IRepository<long,Media>
#endregion
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
List<string> allowedExtensions, string category);
}

View File

@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using _0_Framework.Domain;
using AccountManagement.Domain.AssignAgg;
using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TaskScheduleAgg;
using OfficeOpenXml.Style;
namespace AccountManagement.Domain.TaskAgg;
@@ -80,4 +82,40 @@ public class Tasks : EntityBase
TaskScheduleId = taskScheduleId;
}
public void ChangeSender(long senderId)
{
var prevSender = SenderId;
var assigners = Assigns.Where(x => x.AssignerId == prevSender).ToList();
foreach (var assigner in assigners)
{
assigner.SetAssignerId(senderId);
}
var senderMessageItem = Assigns
.SelectMany(x=>x.TaskMessageList
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.SenderAccountId == prevSender).ToList();
var receiverMessageItem = Assigns.SelectMany(x=>x.TaskMessageList
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.ReceiverAccountId == prevSender).ToList();
SenderId = senderId;
foreach (var taskMessageItems in senderMessageItem)
{
taskMessageItems.SetSenderId(senderId);
}
foreach (var taskMessageItems in receiverMessageItem)
{
taskMessageItems.SetReceiver(senderId);
}
}
public void SetSender(long senderId)
{
SenderId = senderId;
}
}

View File

@@ -19,4 +19,13 @@ public class TaskMessageItems:EntityBase
public TaskMessage TaskMessage { get; set; }
public void SetSenderId(long senderId)
{
SenderAccountId = senderId;
}
public void SetReceiver(long receiverId)
{
ReceiverAccountId = receiverId;
}
}

View File

@@ -1,5 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Domain.AdminResponseMediaAgg;
@@ -7,27 +10,35 @@ using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TicketMediasAgg;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository;
public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
public class MediaRepository : RepositoryBase<long, Media>, IMediaRepository
{
private const string _basePath = "Storage/Medias";
public string BasePath { get; set; }
private readonly AccountContext _accountContext;
public MediaRepository( AccountContext taskManagerContext) : base(taskManagerContext)
public MediaRepository(AccountContext taskManagerContext, IWebHostEnvironment webHostEnvironment) : base(taskManagerContext)
{
_accountContext = taskManagerContext;
BasePath = webHostEnvironment.ContentRootPath + "/Storage";
}
//ساخت جدول واسط بین مدیا و نسک
//نکته: این متد ذخیره انجام نمیدهد
public void CreateMediaWithTaskMedia(long taskId, long mediaId)
{
var Taskmedias = new TaskMedia(taskId,mediaId);
var Taskmedias = new TaskMedia(taskId, mediaId);
_accountContext.Add(Taskmedias);
}
public void Remove(long id)
{
var media = Get(id);
var media = Get(id);
Remove(media);
}
@@ -77,6 +88,48 @@ public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
{
return _accountContext.Medias.Where(x => mediaIds.Contains(x.id)).ToList();
}
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
List<string> allowedExtensions, string category)
{
OperationResult op = new();
var path = Path.Combine(_basePath, relativePath);
var fileExtension = Path.GetExtension(file.FileName);
if (file == null || file.Length == 0)
return op.Failed("خطای سیستمی");
if (file.Length > (maximumFileLength * 1024 * 1024))
return op.Failed($"حجم فایل نمی تواند بیشتر از " +
$"{maximumFileLength}" +
$"مگابایت باشد");
if (!allowedExtensions.Contains(fileExtension.ToLower()))
{
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
operationMessage += "\n";
operationMessage += string.Join(" ", allowedExtensions);
return op.Failed(operationMessage);
}
Directory.CreateDirectory(path);
var extension = Path.GetExtension(file.FileName);
var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
var filePath = Path.Combine(path, uniqueFileName);
using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
{
file.CopyTo(fileStream);
}
var mediaEntity = new Media(filePath, extension, "فایل", category);
Create(mediaEntity);
SaveChanges();
return op.Succcedded(mediaEntity.id);
}
}
#endregion

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using Company.Domain.CheckoutAgg.ValueObjects;
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
using Company.Domain.WorkshopAgg;
@@ -29,7 +30,7 @@ public class Checkout : EntityBase
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
ICollection<CheckoutLoanInstallment> loanInstallments,
ICollection<CheckoutSalaryAid> salaryAids)
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
{
EmployeeFullName = employeeFullName;
FathersName = fathersName;
@@ -88,6 +89,7 @@ public class Checkout : EntityBase
TotalDayOfBunosesCompute = totalDayOfBunosesCompute;
LoanInstallments = loanInstallments;
SalaryAids = salaryAids;
CheckoutRollCall = checkoutRollCall;
}
public string EmployeeFullName { get; private set; }
@@ -196,7 +198,8 @@ public class Checkout : EntityBase
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
#endregion
public CheckoutRollCall CheckoutRollCall { get; private set; }
#endregion
public Workshop Workshop { get; set; }
@@ -308,4 +311,149 @@ public class Checkout : EntityBase
LoanInstallments = lonaInstallments;
InstallmentDeduction = installmentsAmount;
}
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
{
CheckoutRollCall = checkoutRollCall;
}
}
public class CheckoutRollCall
{
private CheckoutRollCall(){}
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
{
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
TotalPresentTimeSpan = totalPresentTimeSpan;
TotalBreakTimeSpan = totalBreakTimeSpan;
TotalWorkingTimeSpan = totalWorkingTimeSpan;
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
RollCallDaysCollection = rollCallDaysCollection;
}
/// <summary>
/// مجموع ساعت موظفی
/// </summary>
public TimeSpan TotalMandatoryTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت حضور
/// </summary>
public TimeSpan TotalPresentTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت استراحت
/// </summary>
public TimeSpan TotalBreakTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت کارکرد
/// </summary>
public TimeSpan TotalWorkingTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت مرخصی استحقاقی
/// </summary>
public TimeSpan TotalPaidLeaveTmeSpan { get; private set; }
/// <summary>
/// مجموع ساعت مرخصی استعلاجی
/// </summary>
public TimeSpan TotalSickLeaveTimeSpan { get; private set; }
/// <summary>
/// روز های حضور غیاب
/// </summary>
public ICollection<CheckoutRollCallDay> RollCallDaysCollection { get; private set; }
}
public class CheckoutRollCallDay
{
private CheckoutRollCallDay(){}
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
bool isHoliday, string leaveType)
{
Date = date;
FirstStartDate = firstStartDate;
FirstEndDate = firstEndDate;
SecondStartDate = secondStartDate;
SecondEndDate = secondEndDate;
BreakTimeSpan = breakTimeSpan;
IsSliced = isSliced;
WorkingTimeSpan = workingTimeSpan;
IsAbsent = isAbsent;
IsFriday = isFriday;
IsHoliday = isHoliday;
LeaveType = leaveType;
}
public long Id { get; set; }
/// <summary>
/// تاریخ
/// </summary>
public DateTime Date { get; private set; }
/// <summary>
/// ورود اول
/// </summary>
public string FirstStartDate { get; private set; }
/// <summary>
/// خروج اول
/// </summary>
public string FirstEndDate { get; private set; }
/// <summary>
/// ورود دوم
/// </summary>
public string SecondStartDate { get; private set; }
/// <summary>
/// خروج دوم
/// </summary>
public string SecondEndDate { get; private set; }
/// <summary>
/// ساعت استراحت
/// </summary>
public TimeSpan BreakTimeSpan { get; private set; }
/// <summary>
/// مقدار زمان کارکرد
/// </summary>
public TimeSpan WorkingTimeSpan { get; private set; }
/// <summary>
/// آیا منقطع است؟
/// </summary>
public bool IsSliced { get; private set; }
/// <summary>
/// آیا غیبت است
/// </summary>
public bool IsAbsent { get; private set; }
/// <summary>
/// آیا جمعه است
/// </summary>
public bool IsFriday { get; private set; }
/// <summary>
/// آیا تعطیل رسمی است
/// </summary>
public bool IsHoliday { get; private set; }
/// <summary>
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
/// </summary>
public string LeaveType { get; private set; }
public long CheckoutId { get; set; }
}

View File

@@ -27,13 +27,12 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, long employeeId,
long workshopId, double salary, long customizeWorkshopGroupSettingId,
ICollection<CustomizeWorkshopEmployeeSettingsShift> customizeWorkshopEmployeeSettingsShifts,
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime,
int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts
, List<WeeklyOffDay> weeklyOffDays) :
FridayWork fridayWork,
HolidayWork holidayWork, IrregularShift irregularShift, WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
base(fridayPay, overTimePay,
baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
{
CustomizeWorkshopGroupSettingId = customizeWorkshopGroupSettingId;
IsSettingChanged = false;
@@ -83,6 +82,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
/// <param name="fineAbsenceDeduction">جریمه غیبت</param>
/// <param name="lateToWork">تاخیر در ورود</param>
/// <param name="earlyExit">تعجیل درخروج</param>
/// <param name="fridayWork">آیا در روز های جمعه موظف به کار است</param>
/// <param name="holidayWork">آیا در تعطیلات رسمی موظف به کار است</param>
/// <param name="workshopIrregularShifts">نوع شیفت کاری </param>
/// <param name="workshopShiftStatus">آیا شیفت منظم است یا نا منظم</param>
@@ -91,7 +91,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
FridayWork fridayWork, HolidayWork holidayWork, IrregularShift irregularShift, bool isSettingChange, int leavePermittedDays)
{
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
@@ -99,6 +99,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
Salary = salary;
IsSettingChanged = isSettingChange;
FridayWork = fridayWork;
HolidayWork = holidayWork;
LeavePermittedDays = leavePermittedDays;
}
@@ -111,8 +112,8 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
public void SimpleEdit(
ICollection<CustomizeWorkshopEmployeeSettingsShift> employeeSettingsShift,
IrregularShift irregularShift,
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange,HolidayWork holidayWork,
ICollection<CustomizeRotatingShift> rotatingShifts,List<WeeklyOffDay> weeklyOffDays)
WorkshopShiftStatus workshopShiftStatus, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork,
ICollection<CustomizeRotatingShift> rotatingShifts)
{
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChanged = isShiftChange;
@@ -125,8 +126,9 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
: new IrregularShift(irregularShift.StartTime, irregularShift.EndTime, irregularShift.WorkshopIrregularShifts);
CustomizeRotatingShifts = workshopShiftStatus == WorkshopShiftStatus.Rotating ? rotatingShifts : [];
FridayWork = fridayWork;
HolidayWork = holidayWork;
WeeklyOffDays = weeklyOffDays;
}
@@ -267,6 +269,4 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
IsShiftChanged = isShiftChange;
}
}

View File

@@ -27,12 +27,11 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay,
BonusesPay bonusesPay, NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays,
ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays) :
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork,
HolidayWork holidayWork, BreakTime breakTime, WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, int leavePermittedDays, ICollection<CustomizeRotatingShift> rotatingShifts) :
base(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, holidayWork, breakTime, leavePermittedDays,weeklyOffDays)
earlyExit, fridayWork, holidayWork, breakTime, leavePermittedDays)
{
GroupName = groupName;
Salary = salary;
@@ -77,7 +76,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, FridayWork fridayWork,
HolidayWork holidayWork, IrregularShift irregularShift, ICollection<CustomizeRotatingShift> rotatingShifts,
WorkshopShiftStatus workshopShiftStatus, long customizeWorkshopSettingId, BreakTime breakTime, int leavePermittedDays)
{
@@ -97,6 +96,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
LeavePermittedDays = leavePermittedDays;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -123,7 +123,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
{
GroupName = groupName;
Salary = salary;
@@ -140,6 +140,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
IsSettingChange = isSettingChange;
LeavePermittedDays = leavePermittedDays;
@@ -153,7 +154,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
{
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
}
}
public void EditAndOverwriteOnAllEmployees(string groupName, double salary,
@@ -161,13 +162,14 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay, ShiftPay shiftPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, FamilyAllowance familyAllowance,
LeavePay leavePay, InsuranceDeduction insuranceDeduction, FineAbsenceDeduction fineAbsenceDeduction,
LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
LateToWork lateToWork, EarlyExit earlyExit, FridayWork fridayWork, HolidayWork holidayWork, bool isSettingChange, int leavePermittedDays)
{
SetValueObjects(fridayPay, overTimePay, baseYearsPay, bonusesPay
, nightWorkPay, marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction,
lateToWork, earlyExit);
GroupName = groupName;
Salary = salary;
FridayWork = fridayWork;
HolidayWork = holidayWork;
IsSettingChange = isSettingChange;
LeavePermittedDays = leavePermittedDays;
@@ -180,7 +182,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
{
item.EditEmployees(Salary, FridayPay, OverTimePay, BaseYearsPay, BonusesPay
, NightWorkPay, MarriedAllowance, ShiftPay, FamilyAllowance, LeavePay, InsuranceDeduction, FineAbsenceDeduction,
LateToWork, EarlyExit, HolidayWork, IrregularShift, false, leavePermittedDays);
LateToWork, EarlyExit, FridayWork, HolidayWork, IrregularShift, false, leavePermittedDays);
}
}
@@ -193,7 +195,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
public void EditSimpleAndOverwriteOnEmployee(string groupName, IEnumerable<long> employeeIds,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts, WorkshopShiftStatus workshopShiftStatus,
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts, List<WeeklyOffDay> weeklyOffDays)
IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange, FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
{
GroupName = groupName;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -207,11 +209,9 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChange = isShiftChange;
FridayWork = fridayWork;
HolidayWork = holidayWork;
WeeklyOffDays = weeklyOffDays;
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
if (isShiftChange)
@@ -227,7 +227,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
.ToList();
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
IrregularShift, WorkshopShiftStatus, BreakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
IrregularShift, WorkshopShiftStatus, BreakTime, false, FridayWork, HolidayWork, newRotatingShifts);
}
}
@@ -235,7 +235,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
public void EditSimpleAndOverwriteOnAllEmployees(string groupName,
ICollection<CustomizeWorkshopGroupSettingsShift> customizeWorkshopGroupSettingsShifts,
WorkshopShiftStatus workshopShiftStatus, IrregularShift irregularShift, BreakTime breakTime, bool isShiftChange,
HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts ,List<WeeklyOffDay> weeklyOffDays)
FridayWork fridayWork, HolidayWork holidayWork, ICollection<CustomizeRotatingShift> rotatingShifts)
{
GroupName = groupName;
CustomizeWorkshopGroupSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopGroupSettingsShifts : [];
@@ -251,8 +251,8 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
BreakTime = new BreakTime(breakTime.HasBreakTimeValue, breakTime.BreakTimeValue);
IsShiftChange = isShiftChange;
HolidayWork = holidayWork;
FridayWork = fridayWork;
WeeklyOffDays = weeklyOffDays;
//var employeeSettingsShift = customizeWorkshopGroupSettingsShifts
// .Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList();
@@ -262,7 +262,7 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
.ToList();
item.SimpleEdit(customizeWorkshopGroupSettingsShifts
.Select(x => new CustomizeWorkshopEmployeeSettingsShift(x.StartTime, x.EndTime, x.Placement)).ToList(),
irregularShift, workshopShiftStatus, breakTime, false, HolidayWork, newRotatingShifts,WeeklyOffDays.ToList());
irregularShift, workshopShiftStatus, breakTime, false, FridayWork, HolidayWork, newRotatingShifts);
}
}
@@ -298,14 +298,13 @@ public class CustomizeWorkshopGroupSettings : BaseCustomizeEntity
IrregularShift irregularShift = new(IrregularShift.StartTime, IrregularShift.EndTime,
IrregularShift.WorkshopIrregularShifts);
BreakTime breakTime = new(BreakTime.HasBreakTimeValue, BreakTime.BreakTimeValue);
List<WeeklyOffDay> weeklyOffDays = WeeklyOffDays.Select(x => new WeeklyOffDay(x.DayOfWeek)).ToList();
var rotatingShift = CustomizeRotatingShifts.Select(x => new CustomizeRotatingShift(x.StartTime, x.EndTime)).ToList();
var customizeWorkshopEmployeeSettings = new CustomizeWorkshopEmployeeSettings(fridayPay, overTimePay, baseYearsPay, bonusesPay, nightWorkPay,
marriedAllowance, shiftPay, familyAllowance, leavePay, insuranceDeduction, fineAbsenceDeduction, lateToWork,
earlyExit, employeeId, workshopId, Salary, id, shifts, HolidayWork, irregularShift,
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift, weeklyOffDays);
earlyExit, employeeId, workshopId, Salary, id, shifts, FridayWork, HolidayWork, irregularShift,
WorkshopShiftStatus, breakTime, LeavePermittedDays, rotatingShift);
CustomizeWorkshopEmployeeSettingsCollection.Add(customizeWorkshopEmployeeSettings);
}

View File

@@ -17,7 +17,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
public CustomizeWorkshopSettings(long workshopId,
ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts, int leavePermittedDays,
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
{
FridayPay = new FridayPay(FridayPayType.None, 0);
OverTimePay = new OverTimePay(OverTimePayType.None, 0);
@@ -38,10 +38,11 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
OverTimeThresholdMinute = 0;
Currency = Currency.Rial;
MaxMonthDays = MaxMonthDays.Default;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BonusesPaysInEndOfMonth = BonusesPaysInEndOfYear.EndOfYear;
WorkshopShiftStatus = workshopShiftStatus;
WeeklyOffDays = weeklyOffDays;
HolidayWork = holidayWork;
if (workshopShiftStatus == WorkshopShiftStatus.Irregular)
return;
@@ -91,7 +92,8 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
public void Edit(FridayPay fridayPay, OverTimePay overTimePay, BaseYearsPay baseYearsPay, BonusesPay bonusesPay,
NightWorkPay nightWorkPay, MarriedAllowance marriedAllowance, ShiftPay shiftPay,
FamilyAllowance familyAllowance, LeavePay leavePay, InsuranceDeduction insuranceDeduction,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
FineAbsenceDeduction fineAbsenceDeduction, LateToWork lateToWork, EarlyExit earlyExit,
FridayWork fridayWork, HolidayWork holidayWork, BonusesPaysInEndOfYear bonusesPaysInEndOfYear,
int leavePermittedDays, BaseYearsPayInEndOfYear baseYearsPayInEndOfYear, int overTimeThresholdMinute)
{
FridayPay = fridayPay;
@@ -107,6 +109,7 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
FineAbsenceDeduction = fineAbsenceDeduction;
LateToWork = lateToWork;
EarlyExit = earlyExit;
FridayWork = fridayWork;
HolidayWork = holidayWork;
BonusesPaysInEndOfMonth = bonusesPaysInEndOfYear;
LeavePermittedDays = leavePermittedDays;
@@ -124,18 +127,19 @@ public class CustomizeWorkshopSettings : BaseCustomizeEntity
}
public void ChangeWorkshopShifts(ICollection<CustomizeWorkshopSettingsShift> customizeWorkshopSettingsShifts,
WorkshopShiftStatus workshopShiftStatus,HolidayWork holidayWork, List<WeeklyOffDay> weeklyOffDays)
WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork)
{
WorkshopShiftStatus = workshopShiftStatus;
HolidayWork = holidayWork;
FridayWork = fridayWork;
CustomizeWorkshopSettingsShifts = workshopShiftStatus == WorkshopShiftStatus.Regular ? customizeWorkshopSettingsShifts : new List<CustomizeWorkshopSettingsShift>();
WeeklyOffDays = weeklyOffDays;
if (workshopShiftStatus == WorkshopShiftStatus.Regular)
{
var date = new DateOnly();
var firstStartShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MinBy(x => x.Placement).StartTime);
var lastEndShift = new DateTime(date, CustomizeWorkshopSettingsShifts.MaxBy(x => x.Placement).EndTime);
if (lastEndShift > firstStartShift)
firstStartShift = firstStartShift.AddDays(1);
var offSet = (firstStartShift - lastEndShift).Divide(2);

View File

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

View File

@@ -60,4 +60,13 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
#region client
List<InsuranceListViewModel> SearchForClient(InsuranceListSearchModel searchModel);
#endregion
#region Mahan
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
}

View File

@@ -4,7 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _0_Framework.Domain;
using Company.Domain.InsuranceListAgg.ValueObjects;
using Company.Domain.InsuranceWorkshopAgg;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace Company.Domain.InsuranceListAgg;
@@ -151,6 +153,21 @@ public class InsuranceList : EntityBase
/// </summary>
public double SumOfMarriedAllowance { get; private set; }
#region Mahan
/// <summary>
/// بازرسی
/// </summary>
public InsuranceListInspection Inspection { get; set; } =new (InsuranceListInspectionType.None,DateTime.MinValue, 0);
/// <summary>
/// بدهی
/// </summary>
public InsuranceListDebt Debt { get; set; } = new(InsuranceListDebtType.None, DateTime.MinValue, 0, 0);
/// <summary>
/// تاییدیه کارفرما
/// </summary>
public InsuranceListEmployerApproval EmployerApproval { get; set; } = new(InsuranceListEmployerApprovalStatus.None, string.Empty);
#endregion
public List<InsuranceListWorkshop> InsuranceListWorkshops { get; set; }
public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included,
@@ -174,4 +191,22 @@ public class InsuranceList : EntityBase
SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears;
}
public void SetDebt(InsuranceListDebt debt)
{
Debt = debt;
}
public void SetInspection(InsuranceListInspection inspection)
{
Inspection = inspection;
}
public void SetEmployerApproval(InsuranceListEmployerApproval employerApproval)
{
EmployerApproval = employerApproval;
}
public void SetConfirmSentlist(bool confirmSentlist)
{
ConfirmSentlist = confirmSentlist;
}
}

View File

@@ -0,0 +1,31 @@
using System;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace Company.Domain.InsuranceListAgg.ValueObjects;
public class InsuranceListDebt
{
public InsuranceListDebt(InsuranceListDebtType type, DateTime debtDate, double amount, long mediaId)
{
Type = type;
if (type == InsuranceListDebtType.None)
{
DebtDate = DateTime.MinValue;
Amount = 0;
MediaId = 0;
}
else
{
DebtDate = debtDate;
Amount = amount;
MediaId = mediaId;
IsDone = true;
}
}
public InsuranceListDebtType Type { get; set; }
public DateTime DebtDate { get; set; }
public double Amount { get; set; }
public long MediaId { get; set; }
public bool IsDone { get; set; }
}

View File

@@ -0,0 +1,26 @@
using System.Security.Cryptography;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace Company.Domain.InsuranceListAgg.ValueObjects;
public class InsuranceListEmployerApproval
{
public InsuranceListEmployerApproval(InsuranceListEmployerApprovalStatus status, string description)
{
Status = status;
if (status == InsuranceListEmployerApprovalStatus.None)
{
Description = string.Empty;
}
else
{
Description = description;
IsDone = true;
}
}
public InsuranceListEmployerApprovalStatus Status { get; set; }
public string Description { get; set; }
public bool IsDone { get; set; }
}

View File

@@ -0,0 +1,29 @@
using System;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace Company.Domain.InsuranceListAgg.ValueObjects;
public class InsuranceListInspection
{
public InsuranceListInspection(InsuranceListInspectionType type, DateTime lastInspectionDateTime, long mediaId)
{
Type = type;
if (type == InsuranceListInspectionType.None)
{
LastInspectionDateTime = DateTime.MinValue;
MediaId = 0;
}
else
{
LastInspectionDateTime = lastInspectionDateTime;
MediaId = mediaId;
IsDone = true;
}
}
public InsuranceListInspectionType Type { get; set; }
public DateTime LastInspectionDateTime { get; set; }
public long MediaId { get; set; }
public bool IsDone { get; set; }
}

View File

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

View File

@@ -132,7 +132,115 @@ public class CheckoutViewModel
/// مدت مرخصی استحقاقی
/// </summary>
public string TotalPaidLeave { get; set; }
public TimeSpan TotalHourlyLeave { get; set; }
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
}
public class CheckoutRollCallViewModel
{
/// <summary>
/// مجموع ساعت موظفی
/// </summary>
public TimeSpan TotalMandatoryTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت حضور
/// </summary>
public TimeSpan TotalPresentTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت استراحت
/// </summary>
public TimeSpan TotalBreakTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت کارکرد
/// </summary>
public TimeSpan TotalWorkingTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت مرخصی استحقاقی
/// </summary>
public TimeSpan TotalPaidLeaveTmeSpan { get; set; }
/// <summary>
/// مجموع ساعت مرخصی استعلاجی
/// </summary>
public TimeSpan TotalSickLeaveTimeSpan { get; set; }
/// <summary>
/// روز های حضور غیاب
/// </summary>
public ICollection<CheckoutRollCallDayViewModel> RollCallDaysCollection { get; set; }
}
public class CheckoutRollCallDayViewModel
{
public long Id { get; set; }
/// <summary>
/// تاریخ
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// ورود اول
/// </summary>
public string FirstStartDate { get; set; }
/// <summary>
/// خروج اول
/// </summary>
public string FirstEndDate { get; set; }
/// <summary>
/// ورود دوم
/// </summary>
public string SecondStartDate { get; set; }
/// <summary>
/// خروج دوم
/// </summary>
public string SecondEndDate { get; set; }
/// <summary>
/// ساعت استراحت
/// </summary>
public TimeSpan BreakTimeSpan { get; set; }
/// <summary>
/// مقدار زمان کارکرد
/// </summary>
public TimeSpan WorkingTimeSpan { get; set; }
/// <summary>
/// آیا منقطع است؟
/// </summary>
public bool IsSliced { get; set; }
/// <summary>
/// آیا غیبت است
/// </summary>
public bool IsAbsent { get; set; }
/// <summary>
/// آیا جمعه است
/// </summary>
public bool IsFriday { get; set; }
/// <summary>
/// آیا تعطیل رسمی است
/// </summary>
public bool IsHoliday { get; set; }
/// <summary>
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
/// </summary>
public string LeaveType { get; set; }
public long CheckoutId { get; set; }
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.YearlySalary;
using Microsoft.AspNetCore.Mvc.Rendering;
@@ -138,4 +139,20 @@ public class CreateCheckout
public string ShiftWork { get; set; }
/// <summary>
/// محاسبه اضافه کار در بیمه
/// </summary>
public bool HasInsuranceChekoutOverTime {get; set; }
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
public TimeSpan TotalWorkingTimeSpan { get; set; }
public TimeSpan TotalBreakTimeSpan { get; set; }
public TimeSpan TotalPresentTimeSpan { get; set; }
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using CompanyManagment.App.Contracts.Loan;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.SalaryAid;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
@@ -45,6 +46,15 @@ public class ComputingViewModel
public bool HasRotatingShift { get; set; }
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
public TimeSpan TotalWorkingTimeSpan { get; set; }
public TimeSpan TotalBreakTimeSpan { get; set; }
public TimeSpan TotalPresentTimeSpan { get; set; }
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
//public List<string> holidays;
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
@@ -17,9 +16,8 @@ public class CreateCustomizeWorkshopGroupSettings
public IrregularShift IrregularShift { get; set; }
public BreakTime BreakTime { get; set; }
public int LeavePermittedDays { get; set; }
//public FridayWork FridayWork { get; set; }
public FridayWork FridayWork { get; set; }
public HolidayWork HolidayWork { get; set; }
public List<DayOfWeek> OffDayOfWeeks { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
}

View File

@@ -1,5 +1,4 @@
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
@@ -21,18 +20,16 @@ public class CreateCustomizeWorkshopSettings
public BreakTime BreakTime { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند
/// </summary>
public HolidayWork HolidayWork { get; set; }
public List<DayOfWeek> OffDays { get; set; }

View File

@@ -1,5 +1,4 @@
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using System.Collections.Generic;
@@ -21,8 +20,7 @@ public class CustomizeWorkshopEmployeeSettingsViewModel
public bool ChangeSettingEmployeeShiftIsChange { get; set; }
public BreakTime BreakTime { get; set; }
public HolidayWork HolidayWork { get; set; }
//public FridayWork FridayWork { get; set; }
public FridayWork FridayWork { get; set; }
public int LeavePermittedDays { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShiftsViewModels { get; set; }
public List<DayOfWeek> WeeklyOffDays { get; set; }
}

View File

@@ -1,5 +1,4 @@
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
@@ -73,19 +72,17 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
/// </summary>
public EarlyExitViewModel EarlyExit { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند
/// </summary>
public HolidayWork HolidayWork { get; set; }
public List<DayOfWeek> WeeklyOffDays { get; set; }
public long Id { get; set; }
public long Id { get; set; }
public string Salary { get; set; }
public string NameGroup { get; set; }
public string EmployeeFullName { get; set; }
@@ -94,5 +91,4 @@ public class EditCustomizeEmployeeSettings:CreateCustomizeEmployeeSettings
public IEnumerable<CustomizeWorkshopShiftViewModel> ShiftViewModel { get; set; }
public ICollection<CustomizeRotatingShiftsViewModel> CustomizeRotatingShifts{ get; set; }
public BreakTime BreakTime { get; set; }
}

View File

@@ -1,8 +1,6 @@
using System;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
using System.Collections.Generic;
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
@@ -77,18 +75,16 @@ public class EditCustomizeWorkshopGroupSettings : CreateCustomizeWorkshopGroupSe
/// </summary>
public EarlyExitViewModel EarlyExit { get; set; }
///// <summary>
///// آیا جمعه کار میکند یا نه
///// </summary>
//public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا جمعه کار میکند یا نه
/// </summary>
public FridayWork FridayWork { get; set; }
/// <summary>
/// آیا در روز های تعطیل کار میکند
/// </summary>
public HolidayWork HolidayWork { get; set; }
//public List<DayOfWeek> WeeklyOffDays { get; set; }
public bool IsShiftChanged { get; set; }
public bool IsSettingChanged { get; set; }
}

View File

@@ -1,5 +1,4 @@
using System;
using _0_Framework.Application;
using _0_Framework.Application;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using CompanyManagment.App.Contracts.Employee;
@@ -52,14 +51,11 @@ public interface ICustomizeWorkshopSettingsApplication
/// </summary>
/// <param name="shiftViewModels">شیفت هت</param>
/// <param name="customizeWorkshopSettingsId">آیدی تنظیمات کارگاه</param>
/// <param name="workshopShiftStatus"></param>
/// <param name="holidayWork"></param>
/// <param name="weeklyOffDays"></param>
/// <param name="replaceChangedGroups"></param>
/// <param name="workshopShiftStatus"></param>
/// <returns></returns>
OperationResult EditWorkshopSettingShifts(List<CustomizeWorkshopShiftViewModel> shiftViewModels,
long customizeWorkshopSettingsId, WorkshopShiftStatus workshopShiftStatus,
HolidayWork holidayWork, List<DayOfWeek> weeklyOffDays);
long customizeWorkshopSettingsId,WorkshopShiftStatus workshopShiftStatus,FridayWork fridayWork,HolidayWork holidayWork);
// It will Get the Workshop Settings with its groups and the employees of groups.
CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth);

View File

@@ -28,6 +28,8 @@ public class CreateEmployeeByClient
public List<AddEmployeeDocumentItem> EmployeeDocumentItems { get; set; }
public bool HasEmployeeDocument { get; set; }
public bool HasRollCallService { get; set; }
public bool CanceledAuthorize { get; set; }
public string BirthDate { get; set; }
}

View File

@@ -17,6 +17,7 @@ public record EmployeeByNationalCodeInWorkshopViewModel
public long PersonnelCode { get; set; }
public List<EmployeeByNationalCodeEmployeeBankInfoViewModel> EmployeeBankInfos { get; set; }
public EmployeeByNationalCodeEmployeeDocumentViewModel EmployeeDocument { get; set; }
public bool AuthorizedCanceled { get; set; }
}

View File

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

View File

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

View File

@@ -14,9 +14,6 @@ public class EditInsuranceList:CreateInsuranceList
public bool FixedSalary { get; set; }
public string Population { get; set; }
public long? InsuranceJobId { get; set; }
/// <summary>
/// پرسنل هایی که قرارداد ترک کار کرده اند ولی ترک کار بیمه ندارند
/// </summary>
public List<LeftWorkViewModel> LeftWorkEmployees { get; set; }
}

View File

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

View File

@@ -0,0 +1,8 @@
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
public enum InsuranceListDebtType
{
None,
Old,
New
}

View File

@@ -0,0 +1,14 @@
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
public enum InsuranceListEmployerApprovalStatus
{
None,
/// <summary>
/// تاییدیه شفاهی (اذنی)
/// </summary>
VerbalApproval,
/// <summary>
/// تاییدیه کاغذی
/// </summary>
WrittenApproval
}

View File

@@ -0,0 +1,8 @@
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
public enum InsuranceListInspectionType
{
None,
Old,
New
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.InsuranceList;
using Microsoft.AspNetCore.Http;
namespace CompanyManagment.App.Contracts.InsuranceList;
@@ -17,9 +18,9 @@ public interface IInsuranceListApplication
MainEmployeeDetailsViewModel SearchEmployeeForCreateInsuranceList(EmployeeForCreateInsuranceListSearchModel searchModel);
double MarriedAllowance(string maritalStatus, long jobId, bool includedStatus,
int countWorkingDays, double marriedAlowance, int endMonthCurrentDay);
int countWorkingDays, double marriedAlowance, int endMonthCurrentDay);
OperationResult CreateEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
OperationResult CreateEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
OperationResult EditEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
OperationResult Remove(long id);
EditInsuranceList GetDetailsForEdit(long id);
@@ -34,4 +35,16 @@ public interface IInsuranceListApplication
//farokhiChanges
(double basic, int totalYear) BasicYear(long employeeId, long worshopId, DateTime startDate);
double GetMonthlyBaseYear(double dayliBase, int countWorkingDays);
#region Mahan
/// <summary>
/// مراحل اجرایی برای تکمیل و ارسال لیست بیمه
/// </summary>
/// <returns></returns>
Task<OperationResult> ConfirmInsuranceOperation(InsuranceListConfirmOperation command);
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
}

View File

@@ -0,0 +1,48 @@
using CompanyManagment.App.Contracts.InsuranceList.Enums;
using Microsoft.AspNetCore.Http;
namespace CompanyManagment.App.Contracts.InsuranceList;
public class InsuranceListConfirmOperation
{
public long InsuranceListId { get; set; }
/// <summary>
/// بازرسی
/// </summary>
public CreateInsuranceListInspection Inspection { get; set; }
/// <summary>
/// بدهی
/// </summary>
public CreateInsuranceListDebt Debt { get; set; }
/// <summary>
/// تاییدیه کارفرما
/// </summary>
public CreateInsuranceListApproval Approval { get; set; }
public bool ConfirmSentList { get; set; }
}
public class CreateInsuranceListApproval
{
public InsuranceListEmployerApprovalStatus ApprovalStatus { get; set; }
public string Description { get; set; }
}
public class CreateInsuranceListDebt
{
public InsuranceListDebtType Type { get; set; }
public string DebtDate { get; set; }
public string Amount { get; set; }
public IFormFile DebtFile { get; set; }
public long DebtFileMediaId { get; set; }
public string FilePath { get; set; }
}
public class CreateInsuranceListInspection
{
public InsuranceListInspectionType Type { get; set; }
public string LastInspectionDate { get; set; }
public IFormFile InspectionFile { get; set; }
public long InspectionFileMediaId { get; set; }
public string FilePath { get; set; }
}

View File

@@ -25,4 +25,29 @@ public class InsuranceListSearchModel
public int PageIndex { get; set; }
public bool SearchAll { get; set; }
public InsuranceListSearchStatus Status { get; set; }
}
public enum InsuranceListSearchStatus
{
/// <summary>
/// انجام نشده
/// </summary>
NotStarted = 0,
/// <summary>
/// در حال انجام امور
/// </summary>
InProgress = 1,
/// <summary>
/// آماده ارسال لیست
/// </summary>
ReadyToSendList = 2,
/// <summary>
/// انجام بیمه
/// </summary>
Done = 3
}

View File

@@ -0,0 +1,24 @@
namespace CompanyManagment.App.Contracts.InsuranceList;
public class InsuranceListTabsCountViewModel
{
/// <summary>
/// انجام نشده
/// </summary>
public int NotStarted { get; set; }
/// <summary>
/// در حال انجام امور
/// </summary>
public int InProgress { get; set; }
/// <summary>
/// آماده ارسال لیست
/// </summary>
public int ReadyToSendList { get; set; }
/// <summary>
/// انجام بیمه
/// </summary>
public int Done { get; set; }
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace CompanyManagment.App.Contracts.InsuranceList;
@@ -27,4 +28,16 @@ public class InsuranceListViewModel
public long WorkShopId { get; set; }
public string IsBlockCantracingParty { get; set; }
public long EmployerId { get; set; }
/// <summary>وضعیت بازرسی</summary>
public bool InspectionDone { get; set; }
/// <summary>وضعیت بدهی</summary>
public bool DebtDone { get; set; }
/// <summary>تاییدیه کارفرما</summary>
public bool EmployerApproved { get; set; }
/// <summary>
/// نوع تاییدیه کارفرما
/// </summary>
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
}

View File

@@ -6,10 +6,12 @@ public class ShiftList
{
public DateTime Start { get; set; }
public DateTime End { get; set; }
/// <summary>
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
/// </summary>
public TimeSpan LateEntryDuration { get; set; }
public DateTime EndWithOutResTime { get; set; }
/// <summary>
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
/// </summary>
public TimeSpan LateEntryDuration { get; set; }
/// <summary>
/// تعجیل در ورود (مدت زمانی که کارمند زودتر از زمان مشخص وارد شده است)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -55,7 +55,7 @@ namespace CompanyManagment.Application
if(command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length >0 )
{
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"]);
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"], "Bank");
if (uploadResult.IsSuccedded == false)
return uploadResult;
mediaId = uploadResult.SendId;
@@ -81,7 +81,7 @@ namespace CompanyManagment.Application
if (command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length > 0)
{
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"]);
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"], "Bank");
if (uploadResult.IsSuccedded == false)
return uploadResult;
_mediaApplication.DeleteFile(entity.BankLogoMediaId);

File diff suppressed because it is too large Load Diff

View File

@@ -996,9 +996,23 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
// return op.Failed("این پرسنل قبلا افزوده شده است و در انتظار تایید میباشد");
//}
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(command.NationalCode);
var workshop = _WorkShopRepository.GetDetails(command.WorkshopId);
if (employee == null)
if (employee == null && command.CanceledAuthorize)
{
var birthDate = command.BirthDate.ToGeorgianDateTime();
var dateOfIssue = new DateTime(1922, 1, 1);
employee = new Employee(command.FirstName, command.LastName, null, birthDate,
dateOfIssue, null, command.NationalCode, null, command.Gender, "ایرانی", null, null);
_EmployeeRepository.Create(employee);
_EmployeeRepository.SaveChanges();
}
if (employee == null)
{
return op.Failed("خطای سیستمی. لطفا دوباره تلاش کنید . درصورت تکرار این مشکل با تیم پشتیبان تماس بگیرید");
}
@@ -1241,6 +1255,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
if (employee == null)
{
var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate);
if (personalInfo.ResponseContext.Status.Code == 14)
{
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید",new EmployeeByNationalCodeInWorkshopViewModel(){AuthorizedCanceled = true});
}
if (personalInfo.ResponseContext.Status.Code != 0)
{
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -176,6 +176,8 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
_leftWorkTempRepository.Remove(leftWorkTemp);
await _leftWorkRepository.SaveChangesAsync();
await _leftWorkTempRepository.SaveChangesAsync();
return op.Succcedded();
}

View File

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

View File

@@ -1,5 +1,6 @@
using System;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.CheckoutAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -73,5 +74,28 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
salaryAid.Property(x => x.Amount).HasMaxLength(25);
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
});
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
{
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalBreakTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalWorkingTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalPaidLeaveTmeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalSickLeaveTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalMandatoryTimeSpan).HasTimeSpanConversion();
rollCall.OwnsMany(x => x.RollCallDaysCollection, rollCallDay =>
{
rollCallDay.HasKey(x => x.Id);
rollCallDay.WithOwner().HasForeignKey(x => x.CheckoutId);
rollCallDay.Property(x => x.WorkingTimeSpan).HasTimeSpanConversion();
rollCallDay.Property(x => x.BreakTimeSpan).HasTimeSpanConversion();
rollCallDay.Property(x => x.FirstStartDate).HasMaxLength(18);
rollCallDay.Property(x => x.FirstEndDate).HasMaxLength(18);
rollCallDay.Property(x => x.SecondStartDate).HasMaxLength(18);
rollCallDay.Property(x => x.SecondEndDate).HasMaxLength(18);
rollCallDay.Property(x => x.LeaveType).HasMaxLength(18);
});
});
}
}

View File

@@ -228,14 +228,7 @@ public class CustomizeWorkshopEmployeeSettingsMapping : IEntityTypeConfiguration
});
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
{
offDay.HasKey(x => x.Id);
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
offDay.WithOwner().HasForeignKey(x => x.ParentId);
});
builder.OwnsMany(x => x.CustomizeRotatingShifts);
builder.OwnsMany(x => x.CustomizeRotatingShifts);
}
}

View File

@@ -227,15 +227,7 @@ public class CustomizeWorkshopGroupSettingsMapping : IEntityTypeConfiguration<Cu
});
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
{
offDay.HasKey(x => x.Id);
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
offDay.WithOwner().HasForeignKey(x => x.ParentId);
});
builder.OwnsMany(x => x.CustomizeRotatingShifts);
builder.OwnsMany(x => x.CustomizeRotatingShifts);
builder.HasOne(x => x.CustomizeWorkshopSettings).WithMany(x => x.CustomizeWorkshopGroupSettingsCollection)

View File

@@ -221,12 +221,6 @@ public class CustomizeWorkshopSettingsMapping:IEntityTypeConfiguration<Customize
});
builder.OwnsMany(x => x.WeeklyOffDays, offDay =>
{
offDay.HasKey(x => x.Id);
offDay.Property(x => x.DayOfWeek).HasConversion<string>().HasMaxLength(15);
offDay.WithOwner().HasForeignKey(x => x.ParentId);
});
builder.HasMany(x => x.CustomizeWorkshopGroupSettingsCollection).WithOne(x => x.CustomizeWorkshopSettings)

View File

@@ -13,5 +13,32 @@ public class InsuranceListMapping : IEntityTypeConfiguration<InsuranceList>
builder.Property(x => x.Year).HasMaxLength(4);
builder.Property(x => x.Month).HasMaxLength(2);
builder.ComplexProperty(x => x.Inspection, inspection =>
{
inspection.IsRequired();
inspection.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
inspection.Property(x => x.LastInspectionDateTime);
inspection.Property(x => x.MediaId);
});
builder.ComplexProperty(x => x.Debt, debt =>
{
debt.IsRequired();
debt.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
debt.Property(x => x.DebtDate);
debt.Property(x => x.Amount);
debt.Property(x => x.MediaId);
});
builder.ComplexProperty(x => x.EmployerApproval, approval =>
{
approval.IsRequired();
approval.Property(x => x.Status).HasConversion<string>().HasMaxLength(50);
approval.Property(x => x.Description).HasMaxLength(500);
});
//builder.HasMany(x => x.EmployerSignatures)
// .WithOne(x => x.InsuranceList).HasForeignKey(x => x.InsuranceListId);
}
}

View File

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

View File

@@ -0,0 +1,121 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addinspectiondebtapprovaltoinsurancelist : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<double>(
name: "Debt_Amount",
table: "InsuranceLists",
type: "float",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<DateTime>(
name: "Debt_DebtDate",
table: "InsuranceLists",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<long>(
name: "Debt_MediaId",
table: "InsuranceLists",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "Debt_Type",
table: "InsuranceLists",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "None");
migrationBuilder.AddColumn<string>(
name: "EmployerApproval_Description",
table: "InsuranceLists",
type: "nvarchar(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "EmployerApproval_Status",
table: "InsuranceLists",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "None");
migrationBuilder.AddColumn<DateTime>(
name: "Inspection_LastInspectionDateTime",
table: "InsuranceLists",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<long>(
name: "Inspection_MediaId",
table: "InsuranceLists",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<string>(
name: "Inspection_Type",
table: "InsuranceLists",
type: "nvarchar(50)",
maxLength: 50,
nullable: false,
defaultValue: "None");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Debt_Amount",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Debt_DebtDate",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Debt_MediaId",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Debt_Type",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "EmployerApproval_Description",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "EmployerApproval_Status",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Inspection_LastInspectionDateTime",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Inspection_MediaId",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Inspection_Type",
table: "InsuranceLists");
}
}
}

View File

@@ -1,106 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addoffDaystocws : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_CustomizeWorkshopEmployeeSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopEmployeeSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopGroupSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopGroupSettings_WeeklyOffDays_CustomizeWorkshopGroupSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopGroupSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "CustomizeWorkshopSettings_WeeklyOffDays",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DayOfWeek = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CustomizeWorkshopSettings_WeeklyOffDays", x => x.Id);
table.ForeignKey(
name: "FK_CustomizeWorkshopSettings_WeeklyOffDays_CustomizeWorkshopSettings_ParentId",
column: x => x.ParentId,
principalTable: "CustomizeWorkshopSettings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopEmployeeSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopGroupSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopGroupSettings_WeeklyOffDays",
column: "ParentId");
migrationBuilder.CreateIndex(
name: "IX_CustomizeWorkshopSettings_WeeklyOffDays_ParentId",
table: "CustomizeWorkshopSettings_WeeklyOffDays",
column: "ParentId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
migrationBuilder.DropTable(
name: "CustomizeWorkshopGroupSettings_WeeklyOffDays");
migrationBuilder.DropTable(
name: "CustomizeWorkshopSettings_WeeklyOffDays");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class insuranceoperationlist : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Debt_IsDone",
table: "InsuranceLists",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "EmployerApproval_IsDone",
table: "InsuranceLists",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "Inspection_IsDone",
table: "InsuranceLists",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Debt_IsDone",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "EmployerApproval_IsDone",
table: "InsuranceLists");
migrationBuilder.DropColumn(
name: "Inspection_IsDone",
table: "InsuranceLists");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,124 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addrollcallincheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.CreateTable(
name: "CheckoutRollCallDay",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
FirstStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
FirstEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
BreakTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
WorkingTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
IsSliced = table.Column<bool>(type: "bit", nullable: false),
IsAbsent = table.Column<bool>(type: "bit", nullable: false),
IsFriday = table.Column<bool>(type: "bit", nullable: false),
IsHoliday = table.Column<bool>(type: "bit", nullable: false),
LeaveType = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
CheckoutId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id);
table.ForeignKey(
name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId",
column: x => x.CheckoutId,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CheckoutRollCallDay_CheckoutId",
table: "CheckoutRollCallDay",
column: "CheckoutId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutRollCallDay");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts");
}
}
}

View File

@@ -1,5 +1,6 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using CompanyManagment.EFCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
@@ -12,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CompanyManagment.EFCore.Migrations
{
[DbContext(typeof(CompanyContext))]
[Migration("20250602161025_add offDays to cws")]
partial class addoffDaystocws
[Migration("20250611160351_add workshop create contract settings")]
partial class addworkshopcreatecontractsettings
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -3353,6 +3354,64 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(4)
.HasColumnType("nvarchar(4)");
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
{
b1.IsRequired();
b1.Property<double>("Amount")
.HasColumnType("float");
b1.Property<DateTime>("DebtDate")
.HasColumnType("datetime2");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
{
b1.IsRequired();
b1.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<string>("Status")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
{
b1.IsRequired();
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<DateTime>("LastInspectionDateTime")
.HasColumnType("datetime2");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.HasKey("id");
b.ToTable("InsuranceLists", (string)null);
@@ -5590,9 +5649,20 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("CutContractEndOfYear")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<bool>("FixedSalary")
.HasColumnType("bit");
@@ -5630,6 +5700,12 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<string>("State")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@@ -7436,32 +7512,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -7497,8 +7547,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("OverTimePay");
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
});
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
@@ -8022,32 +8070,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -8083,8 +8105,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("OverTimePay");
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
});
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
@@ -8535,32 +8555,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -8589,8 +8583,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
b.Navigation("Workshop");
});

View File

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

View File

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

View File

@@ -1,5 +1,6 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using CompanyManagment.EFCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
@@ -1808,12 +1809,24 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("EmployeeId")
.HasColumnType("bigint");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
@@ -3350,6 +3363,64 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(4)
.HasColumnType("nvarchar(4)");
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
{
b1.IsRequired();
b1.Property<double>("Amount")
.HasColumnType("float");
b1.Property<DateTime>("DebtDate")
.HasColumnType("datetime2");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
{
b1.IsRequired();
b1.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<string>("Status")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
{
b1.IsRequired();
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<DateTime>("LastInspectionDateTime")
.HasColumnType("datetime2");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.HasKey("id");
b.ToTable("InsuranceLists", (string)null);
@@ -5587,9 +5658,20 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("CutContractEndOfYear")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<bool>("FixedSalary")
.HasColumnType("bit");
@@ -5627,6 +5709,12 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<string>("State")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@@ -6109,6 +6197,117 @@ namespace CompanyManagment.EFCore.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 =>
{
b1.Property<long>("Checkoutid")
.HasColumnType("bigint");
b1.Property<string>("TotalBreakTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalMandatoryTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalPaidLeaveTmeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalPresentTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalSickLeaveTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalWorkingTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.HasKey("Checkoutid");
b1.ToTable("Checkouts");
b1.WithOwner()
.HasForeignKey("Checkoutid");
b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 =>
{
b2.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property<long>("Id"));
b2.Property<string>("BreakTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b2.Property<long>("CheckoutId")
.HasColumnType("bigint");
b2.Property<DateTime>("Date")
.HasColumnType("datetime2");
b2.Property<string>("FirstEndDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("FirstStartDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<bool>("IsAbsent")
.HasColumnType("bit");
b2.Property<bool>("IsFriday")
.HasColumnType("bit");
b2.Property<bool>("IsHoliday")
.HasColumnType("bit");
b2.Property<bool>("IsSliced")
.HasColumnType("bit");
b2.Property<string>("LeaveType")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("SecondEndDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("SecondStartDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("WorkingTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b2.HasKey("Id");
b2.HasIndex("CheckoutId");
b2.ToTable("CheckoutRollCallDay");
b2.WithOwner()
.HasForeignKey("CheckoutId");
});
b1.Navigation("RollCallDaysCollection");
});
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
{
b1.Property<long>("Checkoutid")
@@ -6196,6 +6395,8 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("Checkoutid");
});
b.Navigation("CheckoutRollCall");
b.Navigation("LoanInstallments");
b.Navigation("SalaryAids");
@@ -7433,32 +7634,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopEmployeeSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopEmployeeSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -7494,8 +7669,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("OverTimePay");
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
});
modelBuilder.Entity("Company.Domain.CustomizeWorkshopGroupSettingsAgg.Entities.CustomizeWorkshopGroupSettings", b =>
@@ -8019,32 +8192,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopGroupSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopGroupSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -8080,8 +8227,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("OverTimePay");
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
});
modelBuilder.Entity("Company.Domain.CustomizeWorkshopSettingsAgg.Entities.CustomizeWorkshopSettings", b =>
@@ -8532,32 +8677,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("CustomizeWorkshopSettingsid");
});
b.OwnsMany("_0_Framework.Domain.CustomizeCheckoutShared.Base.WeeklyOffDay", "WeeklyOffDays", b1 =>
{
b1.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<long>("Id"));
b1.Property<string>("DayOfWeek")
.IsRequired()
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b1.Property<long>("ParentId")
.HasColumnType("bigint");
b1.HasKey("Id");
b1.HasIndex("ParentId");
b1.ToTable("CustomizeWorkshopSettings_WeeklyOffDays");
b1.WithOwner()
.HasForeignKey("ParentId");
});
b.Navigation("BaseYearsPay");
b.Navigation("BonusesPay");
@@ -8586,8 +8705,6 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("ShiftPay");
b.Navigation("WeeklyOffDays");
b.Navigation("Workshop");
});

File diff suppressed because it is too large Load Diff

View File

@@ -26,6 +26,7 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
return new();
return new EditCustomizeEmployeeSettings()
{
FridayWork = entity.FridayWork,
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{

View File

@@ -265,7 +265,7 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
var entity = _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery().FirstOrDefault(x => x.id == groupId);
return new EditCustomizeWorkshopGroupSettings()
{
//FridayWork = entity.FridayWork,
FridayWork = entity.FridayWork,
FridayPay = new (){ FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{
@@ -338,8 +338,8 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
{
EndTime = x.EndTime.ToString("HH:mm"),
StartTime = x.StartTime.ToString("HH:mm")
}).ToList(),
OffDayOfWeeks = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
}).ToList()
};
}

View File

@@ -159,6 +159,7 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
return new();
var viewModel = new EditCustomizeWorkshopSettings()
{
FridayWork = entity.FridayWork,
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
LateToWork = new()
{
@@ -233,8 +234,7 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
LeavePermittedDays = entity.LeavePermittedDays,
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
WorkshopId = entity.WorkshopId,
WorkshopShiftStatus = entity.WorkshopShiftStatus,
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
WorkshopShiftStatus = entity.WorkshopShiftStatus
};
return viewModel;
@@ -261,8 +261,8 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
Id = entity.id,
WorkshopId = entity.WorkshopId,
WorkshopShiftStatus = entity.WorkshopShiftStatus,
HolidayWork = entity.HolidayWork,
OffDays = entity.WeeklyOffDays.Select(x=>x.DayOfWeek).ToList()
FridayWork = entity.FridayWork,
HolidayWork = entity.HolidayWork
};
}

View File

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

View File

@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using AccountMangement.Infrastructure.EFCore;
using Company.Domain.EmployeeAgg;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsurancListDataAgg;
@@ -16,6 +20,7 @@ using CompanyManagment.App.Contracts.EmployeeInsurancListData;
using CompanyManagment.App.Contracts.InsuranceList;
using CompanyManagment.App.Contracts.InsuranceWorkshopInfo;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Identity.Client;
using PersianTools.Core;
@@ -32,7 +37,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
private readonly IAuthHelper _authHelper;
private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly IInsuranceYearlySalaryRepository _insuranceYearlySalaryRepository;
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository , IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository) : base(context)
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly AccountContext _accountContext;
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository, IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository, IWebHostEnvironment webHostEnvironment, AccountContext accountContext) : base(context)
{
_context = context;
_employeeInsurancListDataRepository = employeeInsurancListDataRepository;
@@ -41,20 +49,22 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
_authHelper = authHelper;
_contractingPartyApp = contractingPartyApp;
_insuranceYearlySalaryRepository = insuranceYearlySalaryRepository;
_webHostEnvironment = webHostEnvironment;
_accountContext = accountContext;
}
public OperationResult CreateInsuranceListworkshop(long id, List<long> workshopIds)
{
var operation = new OperationResult();
//try
//{
var list= new List<InsuranceListWorkshop>();
var list = new List<InsuranceListWorkshop>();
foreach (var item in workshopIds)
{
list.Add(new InsuranceListWorkshop()
{
WorkshopId =item,
InsurancListId= id
WorkshopId = item,
InsurancListId = id
});
}
@@ -77,10 +87,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{
var operation = new OperationResult();
var obj = _context.InsuranceWorkshopInformationSet.Where(x=>x.WorkshopId== command.WorkshopId).FirstOrDefault();
var obj = _context.InsuranceWorkshopInformationSet.Where(x => x.WorkshopId == command.WorkshopId).FirstOrDefault();
if (obj != null)
{
obj.Edit(command.WorkshopName, command.InsuranceCode, command.AgreementNumber, command.EmployerName, command.Address,command.ListNumber);
obj.Edit(command.WorkshopName, command.InsuranceCode, command.AgreementNumber, command.EmployerName, command.Address, command.ListNumber);
_context.SaveChanges();
}
else
@@ -103,8 +113,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
try
{
var insuranceListObj = Get(command.Id);
insuranceListObj.Edit(command.SumOfEmployees,command.SumOfWorkingDays,command.SumOfSalaries,command.SumOfBenefitsIncluded,command.Included,command.IncludedAndNotIncluded,command.InsuredShare,
command.EmployerShare,command.UnEmploymentInsurance,command.DifficultJobsInsuranc,command.StartDate,command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance, command.ConfirmSentlist);
insuranceListObj.Edit(command.SumOfEmployees, command.SumOfWorkingDays, command.SumOfSalaries, command.SumOfBenefitsIncluded, command.Included, command.IncludedAndNotIncluded, command.InsuredShare,
command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc, command.StartDate, command.SumOfDailyWage, command.SumOfBaseYears, command.SumOfMarriedAllowance, command.ConfirmSentlist);
var id = insuranceListObj.id;
if (command.EmployeeInsurancListDataList != null && command.EmployeeInsurancListDataList.Count > 0)
@@ -121,14 +131,14 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous,
item.InsuranceShare, item.StartWorkDate,
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
}
else
{
var employeeInsurancListDataObj = _employeeInsurancListDataRepository.Get(item.EmployeeInsurancListDataId);
employeeInsurancListDataObj.Edit(item.WorkingDays,item.DailyWage,item.MonthlySalary,item.MonthlyBenefits,item .MonthlyBenefitsIncluded,item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous,item.InsuranceShare,item.StartWorkDate,item.LeftWorkDate,item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
employeeInsurancListDataObj.Edit(item.WorkingDays, item.DailyWage, item.MonthlySalary, item.MonthlyBenefits, item.MonthlyBenefitsIncluded, item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous, item.InsuranceShare, item.StartWorkDate, item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
}
}
_employeeInsurancListDataRepository.SaveChanges();
@@ -234,7 +244,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//مزایای ماهانه
employeeInsurancListData.MonthlyBenefits = item.MonthlyBenefits;
//دستمزد و مزایای ماهانه مشمول
employeeInsurancListData.MonthlyBenefitsIncluded =item.MonthlyBenefitsIncluded;
employeeInsurancListData.MonthlyBenefitsIncluded = item.MonthlyBenefitsIncluded;
// مزایای مشمول و غیر مشمول
employeeInsurancListData.BenefitsIncludedContinuous = item.BenefitsIncludedContinuous;
//مزایای مشمول غیر مستمر
@@ -253,7 +263,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty; ;
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
if(item.LeftWorkDate!=null)
if (item.LeftWorkDate != null)
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
@@ -266,7 +276,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
#endregion
#region WorkshopIds
var workshopIds = _context.InsuranceListWorkshopSet.Where(x=>x.InsurancListId==id).Select(x => x.WorkshopId).ToList();
var workshopIds = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).Select(x => x.WorkshopId).ToList();
#endregion
#region InsuranceEmployeeInformation
@@ -286,7 +296,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
employeeDetails.DateOfBirthGr = item.DateOfBirth;
employeeDetails.DateOfIssueGr = item.DateOfIssue;
employeeDetails.DateOfBirth = item.DateOfBirth.ToFarsi();
employeeDetails.DateOfIssue = ((item.DateOfIssue.ToFarsi())=="1300/10/11")?"": item.DateOfIssue.ToFarsi();
employeeDetails.DateOfIssue = ((item.DateOfIssue.ToFarsi()) == "1300/10/11") ? "" : item.DateOfIssue.ToFarsi();
employeeDetails.PlaceOfIssue = item.PlaceOfIssue;
employeeDetails.NationalCode = item.NationalCode;
//employeeDetails.Nationality = item.Nationality;
@@ -380,7 +390,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
result => result.workshop.id,
employer => employer.WorkshopId,
(result, employer) => new { result.insurance, result.workshop, employer })
.Select(result => new InsuranceListViewModel
.Select(result => new InsuranceListViewModel
{
Id = result.insurance.id,
Year = result.insurance.Year,
@@ -402,9 +412,28 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
.Where(p => p.Employers.Any(e => e.id == result.employer.First().EmployerId))
.Select(p => p.IsBlock)
.FirstOrDefault(),
EmployerId = result.employer.First().EmployerId
});
EmployerId = result.employer.First().EmployerId,
DebtDone = result.insurance.Debt.IsDone,
EmployerApproved = result.insurance.EmployerApproval.IsDone,
InspectionDone = result.insurance.Inspection.IsDone,
EmployerApprovalStatus = result.insurance.EmployerApproval.Status
});
query = searchModel.Status switch
{
InsuranceListSearchStatus.NotStarted => query.Where(x =>
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
InsuranceListSearchStatus.InProgress => query.Where(x =>
(x.DebtDone || x.EmployerApproved || x.InspectionDone)&& !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
InsuranceListSearchStatus.ReadyToSendList => query.Where(x =>
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
InsuranceListSearchStatus.Done => query.Where(x => x.ConfirmSentlist),
_ => query
};
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month).OrderByDescending(x => x.Id);
@@ -456,7 +485,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//var testquery = query.Where(x => x.Year == searchModel.Year).AsEnumerable();
return query.ToList();
return query.Skip(searchModel.PageIndex).Take(30).ToList();
}
public List<InsuranceListViewModel> Search(InsuranceListSearchModel searchModel)
{
@@ -465,9 +494,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var acountID = _authHelper.CurrentAccountId();
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountID).Select(x => x.WorkshopId).ToList();
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>();
var query = _context.InsuranceListSet.Where(x=> workshopIds.Contains(x.WorkshopId)).ToList();
var query = _context.InsuranceListSet.Where(x => workshopIds.Contains(x.WorkshopId)).ToList();
var insuranceWorkshopInformationList = _context.InsuranceWorkshopInformationSet.Where(u => workshopIds.Contains(u.WorkshopId));
var workshopList = _context.Workshops.Where(u => workshopIds.Contains(u.id));
var workshopList = _context.Workshops.Where(u => workshopIds.Contains(u.id));
foreach (var item in query)
{
@@ -490,19 +519,19 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
typeOfInsuranceSend = "خانوادگی";
}
var insuranceListViewModel =new InsuranceListViewModel()
var insuranceListViewModel = new InsuranceListViewModel()
{
Id = item.id,
Year = item.Year,
Month = item.Month,
MonthNumber = item.Month,
WorkShopCode = insuranceWorkshopInformation==null? workshop.InsuranceCode: insuranceWorkshopInformation.InsuranceCode,
WorkShopCode = insuranceWorkshopInformation == null ? workshop.InsuranceCode : insuranceWorkshopInformation.InsuranceCode,
WorkShopName = insuranceWorkshopInformation == null ? workshop.WorkshopName : insuranceWorkshopInformation.WorkshopName,
WorkShopId = workshop.id ,
WorkShopId = workshop.id,
TypeOfInsuranceSend = typeOfInsuranceSend,
FixedSalary = workshop.FixedSalary,
StrFixedSalary = workshop.FixedSalary?"دارد":"ندارد",
EmployerName = insuranceWorkshopInformation == null? workshop.WorkshopFullName: insuranceWorkshopInformation.EmployerName,
StrFixedSalary = workshop.FixedSalary ? "دارد" : "ندارد",
EmployerName = insuranceWorkshopInformation == null ? workshop.WorkshopFullName : insuranceWorkshopInformation.EmployerName,
Branch = "",
City = "",
ConfirmSentlist = item.ConfirmSentlist,
@@ -530,7 +559,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
list = list.Where(x => x.WorkShopCode == searchModel.WorkShopCode).OrderByDescending(x => x.Year).OrderByDescending(x => x.Month).ThenByDescending(x => x.EmployerName).ToList();
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
list = list.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName) ).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
list = list.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName)).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
if (searchModel.WorkshopId > 0)
@@ -553,7 +582,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
list = list.Where(x => x.EmployerName.Contains(searchModel.EmployerName)).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
if (searchModel.FixedSalary!=null)
if (searchModel.FixedSalary != null)
list = list.Where(x => x.FixedSalary == searchModel.FixedSalary).ToList();
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
@@ -587,7 +616,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var insuranceListObj = _context.InsuranceListSet.Where(x => x.id == id).FirstOrDefault();
if(insuranceListObj!=null)
if (insuranceListObj != null)
Remove(insuranceListObj);
SaveChanges();
@@ -606,11 +635,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
return result;
}
/// <summary>
/// ایجاد لیست بیمه
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
/// <summary>
/// ایجاد لیست بیمه
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public OperationResult CreateInsuranceList(CreateInsuranceList command)
{
OperationResult result = new OperationResult();
@@ -625,7 +654,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
command.InsuredShare,
command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc,
command.StartDate,
command.EndDate, command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance);
command.EndDate, command.SumOfDailyWage, command.SumOfBaseYears, command.SumOfMarriedAllowance);
Create(insuranceListObj);
SaveChanges();
var id = insuranceListObj.id;
@@ -641,10 +670,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous,
item.InsuranceShare, item.StartWorkDate,
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
}_employeeInsurancListDataRepository.SaveChanges();
}
_employeeInsurancListDataRepository.SaveChanges();
}
if (command.WorkshopIds != null && command.WorkshopIds.Count > 0)
@@ -834,7 +864,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
}
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel )
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel)
{
var employeeDetailsViewModel = new MainEmployeeDetailsViewModel();
@@ -845,7 +875,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{
var leftWorkInsurance = _context.LeftWorkInsuranceList
.Where(i => i.EmployeeId == item.EmployeeId && i.WorkshopId == searchModel.WorkshopId)
.AsNoTracking().OrderByDescending(x=>x.id).FirstOrDefault();
.AsNoTracking().OrderByDescending(x => x.id).FirstOrDefault();
var job = _context.Jobs.Where(i => i.id == item.JobId).AsNoTracking().FirstOrDefault();
var employeeInsurancListData = new EmployeeInsurancListDataViewModel();
employeeInsurancListData.EmployeeInsurancListDataId = item.id;
@@ -866,7 +896,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//// مزایای ماهیانه مشمول
employeeInsurancListData.BenefitsIncludedNonContinuous = item.BenefitsIncludedNonContinuous;
//// حقوق و مزایای ماهیانه مشمول و غیر مشمول **
employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous;
employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous;
employeeInsurancListData.BaseYears = item.BaseYears;
employeeInsurancListData.MarriedAllowance = item.MarriedAllowance;
@@ -875,7 +905,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//سهم بیمه حق کارگر
employeeInsurancListData.InsuranceShare = item.InsuranceShare;
// تاریخ شروع به کار
employeeInsurancListData.StartWorkDate =item.StartWorkDate;
employeeInsurancListData.StartWorkDate = item.StartWorkDate;
//تاریخ ترک کار
employeeInsurancListData.LeftWorkDate = item.LeftWorkDate;
// آی دی شغل
@@ -893,7 +923,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//ممکن است کسی شامل مزایا باشد و در آن ماه برایش یا مزد روزانه رد نشده باشد
// باید با یک فیلد چک شود
//
if (leftWorkInsurance != null && ((leftWorkInsurance.IncludeStatus!=leftWorkInsurance.IncludeStatus ) || ((leftWorkInsurance.LeftWorkDate!=item.LeftWorkDate)||(leftWorkInsurance.StartWorkDate != item.StartWorkDate ) ||(leftWorkInsurance.JobId != item.JobId))))
if (leftWorkInsurance != null && ((leftWorkInsurance.IncludeStatus != leftWorkInsurance.IncludeStatus) || ((leftWorkInsurance.LeftWorkDate != item.LeftWorkDate) || (leftWorkInsurance.StartWorkDate != item.StartWorkDate) || (leftWorkInsurance.JobId != item.JobId))))
{
employeeInsurancListData.HasConfilictLeftWork = true;
if (leftWorkInsurance.LeftWorkDate != null)
@@ -924,7 +954,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var employeeDetailsForInsuranceList = new List<EmployeeDetailsForInsuranceListViewModel>();
foreach (var item in insuranceEmployeeInformationList)
{
var employeeObject = _context.Employees.Where(x=>x.id==item.EmployeeId)?.FirstOrDefault();
var employeeObject = _context.Employees.Where(x => x.id == item.EmployeeId)?.FirstOrDefault();
var employeeInsurancListData = employeeInsurancListDataViewModelList.Where(x => x.EmployeeId == item.EmployeeId)?.FirstOrDefault();
var employeeDetails = new EmployeeDetailsForInsuranceListViewModel();
employeeDetails.EmployeeId = item.EmployeeId;
@@ -999,7 +1029,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{
var insuranceListObj = Get(id);
insuranceListObj.Edit(insuranceListObj.SumOfEmployees, insuranceListObj.SumOfWorkingDays, insuranceListObj.SumOfSalaries, insuranceListObj.SumOfBenefitsIncluded, insuranceListObj.Included, insuranceListObj.IncludedAndNotIncluded, insuranceListObj.InsuredShare,
insuranceListObj.EmployerShare, insuranceListObj.UnEmploymentInsurance, insuranceListObj.DifficultJobsInsuranc, insuranceListObj.StartDate, insuranceListObj.SumOfDailyWage,insuranceListObj.SumOfBaseYears,insuranceListObj.SumOfMarriedAllowance,true);
insuranceListObj.EmployerShare, insuranceListObj.UnEmploymentInsurance, insuranceListObj.DifficultJobsInsuranc, insuranceListObj.StartDate, insuranceListObj.SumOfDailyWage, insuranceListObj.SumOfBaseYears, insuranceListObj.SumOfMarriedAllowance, true);
SaveChanges();
@@ -1020,7 +1050,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{
var insuranceListViewModel = new InsuranceListViewModel();
var insuranceList = _context.InsuranceListSet.Where(x => x.WorkshopId == workshopId && x.Year == year).OrderByDescending(x=>x.id)?.FirstOrDefault();
var insuranceList = _context.InsuranceListSet.Where(x => x.WorkshopId == workshopId && x.Year == year).OrderByDescending(x => x.id)?.FirstOrDefault();
if (insuranceList != null)
{
@@ -1031,7 +1061,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
insuranceListViewModel.WorkShopId = insuranceList.WorkshopId;
insuranceListViewModel.ConfirmSentlist = insuranceList.ConfirmSentlist;
}
return insuranceListViewModel;
return insuranceListViewModel;
}
#region client
@@ -1113,11 +1143,46 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
default: return query.OrderByDescending(x => x.Id).Skip(searchModel.PageIndex).ToList();
}
}
public async Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id)
{
var res = await _context.InsuranceListSet.Select(x => new InsuranceListConfirmOperation()
{
InsuranceListId = x.id,
Approval = new CreateInsuranceListApproval()
{
ApprovalStatus = x.EmployerApproval.Status,
Description = x.EmployerApproval.Description,
},
Debt = new CreateInsuranceListDebt()
{
Amount = x.Debt.Amount.ToMoney(),
DebtDate = x.Debt.DebtDate.ToFarsi(),
DebtFileMediaId = x.Debt.MediaId,
Type = x.Debt.Type
},
Inspection = new CreateInsuranceListInspection()
{
Type = x.Inspection.Type,
InspectionFileMediaId = x.Inspection.MediaId,
LastInspectionDate = x.Inspection.LastInspectionDateTime.ToFarsi()
},
ConfirmSentList = x.ConfirmSentlist,
}).FirstOrDefaultAsync(x => x.InsuranceListId == id);
res.Inspection.FilePath = GetInsuranceListFilePath(res.Inspection.InspectionFileMediaId);
res.Debt.FilePath = GetInsuranceListFilePath(res.Debt.DebtFileMediaId);
return res;
}
public List<InsuranceListViewModel> SearchForClientOld(InsuranceListSearchModel searchModel)
{
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>();
var query = _context.InsuranceListSet.Where(x=>x.WorkshopId== searchModel.WorkshopId).ToList();
var query = _context.InsuranceListSet.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
foreach (var item in query)
{
var insuranceWorkshopInformation = _context.InsuranceWorkshopInformationSet.FirstOrDefault(u => u.WorkshopId == item.WorkshopId);
@@ -1194,16 +1259,16 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
#endregion
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay,DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft)
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay, DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft)
{
var lefts = _context.LeftWorkInsuranceList
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x=> new
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new
{
startWork = x.StartWorkDate,
leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value,
}).OrderBy(x=>x.startWork).ToList();
startWork = x.StartWorkDate,
leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value,
}).OrderBy(x => x.startWork).ToList();
int countDay = 0;
foreach (var left in lefts)
{
@@ -1212,12 +1277,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//شمارش فقط تا روز قبل از شروع لیست انجام شود
if (left.leftWork >= listStartDate)
{
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
}
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
}
var count = (int)(end - start).TotalDays +1;
var count = (int)(end - start).TotalDays + 1;
countDay += count;
}
@@ -1229,7 +1294,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//بدست آوردن مزد سنوات بر اساس سابقه به سال
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
if(baseYear == 0)
if (baseYear == 0)
return (0, 0);
@@ -1279,108 +1344,108 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
public List<EmployeeDetailsForInsuranceListViewModel> GetEmployeeInsuranceDataForEdit(long insuranceListId, DateTime startDate, DateTime endDate)
{
var res = _context.EmployeeInsurancListDataSet
.Where(x => x.InsuranceListId == insuranceListId)
.Join(_context.LeftWorkInsuranceList
.Where(x =>
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
((DateTime)x.LeftWorkDate >= startDate &&
(DateTime)x.LeftWorkDate <= endDate)) ||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
(DateTime)x.LeftWorkDate >= endDate) ||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue))
.Where(x => x.StartWorkDate <= endDate)
.Include(x => x.Employee),
employeeData => employeeData.EmployeeId,
leftwork => leftwork.EmployeeId,
(employeeData, leftwork) => new { employeeData, leftwork })
.Join(_context.Jobs,
result => result.leftwork.JobId,
job => job.id,
(result, job) => new { result, job })
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(),
allResult => allResult.result.employeeData.EmployeeId,
employeeInfo => employeeInfo.EmployeeId,
(allResult, employeeInfo) => new
{
allResult.result,
allResult.job,
employeeInfo
})
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo })
.Select(result => new EmployeeDetailsForInsuranceListViewModel
{
StartWorkDateNew = result.x.result.leftwork.StartWorkDate,
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate,
JobIdNew = result.x.result.leftwork.JobId,
var res = _context.EmployeeInsurancListDataSet
.Where(x => x.InsuranceListId == insuranceListId)
.Join(_context.LeftWorkInsuranceList
.Where(x =>
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
((DateTime)x.LeftWorkDate >= startDate &&
(DateTime)x.LeftWorkDate <= endDate)) ||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
(DateTime)x.LeftWorkDate >= endDate) ||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue))
.Where(x => x.StartWorkDate <= endDate)
.Include(x => x.Employee),
employeeData => employeeData.EmployeeId,
leftwork => leftwork.EmployeeId,
(employeeData, leftwork) => new { employeeData, leftwork })
.Join(_context.Jobs,
result => result.leftwork.JobId,
job => job.id,
(result, job) => new { result, job })
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(),
allResult => allResult.result.employeeData.EmployeeId,
employeeInfo => employeeInfo.EmployeeId,
(allResult, employeeInfo) => new
{
allResult.result,
allResult.job,
employeeInfo
})
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo })
.Select(result => new EmployeeDetailsForInsuranceListViewModel
{
StartWorkDateNew = result.x.result.leftwork.StartWorkDate,
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate,
JobIdNew = result.x.result.leftwork.JobId,
StartWorkDateGr = result.x.result.leftwork.StartWorkDate,
LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate,
IncludeStatus = result.x.result.employeeData.IncludeStatus,
JobId = result.x.result.employeeData.JobId,
JobName = result.x.job != null ? result.x.job.JobName : string.Empty,
JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty,
InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0,
EmployeeId = result.x.result.employeeData.EmployeeId,
StartWorkDateGr = result.x.result.leftwork.StartWorkDate,
LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate,
IncludeStatus = result.x.result.employeeData.IncludeStatus,
JobId = result.x.result.employeeData.JobId,
JobName = result.x.job != null ? result.x.job.JobName : string.Empty,
JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty,
InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0,
EmployeeId = result.x.result.employeeData.EmployeeId,
//اطلاعات هویتی
FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.result.leftwork.Employee.FName,
LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.result.leftwork.Employee.LName,
FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.result.leftwork.Employee.FatherName,
DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.result.leftwork.Employee.DateOfBirth,
DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.result.leftwork.Employee.DateOfIssue,
PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.result.leftwork.Employee.PlaceOfIssue,
IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.result.leftwork.Employee.IdNumber,
Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.result.leftwork.Employee.Gender,
NationalCode = result.x.result.leftwork.Employee.NationalCode,
Nationality = result.x.result.leftwork.Employee.Nationality,
InsuranceCode = result.x.result.leftwork.Employee.InsuranceCode,
MaritalStatus = result.x.result.leftwork.Employee.MaritalStatus,
IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.result.leftwork.Employee.MaritalStatus),
//اطلاعات هویتی
FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.result.leftwork.Employee.FName,
LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.result.leftwork.Employee.LName,
FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.result.leftwork.Employee.FatherName,
DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.result.leftwork.Employee.DateOfBirth,
DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.result.leftwork.Employee.DateOfIssue,
PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.result.leftwork.Employee.PlaceOfIssue,
IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.result.leftwork.Employee.IdNumber,
Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.result.leftwork.Employee.Gender,
NationalCode = result.x.result.leftwork.Employee.NationalCode,
Nationality = result.x.result.leftwork.Employee.Nationality,
InsuranceCode = result.x.result.leftwork.Employee.InsuranceCode,
MaritalStatus = result.x.result.leftwork.Employee.MaritalStatus,
IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.result.leftwork.Employee.MaritalStatus),
//اطاعات محاسباتی
EmployeeInsurancListDataId = result.x.result.employeeData.id,
DailyWage = result.x.result.employeeData.DailyWage,
// LeftWorkDateGr = x.LeftWorkDate,
// StartWorkDateGr = x.StartWorkDate,
MonthlyBenefitsIncluded = result.x.result.employeeData.MonthlyBenefitsIncluded,
// JobId = x.JobId,
WorkingDays = result.x.result.employeeData.WorkingDays,
//پایه سنوات
BaseYears = result.x.result.employeeData.BaseYears,
//اطاعات محاسباتی
EmployeeInsurancListDataId = result.x.result.employeeData.id,
DailyWage = result.x.result.employeeData.DailyWage,
// LeftWorkDateGr = x.LeftWorkDate,
// StartWorkDateGr = x.StartWorkDate,
MonthlyBenefitsIncluded = result.x.result.employeeData.MonthlyBenefitsIncluded,
// JobId = x.JobId,
WorkingDays = result.x.result.employeeData.WorkingDays,
//پایه سنوات
BaseYears = result.x.result.employeeData.BaseYears,
//مجموع مزد روزانه و پایه سنوات
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
//مجموع مزد روزانه و پایه سنوات
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
//حق تاهل
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
//حق تاهل
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
//دستمزد ماهانه
MonthlySalary = result.x.result.employeeData.MonthlySalary,
//دستمزد ماهانه
MonthlySalary = result.x.result.employeeData.MonthlySalary,
//مزایای ماهانه
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
//مزایای ماهانه
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
//مزایای مشمول
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
//مزایای مشمول
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
//مزایای غیر مشمول
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
//مزایای غیر مشمول
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
//حق بیمه سهم بیمه شده
InsuranceShare = result.x.result.employeeData.InsuranceShare,
//حق بیمه سهم بیمه شده
InsuranceShare = result.x.result.employeeData.InsuranceShare,
//اضافه کار فیش حقوقی
OverTimePay = result.x.result.employeeData.OverTimePay,
//اضافه کار فیش حقوقی
OverTimePay = result.x.result.employeeData.OverTimePay,
//حق اولا فیش حقوقی
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
});
//حق اولا فیش حقوقی
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
});
//.Select(x => new EmployeeDetailsForInsuranceListViewModel
@@ -1427,4 +1492,120 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
return res.ToList();
}
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
{
var acountId = _authHelper.CurrentAccountId();
var workshopIds = _context.WorkshopAccounts
.Where(a => a.AccountId == acountId)
.Select(a => a.WorkshopId);
var query = _context.InsuranceListSet
.Where(x => workshopIds.Contains(x.WorkshopId))
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
insurance => insurance.WorkshopId,
workshop => workshop.id,
(insurance, workshop) => new { insurance, workshop })
.GroupJoin(_context.WorkshopEmployers,
result => result.workshop.id,
employer => employer.WorkshopId,
(result, employer) => new { result.insurance, result.workshop, employer })
.Select(result => new InsuranceListViewModel
{
Id = result.insurance.id,
Year = result.insurance.Year,
Month = result.insurance.Month,
WorkShopId = result.insurance.WorkshopId,
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
FixedSalary = result.workshop.FixedSalary,
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
ConfirmSentlist = result.insurance.ConfirmSentlist,
EmployerId = result.employer.First().EmployerId,
DebtDone = result.insurance.Debt.IsDone,
EmployerApproved = result.insurance.EmployerApproval.IsDone,
InspectionDone = result.insurance.Inspection.IsDone
});
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
else
{
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Month == searchModel.Month);
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
query = query.Where(x => x.Year == searchModel.Year);
}
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
if (searchModel.WorkshopId > 0)
{
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
query = query.Where(x => x.WorkShopName.Contains(workshopName));
}
if (searchModel.EmployerId > 0)
{
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
query = query.Where(x => x.EmployerName.Contains(employerName));
}
if (!string.IsNullOrEmpty(searchModel.EmployerName))
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
if (searchModel.FixedSalary != null)
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
query = query.Where(x => x.City == searchModel.City);
if (!string.IsNullOrEmpty(searchModel.Branch))
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
var res = await query.GroupBy(x => 1)
.Select(g => new InsuranceListTabsCountViewModel
{
NotStarted = g.Count(x =>
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
InProgress = g.Count(x =>
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
ReadyToSendList = g.Count(x =>
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
Done = g.Count(x => x.ConfirmSentlist)
})
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
return res;
}
/// <summary>
///
/// </summary>
/// <param name="year"></param>
/// <param name="month"></param>
/// <param name="insuranceListId"></param>
/// <param name="type">debt / inspection</param>
/// <returns></returns>
private string GetInsuranceListFilePath(long mediaId)
{
return _accountContext.Medias.FirstOrDefault(x => x.id == mediaId)?.Path ?? "";
}
}

View File

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

View File

@@ -61,7 +61,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
_holidayItemRepository = holidayItemRepository;
_testDbContext = testDbContext;
}
}
#region OfficialChckout
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
@@ -108,8 +108,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
#endregion
@@ -125,10 +125,11 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
groupedRollCall = rollCallResult.GroupBy(x => x.ShiftDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value,EndWithOutResTime = s.ShiftEndWithoutRest.Value != null ? s.ShiftEndWithoutRest.Value : new DateTime()}).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)),
BreakTime = x.First().BreakTimeSpan
}).OrderBy(x => x.CreationDate).ToList();
}
@@ -145,16 +146,31 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x =>
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
TimeSpan breakTime;
if (contractStart > endOfFarvardin)
{
breakTime = CalculateBreakTime(
x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
}
else
{
breakTime = CalculateBreakTime(breakTimeEntity, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
}
return new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value, EndWithOutResTime = s.EndDate!.Value })
.ToList(),
HasFriday = x.Any(s =>
s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday ||
s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - breakTime,
BreakTime = breakTime,
};
}).OrderBy(x => x.CreationDate).ToList();
}
@@ -228,9 +244,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
double minutesDecimal = (starndardHoursesPerTotalDays - hours) * 60;
int minutes = (int)minutesDecimal;
TimeSpan totalLeaveSpan = TimeSpan.Zero;
TimeSpan starndardHoursesPerTotalDaysSapn = new TimeSpan(hours, minutes, 0);
if (leaveSearchResult.Count > 0)
if (leaveSearchResult.Count > 0 || hoursesleave.Count > 0)
{
if (leaveSearchResult.Any(x => x.HasShiftDuration))
{
@@ -261,8 +277,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
}
totalLeaveSpan = totalLeave;
}
else
{
int leavingDayCout = 0;
@@ -311,7 +327,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
{
sumSpans = sumSpans.Add(sumLeave);
}
}
totalLeaveSpan = sumLeave;
}
}
@@ -343,9 +361,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//***********************************//
var dailyFix = TimeSpan.Parse("07:20");
TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
//var dailyFix = TimeSpan.Parse("07:20");
//TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
//TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60;
double overTimeWork = 0;
@@ -621,45 +639,75 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
{
validCount = 8;
validCount = 6;
}
else
{
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
validCount = (int)((totalDays * 8) / 28);
validCount = (int)((totalDays * 6) / 28);
}
string maxName;
int maxValue = moriningCount;
if (moriningCount >= validCount)
RotatingfaName.Add("صبح");
if (eveningCount >= validCount)
RotatingfaName.Add("عصر");
if (nightCount >= validCount)
RotatingfaName.Add("شب");
var rotatingFaResult = "";
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
{
shiftOver22Hours = "0";
shiftOver22Minuts = "0";
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else if (RotatingfaName.Count <= 1)
{
rotatingFaResult = "نوبت کاری ندارد";
maxName = "moriningCount";
if (eveningCount > maxValue)
{
maxValue = eveningCount;
maxName = "eveningCount";
}
if (nightCount > maxValue)
{
maxValue = nightCount;
maxName = "nightCount";
}
var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
int countOutOfRange = 0;
switch (maxName)
{
case "moriningCount":
countOutOfRange = eveningCount + nightCount;
break;
case "eveningCount":
countOutOfRange = moriningCount + nightCount;
break;
case "nightCount":
countOutOfRange = moriningCount + eveningCount;
break;
}
var rotatingFaResult = "";
if (countOutOfRange >= validCount)
{
shiftOver22Hours = "0";
shiftOver22Minuts = "0";
if (moriningCount >= 1)
RotatingfaName.Add("صبح");
if (eveningCount >= 1)
RotatingfaName.Add("عصر");
if (nightCount >= 1)
RotatingfaName.Add("شب");
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else
{
rotatingFaResult = "نوبت کاری ندارد";
var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
}
}
#endregion
//******* محاسبه مبلغ نوبت کاری *************
#region ShiftPayPercent
@@ -688,11 +736,30 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
}
#endregion
#endregion
#region Result
#region Result
LeaveSearchModel sickLeaveSearch = new LeaveSearchModel()
{
EmployeeId = employeeId,
WorkshopId = workshopId,
LeaveType = "استعلاجی",
PaidLeaveType = "روزانه",
StartLeaveGr = contractStart,
EndLeaveGr = contractEnd,
IsAccepted = true,
};
var sickLeaveSearchResult = _leaveRepository.search(sickLeaveSearch);
var res = new ComputingViewModel()
var sickLeaveTimeSpans = sickLeaveSearchResult.Select(x =>
{
var startLeave = contractStart > x.StartLeaveGr ? contractStart : x.StartLeaveGr;
var endLeave = contractEnd < x.EndLeaveGr ? contractEnd : x.EndLeaveGr;
return (endLeave - startLeave).Add(TimeSpan.FromDays(1));
});
var totalBreakTime = new TimeSpan(groupedRollCall.Sum(x => x.BreakTime.Ticks));
var res = new ComputingViewModel()
{
NumberOfWorkingDays = $"{groupedRollCall.Count}",
@@ -720,60 +787,70 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
TotalHolidayAndNotM = totalHolidaysAndNotM.ToString(),
DayliFeeComplete = dayliFeeComplete,
MarriedAllowance = MarriedAllowanceStr,
RotatingShiftValue = shiftPayValue
};
RotatingShiftValue = shiftPayValue,
#region SaveRollCall
GroupedRollCalls = groupedRollCall,
TotalWorkingTimeSpan = sumSpansWhitOutleaves,
TotalBreakTimeSpan = totalBreakTime,
TotalPresentTimeSpan = sumSpansWhitOutleaves + totalBreakTime,
TotalPaidLeave = totalLeaveSpan,
TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x=>x.Ticks)),
#endregion
};
#endregion
return res;
}
/// <summary>
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
/// </summary>
/// <param name="employeeId"></param>
/// <param name="workshopId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <returns></returns>
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
DateTime contractStart, DateTime contractEnd)
{
//bool hasRollcall =
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
//if (!hasRollcall)
// return (false, new TimeSpan());
List<RollCallViewModel> rollCallResult;
List<GroupedRollCalls> groupedRollCall;
/// <summary>
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
/// </summary>
/// <param name="employeeId"></param>
/// <param name="workshopId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <returns></returns>
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
DateTime contractStart, DateTime contractEnd)
{
//bool hasRollcall =
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
//if (!hasRollcall)
// return (false, new TimeSpan());
List<RollCallViewModel> rollCallResult;
List<GroupedRollCalls> groupedRollCall;
rollCallResult = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
CreationDate = x.ShiftDate,
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
rollCallResult = _context.RollCalls.Where(x =>
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
{
StartDate = x.StartDate,
EndDate = x.EndDate,
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
CreationDate = x.ShiftDate,
BreakTimeSpan = x.BreakTimeSpan
}).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
}).OrderBy(x => x.CreationDate).ToList();
}).OrderBy(x => x.CreationDate).ToList();
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
return (true, sumSpans);
}
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
return (true, sumSpans);
}
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
@@ -864,20 +941,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
// شبکاری
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
var RotatingfaName = new List<string>();
//if (shiftwork != "1" && shiftwork != "2" && shiftwork != "4")//اگر چرخشی بود و منظم نبود
//{
// if (moriningCount > 0)
// RotatingfaName.Add("صبح");
// if (eveningCount > 0)
// RotatingfaName.Add("عصر");
// if (nightCount > 0)
// RotatingfaName.Add("شب");
//}
//else// اگر منظم و شیفتی بود
//{
//}
var totalDays = (int)(contractEnd - contractStart).TotalDays + 1;
int validCount = 0;
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
@@ -894,37 +958,66 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
validCount = (int)((totalDays * 6) / 28);
}
Console.WriteLine(validCount);
if (moriningCount >= validCount)
RotatingfaName.Add("صبح");
if (eveningCount >= validCount)
RotatingfaName.Add("عصر");
if (nightCount >= validCount)
RotatingfaName.Add("شب");
var rotatingFaResult = "";
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
{
string maxName;
int maxValue = moriningCount;
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else if (RotatingfaName.Count <= 1)
{
rotatingFaResult = "نوبت کاری ندارد";
maxName = "moriningCount";
if (eveningCount > maxValue)
{
maxValue = eveningCount;
maxName = "eveningCount";
}
if (nightCount > maxValue)
{
maxValue = nightCount;
maxName = "nightCount";
}
int countOutOfRange = 0;
switch (maxName)
{
case "moriningCount":
countOutOfRange = eveningCount + nightCount;
break;
case "eveningCount":
countOutOfRange = moriningCount + nightCount;
break;
case "nightCount":
countOutOfRange = moriningCount + eveningCount;
break;
}
var rotatingFaResult = "";
if (countOutOfRange >= validCount)
{
if (moriningCount >= 1)
RotatingfaName.Add("صبح");
if (eveningCount >= 1)
RotatingfaName.Add("عصر");
if (nightCount >= 1)
RotatingfaName.Add("شب");
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else
{
rotatingFaResult = "نوبت کاری ندارد";
}
}
return new ComputingViewModel
{
@@ -939,19 +1032,19 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
//{
// if (breakTime.BreakTimeType != BreakTimeType.WithTime)
// return new TimeSpan();
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
{
if (breakTime.BreakTimeType != BreakTimeType.WithTime)
return new TimeSpan();
// var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
// if (breakTimeSpan * 2 >= sumOneDaySpan)
// return new TimeSpan();
if (breakTimeSpan * 2 >= sumOneDaySpan)
return new TimeSpan();
// return breakTimeSpan; ;
return breakTimeSpan; ;
//}
}
public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
{
if (breakTimeSpan * 2 >= sumOneDaySpan)
@@ -2090,7 +2183,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var starTimeSingel1 = Convert.ToDateTime(shift1Start);
var endTimeSingel2 = Convert.ToDateTime(shift1End);
bool hasRestTime = false;
bool hasRestTime = false;
shift1StartGr = new DateTime(cuurentDate.Year, cuurentDate.Month, cuurentDate.Day, starTimeSingel1.Hour, starTimeSingel1.Minute, 0);
@@ -2099,92 +2192,92 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay)
shift1EndGr = shift1EndGr.AddDays(1);
var shiftEndWithoutRest = shift1EndGr;
var shiftEndWithoutRest = shift1EndGr;
var shiftSpan = (shift1EndGr - shift1StartGr);
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
{
hasRestTime = true;
shift1EndGr = shift1EndGr.Subtract(restTime);
shiftSpan = (shift1EndGr - shift1StartGr);
var shiftSpan = (shift1EndGr - shift1StartGr);
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
{
hasRestTime = true;
shift1EndGr = shift1EndGr.Subtract(restTime);
shiftSpan = (shift1EndGr - shift1StartGr);
}
}
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType =="روزانه"))
{
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
if (hourseLeaveTypeResult == null)
{
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = shift1EndGr,
ShiftSpan = shiftSpan,
ShiftDate = shift1StartGr,
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "روزانه"))
{
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
if (hourseLeaveTypeResult == null)
{
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = shift1EndGr,
ShiftSpan = shiftSpan,
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else
{
});
}
else
{
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
});
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
{
//leave <-------------------->
//shift <---------------------------------->
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
result.Add(new RollCallViewModel()
{
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
});
});
}
@@ -2241,6 +2334,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
EndDate = shift2EndGr,
ShiftSpan = (shift2EndGr - shift2StartGr),
ShiftDate = shift1?.ShiftDate ?? shift2EndGr,
ShiftEndWithoutRest = shift2EndGr,
});
}
else
@@ -2256,7 +2350,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
EndDate = shift2EndGr,
ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1?.EndDate ?? shift2EndGr,
});
ShiftEndWithoutRest = shift2EndGr,
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr < shift2EndGr)
{
@@ -2268,7 +2363,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
ShiftDate = shift1?.EndDate ?? shift2EndGr,
});
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
});
result.Add(new RollCallViewModel()
{
@@ -2276,7 +2372,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
EndDate = shift2EndGr,
ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1?.EndDate ?? shift2EndGr,
});
ShiftEndWithoutRest = shift2EndGr,
});
}
else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift2EndGr)
{
@@ -2289,7 +2386,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
ShiftDate = shift1?.EndDate ?? shift2EndGr,
});
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
});
}
@@ -3021,13 +3119,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var endFarvarding = new DateTime(2025, 4, 20);
if (contractStart>endFarvarding)
if (contractStart > endFarvarding)
{
customizeWorkshopEmployeeSettings=_context.CustomizeWorkshopEmployeeSettings
customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings
.AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
customizeWorkshopSettings =_context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
}
else
@@ -3982,40 +4080,40 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}).ToList();
}
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
{
return _context.Loans
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
.SelectMany(x => x.LoanInstallments)
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
.Select(x => new LoanInstallmentViewModel()
{
Id = x.Id,
Month = x.Month,
IsActive = x.IsActive,
Amount = x.AmountForMonth.ToMoney(),
Year = x.Year,
AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
.Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList();
}
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
{
return _context.Loans
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
.SelectMany(x => x.LoanInstallments)
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
.Select(x => new LoanInstallmentViewModel()
{
Id = x.Id,
Month = x.Month,
IsActive = x.IsActive,
Amount = x.AmountForMonth.ToMoney(),
Year = x.Year,
AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
.Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList();
}
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
{
return _context.SalaryAids
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
{
Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount,
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime,
CalculationDateTimeGe = x.CalculationDate,
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
Id = x.id
}).ToList();
}
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
{
return _context.SalaryAids
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
{
Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount,
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime,
CalculationDateTimeGe = x.CalculationDate,
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
Id = x.id
}).ToList();
}
private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year,
DateTime contractStart)

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -485,7 +485,10 @@ public class IndexModel : PageModel
TotalHolidaysAndNotH = mandatoryCompute.TotalHolidayAndNotH,
TotalHolidaysAndNotM = mandatoryCompute.TotalHolidayAndNotM,
DailFeeComplete = mandatoryCompute.DayliFeeComplete,
Signature = checkout.Signature
Signature = checkout.Signature,
};
_checkoutApplication.Create(command);
//if (checkout.Signature == "1")
@@ -963,7 +966,21 @@ public class IndexModel : PageModel
TotalDayOfBunosesCompute = bunosesPay.Bunoses > 0 ? $"{bunosesPay.TotalDayCompute}" : "0",
HolidayWorking = workshop.WorkshopHolidayWorking,
ShiftWork = workingHours.ShiftWork,
};
TotalWorkingTimeSpan=mandatoryCompute.TotalWorkingTimeSpan,
TotalBreakTimeSpan=mandatoryCompute.TotalBreakTimeSpan,
TotalPresentTimeSpan=mandatoryCompute.TotalPresentTimeSpan,
TotalPaidLeave=mandatoryCompute.TotalPaidLeave,
TotalSickLeave=mandatoryCompute.TotalSickLeave,
GroupedRollCalls = mandatoryCompute.GroupedRollCalls,
HasInsuranceChekoutOverTime = workshop.InsuranceCheckoutOvertime
};
_checkoutApplication.Create(command);
//var workshopId = $"{contract.WorkshopIds}";
@@ -1013,7 +1030,7 @@ public class IndexModel : PageModel
public IActionResult OnGetPrintOne(long id)
{
var res = _checkoutApplication.PrintOne(id);
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault();
//var res = _contractApplication.PrintAll(ids);
if (res.HasRollCall) return Partial("PrintDetailsRollCall", res);

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,23 +2,34 @@
@Html.AntiForgeryToken()
@{
<style>
<style>
.modal-content {
height: 847px !important;
}
.select2.select2-container .select2-selection {
border: 1px solid #aeaeae;
height: 35px;
}
.select2-container--default .select2-selection--multiple {
min-height: 50px !important;
padding: 6px 8px;
overflow-y: auto;
}
@@media (max-width: 1550px) {
.modal-content {
height: 847px !important;
height: 655px !important;
}
}
@@media (max-width: 1550px) {
.modal-content {
height: 655px !important;
}
@@media (max-width: 1370px) {
.modal-content {
height: 582px !important;
}
@@media (max-width: 1370px) {
.modal-content {
height: 582px !important;
}
}
</style>
}
</style>
}
<div class="container">
@@ -36,7 +47,7 @@
<div class="row form" style="width: 100%;">
<input type="hidden" class="input td-ellipsis" id="isLegal" />
<input type="hidden" class="input " id="hfTypeOfInsuranceSendWorkshop" />
<input type="hidden" class="input" id="hfTypeOfInsuranceSendWorkshop" />
<input type="hidden" class="input" id="hfFixedSalary">
<input type="hidden" class="input" id="hfPopulation">
<input type="hidden" class="input" id="hfInsuranceJobId">
@@ -44,7 +55,7 @@
<div class="col-md-3 col-3 col-sm-3 inputs" id="karfarma-container" disabled>
<input type="text" class="input td-ellipsis" id="karfarma" />
</div>
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs ">
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs">
<select class="input select-city" asp-for="@Model.WorkshopId" onchange="getEmployerAndWorkshopInfo(this.value);" asp-items="@Model.WorkShopSelectList">
<option value="0" selected hidden> کارگاه </option>
</select>
@@ -77,7 +88,7 @@
</select>
</div>
</div>
<div class="col-md-12 col-12 col-sm-12 inputs">
<div class="col-md-12 col-12 col-sm-12 inputs" style="padding: 0 18px;height: 45px">
@* <select name="dropdown5" id="workshops" asp-for="@Model.WorkshopIds" asp-items='@Model.WorkShopSelectList' class="input multi-drop text-right select-city2" multiple>
<option value="0" disabled hidden> کارگاه ها </option>
</select>*@
@@ -87,7 +98,7 @@
</div>
<!--اطلاعات کارگاه-->
<div class="col-md-12 col-12 col-sm-12 form-box" id="divInsuranceWorkshopInfo">
@* <div class="d-flex">
@* <div class="d-flex">
<span class="form-title">کپی از آخرین لیست ارسالی </span>
<div id="resultExistPersonel" class="alert alert-danger" style="display:none"></div>
</div> *@
@@ -127,7 +138,7 @@
</div>
<div class="col-md-12 col-12 col-sm-12 sml-pad">
<ul class="nav nav-tabs" style="margin-right: -36px;">
<ul class="nav nav-tabs" style="margin-right: 4px;">
<li class="active pull-right DSSKAR">
<a href="#DSSKAR" data-toggle="tab">DSSKAR</a>
</li>
@@ -137,81 +148,81 @@
</ul>
<div class="tab-content">
<div class="tab-pane active" id="DSSKAR">
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br/> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10"> تعداد نفرات </label>
<input type="text" placeholder="" id="txtSumOfEmployees" asp-for="SumOfEmployees" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع پایه سنواتی </label>
<input type="text" placeholder="" id="txtSumOfBaseYears" asp-for="SumOfBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع روزهای کارکرد کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfWorkingDays" asp-for="SumOfWorkingDays" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول </label>
<input type="text" placeholder="" id="txtIncluded" asp-for="Included" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد روزانه کل پرسنل </label>
<input type="text" placeholder="" id="txtSumOfDailyWage" asp-for="SumOfDailyWage" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع مزایای ماهانه غیرمشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncludedNonContinuous" value="0" name="SumOfBenefitsIncludedNonContinuous" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع دستمزد روزانه <br /> (دستمزد روزانه + پایه سنواتی) </label>
<input type="text" placeholder="" id="txtSumOfDailyWagePlusBaseYears" value="0" name="SumOfDailyWagePlusBaseYears" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد و مزایای ماهانه مشمول و غیرمشمول (ریال) </label>
<input type="text" placeholder="" id="txtIncludedAndNotIncluded" asp-for="IncludedAndNotIncluded" class="input yellow col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> جمع دستمزد ماهانه (حقوق ماهانه) </label>
<input type="text" placeholder="" id="txtSumOfSalaries" asp-for="SumOfSalaries" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم بیمه شده (7%) </label>
<input type="text" placeholder="" id="txtInsuredShare" asp-for="InsuredShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع حق تاهل </label>
<input type="text" placeholder="" id="txtSumOfMarriedAllowance" asp-for="SumOfMarriedAllowance" class="input green col-md-2 col-2 col-sm-2">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه سهم کارفرما (20%) </label>
<input type="text" placeholder="" id="txtEmployerShare" asp-for="EmployerShare" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10"> حق بیمه بیکاری (3%) </label>
<input type="text" placeholder="" id="txtUnEmploymentInsurance" asp-for="UnEmploymentInsurance" class="input blue col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6" style="display: none">
</div>
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group" style="display: none">
<label class="col-md-10 col-10 col-sm-10 text-small"> 4% سخت و زیان آور </label>
@@ -346,9 +357,9 @@
<div class="s9s">
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="WorkingDays"> روزهای کارکرد</label>
@* <input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="getMonthlySalaryByWorkingDays()" name="WorkingDays" maxlength="2"> *@
<input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="changeWorkingDays()" name="WorkingDays" maxlength="2">
<input type="hidden" class="input s7 " id="OldWorkingDays" maxlength="2">
@* <input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="getMonthlySalaryByWorkingDays()" name="WorkingDays" maxlength="2"> *@
<input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="changeWorkingDays()" name="WorkingDays" maxlength="2">
<input type="hidden" class="input s7" id="OldWorkingDays" maxlength="2">
<input type="hidden" class="input s7" id="HousingAllowance" name="HousingAllowance">
<input type="hidden" class="input s7" id="ConsumableItems" name="ConsumableItems">
<input type="hidden" class="input s7" id="EndMonthCurrentDay" name="EndMonthCurrentDay">
@@ -360,8 +371,8 @@
</div>
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="DailyWage">دستمزد روزانه</label>
<input type="text" class="input s7 " id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
<input type="hidden" class="input s7 " id="yearlySalaryItem">
<input type="text" class="input s7" id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
<input type="hidden" class="input s7" id="yearlySalaryItem">
</div>
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
@@ -402,7 +413,7 @@
<input type="hidden" class="input" id="LeftWorkDateGr" name="LeftWorkDateGr" autocomplete="off" style="background-color: #f7aeae;">
</div>
</div>
<div id="divComputing" class="col-md-12 col-12 text-center ">
<div id="divComputing" class="col-md-12 col-12 text-center">
<button type="button" id="btnComputing" onclick="computing()" disabled="disabled" class="btn modal2-btn insurance-disabled btn-primary">محاسبه </button>
</div>
</div>
@@ -419,9 +430,9 @@
</div>
<div class="btns">
<div class="col-md-5">
<a href="#" class=" btn btn-modal" id="save">ذخیره</a>
<a href="#" class=" btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
@*<button type="submit" class=" btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
<a href="#" class="btn btn-modal" id="save">ذخیره</a>
<a href="#" class="btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
@*<button type="submit" class="btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
</div>
@@ -1046,6 +1057,9 @@
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
@@ -1369,7 +1383,17 @@
if (response.isSuccedded == true) {
$.Notification.autoHideNotify('success', 'top right', response.message);
$("#MainModal").modal('hide');
$('.btn-search1').click();
// $('.btn-search1').click();
// Reload Function
pageIndexJs = 0;
hasMoreData = true;
var $activeTab = $('.tab-bar__tab--active');
var activeValue = $activeTab.val();
$('#load-data-html').html('');
loadGetTabCounts();
loadSearchNew(activeValue);
} else {
$.Notification.autoHideNotify('error', 'top right', response.message);
}

View File

@@ -7,6 +7,17 @@
height: 847px !important;
}
.select2.select2-container .select2-selection {
border: 1px solid #aeaeae;
height: 35px;
}
.select2-container--default .select2-selection--multiple {
min-height: 50px !important;
padding: 6px 8px;
overflow-y: auto;
}
@@media (max-width: 1550px) {
.modal-content {
height: 655px !important;
@@ -18,7 +29,6 @@
height: 582px !important;
}
}
</style>
}
@@ -37,7 +47,7 @@
data-ajax="true">
<div id="divEmployeeInsurancListData"></div>
<input type="hidden" class="input td-ellipsis" id="isLegal"/>
<input type="hidden" class="input " id="hfTypeOfInsuranceSendWorkshop" value="@Model.TypeOfInsuranceSend"/>
<input type="hidden" class="input" id="hfTypeOfInsuranceSendWorkshop" value="@Model.TypeOfInsuranceSend"/>
<input type="hidden" class="input" id="hfFixedSalary" value="@Model.FixedSalary" >
<input type="hidden" class="input" id="hfPopulation" value="@Model.Population" >
<input type="hidden" class="input" id="hfInsuranceJobId" >*@
@@ -47,9 +57,9 @@
<div class="col-md-3 col-3 col-sm-3 inputs" id="karfarma-container" disabled>
<input type="text" class="input td-ellipsis" id="karfarma"/>
</div>
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs ">
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs">
<input type="text" class="input" asp-for="@Model.WorkshopName" disabled/>
<input type="hidden" class="input " asp-for="@Model.WorkshopId"/>
<input type="hidden" class="input" asp-for="@Model.WorkshopId"/>
@* <select class="input select-city" disabled="disabled" asp-for="@Model.WorkshopId" asp-items='@Model.WorkShopSelectList'>
<option value="0" selected hidden> کارگاه </option>
</select>
@@ -79,7 +89,7 @@
</select>
</div>
</div>
<div class="col-md-12 col-12 col-sm-12 inputs">
<div class="col-md-12 col-12 col-sm-12 inputs" style="padding: 0 18px;height: 45px">
@* <select name="dropdown5" id="workshops" asp-for="@Model.WorkshopIds" asp-items='@Model.WorkShopSelectList' class="input multi-drop text-right select-city2" multiple>
<option value="0" disabled hidden> کارگاه ها </option>
</select>*@
@@ -95,7 +105,7 @@
</div> *@
<div class="col-md-3 col-3 col-sm-3 inputs">
<input type="hidden" class="input green input-field" asp-for="@Model.InsuranceWorkshopInfo.InsuranceWorkshopInfoId">
<input type="hidden" class="input green input-field" asp-for="@Model.InsuranceWorkshopInfo.InsuranceWorkshopInfoId">
<input type="text" class="input green notEmpty input-field" asp-for="@Model.InsuranceWorkshopInfo.WorkshopName" placeholder="نام کارگاه">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs">
@@ -128,7 +138,7 @@
<input type="hidden" class="input green" value="" id="InsuranceWorkshopInfo_ListNumber" name="InsuranceWorkshopInfo.ListNumber">
</div>
<div class="col-md-12 col-12 col-sm-12 sml-pad">
<ul class="nav nav-tabs" style="margin-right: -36px;">
<ul class="nav nav-tabs" style="margin-right: 4px;">
<li class="active pull-right DSSKAR">
<a href="#DSSKAR" data-toggle="tab">DSSKAR</a>
</li>
@@ -200,7 +210,7 @@
<div class="col-md-6 col-6 col-sm-6 inputs-group">
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
</div>
<div class="col-md-6 col-6 col-sm-6 inputs-group">
@@ -262,7 +272,7 @@
<label for="LName"> نام خانوادگی</label>
<input type="text" class="input f9" id="LName" name="LName" autocomplete="off">
</div>
<div class="col-md-4 col-4 col-sm-4 " style="padding:10px">
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="Gender"> جنسیت </label>
<input type="text" class="input f9" id="Gender" name="Gender" autocomplete="off">
@@ -292,8 +302,8 @@
<div class="s9s">
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="WorkingDays"> روزهای کارکرد</label>
<input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="changeDailyWage();" name="WorkingDays">
<input type="hidden" class="input s7 " id="OldWorkingDays" maxlength="2">
<input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="changeDailyWage();" name="WorkingDays">
<input type="hidden" class="input s7" id="OldWorkingDays" maxlength="2">
<input type="hidden" class="input s7" id="HousingAllowance" name="HousingAllowance">
<input type="hidden" class="input s7" id="ConsumableItems" name="ConsumableItems">
<input type="hidden" class="input s7" id="EndMonthCurrentDay" name="EndMonthCurrentDay">
@@ -305,8 +315,8 @@
</div>
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="DailyWage">دستمزد روزانه</label>
<input type="text" class="input s7 " id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
<input type="hidden" class="input s7 " id="yearlySalaryItem">
<input type="text" class="input s7" id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
<input type="hidden" class="input s7" id="yearlySalaryItem">
</div>
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
<label for="MonthlySalary"> حقوق ماهیانه + پایه سنوات </label>
@@ -342,7 +352,7 @@
<input type="hidden" class="input" id="LeftWorkDateGr" name="LeftWorkDateGr" autocomplete="off" style="background-color: #f7aeae;">
</div>
</div>
<div id="divComputing" class="col-md-12 col-12 text-center ">
<div id="divComputing" class="col-md-12 col-12 text-center">
<button type="button" id="btnComputing" onclick="computing()" disabled="disabled" class="btn insurance-disabled modal2-btn btn-primary">محاسبه </button>
</div>
</div>
@@ -358,9 +368,9 @@
</div>
<div class="btns">
<div class="col-md-5">
<a href="#" class=" btn btn-modal" id="save">ویرایش</a>
<a href="#" class=" btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
@*<button type="submit" class=" btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
<a href="#" class="btn btn-modal" id="save">ویرایش</a>
<a href="#" class="btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
@*<button type="submit" class="btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
</div>
@@ -766,7 +776,8 @@
employeeDetails.BaseYears = Number($(this).find('td:eq(10)').attr('data-BaseYears'));
employeeDetails.DailyWagePlusBaseYears = Number($(this).find('td:eq(11)').attr('data-DailyWagePlusBaseYears'));
employeeDetails.BenefitsIncludedNonContinuous = Number($(this).find('td:eq(5)').attr('data-BenefitsIncludedNonContinuous'));
employeeDetails.Year = $("#Year").val();
employeeDetails.Month = $("#ddlMonth").val();
employeeDetailsForInsuranceList.push(employeeDetails);
});
//console.log(employeeDetailsForInsuranceList);
@@ -1244,7 +1255,17 @@
if (response.isSuccedded == true) {
$.Notification.autoHideNotify('success', 'top right', response.message);
$("#MainModal").modal('hide');
$('.btn-search1').click();
// $('.btn-search1').click();
// Reload Function
pageIndexJs = 0;
hasMoreData = true;
var $activeTab = $('.tab-bar__tab--active');
var activeValue = $activeTab.val();
$('#load-data-html').html('');
loadGetTabCounts();
loadSearchNew(activeValue);
} else {
$.Notification.autoHideNotify('error', 'top right', response.message);
}

View File

@@ -26,6 +26,8 @@ public class IndexModel : PageModel
private readonly IInsuranceListApplication _insuranceListApplication;
private readonly IInsuranceWorkshopInfoApplication _insuranceWorkshopInfoApplication;
private readonly IAuthHelper _authHelper;
private readonly IJobApplication _jobApplication;
//private readonly IInsuranceEmployeeInfoApplication _insuranceEmployeeInfoApplication;
@@ -45,7 +47,7 @@ public class IndexModel : PageModel
IYearlySalaryApplication yearlySalaryApplication, IEmployerApplication employerApplication,
IInsuranceWorkshopInfoApplication insuranceWorkshopInfoApplication, IEmployeeApplication employeeApplication,
IJobApplication jobApplication,
IWebHostEnvironment webHostEnvironment) // , IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication )
IWebHostEnvironment webHostEnvironment, IAuthHelper authHelper) // , IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication )
{
_jobApplication = jobApplication;
_insuranceListApplication = insuranceListApplication;
@@ -56,6 +58,7 @@ public class IndexModel : PageModel
_employeeApplication = employeeApplication;
//_insuranceEmployeeInfoApplication = insuranceEmployeeInfoApplication;
_webHostEnvironment = webHostEnvironment;
_authHelper = authHelper;
}
@@ -175,7 +178,7 @@ public class IndexModel : PageModel
double included = 0; //مشمول
double sumOfWorkingDays = 0;
double benefitsIncludedNonContinuous = 0; //مزایای ماهانه غیر مشمول
double sumOfSalaries = 0;
double sumOfSalaries = 0;
double sumOfDailyWage = 0;
double insuredShare = 0;
double employerShare = 0; //سهم بیمه کارفرما
@@ -186,15 +189,28 @@ public class IndexModel : PageModel
double benefitsIncludedContinuous = 0;
double sumOfIncludedKarfarma = 0;
var hasKarfarma = false;
var karfamaCount = 0;
double countWithoutLeft = 0;
double sumOfBaseYears = 0;
double sumOfMarriedAllowance = 0;
double sumOfDailyWagePlusBaseYear = 0;
double yearlySalaryDailyWage = 0;
if (employeeDetailsForInsuranceList.Count > 0)
{
var employeeDetail = employeeDetailsForInsuranceList.First();
var startMonthFa = $"{employeeDetail.Year}/{employeeDetail.Month.PadLeft(2, '0')}/01";
DateTime startDateGr = startMonthFa.ToGeorgianDateTime();
DateTime endDateGr = startMonthFa.FindeEndOfMonth()
.ToGeorgianDateTime();
int endOfMonth = Convert.ToInt32((startMonthFa.FindeEndOfMonth()).Substring(8, 2));
yearlySalaryDailyWage = _yearlySalaryApplication.GetInsuranceItems(startDateGr, endDateGr, employeeDetail.Year).DayliWage;
}
double sumOfBenefitIncludedAndNotIncluded = 0; //مشمول و غیر مشمول
double sumOfDailyWagePlusBaseYear = 0;
double sumOfBenefitIncludedAndNotIncluded = 0; //مشمول و غیر مشمول
double sumOfMonthlySalaryWithoutBaseYears = 0; //جمع حقوق ماهیانه بدون پایه سنوات
for (var i = 0; i < employeeDetailsForInsuranceList.Count; i++)
for (var i = 0; i < employeeDetailsForInsuranceList.Count; i++)
{
var leftWorkDay = "";
if (!string.IsNullOrWhiteSpace(employeeDetailsForInsuranceList[i].LeftWorkDate))
@@ -211,16 +227,16 @@ public class IndexModel : PageModel
}
//بدست آوردن جمع پایه سنواتی
var baseYear = employeeDetailsForInsuranceList[i].BaseYears *
employeeDetailsForInsuranceList[i].WorkingDays;
sumOfBaseYears += baseYear;
var baseYear = employeeDetailsForInsuranceList[i].BaseYears *
employeeDetailsForInsuranceList[i].WorkingDays;
sumOfBaseYears += baseYear;
//بدست آوردن جمع حق تاهل
sumOfMarriedAllowance += employeeDetailsForInsuranceList[i].MarriedAllowance;
//بدست آوردن جمع حق تاهل
sumOfMarriedAllowance += employeeDetailsForInsuranceList[i].MarriedAllowance;
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
// if (employeeDetailsForInsuranceList[i].IncludeStatus && (employeeDetailsForInsuranceList[i].JobId == 10 || employeeDetailsForInsuranceList[i].JobId == 17 || employeeDetailsForInsuranceList[i].JobId == 18 || employeeDetailsForInsuranceList[i].JobId == 16))// 10 --> karfarma
if (!employeeDetailsForInsuranceList[i].IncludeStatus &&
(employeeDetailsForInsuranceList[i].JobCode == "027079" ||
employeeDetailsForInsuranceList[i].JobCode == "024398" ||
employeeDetailsForInsuranceList[i].JobCode == "011015" ||
@@ -239,7 +255,15 @@ public class IndexModel : PageModel
if (employeeDetailsForInsuranceList[i].JobCode == "024398") //کارفرما
{
hasKarfarma = true;
sumOfIncludedKarfarma = employeeDetailsForInsuranceList[i].BenefitsIncludedContinuous;
sumOfIncludedKarfarma += employeeDetailsForInsuranceList[i].BenefitsIncludedContinuous;
karfamaCount++;
}
else
{
//Mahan Changes
//مجموع حقوق ماهیانه خالص
sumOfMonthlySalaryWithoutBaseYears +=
GetRoundValueWhitGovermentlist(yearlySalaryDailyWage * employeeDetailsForInsuranceList[i].WorkingDays, typeOfInsuranceSendWorkshop);
}
sumOfWorkingDays = sumOfWorkingDays + employeeDetailsForInsuranceList[i].WorkingDays;
@@ -248,14 +272,15 @@ public class IndexModel : PageModel
monthlyBenefits = monthlyBenefits + +employeeDetailsForInsuranceList[i].MonthlyBenefits;
sumOfIncluded = sumOfIncluded + employeeDetailsForInsuranceList[i].BenefitsIncludedContinuous;
sumOfDailyWagePlusBaseYear += employeeDetailsForInsuranceList[i].DailyWagePlusBaseYears;
sumOfDailyWagePlusBaseYear += employeeDetailsForInsuranceList[i].DailyWagePlusBaseYears;
if (leftWorkDay != "01") //اگر ترک کار آن یکم ماه نبود
if (leftWorkDay != "01") //اگر ترک کار آن یکم ماه نبود
sumOfBenefitIncludedAndNotIncluded += employeeDetailsForInsuranceList[i].IncludedAndNotIncluded;
benefitsIncludedNonContinuous += employeeDetailsForInsuranceList[i].BenefitsIncludedNonContinuous;
insuredShare = insuredShare + employeeDetailsForInsuranceList[i].InsuranceShare;
benefitsIncludedNonContinuous += employeeDetailsForInsuranceList[i].BenefitsIncludedNonContinuous;
insuredShare = insuredShare + employeeDetailsForInsuranceList[i].InsuranceShare;
}
employerShare = GetRoundValueWhitGovermentlist(sumOfIncluded * 20 / 100, typeOfInsuranceSendWorkshop);
@@ -264,41 +289,85 @@ public class IndexModel : PageModel
var totalEmployee = sumOfEmployees;
//sumOfEmployees = sumOfEmployees - countWithoutLeft;
#region heydari
if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft <= 5 && !hasKarfarma)
//console.log(1);
employerShare = 0;
if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft <= 6 && hasKarfarma)
var workingEmployeesCount = sumOfEmployees - countWithoutLeft; //تعداد کارگران بدون ترک کار
if (hasKarfarma)
{
//console.log(sumOfIncludedKarfarma);
var result = sumOfIncludedKarfarma * 20 / 100;
employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
workingEmployeesCount -= karfamaCount; //تعداد کارگران بدون ترک کار و بدون کارفرما
}
if (typeOfInsuranceSendWorkshop == "Govermentlist")
{
if (workingEmployeesCount <= 5)
{
var result = ((sumOfIncluded - sumOfMonthlySalaryWithoutBaseYears) * 20 / 100);
employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
if (hasKarfarma)
{
employerShare += (sumOfIncludedKarfarma * 20 / 100);
}
}
else
{
var governmentPay = (sumOfMonthlySalaryWithoutBaseYears / workingEmployeesCount) * 5;
var extraAmount = sumOfMonthlySalaryWithoutBaseYears - governmentPay;
var employeeSumOfIncluded = sumOfIncluded - sumOfIncludedKarfarma;
var employeesBenefits = employeeSumOfIncluded - sumOfMonthlySalaryWithoutBaseYears;
var result = extraAmount + employeesBenefits;
employerShare = result * 20 / 100;
if (hasKarfarma)
{
var karfarmaShare = sumOfIncludedKarfarma * 20 / 100;
employerShare += GetRoundValueWhitGovermentlist(karfarmaShare, typeOfInsuranceSendWorkshop);
}
}
}
if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft >= 6 && !hasKarfarma)
{
//ابتدا جمع کل مزایا به دست می آید
//جمع کل مزایا تقسیم بر تعداد کارگران منهای کسانی که ترک کار کرده اند.
//حاصل عبارت بالا در 5 ضرب میشو یعنی میانگینی برای محاسبه قیمت 5 نفر حساب می کنیم تا از طریق دولت پرداخت شود
//if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft <= 5 && !hasKarfarma)
//{
// employerShare = 0;
var result = (sumOfIncluded - sumOfIncluded / (sumOfEmployees - countWithoutLeft) * 5) * 20 / 100;
//}
////console.log(1);
employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
}
//if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft <= 6 && hasKarfarma)
//{
// //console.log(sumOfIncludedKarfarma);
// var result = sumOfIncludedKarfarma * 20 / 100;
// employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
//}
if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft > 6 && hasKarfarma)
{
// console.log(4);
//مجموع حقوق و مزایای ماهانه مشمول - حقوق و مزایای ماهانه مشمول کارفرما
var sum = sumOfIncluded - sumOfIncludedKarfarma; //ستون مربوط به کارفرما محاسبه نمی شود
var result = (sum - sum / (sumOfEmployees - countWithoutLeft - 1) * 5 + sumOfIncludedKarfarma) * 20 / 100;
employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
}
#endregion
//if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft >= 6 && !hasKarfarma)
//{
// //ابتدا جمع کل مزایا به دست می آید
// //جمع کل مزایا تقسیم بر تعداد کارگران منهای کسانی که ترک کار کرده اند.
// //حاصل عبارت بالا در 5 ضرب میشو یعنی میانگینی برای محاسبه قیمت 5 نفر حساب می کنیم تا از طریق دولت پرداخت شود
// var result = (sumOfIncluded - sumOfIncluded / (sumOfEmployees - countWithoutLeft) * 5) * 20 / 100;
// employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
//}
//if (typeOfInsuranceSendWorkshop == "Govermentlist" && sumOfEmployees - countWithoutLeft > 6 && hasKarfarma)
//{
// // console.log(4);
// //مجموع حقوق و مزایای ماهانه مشمول - حقوق و مزایای ماهانه مشمول کارفرما
// var sum = sumOfIncluded - sumOfIncludedKarfarma; //ستون مربوط به کارفرما محاسبه نمی شود
// var result = (sum - sum / (sumOfEmployees - countWithoutLeft - 1) * 5 + sumOfIncludedKarfarma) * 20 / 100;
// employerShare = GetRoundValueWhitGovermentlist(result, typeOfInsuranceSendWorkshop);
//}
////اگر گارگاه کمک دولت بود بعد از اجرای فرمول ها
////بیست درصد از اختلاف ( مجموع حقوق خالص با مجموع مزایای مشمول ) به سهم کارفرما اضافه میشود
//if (typeOfInsuranceSendWorkshop == "Govermentlist")
//{
//}
//sumOfIncluded مجموع حقوق و مزایای ماهیانه مشمول
// عادی
@@ -396,15 +465,15 @@ public class IndexModel : PageModel
//جمع پایه سنواتی
SumOfBaseYears = sumOfBaseYears.ToMoney(),
//جمع حق تاهل
SumOfMarriedAllowance = sumOfMarriedAllowance.ToMoney(),
SumOfMarriedAllowance = sumOfMarriedAllowance.ToMoney(),
//جمع دستمزد روزانه + پایه سنوات روزانه
SumOfDailyWagePlusBaseYears = sumOfDailyWagePlusBaseYear.ToMoney(),
//جمع دستمزد روزانه + پایه سنوات روزانه
SumOfDailyWagePlusBaseYears = sumOfDailyWagePlusBaseYear.ToMoney(),
//جمع مزایای غیر مشمول
SumOfBenefitsIncludedNonContinuous = benefitsIncludedNonContinuous.ToMoney(),
SumOfBenefitsIncludedNonContinuous = benefitsIncludedNonContinuous.ToMoney(),
});
});
}
@@ -559,14 +628,14 @@ public class IndexModel : PageModel
odbf.Header.AddColumn(new DbfColumn("DSK_DISC", DbfColumn.DbfColumnType.Character, 100, 0));
//تعداد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_NUM", DbfColumn.DbfColumnType.Number, 5, 0));
//مجموع روزهای کارکرد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TDD", DbfColumn.DbfColumnType.Number, 6, 0));
//مجموع روزهای کارکرد کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TDD", DbfColumn.DbfColumnType.Number, 6, 0));
//مجموع دستمزد روزانه کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TROOZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع دستمزد ماهانه کارکنان
odbf.Header.AddColumn(new DbfColumn("DSK_TMAH", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMAZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMAZ", DbfColumn.DbfColumnType.Number, 12, 0));
//مجموع دستمزد و مزایای ماهانه مشمول
odbf.Header.AddColumn(new DbfColumn("DSK_TMASH", DbfColumn.DbfColumnType.Number, 12, 0));
// مجموع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
@@ -586,11 +655,11 @@ public class IndexModel : PageModel
//ردیف پیمان
odbf.Header.AddColumn(new DbfColumn("MON_PYM", DbfColumn.DbfColumnType.Character, 3, 0));
//مجموع پایه سنواتی ها
odbf.Header.AddColumn(new DbfColumn("DSK_INC", DbfColumn.DbfColumnType.Character, 12, 0));
//مجموع حق تاهل ها
odbf.Header.AddColumn(new DbfColumn("DSK_SPOUSE", DbfColumn.DbfColumnType.Character, 12, 0));
var orec = new DbfRecord(odbf.Header);
//مجموع پایه سنواتی ها
odbf.Header.AddColumn(new DbfColumn("DSK_INC", DbfColumn.DbfColumnType.Character, 12, 0));
//مجموع حق تاهل ها
odbf.Header.AddColumn(new DbfColumn("DSK_SPOUSE", DbfColumn.DbfColumnType.Character, 12, 0));
var orec = new DbfRecord(odbf.Header);
//کد کارگاه
orec[0] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.InsuranceCode, 10);
@@ -612,12 +681,12 @@ public class IndexModel : PageModel
orec[8] = GetSpecifiedCharactes("", 100).ToIranSystem();
//تعداد کرکنان
orec[9] = createInsuranceList.SumOfEmployees.ToString();
//مجموع روزهای کارکرد کارکنان
orec[10] = createInsuranceList.SumOfWorkingDays.ToString();
//مجموع روزهای کارکرد کارکنان
orec[10] = createInsuranceList.SumOfWorkingDays.ToString();
//مجموع دستمزد روزانه کارکنان
orec[11] = createInsuranceList.SumOfDailyWage.ToString();
//مجموع دستمزد ماهانه کارکنان
orec[12] = createInsuranceList.SumOfSalaries.ToString();
//مجموع دستمزد ماهانه کارکنان
orec[12] = createInsuranceList.SumOfSalaries.ToString();
//مجموع مزایای ماهانه مشمول
orec[13] = createInsuranceList.SumOfBenefitsIncluded.ToString();
//مجموع دستمزد و مزایای ماهانه مشمول
@@ -628,7 +697,7 @@ public class IndexModel : PageModel
orec[16] = createInsuranceList.InsuredShare.ToString();
//مجموع حق بیمه سهم کارفرما
orec[17] = createInsuranceList.EmployerShare.ToString(); //"44911361";
//مجموع حق بیمه بیکاری
//مجموع حق بیمه بیکاری
orec[18] = createInsuranceList.UnEmploymentInsurance.ToString();
//نرخ حق بیمه
orec[19] = "23";
@@ -639,13 +708,13 @@ public class IndexModel : PageModel
//ردیف پیمان
orec[22] = GetSpecifiedCharactes(createInsuranceList.InsuranceWorkshopInfo.AgreementNumber, 12);
//مجموع پایه سنواتی ها
orec[23] = createInsuranceList.SumOfBaseYears.ToString();
//مجموع پایه سنواتی ها
orec[23] = createInsuranceList.SumOfBaseYears.ToString();
//مجموع حق تاهل ها
orec[24] = createInsuranceList.SumOfMarriedAllowance.ToString();
//مجموع حق تاهل ها
orec[24] = createInsuranceList.SumOfMarriedAllowance.ToString();
odbf.Write(orec);
odbf.Write(orec);
//odbf.Header.RecordCount = 50;
odbf.WriteHeader();
odbf.Close();
@@ -712,12 +781,12 @@ public class IndexModel : PageModel
// کد ملی
dsw.Header.AddColumn(new DbfColumn("PER_NATCOD", DbfColumn.DbfColumnType.Character, 10, 0));
// پایه سنوات
dsw.Header.AddColumn(new DbfColumn("DSW_INC", DbfColumn.DbfColumnType.Number, 12, 0));
// حق تاهل
dsw.Header.AddColumn(new DbfColumn("DSW_SPOUSE", DbfColumn.DbfColumnType.Number, 12, 0));
// پایه سنوات
dsw.Header.AddColumn(new DbfColumn("DSW_INC", DbfColumn.DbfColumnType.Number, 12, 0));
// حق تاهل
dsw.Header.AddColumn(new DbfColumn("DSW_SPOUSE", DbfColumn.DbfColumnType.Number, 12, 0));
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
foreach (var item in createInsuranceList.EmployeeInsurancListDataList)
{
var employee = createInsuranceList.EmployeeDetailsForInsuranceList.FirstOrDefault(p => p.EmployeeId == item.EmployeeId);
@@ -795,12 +864,12 @@ public class IndexModel : PageModel
//کد ملی
dswrec[26] = employee.NationalCode;
//پایه سنوات
dswrec[27] = item.BaseYears.ToString();
//حق تاهل
dswrec[28] = item.MarriedAllowance.ToString();
//پایه سنوات
dswrec[27] = item.BaseYears.ToString();
//حق تاهل
dswrec[28] = item.MarriedAllowance.ToString();
dsw.Write(dswrec);
dsw.Write(dswrec);
}
@@ -842,18 +911,18 @@ public class IndexModel : PageModel
return Partial("Edit", insurance);
}
//-2
/// <summary>
/// لود اطلاعات پرسنل در مودال ویرایش بیمه -- DSKWOR
/// محاسبه تب پرسنل
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
public IActionResult OnGetEmployeeListForEdit(EmployeeForEditInsuranceListSearchModel searchModel)
//-2
/// <summary>
/// لود اطلاعات پرسنل در مودال ویرایش بیمه -- DSKWOR
/// محاسبه تب پرسنل
/// </summary>
/// <param name="searchModel"></param>
/// <returns></returns>
public IActionResult OnGetEmployeeListForEdit(EmployeeForEditInsuranceListSearchModel searchModel)
{
// var result = _insuranceListApplication.SearchEmployeeListForEditByInsuranceListId(searchModel);
var result = _insuranceListApplication.GetEmployeeListForEditByInsuranceListId(searchModel);
return Partial("./EmployeeListForEdit", result);
// var result = _insuranceListApplication.SearchEmployeeListForEditByInsuranceListId(searchModel);
var result = _insuranceListApplication.GetEmployeeListForEditByInsuranceListId(searchModel);
return Partial("./EmployeeListForEdit", result);
}
//-3
@@ -922,7 +991,7 @@ public class IndexModel : PageModel
string benefitsIncludedContinuous, string jobId, string housingAllowance, string includeStatus,
string consumableItems, string endMonthCurrentDay, long employeeId, double maritalStatus, double baseYear)
{
if(workingDays == "0")
if (workingDays == "0")
return new JsonResult(new
{
monthlySalaryPlusBaseYear = "0",
@@ -939,12 +1008,12 @@ public class IndexModel : PageModel
var benefitsIncludedContinuousL = benefitsIncludedContinuous.MoneyToDouble();
bool isManager = jobId is "10" or "16" or "17" or "18" or "3498";
bool isManager = jobId is "10" or "16" or "17" or "18" or "3498";
//if (isManager && includeStatus !="1") شنبه
if (isManager)
maritalStatus = 0;
double sum = 0;
double sum = 0;
var employeeMaritalStatus = _employeeApplication.GetDetails(employeeId);
if (employeeMaritalStatus.MaritalStatus == "متاهل")
sum = consumableItems.MoneyToDouble() + housingAllowance.MoneyToDouble() + maritalStatus;
@@ -957,10 +1026,10 @@ public class IndexModel : PageModel
var jobIdL = Convert.ToInt64(jobId);
var includeStatusL = Convert.ToInt64(includeStatus);
var dailyWageL = (dailyWage.MoneyToDouble()) + baseYear;
var dailyWageWithOutBaseYear = dailyWage.MoneyToDouble();
var dailyWageWithOutBaseYear = dailyWage.MoneyToDouble();
if (workingDaysL == endMonthCurrentDayL) benefitsIncludedContinuousL = sum;
if (workingDaysL == endMonthCurrentDayL) benefitsIncludedContinuousL = sum;
//farokhiChanges
if (employeeId == 42783)
benefitsIncludedContinuousL = 53082855;
@@ -983,24 +1052,24 @@ public class IndexModel : PageModel
// benefitsIncludedContinuousL = 0;
//}
if (isManager && includeStatus != "1")
benefitsIncludedContinuousL = 0;
benefitsIncludedContinuousL = 0;
var monthlySalaryL = workingDaysL * dailyWageL;
var insuranceShareL = (benefitsIncludedContinuousL + monthlySalaryL) * 7 / 100;
insuranceShareL = _insuranceListApplication.GetRoundValue(insuranceShareL);
var monthlySalaryWithOutBaseYear = workingDaysL * dailyWageWithOutBaseYear;
//var persianBefore = "";
//var year = Convert.ToInt32(date.Substring(0, 4));
//var month = Convert.ToInt32(date.Substring(5, 2));
//var day = Convert.ToInt32(date.Substring(8, 2));
//var persianDate = new PersianDateTime(year, month, day);
//var persianBeforeDate = persianDate.AddDays(-1);
//persianBefore = persianBeforeDate.ToString("yyyy/MM/dd");
var monthlySalaryWithOutBaseYear = workingDaysL * dailyWageWithOutBaseYear;
//var persianBefore = "";
//var year = Convert.ToInt32(date.Substring(0, 4));
//var month = Convert.ToInt32(date.Substring(5, 2));
//var day = Convert.ToInt32(date.Substring(8, 2));
//var persianDate = new PersianDateTime(year, month, day);
//var persianBeforeDate = persianDate.AddDays(-1);
//persianBefore = persianBeforeDate.ToString("yyyy/MM/dd");
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 && dailyWageL == 0)
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 && dailyWageL == 0)
workingDaysL = 0;
if (benefitsIncludedContinuousL == 0 && monthlySalaryL == 0 && insuranceShareL == 0 &&
workingDaysL == 0) dailyWageL = 0;
workingDaysL == 0) dailyWageL = 0;
var includeStatusBool = includeStatus == "1";
double marridAllowance = 0;
@@ -1010,20 +1079,20 @@ public class IndexModel : PageModel
includeStatusBool, Convert.ToInt32(workingDays), maritalStatus, Convert.ToInt32(endMonthCurrentDay));
}
var baseYears = baseYear;
var baseYears = baseYear;
Console.WriteLine(baseYears);
return new JsonResult(new
{
monthlySalaryPlusBaseYear = monthlySalaryL.ToMoney(),
monthlySalary = monthlySalaryWithOutBaseYear.ToMoney(),
monthlySalaryPlusBaseYear = monthlySalaryL.ToMoney(),
monthlySalary = monthlySalaryWithOutBaseYear.ToMoney(),
benefitsIncludedContinuous = benefitsIncludedContinuousL.ToMoney(),
insuranceShare = insuranceShareL.ToMoney(),
workingDay = workingDaysL,
dailyWag = dailyWageWithOutBaseYear.ToMoney(),
dailyWagePlusBaseYear = dailyWageL,
dailyWagePlusBaseYear = dailyWageL,
marriedAllowance = marridAllowance.ToMoney(),
baseYears = baseYears.ToMoney(),
});
});
}
@@ -1078,4 +1147,51 @@ public class IndexModel : PageModel
}
#endregion
#region Insurance Operations
public IActionResult OnGetSearchNew(InsuranceListSearchModel searchModel)
{
var resultData = _insuranceListApplication.Search(searchModel);
return new JsonResult(new
{
success = true,
data = resultData,
pageIndex = resultData.Count
});
}
public async Task<IActionResult> OnGetTabCounts(InsuranceListSearchModel searchModel)
{
var resultData = await _insuranceListApplication.GetTabCounts(searchModel);
return new JsonResult(new
{
notStarted = resultData.NotStarted,
inProgress = resultData.InProgress,
readyToSendList = resultData.ReadyToSendList,
done = resultData.Done,
});
}
public async Task<IActionResult> OnGetOperationsModal(long id)
{
var command = await _insuranceListApplication.GetInsuranceOperationDetails(id);
return Partial("_Partials/OperationsModal", command);
}
public async Task<IActionResult> OnPostSaveOperationsModal(InsuranceListConfirmOperation command)
{
var result = await _insuranceListApplication.ConfirmInsuranceOperation(command);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
});
}
#endregion
}

View File

@@ -0,0 +1,662 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.InsuranceList.IndexOldModel
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
Layout = "Shared/_AdminLayout";
ViewData["title"] = "بیمه";
var selctedOption = "selectedOption";
}
@*select2 css start*@
<style>
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #dfdfdf;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
background: #bed3ca;
border-radius: 5px;
}
.opt {
background-color: #d3e7ff;
border-radius: 10px;
text-align: right;
padding: 2px 5px;
text-overflow: ellipsis;
overflow-x: hidden;
width: 100%;
}
.noResult {
background-color: #c0dcfd;
border-radius: 10px;
text-align: right;
padding: 2px 5px;
}
.opt:hover, .noResult:hover {
background-color: #afd0f7 !important;
color: #343434 !important;
}
.selectDiv {
position: relative;
z-index: 2;
border-radius: 10px;
min-height: 20px;
max-height: 190px;
overflow: hidden scroll;
width: 100%;
background-color: rgb(255 255 255);
display: block;
box-shadow: 0px -1px 12px 0px rgba(0,0,0,.16), 2px 1px 10px 0 rgba(0,0,0,.12);
}
.selectedOption {
color: #424242 !important;
background-color: #cee4fb !important;
}
.keyboardSelected {
color: #424242 !important;
background-color: #b1d5ff !important;
}
.bgGray, .bgGray:hover {
background-color: #b5b5b5 !important;
color: #646464;
}
a.disabled {
pointer-events: none;
cursor: default;
background-color: grey !important;
border-color: grey !important;
}
</style>
<link href="~/admintheme/css/insurance-list.css?ver=@adminVersion" rel="stylesheet" />
<div class="row">
<div class="col-sm-12 m-r-10">
<div class="printBtns" style="display: none;">
<button id="closeModal" type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal" style="float: left">بستن</button>
<button id="btnPrint2" type="button" class="btn btn-success btn-rounded waves-effect waves-light" style="float: left">پرینت </button>
</div>
<p class="">
@* pull-right *@
<a href="#showmodal=@Url.Page("/Company/InsuranceList/Index", "OperationsModal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> مودال ویرایش </a>
<a permission="80210" id="btnPopModal" href="#showmodal=@Url.Page("/Company/InsuranceList/Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد لیست بیمه </a>
</p>
</div>
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed">
جستجوی لیست بیمه ی کارگاه ها
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse in collapse">
<div class="panel-body">
@*===================================================================================================================*@
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" name="search-theme-form" id="search-theme-form" autocomplete="off"
method="get"
data-ajax="true"
data-ajax-method="get"
data-ajax-update="#mainPanelSearch"
data-ajax-mode="replace"
data-ajax-url="@Url.Page("./Index","Search")">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="display: flex;">
<div class="date-title">انتخاب تاریخ</div>
<div class="year-box">
<label class="sr-only"></label>
<select class="form-control" asp-for="searchModel.Year" style="width: 100%">
<option value="0" >سال</option>
@foreach (string itemi in @Model.YearlyList)
{
if (Model.CurrentYear_ == itemi)
{
<option selected value="@itemi"> @itemi </option>
}
else
{
<option value="@itemi"> @itemi </option>
}
}
</select>
</div>
<div class="month-box">
<label class="sr-only"></label>
<select class="form-control" asp-for="searchModel.Month" style="width: 100%">
<option value="0" > ماه</option>
<option value="01"> فروردین</option>
<option value="02"> اردیبهشت</option>
<option value="03"> خرداد</option>
<option value="04"> تیر</option>
<option value="05"> مرداد</option>
<option value="06"> شهریور</option>
<option value="07"> مهر</option>
<option value="08"> آبان</option>
<option value="09"> آذر</option>
<option value="10"> دی</option>
<option value="11"> بهمن</option>
<option value="12"> اسفند</option>
</select>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<label class="sr-only"></label>
<input class="form-control" placeholder="کد کارگاهی" asp-for="searchModel.WorkShopCode" style="width: 100%">
</div>
<div style="height:40px" class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<label class="sr-only"></label>
<input type="hidden" class="sendEmployerId" asp-for="searchModel.EmployerId" />
<input type="hidden" asp-for="searchModel.EmployerName" />
<input type="search" id="empSearchEmployer" value="@Model.EmployerFullName" class="form-control inpt @{ if(!string.IsNullOrWhiteSpace(@Model.EmployerFullName)){ @selctedOption } }" autocomplete="off" placeholder=" نام کارفرما " style="width: 100%;position: relative">
<div id="empEmployer" class="selectDiv" style="display: none;">
<ul class="searchResultEmployer m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
@* <input class="form-control" placeholder="نام کارفرما" asp-for="searchModel.EmployerName" style="width: 100%"> *@
</div>
<div style="height:40px" class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<label class="sr-only"></label>
<input type="hidden" class="sendWorkshopId" asp-for="searchModel.WorkshopId" />
<input type="hidden" asp-for="searchModel.WorkShopName" />
<input type="search" id="empSearchWorkshop" value="@Model.WorkshopFullName" class="form-control @{ if(!string.IsNullOrWhiteSpace(@Model.WorkshopFullName)){ @selctedOption } }" autocomplete="off" placeholder=" نام کارگاه /شماره بایگانی " style="width: 100%; position: relative">
<div id="empWorkshop" class="selectDiv" style="display: none;">
<ul class="searchResultWorkshop m-t-10" style="list-style-type: none; padding: 5px">
</ul>
</div>
@* <input class="form-control" placeholder="نام کارگاه" asp-for="searchModel.WorkShopName" style="width: 100%"> *@
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;">
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
<label class="sr-only"></label>
<select class="form-control" asp-for="searchModel.TypeOfInsuranceSend" style="width: 100%">
<option value="0" selected >نوع ارسال لیست</option>
<option value="عادی"> عادی </option>
<option value="کمک دولت">کمک دولت</option>
<option value="خانوادگی">خانوادگی</option>
</select>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
<label class="sr-only"></label>
<input class="form-control" asp-for="searchModel.Branch" placeholder="شعبه تامین اجتماعی " style="width: 100%">
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
<select class="form-control" style="width: 100%" asp-for="searchModel.City">
<option value="0" selected >شهرستان</option>
</select>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
<select class="form-control" style="width: 100%" asp-for="searchModel.FixedSalary">
<option selected >لیست مقطوع</option>
<option value="true"> دارد</option>
<option value="false">ندارد</option>
</select>
</div>
</div>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
</div>
<div class="col-lg-3">
<button type="button" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 btn-search1">
<i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو
</button>
<a onclick="removeSearch()" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 btn-observe">حذف جستجو</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list faSize"></i> لیست بیمه ی کارگاه ها </h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12" id="mainPanelSearch">
<div id="waiting" style="display: none;padding-right: 10px">
<i class="ion-loading-a" style="font-size: 16px"> </i> در حال بارگذاری...
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@section Script
{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/admintheme/js/admin.js" ></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
}
<script>
$(document).ready(function () {
$("#searchModel_Month").val('@Model.BeforCurrentMonth_');
$('.btn-search1').click();
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
$('.btn-search1').on('click', function () {
$("#waiting").show();
var myTable = $("#datatable");
myTable.remove();
if ($("#searchModel_EmployerId").val() == "0" || $("#searchModel_EmployerId").val() == "")
$("#searchModel_EmployerName").val($("#empSearchEmployer").val());
if ($("#searchModel_WorkshopId").val() == "0" || $("#searchModel_WorkshopId").val() == "")
$("#searchModel_WorkShopName").val($("#empSearchWorkshop").val());
$("#search-theme-form").submit();
});
function removeSearch()
{
var month = '@Model.BeforCurrentMonth_';
console.log(month);
$("#waiting").show();
var myTable = $("#datatable");
myTable.remove();
$("#searchModel_WorkshopId").val("0");
$("#searchModel_EmployerId").val("0");
$("#searchModel_WorkShopName").val('');
$("#searchModel_EmployerName").val('');
$(".form-control").val('');
$("#searchModel_Year").val(@Model.CurrentYear_);
$("#searchModel_Month").val(month);
$("#searchModel_TypeOfInsuranceSend").val(0);
$("#searchModel_City").val(0);
$("#searchModel_FixedSalary").val('لیست مقطوع');
$("#search-theme-form").submit();
}
$('#search-theme-form').submit(function(e){
e.preventDefault();
e.stopImmediatePropagation();
$.ajax({
type: "POST",
url: $(this).attr( 'action' ),
data: $(this).serialize(),
success: function (response) {
console.log(response);
if (response.isSuccedded == true) {
// $.Notification.autoHideNotify('success', 'top right', response.message);
}
else{
$.Notification.autoHideNotify('error', 'top right', response.message);
}
}
});
return false;
});
</script>
<script>
//------workshop-----
var containerWorkshop = $('#empWorkshop');
var searchBoxWorkshop = $('#empSearchWorkshop');
var hiddenInputValWorkshop = $('.sendWorkshopId');
var searchResulWorkshop = $('.searchResultWorkshop');
var mixContainerAndSerchResultWorkshop = $('#empWorkshop , .searchResultWorkshop');
containerWorkshop.hide();
var liListWorkshop;
var liPointerWorkshop;
let countWorkshop = 0;
//close search Employee when click on body
$(document).on('click', function (event) {
if (!$(event.target).closest(containerWorkshop).length) {
containerWorkshop.hide();
}
});
//select option by mouse
function selectItemWorkshop(id, employeeFullName) {
searchBoxWorkshop.val(employeeFullName);
hiddenInputValWorkshop.val(id);
containerWorkshop.hide();
searchBoxWorkshop.addClass("selectedOption");
};
//search by Ajax
searchBoxWorkshop.on('keyup keypress',
function (e) {
$(".form-control").removeClass("selectedOption");
//----clean Employer------
$("#searchModel_EmployerName").val('');
$("#searchModel_EmployerId").val('0');
//----clean Employee------
// $("#SearchModel_EmployeeName").val('');
// $("#SearchModel_Id").val('0');
if ($(this).val() == '') {
}
//stop submit form with enter
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
liPointerWorkshop.click();
}
return false;
}
searchBoxWorkshop.removeClass("selectedOption");
let searchText = $(this).val();
hiddenInputValWorkshop.val(0);
if (searchText.length > 1) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "WorkshopName")',
data: { "searchText": searchText },
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function (response) {
$(".opt").remove();
if (response.mylist.length > 0) {//result Founded
// console.log(response.mylist);
$(".noResult").remove();
containerWorkshop.show();
$.each(response.mylist,
function (i, item) {
let li = `<li data-workshopId="${item.id}" class="btn btn-block opt" onclick="selectItemWorkshop(${item.id}, '${item.workshopFullName}');" >`;
li = li + '<span class="name-right" > ' + item.workshopFullName + ' </span><span class="line">|</span> <span class="code-left" > ' + item.archiveCode + ' </span></li> ';
searchResulWorkshop.append(li);
});
} else {//result NotFounded
$(".noResult").remove();
containerWorkshop.show();
let noResult = `<li class="btn btn-block noResult">نتیجه ای یافت نشد</li>`;
searchResulWorkshop.append(noResult);
}
}// endOfSuccess
}); //endOfAjax
} else {
containerWorkshop.hide();
countWorkshop = 0;
}
//keyboard Arrow Key Select And Enter
liListWorkshop = $('#empWorkshop ul li');
mixContainerAndSerchResultWorkshop.animate({
scrollTop: $(liListWorkshop.eq(0)).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
},
50);
if (e.which === 40) {// if ArrowUp
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
liPointerWorkshop.removeClass('keyboardSelected');
console.log(countWorkshop + "plusOne");
liListWorkshop.eq(countWorkshop).addClass('keyboardSelected');
liPointerWorkshop = liListWorkshop.eq(countWorkshop);
if (countWorkshop > 4) {
//ScrollDown
mixContainerAndSerchResultWorkshop.animate({
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
},
50);
}
countWorkshop += 1;
} else {
liListWorkshop.eq(0).addClass("keyboardSelected");
liPointerWorkshop = liListWorkshop.eq(0);
countWorkshop = 1;
}
} else if (e.which === 38) {//if ArrowDown
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
liPointerWorkshop.removeClass('keyboardSelected');
countWorkshop -= 1;
liListWorkshop.eq(countWorkshop).addClass('keyboardSelected');
liPointerWorkshop = liListWorkshop.eq(countWorkshop);
//ScrollUp
mixContainerAndSerchResultWorkshop.animate({
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
},
50);
}
}
});
$("#empSearchWorkshop").keypress(function (event) {
$(".form-control").removeClass("selectedOption");
$("#empSearchEmployer").val('');
$("#empSearch").val('');
$("#searchModel_EmployerName").val('');
$("#searchModel_EmployerId").val('');
// $("#SearchModel_Id").val("0");
// $("#SearchModel_EmployeeName").val('');
if (event.keyCode === 13) {
if ($("#searchModel_WorkshopId").val() == "0")
$("#searchModel_WorkShopName").val($("#empSearchWorkshop").val())
$('.btn-search1').click();
}
});
</script>
<script>
//------Employer-----
var containerEmployer = $('#empEmployer');
var searchBoxEmployer = $('#empSearchEmployer');
var hiddenInputValEmployer = $('.sendEmployerId');
var searchResulEmployer = $('.searchResultEmployer');
var mixContainerAndSerchResultEmployer = $('#empEmployer , .searchResultEmployer');
containerEmployer.hide();
var liListEmployer;
var liPointerEmployer;
let countEmployer = 0;
//close search Employee when click on body
$(document).on('click', function (event) {
if (!$(event.target).closest(containerEmployer).length) {
containerEmployer.hide();
}
});
//select option by mouse
function selectItemEmployer(id, employeeFullName) {
searchBoxEmployer.val(employeeFullName);
hiddenInputValEmployer.val(id);
containerEmployer.hide();
searchBoxEmployer.addClass("selectedOption");
};
//search by Ajax
searchBoxEmployer.on('keyup keypress',
function (e) {
$(".form-control").removeClass("selectedOption");
//----clean Workshop------
$("#empSearchWorkshop").val('');
$("#searchModel_WorkShopName").val('');
//----clean Employee------
// $("#SearchModel_EmployeeName").val('');
// $("#SearchModel_Id").val('0');
if ($(this).val() == '') {
$("#searchModel_EmployerId").val("0");
$("#searchModel_EmployerName").val('');
}
//stop submit form with enter
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
liPointerEmployer.click();
}
return false;
}
searchBoxEmployer.removeClass("selectedOption");
let searchText = $(this).val();
hiddenInputValEmployer.val(0);
if (searchText.length > 1) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "EmployerName")',
data: { "searchText": searchText },
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function (response) {
$(".opt").remove();
if (response.mylist.length > 0) {//result Founded
console.log(response.mylist);
$(".noResult").remove();
containerEmployer.show();
$.each(response.mylist,
function (i, item) {
let li = `<li data-employeeId="${item.id}" class="btn btn-block opt" onclick="selectItemEmployer(${item.id}, '${item.lName}');" >${item.lName}</li>`;
searchResulEmployer.append(li);
});
} else {//result NotFounded
$(".noResult").remove();
containerEmployer.show();
let noResult = `<li class="btn btn-block noResult">نتیجه ای یافت نشد</li>`;
searchResulEmployer.append(noResult);
}
}// endOfSuccess
}); //endOfAjax
} else {
containerEmployer.hide();
countEmployer = 0;
}
//keyboard Arrow Key Select And Enter
liListEmployer = $('#empEmployer ul li');
mixContainerAndSerchResultEmployer.animate({
scrollTop: $(liListEmployer.eq(0)).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
},
50);
if (e.which === 40) {// if ArrowUp
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
liPointerEmployer.removeClass('keyboardSelected');
console.log(countEmployer + "plusOne");
liListEmployer.eq(countEmployer).addClass('keyboardSelected');
liPointerEmployer = liListEmployer.eq(countEmployer);
if (countEmployer > 4) {
//ScrollDown
mixContainerAndSerchResultEmployer.animate({
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
},
50);
}
countEmployer += 1;
} else {
liListEmployer.eq(0).addClass("keyboardSelected");
liPointerEmployer = liListEmployer.eq(0);
countEmployer = 1;
}
} else if (e.which === 38) {//if ArrowDown
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
liPointerEmployer.removeClass('keyboardSelected');
countEmployer -= 1;
liListEmployer.eq(countEmployer).addClass('keyboardSelected');
liPointerEmployer = liListEmployer.eq(countEmployer);
//ScrollUp
mixContainerAndSerchResultEmployer.animate({
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
},
50);
}
}
});
$("#empSearchEmployer").keypress(function (event) {
$(".form-control").removeClass("selectedOption");
$("#empSearch").val('');
$("#empSearchWorkshop").val('');
$("#searchModel_WorkshopId").val("0");
$("#searchModel_WorkShopName").val('');
// $("#SearchModel_Id").val("0");
// $("#SearchModel_EmployeeName").val('');
if (event.keyCode === 13) {
if ($("#searchModel_EmployerId").val() == "0")
$("#searchModel_EmployerName").val($("#empSearchEmployer").val())
$('.btn-search1').click();
}
});
</script>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More