merge fom master
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -10,67 +10,70 @@ namespace _0_Framework.Application.UID;
|
||||
|
||||
public class UidService : IUidService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private const string BaseUrl= "https://json-api.uid.ir/api/inquiry/";
|
||||
private readonly HttpClient _httpClient;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
|
||||
|
||||
public UidService()
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
}
|
||||
public UidService()
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
BirthDate = birthDate ,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
BirthDate = birthDate,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
try
|
||||
{
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return new PersonalInfoResponse(new UidBasicInformation(),
|
||||
new IdentificationInformation(default, default, default, default, default), new RegistrationStatus(),
|
||||
new ResponseContext(new UidStatus(14, "")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
MobileNumber = phoneNumber,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
public async Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode, string phoneNumber)
|
||||
{
|
||||
var request = new PersonalInfoRequest
|
||||
{
|
||||
MobileNumber = phoneNumber,
|
||||
NationalId = nationalCode,
|
||||
RequestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -59,6 +59,16 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
OperationResult DeleteAllCheckouts(List<long> ids);
|
||||
OperationResult DeleteCheckout(long id);
|
||||
List<long> CheckHasSignature(List<long> ids);
|
||||
|
||||
/// <summary>
|
||||
/// لیست تصفیه حساب
|
||||
/// جدید
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel);
|
||||
|
||||
Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel);
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -3,36 +3,110 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
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, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; private set; }
|
||||
|
||||
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout, string contractTerm, IsActive cutContractEndOfYear)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
|
||||
ContractTerm = contractTerm;
|
||||
CutContractEndOfYear = contractTerm == "1" ? IsActive.None : cutContractEndOfYear;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
namespace Company.Domain.LeftWorkAgg;
|
||||
|
||||
@@ -46,4 +47,11 @@ public interface ILeftWorkRepository : IRepository<long, LeftWork>
|
||||
|
||||
Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId);
|
||||
List<LeftWorkViewModel> SearchCreateContract(LeftWorkSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات کارگاه و پرسنل برای ایجاد قرارداد
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
AutoExtensionDto AutoExtentionEmployees(long workshopId);
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -132,7 +132,118 @@ public class CheckoutViewModel
|
||||
/// مدت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public string TotalPaidLeave { get; set; }
|
||||
|
||||
|
||||
public bool HasSignCheckout { 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; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -39,7 +39,11 @@ public class CreateCheckoutListViewModel
|
||||
|
||||
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// آیا پرسنل اجازه ایجاد قرارداد دارد
|
||||
/// </summary>
|
||||
public bool EmployeeHasCreateCheckout { get; set; }
|
||||
|
||||
|
||||
public bool HasWorkFlow { get; set; }
|
||||
public List<CreateCheckoutListViewModel> CreateCheckoutList { get; set; }
|
||||
}
|
||||
@@ -27,6 +27,14 @@ public interface ICheckoutApplication
|
||||
Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year,
|
||||
string month,
|
||||
string contractStart, string contractEnd);
|
||||
/// <summary>
|
||||
/// لیست تصفیه حساب
|
||||
/// جدید
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel);
|
||||
Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel);
|
||||
List<CheckoutViewModel> PrintAll(List<long> id);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -63,6 +63,10 @@ public class ContractViweModel
|
||||
public string EmployeeLName { get; set; }
|
||||
|
||||
public string IsBlockCantracingParty { get; set; }
|
||||
/// <summary>
|
||||
/// آیا مجاز به امضاء قرادا می باشد
|
||||
/// </summary>
|
||||
public bool HasSignContract { get; set; }
|
||||
public IQueryable<WorkshopEmployerViewModel> WorkshopEmployerList { get; set; }
|
||||
public List<EmployerViewModel> Employers { get; set; }
|
||||
public List<WorkshopViewModel> Workshops { get; set; }
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,4 +26,5 @@ public class EmployeeDataFromApiViewModel
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public bool AuthorizedCanceled { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -17,5 +18,35 @@ 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; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
|
||||
public class EmployeeComputeOptionsViewModel
|
||||
{
|
||||
@@ -12,4 +14,34 @@ 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; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListDebtType
|
||||
{
|
||||
None,
|
||||
Old,
|
||||
New
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListEmployerApprovalStatus
|
||||
{
|
||||
None,
|
||||
/// <summary>
|
||||
/// تاییدیه شفاهی (اذنی)
|
||||
/// </summary>
|
||||
VerbalApproval,
|
||||
/// <summary>
|
||||
/// تاییدیه کاغذی
|
||||
/// </summary>
|
||||
WrittenApproval
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListInspectionType
|
||||
{
|
||||
None,
|
||||
Old,
|
||||
New
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -30,4 +31,10 @@ public interface ILeftWorkApplication
|
||||
OperationResult CreateLeftWorkByLeftWorkGroups(string employeeFullName, long commandEmployeeId, List<PersonnelCodeViewModel> commandPersonnelCode, List<LeftWorkGroup> leftWorkGroups);
|
||||
OperationResult CheckDeleteLeftWork(long workshopId, long employeeId, string date, int type);
|
||||
OperationResult CheckEditLeftWork(long workshopId, long employeeId, string date, int type);
|
||||
/// <summary>
|
||||
/// دریافت اطلاعات کارگاه و پرسنل برای ایجاد قرارداد
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
AutoExtensionDto AutoExtentionEmployees(long workshopId);
|
||||
}
|
||||
@@ -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>
|
||||
/// تعجیل در ورود (مدت زمانی که کارمند زودتر از زمان مشخص وارد شده است)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -26,4 +27,34 @@ 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; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// </summary>
|
||||
public string ContractTerm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AutoExtensionDto
|
||||
{
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا کارفرما خطای اطلاعات هویتی دارد
|
||||
/// </summary>
|
||||
public bool EmployerWarning { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پیام خطاهای کارفرما
|
||||
/// </summary>
|
||||
public string EmployerWarningMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا کارگاه پرسنل دارد
|
||||
/// </summary>
|
||||
public bool HavingPersonel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی کارگاه
|
||||
/// </summary>
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد بایگانی کارگاه
|
||||
/// </summary>
|
||||
public string ArchiveCode { get; set; }
|
||||
/// <summary>
|
||||
/// آدرس کارگاه
|
||||
/// </summary>
|
||||
public string WAddress1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی کارفرما
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست پرسنل
|
||||
/// </summary>
|
||||
public SelectList EmployeeSelectList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست پرسنل
|
||||
/// </summary>
|
||||
public List<AutoExtensionEmployeeListDto> EmployeeList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا مجاز به ایجاد قراداد است؟
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
|
||||
public class AutoExtensionEmployeeListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// آی دی پرسنل
|
||||
/// </summary>
|
||||
public long EmployeeId { get; set; }
|
||||
/// <summary>
|
||||
/// نام کامل پرسنل
|
||||
/// </summary>
|
||||
public string EmployeeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد پرسنلی
|
||||
/// </summary>
|
||||
public long PersonnelCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سمت
|
||||
/// </summary>
|
||||
public string JobType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آی دی شغل
|
||||
/// </summary>
|
||||
public long JobTypeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا پرسنل اجازه ایجاد قرارداد دارد
|
||||
/// </summary>
|
||||
public bool EmployeeHasCreateContract { get; set; }
|
||||
|
||||
|
||||
public string ContarctStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
@@ -25,4 +25,5 @@ public interface IYearlySalaryApplication
|
||||
InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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
@@ -12,6 +12,7 @@ using Company.Domain.YearlySalaryAgg;
|
||||
using Company.Domain.YearlySalaryItemsAgg;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeComputeOptions;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -39,6 +40,7 @@ public class ContractApplication : IContractApplication
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApp;
|
||||
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
|
||||
|
||||
public List<EmployerViewModel> EmpList;
|
||||
|
||||
@@ -54,7 +56,7 @@ public class ContractApplication : IContractApplication
|
||||
IYearlySalaryRepository yearlySalaryRepository,
|
||||
IYearlySalaryItemRepository yearlySalaryItemRepository
|
||||
, IEmployeeApplication employeeApplication, IEmployerApplication employerApplication, IWorkshopApplication workshopApplication, IEmployerRepository employerRepository,
|
||||
IWorkingHoursApplication workingHoursApplication, IWorkingHoursItemsApplication workingHoursItemsApplication, ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository, IWorkingHoursTempApplication workingHoursTempApplication, IPersonalContractingPartyApp contractingPartyApp)
|
||||
IWorkingHoursApplication workingHoursApplication, IWorkingHoursItemsApplication workingHoursItemsApplication, ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository, IWorkingHoursTempApplication workingHoursTempApplication, IPersonalContractingPartyApp contractingPartyApp, IEmployeeComputeOptionsApplication employeeComputeOptionsApplication)
|
||||
{
|
||||
_contractRepository = contractRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
@@ -70,6 +72,7 @@ public class ContractApplication : IContractApplication
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_workingHoursTempApplication = workingHoursTempApplication;
|
||||
_contractingPartyApp = contractingPartyApp;
|
||||
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
|
||||
|
||||
//_leftWorkApplication = leftWorkApplication;
|
||||
}
|
||||
@@ -3155,7 +3158,7 @@ public class ContractApplication : IContractApplication
|
||||
EmployeeFName = x.EmployeeFName,
|
||||
EmployeeLName = x.EmployeeLName,
|
||||
IsBlockCantracingParty = _contractingPartyApp.IsBlockByEmployerId(x.EmployerId),
|
||||
|
||||
HasSignContract = _employeeComputeOptionsApplication.GetEmployeeOptions(x.WorkshopIds,x.EmployeeId).SignContract
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
||||
@@ -197,6 +197,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -995,10 +996,24 @@ 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 +1256,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("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
@@ -1539,7 +1559,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
if (apiResult.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||
|
||||
}
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
@@ -1595,7 +1619,16 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
if (apiResult.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید", new EmployeeDataFromApiViewModel() { AuthorizedCanceled = true });
|
||||
|
||||
}
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code == 3)
|
||||
{
|
||||
return op.Failed("کد ملی نامعتبر است");
|
||||
}
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
|
||||
@@ -21,41 +21,54 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
|
||||
|
||||
public OperationResult Create(CreateEmployeeComputeOptions command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
|
||||
var opration = new OperationResult();
|
||||
if (command.CreateContract && command.ContractTerm != "1" && command.CutContractEndOfYear == IsActive.None)
|
||||
return opration.Failed("لطفا تعیین کنید که قراداد منتهی به پایان سال یاشد یا نباشد");
|
||||
|
||||
if (command.ContractTerm == "1")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
|
||||
|
||||
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("ثبت با خطا مواجه شد");
|
||||
}
|
||||
|
||||
{
|
||||
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, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_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, command.ContractTerm, command.CutContractEndOfYear);
|
||||
|
||||
_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
@@ -15,6 +15,7 @@ using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.WorkingHours;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursItems;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using PersianTools.Core;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -600,6 +601,11 @@ public class LeftWorkApplication : ILeftWorkApplication
|
||||
return _leftWorkRepository.CheckEditLeftWork(workshopId, employeeId, date.ToGeorgianDateTime(), type);
|
||||
}
|
||||
|
||||
public AutoExtensionDto AutoExtentionEmployees(long workshopId)
|
||||
{
|
||||
return _leftWorkRepository.AutoExtentionEmployees(workshopId);
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
//این متد ترک کار های کارمند را با فعالیت حضور غیاب یکپارچه می کند
|
||||
private void IfEmployeeHasNewLeftWorkDateAddEndDateToRollCallStatus(long employeeId)
|
||||
|
||||
@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.ReportClient;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployee;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using OperationResult = _0_Framework.Application.OperationResult;
|
||||
using Tools = _0_Framework.Application.Tools;
|
||||
|
||||
@@ -174,8 +175,19 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
|
||||
await _leftWorkRepository.CreateAsync(newLeftWork);
|
||||
_leftWorkTempRepository.Remove(leftWorkTemp);
|
||||
var rollCallEmployee = _rollCallEmployeeRepository.GetBy(leftWorkTemp.EmployeeId, leftWorkTemp.WorkshopId);
|
||||
|
||||
var rollCallStatus = rollCallEmployee?.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
|
||||
if (rollCallStatus != null)
|
||||
{
|
||||
var startWork = newLeftWork.StartWorkDate;
|
||||
rollCallStatus.Edit(startWork, rollCallStatus.EndDate);
|
||||
|
||||
}
|
||||
await _leftWorkRepository.SaveChangesAsync();
|
||||
await _leftWorkTempRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ public class YearlySalaryApplication : IYearlySalaryApplication
|
||||
public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
|
||||
{
|
||||
return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeComputeOptionsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
@@ -16,6 +18,9 @@ public class EmployeeComputeOptionsMapping : IEntityTypeConfiguration<EmployeeCo
|
||||
builder.Property(x => x.ComputeOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.YearsOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.BonusesOptions).HasMaxLength(50);
|
||||
builder.Property(x => x.ContractTerm).HasMaxLength(10);
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
9589
CompanyManagment.EFCore/Migrations/20250521125646_add inspection-debt-approval to insurance list.Designer.cs
generated
Normal file
9589
CompanyManagment.EFCore/Migrations/20250521125646_add inspection-debt-approval to insurance list.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9719
CompanyManagment.EFCore/Migrations/20250602185437_insurance operation list.Designer.cs
generated
Normal file
9719
CompanyManagment.EFCore/Migrations/20250602185437_insurance operation list.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9832
CompanyManagment.EFCore/Migrations/20250611105314_add rollcall in checkout.Designer.cs
generated
Normal file
9832
CompanyManagment.EFCore/Migrations/20250611105314_add rollcall in checkout.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9736
CompanyManagment.EFCore/Migrations/20250611160351_add workshop create contract settings.Designer.cs
generated
Normal file
9736
CompanyManagment.EFCore/Migrations/20250611160351_add workshop create contract settings.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9748
CompanyManagment.EFCore/Migrations/20250611172746_add settings for employee compute options.Designer.cs
generated
Normal file
9748
CompanyManagment.EFCore/Migrations/20250611172746_add settings for employee compute options.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
9870
CompanyManagment.EFCore/Migrations/20250622193551_ContractTermAndCutOptionToEmployeeOptions.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ContractTermAndCutOptionToEmployeeOptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "nvarchar(5)",
|
||||
maxLength: 5,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ContractTerm",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "EmployeeComputeOptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.WorkshopEmployerAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
@@ -30,6 +31,7 @@ using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PersianTools.Core;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -217,6 +219,14 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
checkout => checkout.ContractId,
|
||||
(contractWorkshopEmployeeleftWorkPersonnelCode, checkout) =>
|
||||
new { contractWorkshopEmployeeleftWorkPersonnelCode, checkout })
|
||||
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
x => x.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork.leftwork.EmployeeId,
|
||||
option => option.EmployeeId,
|
||||
(x, options) => new { x.checkout, x.contractWorkshopEmployeeleftWorkPersonnelCode, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.checkout, x.contractWorkshopEmployeeleftWorkPersonnelCode, option })
|
||||
.ToList();
|
||||
Console.WriteLine("query : " + timer.Elapsed);
|
||||
timer.Reset();
|
||||
@@ -234,7 +244,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
if (chekoutCreated != null)
|
||||
{
|
||||
|
||||
|
||||
return new CreateCheckoutListViewModel
|
||||
{
|
||||
Id = chekoutCreated.ContractId,
|
||||
@@ -249,7 +259,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
LaterThanEnd = false,
|
||||
Extension = false,
|
||||
Description = "دارای فیش حقوقی",
|
||||
HasCheckout = true
|
||||
HasCheckout = true,
|
||||
EmployeeHasCreateCheckout = true
|
||||
};
|
||||
}
|
||||
var employeeJoin = result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork
|
||||
@@ -264,7 +275,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
bool extension = true;
|
||||
bool laterThanEnd = false;
|
||||
string description = "";
|
||||
string leftWorkDate="";
|
||||
string leftWorkDate = "";
|
||||
string contractStart = "";
|
||||
string contractEnd = "";
|
||||
|
||||
@@ -276,7 +287,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
if (hasRollCall)
|
||||
{
|
||||
|
||||
|
||||
// اگر ترک کار کرده بود
|
||||
// اگر ترک کارش در بازه انتخاب شده بود
|
||||
if (leftWork.HasLeft && leftWork.LeftWorkDate > startSreach && leftWork.LeftWorkDate <= endSearch)
|
||||
@@ -353,7 +364,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
else if (!leftWork.HasLeft && startSreach < currentStart)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
@@ -401,7 +412,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
description = "به دلیل ترک کار پیش از تاریخ انتخاب شده مجاز به ایجاد فیش نمی باشید";
|
||||
leftWorkDate = leftWork.LeftWorkDate.ToFarsi();
|
||||
}
|
||||
else if(leftWork.LeftWorkDate > endSearch)
|
||||
else if (leftWork.LeftWorkDate > endSearch)
|
||||
{
|
||||
extension = true;
|
||||
|
||||
@@ -424,7 +435,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
else
|
||||
{
|
||||
extension = true;
|
||||
|
||||
|
||||
if (contractStartGr <= startSreach && contractStartGr > endSearch)
|
||||
{
|
||||
laterThanEnd = true;
|
||||
@@ -440,7 +451,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
contractEnd = endSearch.ToFarsi();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -469,10 +480,12 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
Description = description,
|
||||
ContractStart = contractStart,
|
||||
ContractEnd = contractEnd,
|
||||
LeftWorkDate = leftWorkDate
|
||||
LeftWorkDate = leftWorkDate,
|
||||
EmployeeHasCreateCheckout = result.option != null ? result.option.CreateCheckout : result.contractWorkshopEmployeeleftWorkPersonnelCode.contractWorkshopEmployeeleftWork.contractWorkshopEmployee.contractWorkshop.workshop.CreateCheckout
|
||||
|
||||
};
|
||||
|
||||
}).OrderByDescending(x=>x.Extension).ToList();
|
||||
}).Where(x => x.EmployeeHasCreateCheckout).OrderByDescending(x => x.Extension).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -501,6 +514,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
||||
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
@@ -935,7 +949,33 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||
}).ToList(),
|
||||
CheckoutRollCall = x.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
||||
{
|
||||
TotalPresentTimeSpan = x.CheckoutRollCall.TotalPresentTimeSpan,
|
||||
TotalBreakTimeSpan = x.CheckoutRollCall.TotalBreakTimeSpan,
|
||||
TotalWorkingTimeSpan = x.CheckoutRollCall.TotalWorkingTimeSpan,
|
||||
TotalPaidLeaveTmeSpan = x.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
||||
TotalMandatoryTimeSpan = x.CheckoutRollCall.TotalMandatoryTimeSpan,
|
||||
TotalSickLeaveTimeSpan = x.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
||||
RollCallDaysCollection = x.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
||||
{
|
||||
WorkingTimeSpan = d.WorkingTimeSpan,
|
||||
BreakTimeSpan = d.BreakTimeSpan,
|
||||
IsSliced = d.IsSliced,
|
||||
IsAbsent = d.IsAbsent,
|
||||
IsFriday = d.IsFriday,
|
||||
IsHoliday = d.IsHoliday,
|
||||
LeaveType = d.LeaveType,
|
||||
CheckoutId = d.CheckoutId,
|
||||
Date = d.Date,
|
||||
FirstEndDate = d.FirstEndDate,
|
||||
FirstStartDate = d.FirstStartDate,
|
||||
Id = d.Id,
|
||||
SecondEndDate = d.SecondEndDate,
|
||||
SecondStartDate = d.SecondStartDate
|
||||
}).ToList()
|
||||
|
||||
} : null,
|
||||
}).SingleOrDefault(x => x.Id == item);
|
||||
var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId);
|
||||
ch.WorkshopName = workshopName.WorkshopName;
|
||||
@@ -1058,7 +1098,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
});
|
||||
|
||||
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
|
||||
|
||||
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
|
||||
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
|
||||
|
||||
|
||||
@@ -1072,17 +1112,51 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
ch.TotalDeductions = "";
|
||||
ch.TotalPayment = "";
|
||||
}
|
||||
if (ch.HasRollCall)
|
||||
ch.MonthlyRollCall = _rollCallRepository.GetEmployeeRollCallsForMonth(ch.EmployeeId, ch.WorkshopId, ch.ContractStartGr, ch.ContractEndGr);
|
||||
|
||||
if (ch.CheckoutRollCall != null)
|
||||
{
|
||||
ch.TotalWorkingTimeStr = ch.CheckoutRollCall.TotalWorkingTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalBreakTimeStr = ch.CheckoutRollCall.TotalBreakTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalPresentTimeStr = ch.CheckoutRollCall.TotalPresentTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalMandatoryTimeStr = ch.CheckoutRollCall.TotalMandatoryTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
|
||||
ch.MonthlyRollCall = ch.CheckoutRollCall.RollCallDaysCollection
|
||||
.Select(x => new CheckoutDailyRollCallViewModel
|
||||
{
|
||||
DayOfWeek = x.Date.DayOfWeek.DayOfWeeKToPersian(),
|
||||
StartDate1 = x.FirstStartDate,
|
||||
EndDate1 = x.FirstEndDate,
|
||||
StartDate2 = x.SecondStartDate,
|
||||
EndDate2 = x.SecondEndDate,
|
||||
TotalhourseSpan = x.WorkingTimeSpan,
|
||||
IsSliced = x.IsSliced,
|
||||
BreakTimeTimeSpan = x.BreakTimeSpan,
|
||||
LeaveType = x.LeaveType,
|
||||
IsAbsent = x.IsAbsent,
|
||||
IsFriday = x.IsFriday,
|
||||
IsHoliday = x.IsHoliday,
|
||||
DateTimeGr = x.Date,
|
||||
TotalWorkingHours = $"{(int)(x.WorkingTimeSpan.TotalHours)}:{x.WorkingTimeSpan.Minutes:00}",
|
||||
BreakTimeString = $"{(int)(x.BreakTimeSpan.TotalHours)}:{x.BreakTimeSpan.Minutes:00}",
|
||||
RollCallDateFa = x.Date.ToFarsi()
|
||||
}).ToList();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ch.CreateWorkingHoursTemp.ContractStartGr = ch.ContractStartGr;
|
||||
ch.CreateWorkingHoursTemp.ContractEndGr = ch.ContractEndGr;
|
||||
ch.CreateWorkingHoursTemp.ContarctStart = ch.ContractStartGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.ContractEnd = ch.ContractEndGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.EmployeeId = ch.EmployeeId;
|
||||
ch.CreateWorkingHoursTemp.WorkshopId = ch.WorkshopId;
|
||||
ch.MonthlyRollCall = ConvertStaticToRollCall(ch.CreateWorkingHoursTemp, workshopName.WorkshopHolidayWorking);
|
||||
|
||||
if (ch.HasRollCall)
|
||||
ch.MonthlyRollCall = _rollCallRepository.GetEmployeeRollCallsForMonth(ch.EmployeeId, ch.WorkshopId, ch.ContractStartGr, ch.ContractEndGr);
|
||||
else
|
||||
{
|
||||
ch.CreateWorkingHoursTemp.ContractStartGr = ch.ContractStartGr;
|
||||
ch.CreateWorkingHoursTemp.ContractEndGr = ch.ContractEndGr;
|
||||
ch.CreateWorkingHoursTemp.ContarctStart = ch.ContractStartGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.ContractEnd = ch.ContractEndGr.ToFarsi();
|
||||
ch.CreateWorkingHoursTemp.EmployeeId = ch.EmployeeId;
|
||||
ch.CreateWorkingHoursTemp.WorkshopId = ch.WorkshopId;
|
||||
ch.MonthlyRollCall = ConvertStaticToRollCall(ch.CreateWorkingHoursTemp, workshopName.WorkshopHolidayWorking);
|
||||
}
|
||||
}
|
||||
query.Add(ch);
|
||||
}
|
||||
@@ -1387,7 +1461,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
ch.TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
|
||||
|
||||
var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan());
|
||||
var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan()).ToList();
|
||||
|
||||
var dailyPaidLeaveTimeSpans = dailyPaidLeave.Select(x =>
|
||||
{
|
||||
@@ -1397,7 +1471,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
});
|
||||
|
||||
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
|
||||
|
||||
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
|
||||
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
|
||||
|
||||
|
||||
@@ -1526,7 +1600,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
StartDate2 = secondRollCall?.StartDate?.ToString("HH:mm") ?? "",
|
||||
EndDate2 = secondRCEndDate?.ToString("HH:mm") ?? "",
|
||||
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay,
|
||||
TotalhourseSpan = rollCallTimeSpanPerDay - breakTimePerDay,
|
||||
|
||||
BreakTimeTimeSpan = breakTimePerDay,
|
||||
|
||||
@@ -1849,9 +1923,478 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
return notRemoveList;
|
||||
}
|
||||
|
||||
public async Task<List<CheckoutViewModel>> SearchCheckoutOptimized(CheckoutSearchModel searchModel)
|
||||
{
|
||||
bool hasSearch = false;
|
||||
bool hasEmployeeOrWorkshpSearch = false;
|
||||
|
||||
//bool noHasSearch = searchModel.WorkshopId == 0 && searchModel.EmployerId == 0
|
||||
// && searchModel.EmployeeId == 0
|
||||
// && string.IsNullOrWhiteSpace(searchModel.EmployeeName)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.Year)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.Month)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractStart)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractEnd)
|
||||
// && string.IsNullOrWhiteSpace(searchModel.ContractNo);
|
||||
var acountID = _authHelper.CurrentAccountId();
|
||||
var workshopAcounts = _context.WorkshopAccounts.Where(x => x.AccountId == acountID)
|
||||
.Select(x => x.WorkshopId);
|
||||
|
||||
//var checkouts =
|
||||
// _context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
// .Join(_context.Workshops.AsSplitQuery(),
|
||||
// ch => ch.WorkshopId,
|
||||
// workshop => workshop.id,
|
||||
// (ch, workshop) => new { ch, workshop })
|
||||
// .GroupJoin(_context.EmployeeComputeOptionsSet.AsSplitQuery(),
|
||||
// x => x.workshop.id,
|
||||
// option => option.WorkshopId,
|
||||
// (x, options) => new { x.ch, x.workshop, options })
|
||||
// .SelectMany(
|
||||
// x => x.options.DefaultIfEmpty(),
|
||||
// (x, option) => new { x.ch, x.workshop, option })
|
||||
// .GroupJoin(_context.WorkshopEmployers.AsSplitQuery().Include(we => we.Employer),
|
||||
// result => result.workshop.id,
|
||||
// workshopEmployer => workshopEmployer.WorkshopId,
|
||||
// (result, workshopEmployer) => new { result.ch, result.workshop, result.option, workshopEmployer })
|
||||
// .SelectMany(
|
||||
// y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
// (y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
// .GroupJoin(
|
||||
// _context.PersonalContractingParties.Include(p => p.Employers),
|
||||
// secondResult => secondResult.workshopEmployer.Employer.id,
|
||||
// contractingParty => contractingParty.Employers.FirstOrDefault().id, // یا راه بهتر پایین
|
||||
// (secondResult, contractingParties) => new { secondResult, contractingParties }
|
||||
// )
|
||||
// .SelectMany(
|
||||
// x => x.contractingParties.DefaultIfEmpty(),
|
||||
// (x, contractingParty) => new
|
||||
// {
|
||||
// x.secondResult.workshopEmployer,
|
||||
// x.secondResult.workshop,
|
||||
// x.secondResult.option,
|
||||
// x.secondResult.ch,
|
||||
// contractingParty
|
||||
// }
|
||||
// );
|
||||
|
||||
var checkouts =
|
||||
_context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.AsSplitQuery(),
|
||||
ch => ch.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
(ch, workshop) => new { ch, workshop })
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.AsSplitQuery(),
|
||||
x => x.workshop.id,
|
||||
option => option.WorkshopId,
|
||||
(x, options) => new { x.ch, x.workshop, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.ch, x.workshop, option })
|
||||
.GroupJoin(_context.WorkshopEmployers.AsSplitQuery().Include(we => we.Employer),
|
||||
result => result.workshop.id,
|
||||
workshopEmployer => workshopEmployer.WorkshopId,
|
||||
(result, workshopEmployer) => new { result.ch, result.workshop, result.option, workshopEmployer })
|
||||
.SelectMany(
|
||||
y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
(y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
.Select(x => new
|
||||
{
|
||||
x.ch,
|
||||
x.workshop,
|
||||
x.option,
|
||||
x.workshopEmployer,
|
||||
contractingParty = _context.PersonalContractingParties
|
||||
.Include(p => p.Employers)
|
||||
.FirstOrDefault(p => p.Employers.Any(e => e.id == x.workshopEmployer.Employer.id))
|
||||
});
|
||||
|
||||
#region SercheModel
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo) && searchModel.ContractId != 0)
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractNo == searchModel.ContractNo && x.ch.ContractId == searchModel.ContractId);
|
||||
if (searchModel.WorkshopId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
if (searchModel.EmployeeId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.EmployeeId == searchModel.EmployeeId);
|
||||
}
|
||||
if (searchModel.EmployerId != 0)
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.contractingParty.Employers.Select(c => c.id).Contains(searchModel.EmployerId));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo))
|
||||
{
|
||||
hasEmployeeOrWorkshpSearch = true;
|
||||
checkouts = checkouts.Where(x => x.ch.ContractNo == searchModel.ContractNo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//if (searchModel.IsActiveString == null)
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "true");
|
||||
//}
|
||||
|
||||
//if (searchModel.IsActiveString == "false")
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "false");
|
||||
//}
|
||||
//else if (searchModel.IsActiveString == "both")
|
||||
//{
|
||||
// checkouts = checkouts.Where(x => x.ch.IsActiveString == "false" || x.ch.IsActiveString == "true");
|
||||
//}
|
||||
|
||||
|
||||
//سرچ سال
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month) &&
|
||||
(string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)))
|
||||
{
|
||||
hasSearch = true;
|
||||
var startYear = searchModel.Year + "/01/01";
|
||||
var startyearGr = startYear.ToGeorgianDateTime();
|
||||
var endYear = $"{searchModel.Year}/12/01".FindeEndOfMonth();
|
||||
var endYearGr = endYear.ToGeorgianDateTime();
|
||||
|
||||
|
||||
checkouts = checkouts.Where(x => x.ch.ContractStart >= startyearGr && x.ch.ContractEnd <= endYearGr);
|
||||
if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
checkouts = checkouts.OrderByDescending(x => x.ch.ContractEnd);
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.Year) && !string.IsNullOrWhiteSpace(searchModel.Month) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd))
|
||||
{
|
||||
hasSearch = true;
|
||||
//سرچ سال و ماه
|
||||
string y1 = $"{searchModel.Year}/{searchModel.Month}/01";
|
||||
var startDate = y1.ToGeorgianDateTime();
|
||||
string y2 = string.Empty;
|
||||
int month = Convert.ToInt32(searchModel.Month);
|
||||
int year = Convert.ToInt32(searchModel.Year);
|
||||
|
||||
if (month <= 6)
|
||||
{
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/31";
|
||||
}
|
||||
else if (month > 6 && month < 12)
|
||||
{
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
}
|
||||
else if (month == 12)
|
||||
{
|
||||
switch (year)
|
||||
{
|
||||
case 1346:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1350:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1354:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1358:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1362:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1366:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1370:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1375:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1379:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1383:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1387:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1391:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1395:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1399:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1403:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1408:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1412:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1416:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1420:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1424:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1428:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1432:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1436:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1441:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
case 1445:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/30";
|
||||
break;
|
||||
|
||||
default:
|
||||
y2 = $"{searchModel.Year}/{searchModel.Month}/29";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var endDate = y2.ToGeorgianDateTime();
|
||||
|
||||
//checkouts = checkouts.Where(x => x.ContractEndGr >= start && x.ContractEndGr <= end).ToList();
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractStart >= startDate && x.ch.ContractStart < endDate && x.ch.ContractEnd > startDate &&
|
||||
x.ch.ContractEnd <= endDate ||
|
||||
x.ch.ContractStart <= startDate && x.ch.ContractEnd >= endDate ||
|
||||
startDate <= x.ch.ContractStart && endDate > x.ch.ContractStart ||
|
||||
endDate >= x.ch.ContractEnd && startDate < x.ch.ContractEnd);
|
||||
//if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
// checkouts = checkouts.OrderBy(x => x.ch.PersonnelCodeInt);
|
||||
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractEnd) &&
|
||||
string.IsNullOrWhiteSpace(searchModel.Year) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
hasSearch = true;
|
||||
//سرچ تاریخ
|
||||
var start = searchModel.ContractStart.ToGeorgianDateTime();
|
||||
var endd = searchModel.ContractEnd.ToGeorgianDateTime();
|
||||
checkouts = checkouts.Where(x =>
|
||||
x.ch.ContractStart >= start && x.ch.ContractStart <= endd);
|
||||
|
||||
//if (searchModel.WorkshopId > 0 || searchModel.EmployeeId > 0 || searchModel.EmployerId > 0)
|
||||
// checkouts = checkouts.OrderByDescending(x => x.ch.ContractEnd).ThenBy(x => x.ch.PersonnelCodeInt);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployeeName))
|
||||
{
|
||||
hasSearch = true;
|
||||
var employeeList = _context.Employees.Where(x => (!string.IsNullOrEmpty(x.FName) && x.FName.StartsWith(searchModel.EmployeeName)) ||
|
||||
(!string.IsNullOrEmpty(x.LName) && x.LName.StartsWith(searchModel.EmployeeName))).Select(x => x.id).ToList();
|
||||
checkouts = checkouts.Where(x => employeeList.Contains(x.ch.EmployeeId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
if (!hasSearch && !hasEmployeeOrWorkshpSearch)
|
||||
{
|
||||
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
|
||||
}).OrderByDescending(x => x.Id)
|
||||
.ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).Take(50).ToList();
|
||||
}
|
||||
else if (hasSearch && !hasEmployeeOrWorkshpSearch)
|
||||
{
|
||||
|
||||
var result = checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).OrderByDescending(x => x.Id)
|
||||
.GroupBy(x => x.Id)
|
||||
.Select(x => x.First());
|
||||
|
||||
|
||||
|
||||
if ((string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)) && string.IsNullOrWhiteSpace(searchModel.Month))
|
||||
{
|
||||
//اگر فقط سال رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else if ((string.IsNullOrWhiteSpace(searchModel.ContractStart) ||
|
||||
string.IsNullOrWhiteSpace(searchModel.ContractEnd)) && !string.IsNullOrWhiteSpace(searchModel.Month) && !string.IsNullOrWhiteSpace(searchModel.Year))
|
||||
{
|
||||
//اگر فقط سال و ماه رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(searchModel.ContractStart) &&
|
||||
!string.IsNullOrWhiteSpace(searchModel.ContractEnd))
|
||||
{
|
||||
//اگر فقط سال و ماه رو سرچ کرد
|
||||
return result.Take(300)
|
||||
.ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
|
||||
return result.ToList().OrderByDescending(x => x.Id)
|
||||
.ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).ToList();
|
||||
|
||||
}
|
||||
else if (hasEmployeeOrWorkshpSearch && !hasSearch)
|
||||
{
|
||||
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).GroupBy(x => x.Id).Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.ContractStartGr).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return checkouts.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.ch.id,
|
||||
EmployeeFullName = x.ch.EmployeeFullName,
|
||||
ContractStart = x.ch.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ch.ContractEnd.ToFarsi(),
|
||||
ContractStartGr = x.ch.ContractStart,
|
||||
ContractEndGr = x.ch.ContractEnd,
|
||||
PersonnelCode = x.ch.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
|
||||
ArchiveCode = x.workshop.ArchiveCode,
|
||||
SumOfWorkingDays = x.ch.SumOfWorkingDays,
|
||||
WorkshopName = x.workshop.WorkshopName,
|
||||
Month = x.ch.Month,
|
||||
Year = x.ch.Year,
|
||||
ContractNo = x.ch.ContractNo,
|
||||
ContractId = x.ch.ContractId,
|
||||
WorkshopId = x.ch.WorkshopId,
|
||||
EmployeeId = x.ch.EmployeeId,
|
||||
EmployerId = x.workshopEmployer.EmployerId,
|
||||
IsActiveString = x.ch.IsActiveString,
|
||||
Signature = x.ch.Signature,
|
||||
CreationDate = x.ch.CreationDate,
|
||||
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
|
||||
IsBlockCantracingParty = x.contractingParty.IsBlock,
|
||||
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
|
||||
|
||||
}).GroupBy(x => x.Id)
|
||||
.Select(x => x.First()).ToList()
|
||||
.OrderByDescending(x => x.Id)
|
||||
.ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
bool hasSearch = false;
|
||||
bool hasEmployeeOrWorkshpSearch = false;
|
||||
//List<CheckoutViewModel> query = null;
|
||||
@@ -1868,11 +2411,12 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
var emp2 = _context.WorkshopEmployers.Where(x => x.EmployerId == searchModel.EmployerId)
|
||||
.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
|
||||
|
||||
var query = _context.CheckoutSet.Select(x => new CheckoutViewModel()
|
||||
{
|
||||
|
||||
Id = x.id,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
//var start = ;
|
||||
@@ -1900,7 +2444,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
});
|
||||
|
||||
|
||||
Console.WriteLine("storedProc" + watch.Elapsed);
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.ContractNo) && searchModel.ContractId != 0)
|
||||
query = query.Where(x =>
|
||||
|
||||
@@ -30,8 +30,14 @@ 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,
|
||||
ContractTerm = x.ContractTerm,
|
||||
CutContractEndOfYear = x.CutContractEndOfYear
|
||||
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@@ -45,7 +51,13 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
ComputeOptions = getFromWorkshop.ComputeOptions,
|
||||
YearsOptions = getFromWorkshop.YearsOptions,
|
||||
BonusesOptions= getFromWorkshop.BonusesOptions,
|
||||
};
|
||||
CreateCheckout = getFromWorkshop.CreateCheckout,
|
||||
CreateContract = getFromWorkshop.CreateContract,
|
||||
SignCheckout = getFromWorkshop.SignCheckout,
|
||||
SignContract = getFromWorkshop.SignContract,
|
||||
ContractTerm = getFromWorkshop.ContractTerm,
|
||||
CutContractEndOfYear = getFromWorkshop.CutContractEndOfYear
|
||||
};
|
||||
|
||||
result = fromWorkshop;
|
||||
|
||||
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,11 +86,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
public OperationResult CreateInsuranceListworkshopInfo(CreateInsuranceWorkshopInfo command)
|
||||
{
|
||||
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
|
||||
@@ -91,7 +101,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
_context.SaveChanges();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -103,9 +113,9 @@ 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();
|
||||
@@ -210,7 +220,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
// نام کارفرما
|
||||
EmployerName = x.EmployerName,
|
||||
//آدرس کارگاه
|
||||
Address = x.Address,
|
||||
Address = x.Address,
|
||||
ListNumber = x.ListNumber,
|
||||
}).FirstOrDefault();
|
||||
#endregion
|
||||
@@ -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;
|
||||
//مزایای مشمول غیر مستمر
|
||||
@@ -252,8 +262,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty; ;
|
||||
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;
|
||||
@@ -329,7 +339,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
public List<InsuranceListViewModel> OptimizedSearch(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountId).Select(x => x.WorkshopId);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -475,7 +504,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
var workshop = workshopList.FirstOrDefault(u => u.id == item.WorkshopId);
|
||||
var employerId = _context.WorkshopEmployers.Where(x => x.WorkshopId == item.WorkshopId)
|
||||
.Select(x => x.EmployerId).FirstOrDefault();
|
||||
|
||||
|
||||
string typeOfInsuranceSend = "";
|
||||
if (workshop.TypeOfInsuranceSend == "NormalList")
|
||||
{
|
||||
@@ -489,20 +518,20 @@ 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")
|
||||
@@ -574,7 +603,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
OperationResult result = new OperationResult();
|
||||
using (var transaction = _context.Database.BeginTransaction())
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
//var employeeInsurancList= _context.EmployeeInsurancListDataSet.Where(x => x.InsuranceListId == id).ToList();
|
||||
@@ -584,10 +613,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//var insuranceListWorkshopList = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).ToList();
|
||||
//if (insuranceListWorkshopList != null && insuranceListWorkshopList.Count > 0)
|
||||
_insuranceListWorkshopRepository.RemoveRange(id);
|
||||
|
||||
|
||||
|
||||
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)
|
||||
@@ -831,10 +861,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
editInsuranceList.WorkshopIds = workshopIds;
|
||||
|
||||
return editInsuranceList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
// آی دی شغل
|
||||
@@ -883,7 +913,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty;
|
||||
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty;
|
||||
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
|
||||
|
||||
|
||||
if (item.LeftWorkDate != null)
|
||||
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
|
||||
|
||||
@@ -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;
|
||||
@@ -993,13 +1023,13 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
public OperationResult ConfirmInsuranceList(long id)
|
||||
{
|
||||
OperationResult result = new OperationResult();
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -1009,9 +1039,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
|
||||
result.Message = "تایید ارسال لیست بیمه با موفقیت انجام شد";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -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 count = (int)(end - start).TotalDays +1;
|
||||
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
|
||||
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
|
||||
}
|
||||
|
||||
|
||||
var count = (int)(end - start).TotalDays + 1;
|
||||
countDay += count;
|
||||
}
|
||||
|
||||
@@ -1226,12 +1291,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
//تعداد سال های سابقه بیمه
|
||||
int yearsCount = countDay / 365;
|
||||
|
||||
|
||||
//بدست آوردن مزد سنوات بر اساس سابقه به سال
|
||||
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
|
||||
if(baseYear == 0)
|
||||
if (baseYear == 0)
|
||||
return (0, 0);
|
||||
|
||||
|
||||
|
||||
//اگر ترک کار کرده بود
|
||||
//یا
|
||||
@@ -1250,7 +1315,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
return (yearsCount, baseYear);
|
||||
}
|
||||
|
||||
@@ -1278,109 +1343,109 @@ 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,
|
||||
|
||||
|
||||
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),
|
||||
|
||||
//اطاعات محاسباتی
|
||||
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,
|
||||
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
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,
|
||||
|
||||
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
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,
|
||||
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
//اطلاعات هویتی
|
||||
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),
|
||||
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
//اطاعات محاسباتی
|
||||
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,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
//مجموع مزد روزانه و پایه سنوات
|
||||
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
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 ?? "";
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,11 @@ using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -23,18 +26,18 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
public EditLeftWork GetDetails(long id)
|
||||
{
|
||||
return _context.LeftWorkList.Select(x => new EditLeftWork()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId
|
||||
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
@@ -92,10 +95,10 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
JobId = x.JobId,
|
||||
|
||||
|
||||
|
||||
}).Where(x=>x.WorkshopId == workshopId);
|
||||
|
||||
}).Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
return query.ToList();
|
||||
}
|
||||
@@ -103,7 +106,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public List<LeftWorkViewModel> search(LeftWorkSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -135,24 +138,24 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
public LeftWorkViewModel CheckoutleftWorkCheck(DateTime contractStart, long workshopId, long employeeId)
|
||||
{
|
||||
return _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
StartWorkDateGr = x.StartWorkDate,
|
||||
LeftWorkDateGr = x.LeftWorkDate,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
AddBonusesPay = x.AddBonusesPay,
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
StartWorkDate = x.StartWorkDate.ToFarsi(),
|
||||
StartWorkDateGr = x.StartWorkDate,
|
||||
LeftWorkDateGr = x.LeftWorkDate,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
WorkshopName = x.WorkshopName,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
AddLeavePay = x.AddLeavePay,
|
||||
AddBonusesPay = x.AddBonusesPay,
|
||||
AddYearsPay = x.AddYearsPay,
|
||||
|
||||
|
||||
})
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId
|
||||
|
||||
})
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId
|
||||
&& contractStart >= x.StartWorkDateGr && contractStart <= x.LeftWorkDateGr);
|
||||
}
|
||||
|
||||
@@ -163,7 +166,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
if (item != null)
|
||||
{
|
||||
|
||||
|
||||
|
||||
_context.LeftWorkList.Remove(item);
|
||||
_context.SaveChanges();
|
||||
if (!_context.LeftWorkList.Any(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId && item.id != x.id) && HasActiveRollCallStatus(item.WorkshopId, item.EmployeeId))
|
||||
@@ -179,31 +182,31 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public LeftWorkViewModel GetByDateAndWorkshopIdAndEmployeeId(long workshopId, long employeeId, DateTime dateTime)
|
||||
{
|
||||
var entity = _context.LeftWorkList.FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId &&
|
||||
(x.StartWorkDate <= dateTime && x.LeftWorkDate >= dateTime));
|
||||
if (entity == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
LeftWorkDate = entity.LeftWorkDate.ToFarsi(),
|
||||
HasLeft = entity.HasLeft,
|
||||
LeftWorkDateGr = entity.LeftWorkDate,
|
||||
StartWorkDateGr = entity.StartWorkDate,
|
||||
Id = entity.id
|
||||
var entity = _context.LeftWorkList.FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId &&
|
||||
(x.StartWorkDate <= dateTime && x.LeftWorkDate >= dateTime));
|
||||
if (entity == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return new()
|
||||
{
|
||||
EmployeeId = entity.EmployeeId,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
LeftWorkDate = entity.LeftWorkDate.ToFarsi(),
|
||||
HasLeft = entity.HasLeft,
|
||||
LeftWorkDateGr = entity.LeftWorkDate,
|
||||
StartWorkDateGr = entity.StartWorkDate,
|
||||
Id = entity.id
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
public List<long> GetAllEmployeeIdsInWorkshop(long workshopId)
|
||||
{
|
||||
var leftWorks = _context.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
var leftWorks = _context.LeftWorkList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
var insuranceLeftWork = _context.LeftWorkInsuranceList
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
.GroupBy(x => x.EmployeeId).Select(x => x.Key).ToList();
|
||||
@@ -267,7 +270,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
RemoveEmployeeRollCallStatus(workshopId, employeeId);
|
||||
if (hasLeftWorkInsurance)
|
||||
return
|
||||
op.Succcedded(1, "حذف با موفقیت انجام شد."); //+ "<br/>" + "<span class='text-danger'>" + "کد پرسنلی این شخص به دلیل استفاده در ترک کار بیمه قابل حذف نمی باشد. " + "</span>");
|
||||
op.Succcedded(1, "حذف با موفقیت انجام شد."); //+ "<br/>" + "<span class='text-danger'>" + "کد پرسنلی این شخص به دلیل استفاده در ترک کار بیمه قابل حذف نمی باشد. " + "</span>");
|
||||
else
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -369,7 +372,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
_context.LeftWorkList.RemoveRange(LeftWork);
|
||||
DateTime left = item2.LeftWorkDate.ToGeorgianDateTime();
|
||||
var start = item2.StartWorkDate.ToGeorgianDateTime();
|
||||
var leftwork = new LeftWork(left, start, item2.WorkshopId, item2.EmployeeId, command.EmployeeFullName, item2.WorkshopName, item2.JobId, item2.IncludeStatus,item2.AddBonusesPay,item2.AddYearsPay,item2.AddLeavePay, workshopComputeOptions, workshopBonusesOptions);
|
||||
var leftwork = new LeftWork(left, start, item2.WorkshopId, item2.EmployeeId, command.EmployeeFullName, item2.WorkshopName, item2.JobId, item2.IncludeStatus, item2.AddBonusesPay, item2.AddYearsPay, item2.AddLeavePay, workshopComputeOptions, workshopBonusesOptions);
|
||||
Create(leftwork);
|
||||
}
|
||||
}
|
||||
@@ -393,7 +396,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
foreach (var item in leftWorkGroups)
|
||||
{
|
||||
#region PersonelCode
|
||||
@@ -401,7 +404,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
if (commandPersonnelCode != null && commandPersonnelCode.Count > 0)
|
||||
{
|
||||
var personelcode = commandPersonnelCode.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).FirstOrDefault();
|
||||
if (personelcode != null && personelcode.HasPersonelCode==false)
|
||||
if (personelcode != null && personelcode.HasPersonelCode == false)
|
||||
{
|
||||
if (_context.PersonnelCodeSet.Any(x => x.WorkshopId == item.WorkshopId && x.PersonnelCode == personelcode.PersonnelCode))
|
||||
{
|
||||
@@ -416,18 +419,18 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
_context.PersonnelCodeSet.Add(new PersonnelCodeDomain(item.WorkshopId, commandEmployeeId, personelcode.PersonnelCode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
if (item.LeftWorkViewModels != null && item.LeftWorkViewModels.Count > 0)
|
||||
{
|
||||
bool checkRegister = false;
|
||||
|
||||
|
||||
|
||||
var LeftWorkList = _context.LeftWorkList.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).ToList();
|
||||
|
||||
var removeList = new List<LeftWork>();
|
||||
|
||||
|
||||
foreach (var removeItem in LeftWorkList)
|
||||
{
|
||||
if (!item.LeftWorkViewModels.Any(x => x.Id == removeItem.id))
|
||||
@@ -463,7 +466,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
{
|
||||
_context.LeftWorkList.RemoveRange(removeList);
|
||||
}
|
||||
|
||||
|
||||
//foreach (var item2 in item.LeftWorkViewModels)
|
||||
//{
|
||||
// var LeftWork = _context.LeftWorkList.Where(x => x.EmployeeId == commandEmployeeId && x.WorkshopId == item.WorkshopId).ToList();
|
||||
@@ -480,7 +483,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
_context.SaveChanges();
|
||||
transaction.Commit();
|
||||
op.Succcedded(-1, " ثبت با موفقیت انجام شد. ");
|
||||
op.Succcedded(-1, " ثبت با موفقیت انجام شد. ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -497,8 +500,8 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
var op = new OperationResult();
|
||||
bool hasContracts = false;
|
||||
var endDateSend = date.Date.AddDays(-1);
|
||||
if (type==1)
|
||||
hasContracts= _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= endDateSend) && x.IsActiveString == "true");
|
||||
if (type == 1)
|
||||
hasContracts = _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= endDateSend) && x.IsActiveString == "true");
|
||||
else
|
||||
{
|
||||
endDateSend = date.Date;
|
||||
@@ -514,23 +517,23 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
return op.Failed("در این تاریخ تصفیه حساب ثبت شده است.برای حذف تاریخ ترک کار، ابتدا تصفیه حساب های مربوطه را حذف کنید");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult CheckEditLeftWork(long workshopId, long employeeId, DateTime date, int type)
|
||||
}
|
||||
public OperationResult CheckEditLeftWork(long workshopId, long employeeId, DateTime date, int type)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
bool hasContracts = false;
|
||||
|
||||
|
||||
|
||||
if (type == 1)
|
||||
{
|
||||
hasContracts= _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date>= date) && x.IsActiveString == "true");
|
||||
if(hasContracts)
|
||||
hasContracts = _context.CheckoutSet.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && (x.ContractStart.Date >= date) && x.IsActiveString == "true");
|
||||
if (hasContracts)
|
||||
return op.Failed("لطفا ابتدا تصفیه حساب های آتی را حذف نمایید");
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var LeftDay = date.Date;
|
||||
@@ -553,16 +556,16 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
var LastDayContract = _context.CheckoutSet.Any(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.IsActiveString == "true" &&
|
||||
x.ContractEnd.Date > lastDay.Date);
|
||||
if(LastDayContract)
|
||||
if (LastDayContract)
|
||||
return op.Failed("AfterContracts");
|
||||
// var contract = _context.Contracts.Where(x => x.EmployeeId == employeeId && x.WorkshopIds == workshopId && x.IsActiveString == "true").OrderByDescending(x=>x.ContarctStart).FirstOrDefault();
|
||||
// var contract = _context.Contracts.Where(x => x.EmployeeId == employeeId && x.WorkshopIds == workshopId && x.IsActiveString == "true").OrderByDescending(x=>x.ContarctStart).FirstOrDefault();
|
||||
|
||||
//if (contract != null)
|
||||
//{
|
||||
|
||||
|
||||
// if ((contract.ContarctStart.Date <= endDateSend.Date && contract.ContractEnd.Date >= endDateSend.Date))
|
||||
// {
|
||||
|
||||
|
||||
// var checkout = _context.CheckoutSet.Where(x =>
|
||||
// x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
|
||||
// (x.ContractStart.Date <= date.Date && x.ContractEnd.Date >= date.Date)).FirstOrDefault();
|
||||
@@ -591,7 +594,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
// //}
|
||||
//}
|
||||
return op.Succcedded();
|
||||
|
||||
|
||||
}
|
||||
|
||||
return op.Succcedded();
|
||||
@@ -644,7 +647,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
public async Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId)
|
||||
{
|
||||
var leftWork =await _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
var leftWork = await _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
.OrderByDescending(x => x.StartWorkDate).FirstOrDefaultAsync();
|
||||
return leftWork;
|
||||
}
|
||||
@@ -655,9 +658,9 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
var clientTemps = _context.EmployeeClientTemps.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Select(x => x.EmployeeId);
|
||||
.Select(x => x.EmployeeId);
|
||||
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
@@ -675,7 +678,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName
|
||||
|
||||
|
||||
}).Where(x=> !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||
}).Where(x => !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
||||
@@ -695,7 +698,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
}
|
||||
private void RemoveEmployeeRollCallStatus(long workshopId, long employeeId)
|
||||
{
|
||||
var entity = _context.RollCallEmployees.Include(x=>x.EmployeesStatus).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
var entity = _context.RollCallEmployees.Include(x => x.EmployeesStatus).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
@@ -724,8 +727,167 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
|
||||
}
|
||||
//_context.RollCallEmployees.Remove(entity);
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region AutoExtentionEmployees
|
||||
|
||||
public AutoExtensionDto AutoExtentionEmployees(long workshopId)
|
||||
{
|
||||
if (workshopId == 0)
|
||||
return new AutoExtensionDto();
|
||||
var query = _context.LeftWorkList
|
||||
.Include(x => x.Employee)
|
||||
.Include(x => x.Workshop)
|
||||
.Where(x => x.WorkshopId == workshopId)
|
||||
|
||||
// Left Join با PersonnelCodeSet
|
||||
.GroupJoin(_context.PersonnelCodeSet.Where(p => p.WorkshopId == workshopId),
|
||||
leftList => leftList.EmployeeId,
|
||||
personnelCode => personnelCode.EmployeeId,
|
||||
(leftList, personnelCodes) => new { leftList, personnelCodes })
|
||||
.SelectMany(
|
||||
x => x.personnelCodes.DefaultIfEmpty(),
|
||||
(x, personnelCode) => new { x.leftList, personnelCode })
|
||||
|
||||
// Left Join با Jobs
|
||||
.GroupJoin(_context.Jobs,
|
||||
x => x.leftList.JobId,
|
||||
job => job.id,
|
||||
(x, jobs) => new { x.leftList, x.personnelCode, jobs })
|
||||
.SelectMany(
|
||||
x => x.jobs.DefaultIfEmpty(),
|
||||
(x, job) => new { x.leftList, x.personnelCode, job })
|
||||
|
||||
// Left Join با EmployeeComputeOptionsSet
|
||||
.GroupJoin(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
x => x.leftList.EmployeeId,
|
||||
option => option.EmployeeId,
|
||||
(x, options) => new { x.leftList, x.personnelCode, x.job, options })
|
||||
.SelectMany(
|
||||
x => x.options.DefaultIfEmpty(),
|
||||
(x, option) => new { x.leftList, x.personnelCode, x.job, option })
|
||||
|
||||
.Select(result => new AutoExtensionEmployeeListDto
|
||||
{
|
||||
EmployeeId = result.leftList.EmployeeId,
|
||||
EmployeeName = result.leftList.EmployeeFullName,
|
||||
PersonnelCode = result.personnelCode != null ? result.personnelCode.PersonnelCode : 0,
|
||||
JobType = result.job != null ? result.job.JobName : "نامشخص",
|
||||
JobTypeId = result.job != null ? result.job.id : 0,
|
||||
EmployeeHasCreateContract = result.option != null
|
||||
? result.option.CreateContract
|
||||
: result.leftList.Workshop.CreateContract
|
||||
}).GroupBy(x => x.EmployeeId)
|
||||
.Select(g => g.First())
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
//var query = _context.LeftWorkList.Include(x => x.Employee).Include(w => w.Workshop)
|
||||
// .Where(x => x.WorkshopId == workshopId)
|
||||
// .Join(_context.PersonnelCodeSet.AsSplitQuery().Where(p => p.WorkshopId == workshopId),
|
||||
// leftList => leftList.EmployeeId,
|
||||
// personnelCode => personnelCode.EmployeeId,
|
||||
// (leftList, personnelCode) =>
|
||||
// new { leftList, personnelCode })
|
||||
// .Join(_context.Jobs,
|
||||
// left => left.leftList.JobId,
|
||||
// job => job.id,
|
||||
// (left, job) => new { left, job })
|
||||
// .Join(_context.EmployeeComputeOptionsSet.Where(o => o.WorkshopId == workshopId),
|
||||
// leftResult => leftResult.left.leftList.EmployeeId,
|
||||
// options => options.EmployeeId,
|
||||
// (leftResult, options) => new { leftResult, options })
|
||||
// .Select(result => new AutoExtensionEmployeeListDto()
|
||||
// {
|
||||
|
||||
|
||||
// EmployeeId = result.leftResult.left.leftList.EmployeeId,
|
||||
// EmployeeName = result.leftResult.left.leftList.EmployeeFullName,
|
||||
// PersonnelCode = result.leftResult.left.personnelCode == null ? 0 : result.leftResult.left.personnelCode.PersonnelCode,
|
||||
|
||||
// JobType = result.leftResult.job.JobName,
|
||||
// JobTypeId = result.leftResult.job.id,
|
||||
// EmployeeHasCreateContract = result.options == null ? result.leftResult.left.leftList.Workshop.CreateContract : result.options.CreateContract
|
||||
|
||||
|
||||
// }).ToList();
|
||||
var result = new AutoExtensionDto();
|
||||
var workshop = _context.Workshops.FirstOrDefault(x => x.id == workshopId);
|
||||
var employerId = _context.WorkshopEmployers.FirstOrDefault(x => x.WorkshopId == workshopId)!.EmployerId;
|
||||
|
||||
var employer = _context.Employers.FirstOrDefault(x => x.id == employerId);
|
||||
var employerWarning = false;
|
||||
var employerWarningMessage = "";
|
||||
|
||||
|
||||
if (employer != null && employer.IsLegal == "حقوقی")
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(employer.NationalId) || string.IsNullOrWhiteSpace(employer.RegisterId))
|
||||
{
|
||||
employerWarning = true;
|
||||
employerWarningMessage = "شناسه ملی ، شماره ثبت کارفرمای این کارگاه را بررسی کنید";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(employer.Nationalcode) || string.IsNullOrWhiteSpace(employer.Gender))
|
||||
{
|
||||
employerWarning = true;
|
||||
employerWarningMessage = "کد ملی ، جنسیت کارفرمای این کارگاه را بررسی گنید";
|
||||
}
|
||||
}
|
||||
if (query.Any() && workshop != null)
|
||||
{
|
||||
|
||||
result = new AutoExtensionDto()
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
HavingPersonel = true,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
WAddress1 = workshop.Address,
|
||||
CreateContract = workshop.CreateContract,
|
||||
EmployerId = employerId,
|
||||
EmployerWarning = employerWarning,
|
||||
EmployerWarningMessage = employerWarningMessage,
|
||||
EmployeeList = query.Select(x => new AutoExtensionEmployeeListDto()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeName = x.EmployeeName,
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
JobType = x.JobType,
|
||||
JobTypeId = x.JobTypeId,
|
||||
EmployeeHasCreateContract = x.EmployeeHasCreateContract
|
||||
|
||||
}).ToList(),
|
||||
EmployeeSelectList = new SelectList(query.Where(x => x.EmployeeHasCreateContract), "EmployeeId", "EmployeeName ")
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new AutoExtensionDto()
|
||||
{
|
||||
WorkshopId = workshopId,
|
||||
HavingPersonel = false,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
WAddress1 = workshop.Address,
|
||||
CreateContract = workshop.CreateContract
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -58,7 +58,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
}
|
||||
else
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 585 or 610;
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 610;
|
||||
}
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
|
||||
public RollCallEmployee GetBy(long employeeId, long workshopId)
|
||||
{
|
||||
return _context.RollCallEmployees.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
return _context.RollCallEmployees.Include(x=>x.EmployeesStatus).FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -60,8 +60,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
_leaveRepository = leaveRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
_testDbContext = testDbContext;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region OfficialChckout
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
|
||||
@@ -108,8 +108,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
|
||||
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
|
||||
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
@@ -254,15 +270,17 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
{
|
||||
|
||||
sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn);
|
||||
}
|
||||
totalLeaveSpan = starndardHoursesPerTotalDaysSapn;
|
||||
}
|
||||
else
|
||||
{
|
||||
sumSpans = sumSpans.Add(totalLeave);
|
||||
}
|
||||
totalLeaveSpan = totalLeave;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
int leavingDayCout = 0;
|
||||
@@ -299,8 +317,12 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}
|
||||
else
|
||||
{
|
||||
sumLeave = leavingDayCout * new TimeSpan(7, 20, 0);
|
||||
}
|
||||
var dayLeave = leavingDayCout * new TimeSpan(7, 20, 0);
|
||||
|
||||
sumLeave = dayLeave.Add(hoursesleaveTimeSpans);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (sumLeave > starndardHoursesPerTotalDaysSapn)
|
||||
@@ -311,22 +333,24 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
{
|
||||
sumSpans = sumSpans.Add(sumLeave);
|
||||
}
|
||||
}
|
||||
|
||||
totalLeaveSpan = sumLeave;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//اگر مرخصی روزانه نداشت و فقط مرخصی ساعتی داشت
|
||||
if (leaveSearchResult.Count == 0 && hoursesleave.Count > 0)
|
||||
{
|
||||
if (hoursesleaveTimeSpans > starndardHoursesPerTotalDaysSapn)
|
||||
{
|
||||
sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn);
|
||||
}
|
||||
else
|
||||
{
|
||||
sumSpans = sumSpans.Add(hoursesleaveTimeSpans);
|
||||
}
|
||||
}
|
||||
//if (leaveSearchResult.Count == 0 && hoursesleave.Count > 0)
|
||||
//{
|
||||
// if (hoursesleaveTimeSpans > starndardHoursesPerTotalDaysSapn)
|
||||
// {
|
||||
// sumSpans = sumSpans.Add(starndardHoursesPerTotalDaysSapn);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// sumSpans = sumSpans.Add(hoursesleaveTimeSpans);
|
||||
// }
|
||||
//}
|
||||
Console.WriteLine(sumSpans);
|
||||
#endregion
|
||||
//***********************************//
|
||||
@@ -343,11 +367,11 @@ 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 mandatoryWorkWithOutleaves = (sumSpans.TotalMinutes) / 60;
|
||||
double overTimeWork = 0;
|
||||
if (mandatoryWorkWithOutleaves > mandatoryHours)
|
||||
{
|
||||
@@ -621,45 +645,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 && workshopId != 344)
|
||||
{
|
||||
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 +742,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 +793,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;
|
||||
|
||||
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||
DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//bool hasRollcall =
|
||||
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||
//if (!hasRollcall)
|
||||
// return (false, new TimeSpan());
|
||||
List<RollCallViewModel> rollCallResult;
|
||||
List<GroupedRollCalls> groupedRollCall;
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
return (true, sumSpans);
|
||||
}
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
return (true, sumSpans);
|
||||
}
|
||||
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
@@ -864,20 +947,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 +964,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 +1038,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)
|
||||
@@ -1629,7 +1728,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = endComplex,
|
||||
ShiftSpan = (endComplex - startComplex),
|
||||
ShiftDate = currentDateGr,
|
||||
});
|
||||
ShiftEndWithoutRest = endComplex
|
||||
});
|
||||
|
||||
|
||||
var endCal = end - start;
|
||||
@@ -2090,7 +2190,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 +2199,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 +2341,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = shift2EndGr,
|
||||
ShiftSpan = (shift2EndGr - shift2StartGr),
|
||||
ShiftDate = shift1?.ShiftDate ?? shift2EndGr,
|
||||
ShiftEndWithoutRest = shift2EndGr,
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -2256,7 +2357,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 +2370,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 +2379,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 +2393,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
|
||||
ShiftDate = shift1?.EndDate ?? shift2EndGr,
|
||||
});
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -3021,13 +3126,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 +4087,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)
|
||||
|
||||
@@ -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
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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>
|
||||
@@ -770,15 +770,28 @@
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
|
||||
@@ -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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <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"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@using Microsoft.CodeAnalysis.CSharp.Syntax
|
||||
@model CompanyManagment.App.Contracts.Checkout.CreateCheckoutListViewModel
|
||||
@{
|
||||
var i = 1;
|
||||
var b = 0;
|
||||
@@ -14,7 +15,7 @@
|
||||
|
||||
|
||||
|
||||
@if (Model.CreateCheckoutList.Count > 0)
|
||||
@if (Model.CreateCheckoutList.Count > 0 && !Model.HasWorkFlow)
|
||||
{
|
||||
@foreach (var item in Model.CreateCheckoutList)
|
||||
{
|
||||
@@ -151,6 +152,22 @@
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (@Model.HasWorkFlow)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="3"></div>
|
||||
<div class="6">
|
||||
<h4 style="color: red">این کارگاه به دلیل داشتن کارپوشه مجاز به ایجاد تصفیه حساب نمی باشد</h4>
|
||||
</div>
|
||||
<div class="3"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
@@ -743,7 +743,7 @@
|
||||
<th style="width: 12%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> مقطع اول کار </th>
|
||||
<th style="width: 12%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> مقطع دوم کار </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; border-left: 1px solid #000; font-size: 10px"> استراحت </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; font-size: 10px"> جمع </th>
|
||||
<th style="width: 7%; text-align: center; border-bottom: 1px solid #000; font-size: 10px"> کارکرد </th>
|
||||
</tr>
|
||||
@for (int i = 0; i < 16; i++)
|
||||
{
|
||||
@@ -849,18 +849,18 @@
|
||||
|
||||
|
||||
<tr style="height: 20px; border-bottom: 1px solid; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی <span>:</span> @Model.TotalPaidLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی <span>:</span> @Model.TotalSickLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="10" style="padding: 0;">
|
||||
<table style="width: 100%; table-layout: fixed;">
|
||||
<tr style="height: 20px; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year <span>:</span> @Model.TotalMandatoryTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور <span>:</span> @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت <span>:</span> @Model.TotalBreakTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی <span>:</span> @Model.TotalWorkingTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -170,21 +170,33 @@
|
||||
@item.PersonnelCode
|
||||
</td>
|
||||
<td class="hidden-xs" id="td_@item.Id" class="signSize" style="font-size: 12px !important; text-align: center;">
|
||||
@if (item.Signature == "1")
|
||||
@if (item.HasSignCheckout)
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
@if (item.Signature == "1")
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed" />
|
||||
</a>
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed"/>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20216" class="myLinkSign " name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned"/>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20216" class="myLinkSign " name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned" />
|
||||
<a class="myLinkSign" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #37baf6"></i>
|
||||
|
||||
</a>
|
||||
}
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
@@ -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,339 +54,339 @@
|
||||
{
|
||||
<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> </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> </span>@Model.EmployerList[1].EmployerFullName
|
||||
@if (@Model.EmployerList.Count > 2)
|
||||
{
|
||||
<span>و غیره</span>
|
||||
}
|
||||
@Model.WorkshopName
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>
|
||||
@Model.EmployerList.FirstOrDefault().EmployerFullName
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div style="text-align: justify; padding: 0 6px;">
|
||||
@{
|
||||
var items = new List<string>();
|
||||
|
||||
if (Model.MonthlySalary != "0") items.Add("حقوق و مزد");
|
||||
if (Model.ConsumableItems != "0") items.Add("کمک هزینه اقلام مصرفی خانوار");
|
||||
if (Model.HousingAllowance != "0") items.Add("کمک هزینه مسکن");
|
||||
if (!string.IsNullOrWhiteSpace(Model.OvertimePay) && Model.OvertimePay != "0") items.Add("فوق العاده اضافه کاری");
|
||||
if (!string.IsNullOrWhiteSpace(Model.NightworkPay) && Model.NightworkPay != "0") items.Add("فوق العاده شب کاری");
|
||||
if (!string.IsNullOrWhiteSpace(Model.FridayPay) && Model.FridayPay != "0") items.Add("فوق العاده جمعه کاری");
|
||||
if (Model.MissionPay != "0") items.Add("فوق العاده ماموریت");
|
||||
if (Model.ShiftPay != "0") items.Add("فوق العاده نوبت کاری");
|
||||
if (Model.FamilyAllowance != "0") items.Add("کمک هزینه عائله مندی");
|
||||
if (Model.MarriedAllowance != "0") items.Add("حق تاهل");
|
||||
if (Model.RewardPay != "0") items.Add("پاداش");
|
||||
if (Model.BonusesPay != "0") items.Add("عیدی و پاداش");
|
||||
if (Model.YearsPay != "0") items.Add("سنوات");
|
||||
if (Model.LeavePay != "0") items.Add("مزد مرخصی");
|
||||
|
||||
string finalText = "";
|
||||
if (items.Count == 1)
|
||||
{
|
||||
finalText = items[0];
|
||||
}
|
||||
else if (items.Count > 1)
|
||||
{
|
||||
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
|
||||
}
|
||||
}
|
||||
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
|
||||
{
|
||||
<div style="width: 100%; padding: 3px 0 !important;">
|
||||
<span class="cusSpanTitle">پـرسنل شرکت/موسسه<span>:</span> </span>
|
||||
<span>
|
||||
@Model.WorkshopName
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
<span>
|
||||
کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: justify; padding: 0 6px;">
|
||||
@{
|
||||
var items = new List<string>();
|
||||
</div>
|
||||
</div>
|
||||
|
||||
if (Model.MonthlySalary != "0") items.Add("حقوق و مزد");
|
||||
if (Model.ConsumableItems != "0") items.Add("کمک هزینه اقلام مصرفی خانوار");
|
||||
if (Model.HousingAllowance != "0") items.Add("کمک هزینه مسکن");
|
||||
if (!string.IsNullOrWhiteSpace(Model.OvertimePay) && Model.OvertimePay != "0") items.Add("فوق العاده اضافه کاری");
|
||||
if (!string.IsNullOrWhiteSpace(Model.NightworkPay) && Model.NightworkPay != "0") items.Add("فوق العاده شب کاری");
|
||||
if (!string.IsNullOrWhiteSpace(Model.FridayPay) && Model.FridayPay != "0") items.Add("فوق العاده جمعه کاری");
|
||||
if (Model.MissionPay != "0") items.Add("فوق العاده ماموریت");
|
||||
if (Model.ShiftPay != "0") items.Add("فوق العاده نوبت کاری");
|
||||
if (Model.FamilyAllowance != "0") items.Add("کمک هزینه عائله مندی");
|
||||
if (Model.MarriedAllowance != "0") items.Add("حق تاهل");
|
||||
if (Model.RewardPay != "0") items.Add("پاداش");
|
||||
if (Model.BonusesPay != "0") items.Add("عیدی و پاداش");
|
||||
if (Model.YearsPay != "0") items.Add("سنوات");
|
||||
if (Model.LeavePay != "0") items.Add("مزد مرخصی");
|
||||
|
||||
string finalText = "";
|
||||
if (items.Count == 1)
|
||||
{
|
||||
finalText = items[0];
|
||||
}
|
||||
else if (items.Count > 1)
|
||||
{
|
||||
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
|
||||
}
|
||||
}
|
||||
<div class="row " style="margin-top: 8px;">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
<span>
|
||||
کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row m-t-20">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@* <th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th> *@
|
||||
<th colspan="4" style="text-align: center; position: relative ; font-size: 13px;padding-top:4px;border-left: 2px solid #000;"> مطالبات </th>
|
||||
@* <th style="text-align: center;"> </th>
|
||||
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@* <th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th> *@
|
||||
<th colspan="4" style="text-align: center; position: relative ; font-size: 13px;padding-top:4px;border-left: 2px solid #000;"> مطالبات </th>
|
||||
@* <th style="text-align: center;"> </th>
|
||||
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th> *@
|
||||
<th colspan="3" style="text-align: center; font-size: 13px; position: relative; padding-top: 4px;"> کسورات </th>
|
||||
@* <th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
|
||||
<th colspan="3" style="text-align: center; font-size: 13px; position: relative; padding-top: 4px;"> کسورات </th>
|
||||
@* <th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
|
||||
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 0px 0px 0px;"> </th> *@
|
||||
</tr>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
|
||||
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
|
||||
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
|
||||
</tr>
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
|
||||
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
|
||||
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="font-size: 12px; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; white-space: nowrap;"> کمک هزینه اقلام مصرفی خانوار </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; white-space: nowrap;"> کمک هزینه اقلام مصرفی خانوار </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
|
||||
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<td style="text-align: center; background-color: #ffffff !important;" colspan="3" rowspan="3">
|
||||
<div style="border-top: 1px solid #000;border-top-left-radius: 15px;border-top-right-radius: 15px; height: 65px;">
|
||||
<div style="padding: 0 6px; text-align: start;display: block;align-items: center;height: 64px;margin: 6px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span>
|
||||
<span>@Model.LastDayOfWork</span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span>
|
||||
<span>@Model.LeftWorkDate</span>
|
||||
<span>می باشد</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays)</td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
|
||||
|
||||
@{
|
||||
if (!Model.IsLeft)
|
||||
{
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
|
||||
|
||||
@{
|
||||
if (!Model.IsLeft)
|
||||
{
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
</tr>
|
||||
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
|
||||
<td style="text-align: center; padding: 2px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
|
||||
<td style="padding-right: 8px;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
|
||||
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<td style="text-align: center; background-color: #ffffff !important;" colspan="3" rowspan="3">
|
||||
<div style="border-top: 1px solid #000;border-top-left-radius: 15px;border-top-right-radius: 15px; height: 65px;">
|
||||
<div style="padding: 0 6px; text-align: start;display: block;align-items: center;height: 64px;margin: 6px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span>
|
||||
<span>@Model.LastDayOfWork</span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span>
|
||||
<span>@Model.LeftWorkDate</span>
|
||||
<span>می باشد</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays)</td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
|
||||
|
||||
@{
|
||||
if (!Model.IsLeft)
|
||||
{
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
|
||||
|
||||
@{
|
||||
if (!Model.IsLeft)
|
||||
{
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
}
|
||||
}
|
||||
</tr>
|
||||
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
|
||||
<td style="text-align: center; padding: 2px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
|
||||
<td style="padding-right: 8px;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div style="">
|
||||
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="margin-top: 4px;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%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@@ -557,70 +557,76 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<table style="width:100%; background-color: #575656 !important;border-radius: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr
|
||||
</th>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="" style="margin: 10px 0 0 0;display: flex;gap: 0px;">
|
||||
<div style="width: 65%;">
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
|
||||
|
||||
<div class="table-container">
|
||||
<table style="width: 100%;">
|
||||
<colgroup>
|
||||
<col style="width: 50%;">
|
||||
<col style="width: 50%;">
|
||||
</colgroup>
|
||||
<div class="table-container">
|
||||
<table style="width: 100%;">
|
||||
<colgroup>
|
||||
<col style="width: 50%;">
|
||||
<col style="width: 50%;">
|
||||
</colgroup>
|
||||
|
||||
<tr style="text-align: center; font-size: 10px; padding: 1px 4px; height: 15px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<th colspan="3" style="text-align: center; font-size: 11px;">مساعده</th>
|
||||
</tr>
|
||||
<tr style="text-align: center; font-size: 10px; padding: 1px 4px; height: 15px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<th colspan="3" style="text-align: center; font-size: 11px;">مساعده</th>
|
||||
</tr>
|
||||
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 15px;">
|
||||
<th style="padding: 1px 4px; text-align: center; border-left: 1px solid black; min-width: 3rem; font-size: 11px;">تاریخ</th>
|
||||
<th style="padding: 1px 4px; text-align: center; min-width: 4rem; font-size: 11px;">مبلغ</th>
|
||||
</tr>
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 15px;">
|
||||
<th style="padding: 1px 4px; text-align: center; border-left: 1px solid black; min-width: 3rem; font-size: 11px;">تاریخ</th>
|
||||
<th style="padding: 1px 4px; text-align: center; min-width: 4rem; font-size: 11px;">مبلغ</th>
|
||||
</tr>
|
||||
|
||||
@for (int i = 0; i < 5; i++)
|
||||
{
|
||||
<tr class="trTable" style="text-align: right; font-size: 10px; height: 15px;">
|
||||
<td style="font-size: 8px; text-align: center;border-left: 1px solid black">
|
||||
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
|
||||
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
|
||||
: "")
|
||||
</td>
|
||||
<td style="font-size: 8px; text-align: center;">
|
||||
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
|
||||
? Model.SalaryAidViewModels[i]?.Amount ?? ""
|
||||
: "")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@for (int i = 0; i < 5; i++)
|
||||
{
|
||||
<tr class="trTable" style="text-align: right; font-size: 10px; height: 15px;">
|
||||
<td style="font-size: 8px; text-align: center;border-left: 1px solid black">
|
||||
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
|
||||
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
|
||||
: "")
|
||||
</td>
|
||||
<td style="font-size: 8px; text-align: center;">
|
||||
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
|
||||
? Model.SalaryAidViewModels[i]?.Amount ?? ""
|
||||
: "")
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex; width: 50%;">
|
||||
|
||||
<div class="table-container">
|
||||
@@ -680,7 +686,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -690,7 +696,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">
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -513,18 +513,19 @@
|
||||
|
||||
|
||||
<tr style="height: 20px; border-bottom: 1px solid; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی <span>:</span> @Model.TotalPaidLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی <span>:</span> @Model.TotalSickLeave </td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td colspan="5" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="10" style="padding: 0;">
|
||||
<table style="width: 100%; table-layout: fixed;">
|
||||
<tr style="height: 20px; color:#ffffff !important; background-color: #575656 !important; font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> موظفی @Model.Month @Model.Year <span>:</span> @Model.TotalMandatoryTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور <span>:</span> @Model.TotalPresentTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت <span>:</span> @Model.TotalBreakTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> ساعات کارکرد واقعی <span>:</span> @Model.TotalWorkingTimeStr </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-t-20">
|
||||
<div class="row " style="margin-top: 8px;">
|
||||
<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%">
|
||||
|
||||
@@ -368,7 +368,7 @@
|
||||
</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%;">
|
||||
<div class="" style="margin-top: 4px;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%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@@ -538,23 +538,28 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<table style="width:100%; background-color: #575656 !important;border-radius: 10px">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr
|
||||
</th>
|
||||
<th colspan="2" style="color:#ffffff !important; text-align: center; border-bottom: 1px solid #CCCCCC; font-size: 8px; padding: 2px">
|
||||
ساعات کارکرد واقعی : @Model.TotalWorkingTimeStr
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px"> ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; border-left: 1px solid #CCCCCC; font-size: 8px; padding: 2px">مدت مرخصی استحقاقی : @Model.TotalPaidLeave </td>
|
||||
<td style="color:#ffffff !important; width:25%; text-align: center; font-size: 8px; padding: 2px"> مدت مرخصی استعلاجی : @Model.TotalSickLeave</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,621 +1,231 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@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" />
|
||||
<style>
|
||||
.table > tbody > tr > td{
|
||||
padding: 3px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<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>
|
||||
<span style="font-size:10px">@item.PersonName</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span style="font-size:10px">@item.PersonelCode</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<select class="form-control" data-ContractTerm="@item.EmployeeId" asp-for="@item.ContractTerm" style="width: 75px;font-size: 10px;">
|
||||
<option value="1"> <span>1 ماهه</span> </option>
|
||||
<option value="2"> <span>2 ماهه</span> </option>
|
||||
<option value="3"> <span>3 ماهه</span> </option>
|
||||
<option value="6"> <span>6 ماهه</span> </option>
|
||||
<option value="12"> <span>1 ساله</span> </option>
|
||||
</select>
|
||||
}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select class="form-control" data-CutContractEndOfYear="@item.EmployeeId" asp-for="@item.CutContractEndOfYear" style="width: 100px;font-size: 10px;">
|
||||
<option value="@IsActive.None"> <span></span> </option>
|
||||
<option value="@IsActive.True"> <span>منتهی باشد</span> </option>
|
||||
<option value="@IsActive.False"> <span>منتهی نباشد</span> </option>
|
||||
|
||||
</select>
|
||||
</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: 140px;font-size: 10px;">
|
||||
<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: 140px;font-size: 10px;">
|
||||
<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: 140px;font-size: 10px;">
|
||||
<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 class="real-checkbox" type="checkbox" data-employeeId="@item.EmployeeId" id="FailureCreateContract_@item.EmployeeId" @(item.CreateContract ? "checked" : "") />
|
||||
ایجاد قرارداد
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label for="FailureSignContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
|
||||
<input class="real-checkbox" data-employeeId="@item.EmployeeId" 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 class="real-checkbox" data-employeeId="@item.EmployeeId" 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 class="real-checkbox" data-employeeId="@item.EmployeeId" type="checkbox" id="FailureSignCheckout_@item.EmployeeId" @(item.SignCheckout ? "checked" : "") />
|
||||
امضا تصفیه حساب
|
||||
</label>
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if (@item.ContractPerson)
|
||||
{
|
||||
<button onclick="save(@item.EmployeeId)" style="font-size:8px" 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>
|
||||
}
|
||||
@@ -1,170 +1,205 @@
|
||||
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();
|
||||
|
||||
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"
|
||||
};
|
||||
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
|
||||
|
||||
|
||||
final.Add(finalResult);
|
||||
}
|
||||
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 = option.BonusesOptions,
|
||||
ComputeOptions = option.ComputeOptions,
|
||||
YearsOptions = option.YearsOptions,
|
||||
CreateContract = option.CreateContract,
|
||||
CreateCheckout = option.CreateCheckout,
|
||||
SignContract = option.SignContract,
|
||||
SignCheckout = option.SignCheckout,
|
||||
ContractTerm = option.ContractTerm,
|
||||
CutContractEndOfYear = option.CutContractEndOfYear
|
||||
};
|
||||
|
||||
PersonnelList = new ConnectedPersonnelViewModel
|
||||
{
|
||||
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList()
|
||||
};
|
||||
}
|
||||
final.Add(finalResult);
|
||||
}
|
||||
|
||||
public IActionResult OnGetCreate(CreateEmployeeComputeOptions command)
|
||||
{
|
||||
var result = _employeeComputeOptionsApplication.Create(command);
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccedded = result.IsSuccedded,
|
||||
message = result.Message
|
||||
});
|
||||
}
|
||||
PersonnelList = new ConnectedPersonnelViewModel()
|
||||
{
|
||||
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
public IActionResult OnGetTakePicture(long employeeId, long workshopId)
|
||||
{
|
||||
var res = new TakePictureModel
|
||||
{
|
||||
EmployeeId = employeeId,
|
||||
WorkshopId = workshopId
|
||||
};
|
||||
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
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,30 +748,35 @@
|
||||
@item.PersonnelCode
|
||||
</td>
|
||||
<td class="hidden-xs" id="td_@item.Id" style="font-size: 12px !important; text-align: center; max-width: 60px; width: 65px;">
|
||||
@if (item.Signature == "1")
|
||||
@if (@item.HasSignContract)
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
@if (item.Signature == "1")
|
||||
{
|
||||
<a class="myLinkSign" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed" />
|
||||
</a>
|
||||
@* <a class="myLinkSign @(item.IsBlockCantracingParty=="true"?"disabled":"")" name="foo1" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed"/>
|
||||
</a>
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #1f9c11"></i>
|
||||
<input type="hidden" value="@item.Id" name="signed" />
|
||||
</a> *@
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20117" class="myLinkSign" name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned"/>
|
||||
</a>
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<a permission="20117" class="myLinkSign" name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned" />
|
||||
<a class="myLinkSign" style="font-size: 20px">
|
||||
|
||||
<i class="ion-checkmark-circled" style="color: #37baf6"></i>
|
||||
|
||||
</a>
|
||||
@* <a permission="20117" class="myLinkSign @(item.IsBlockCantracingParty=="true"?"disabled":"")" name="foo2" value="@item.Id" style="font-size: 20px">
|
||||
<i class="ion-ios7-circle-outline" style="color: #dd3632"></i>
|
||||
<input type="hidden" value="@item.Id" name="unsigned" />
|
||||
</a> *@
|
||||
}
|
||||
|
||||
</td>
|
||||
|
||||
@{
|
||||
|
||||
@@ -548,37 +548,105 @@
|
||||
var codeMelli = $('#iniCodeMelli').val();
|
||||
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
const response = $.ajax({
|
||||
url: loadUidInfo,
|
||||
method: 'POST',
|
||||
data: { nationalCode: codeMelli, birthDate: birthday },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken }
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
success: function(response) {
|
||||
debugger;
|
||||
if (response.success) {
|
||||
$('#IsAuthorized').val(true);
|
||||
$('#name').val(response.data.fName);
|
||||
$('#family').val(response.data.lName);
|
||||
$('#FatherName').val(response.data.fatherName);
|
||||
$('#DateOfBirth').val(response.data.birthDate);
|
||||
$('#code-melli').val(response.data.nationalCode);
|
||||
$('#IdNumber').val(response.data.idNumber);
|
||||
$('#IdNumberSerial').val(response.data.idNumberSerial);
|
||||
$('#IdNumberSeri').val(response.data.idNumberSeri);
|
||||
if (response.data.gender === 0) {
|
||||
$('#GenderMale').prop('checked', true);
|
||||
$('#soldier').prop('disabled', false);
|
||||
} else if (response.data.gender === 1) {
|
||||
$('#GenderFemale').prop('checked', true);
|
||||
$('#soldier').prop('disabled', true);
|
||||
}
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
}
|
||||
else if (response.data?.authorizedCanceled) {
|
||||
|
||||
$('#name').removeClass("disable");
|
||||
$('#family').removeClass("disable");
|
||||
$('#FatherName').removeClass("disable");
|
||||
$('#DateOfBirth').removeClass("disable");
|
||||
$('#code-melli').removeClass("disable");
|
||||
$('#IdNumber').removeClass("disable");
|
||||
$('#IdNumberSerial').removeClass("disable");
|
||||
$('#IdNumberSeri').removeClass("disable");
|
||||
$('#GenderMale').removeClass("disable");
|
||||
$('#GenderFemale').removeClass("disable");
|
||||
$('#divGender .radio-box').removeClass('disable');
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
},
|
||||
error:function(error) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
// debugger;
|
||||
// if (response.success) {
|
||||
// $('#IsAuthorized').val(true);
|
||||
// $('#name').val(response.data.fName);
|
||||
// $('#family').val(response.data.lName);
|
||||
// $('#FatherName').val(response.data.fatherName);
|
||||
// $('#DateOfBirth').val(response.data.birthDate);
|
||||
// $('#code-melli').val(response.data.nationalCode);
|
||||
// $('#IdNumber').val(response.data.idNumber);
|
||||
// $('#IdNumberSerial').val(response.data.idNumberSerial);
|
||||
// $('#IdNumberSeri').val(response.data.idNumberSeri);
|
||||
// if (response.data.gender === 0) {
|
||||
// $('#GenderMale').prop('checked', true);
|
||||
// $('#soldier').prop('disabled', false);
|
||||
// } else if (response.data.gender === 1) {
|
||||
// $('#GenderFemale').prop('checked', true);
|
||||
// $('#soldier').prop('disabled', true);
|
||||
// }
|
||||
// }
|
||||
// else if (response.data.authorizedCanceled) {
|
||||
|
||||
if (response.success) {
|
||||
$('#IsAuthorized').val(true);
|
||||
$('#name').val(response.data.fName);
|
||||
$('#family').val(response.data.lName);
|
||||
$('#FatherName').val(response.data.fatherName);
|
||||
$('#DateOfBirth').val(response.data.birthDate);
|
||||
$('#code-melli').val(response.data.nationalCode);
|
||||
$('#IdNumber').val(response.data.idNumber);
|
||||
$('#IdNumberSerial').val(response.data.idNumberSerial);
|
||||
$('#IdNumberSeri').val(response.data.idNumberSeri);
|
||||
if (response.data.gender === 0) {
|
||||
$('#GenderMale').prop('checked', true);
|
||||
$('#soldier').prop('disabled', false);
|
||||
} else if (response.data.gender === 1) {
|
||||
$('#GenderFemale').prop('checked', true);
|
||||
$('#soldier').prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
// $('#name').removeClass("disable");
|
||||
// $('#family').removeClass("disable");
|
||||
// $('#FatherName').removeClass("disable");
|
||||
// $('#DateOfBirth').removeClass("disable");
|
||||
// $('#code-melli').removeClass("disable");
|
||||
// $('#IdNumber').removeClass("disable");
|
||||
// $('#IdNumberSerial').removeClass("disable");
|
||||
// $('#IdNumberSeri').removeClass("disable");
|
||||
// $('#GenderMale').removeClass("disable");
|
||||
// $('#GenderFemale').removeClass("disable");
|
||||
// $('#divGender .radio-box').removeClass('disable');
|
||||
// currentStep++;
|
||||
// showStep(currentStep);
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
// return;
|
||||
// }
|
||||
// else {
|
||||
// $.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
// return;
|
||||
// }
|
||||
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
// currentStep++;
|
||||
// showStep(currentStep);
|
||||
} catch (error) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "ارسال اطلاعات با مشکل مواجه شد.");
|
||||
return;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user