Compare commits

..

2 Commits

Author SHA1 Message Date
ab604d3be5 change qr code to barcode 2025-06-17 13:46:13 +03:30
MahanCh
d713cbb1fe add qrCode 2025-05-31 20:30:36 +03:30
122 changed files with 18508 additions and 64910 deletions

View File

@@ -12,65 +12,65 @@ namespace _0_Framework.Application;
public class AuthHelper : IAuthHelper public class AuthHelper : IAuthHelper
{ {
private readonly IHttpContextAccessor _contextAccessor; private readonly IHttpContextAccessor _contextAccessor;
public AuthHelper(IHttpContextAccessor contextAccessor)
{
_contextAccessor = contextAccessor;
}
public AuthHelper(IHttpContextAccessor contextAccessor) public AuthViewModel CurrentAccountInfo()
{ {
_contextAccessor = contextAccessor; var result = new AuthViewModel();
} if (!IsAuthenticated())
return result;
public AuthViewModel CurrentAccountInfo() var claims = _contextAccessor.HttpContext.User.Claims.ToList();
{ result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
var result = new AuthViewModel(); result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
if (!IsAuthenticated()) result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value;
return result; result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value);
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
var claims = _contextAccessor.HttpContext.User.Claims.ToList(); result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value;
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value); result.ClientAriaPermission =claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value; result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value; result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value); result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value; result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value; result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
result.ClientAriaPermission = claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value); result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value; result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
return result; return result;
} }
public List<int> GetPermissions() public List<int> GetPermissions()
{ {
if (!IsAuthenticated()) if (!IsAuthenticated())
return new List<int>(); return new List<int>();
var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions") var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions")
?.Value; ?.Value;
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
} }
public long CurrentAccountId() public long CurrentAccountId()
{ {
return IsAuthenticated() return IsAuthenticated()
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value) ? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value)
: 0; : 0;
} }
public long CurrentSubAccountId() public long CurrentSubAccountId()
{ {
return IsAuthenticated() return IsAuthenticated()
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value) ? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value)
: 0; : 0;
} }
public string CurrentAccountMobile() public string CurrentAccountMobile()
{ {
return IsAuthenticated() return IsAuthenticated()
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value ? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value
: ""; : "";
} }
#region Vafa #region Vafa
@@ -111,166 +111,160 @@ public class AuthHelper : IAuthHelper
} }
public string GetWorkshopSlug() public string GetWorkshopSlug()
{ {
return CurrentAccountInfo().ClientAriaPermission == "true" return CurrentAccountInfo().ClientAriaPermission == "true"
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value ? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
: ""; : "";
} }
public string GetWorkshopName() public string GetWorkshopName()
{ {
var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true"; var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true";
if (workshopName) if (workshopName)
{ {
return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value; return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value;
} }
return ""; return "";
} }
#endregion #endregion
public string CurrentAccountRole() public string CurrentAccountRole()
{ {
if (IsAuthenticated()) if (IsAuthenticated())
return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value; return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
return null; return null;
} }
public bool IsAuthenticated() public bool IsAuthenticated()
{ {
return _contextAccessor.HttpContext.User.Identity.IsAuthenticated; return _contextAccessor.HttpContext.User.Identity.IsAuthenticated;
//var claims = _contextAccessor.HttpContext.User.Claims.ToList(); //var claims = _contextAccessor.HttpContext.User.Claims.ToList();
//if (claims.Count > 0) //if (claims.Count > 0)
// return true; // return true;
//return false; //return false;
//return claims.Count > 0; //return claims.Count > 0;
} }
public void Signin(AuthViewModel account) public void Signin(AuthViewModel account)
{ {
#region MahanChanges #region MahanChanges
if (account.Id == 322) var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
account.Permissions.AddRange([3060301, 30603, 30604, 30605]); var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
var slug = account.WorkshopSlug ?? "";
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : ""; #endregion
var claims = new List<Claim>
{
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : ""; new Claim("AccountId", account.Id.ToString()),
var slug = account.WorkshopSlug ?? ""; new Claim(ClaimTypes.Name, account.Fullname),
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
#endregion new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
var claims = new List<Claim>
{
new Claim("AccountId", account.Id.ToString()),
new Claim(ClaimTypes.Name, account.Fullname),
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
new Claim("permissions", permissions), new Claim("permissions", permissions),
new Claim("Mobile", account.Mobile), new Claim("Mobile", account.Mobile),
new Claim("ProfilePhoto", account.ProfilePhoto ), new Claim("ProfilePhoto", account.ProfilePhoto ),
new Claim("RoleName", account.RoleName), new Claim("RoleName", account.RoleName),
new Claim("SubAccountId", account.SubAccountId.ToString()), new Claim("SubAccountId", account.SubAccountId.ToString()),
new Claim("AdminAreaPermission", account.AdminAreaPermission.ToString()), new Claim("AdminAreaPermission", account.AdminAreaPermission.ToString()),
new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()), new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()),
new Claim("IsCamera", "false"), new Claim("IsCamera", "false"),
new Claim("PositionValue",account.PositionValue.ToString()), new Claim("PositionValue",account.PositionValue.ToString()),
//mahanChanges //mahanChanges
new("workshopList",workshopBson), new("workshopList",workshopBson),
new("WorkshopSlug",slug), new("WorkshopSlug",slug),
new("WorkshopName",account.WorkshopName??"") new("WorkshopName",account.WorkshopName??"")
}; };
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme); var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
var authProperties = new AuthenticationProperties var authProperties = new AuthenticationProperties
{ {
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1) ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1)
}; };
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, _contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
new ClaimsPrincipal(claimsIdentity), new ClaimsPrincipal(claimsIdentity),
authProperties); authProperties);
} }
#region Camera #region Camera
public void CameraSignIn(CameraAuthViewModel account) public void CameraSignIn(CameraAuthViewModel account)
{ {
var claims = new List<Claim> var claims = new List<Claim>
{ {
new Claim("AccountId", account.Id.ToString()), new Claim("AccountId", account.Id.ToString()),
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
new Claim("WorkshopId", account.WorkshopId.ToString()), new Claim("WorkshopId", account.WorkshopId.ToString()),
new Claim("WorkshopName", account.WorkshopName), new Claim("WorkshopName", account.WorkshopName),
new Claim("Mobile", account.Mobile), new Claim("Mobile", account.Mobile),
new Claim("AccountId", account.AccountId.ToString()), new Claim("AccountId", account.AccountId.ToString()),
new Claim("IsActiveString", account.IsActiveString), new Claim("IsActiveString", account.IsActiveString),
new Claim("IsCamera", "true"), new Claim("IsCamera", "true"),
}; };
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme); var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
var authProperties = new AuthenticationProperties var authProperties = new AuthenticationProperties
{ {
//ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30) //ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30)
ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero) ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero)
}; };
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, _contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
new ClaimsPrincipal(claimsIdentity), new ClaimsPrincipal(claimsIdentity),
authProperties); authProperties);
} }
public CameraAuthViewModel CameraAccountInfo() public CameraAuthViewModel CameraAccountInfo()
{ {
var result = new CameraAuthViewModel(); var result = new CameraAuthViewModel();
if (!IsAuthenticated()) if (!IsAuthenticated())
return result; return result;
var claims = _contextAccessor.HttpContext.User.Claims.ToList(); var claims = _contextAccessor.HttpContext.User.Claims.ToList();
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value); result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value; result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value); result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value);
result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value; result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value;
result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value; result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value;
result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value); result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value);
result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value; result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value;
return result; return result;
} }
#endregion #endregion
public void SignOut() public void SignOut()
{ {
_contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme); _contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
} }
#region Pooya #region Pooya
public (long Id, UserType userType, long roleId) GetUserTypeWithId() public (long Id, UserType userType, long roleId) GetUserTypeWithId()
{ {
if (!IsAuthenticated()) if (!IsAuthenticated())
return (0, UserType.Anonymous, 0); return (0, UserType.Anonymous, 0);
var claims = _contextAccessor.HttpContext.User.Claims.ToList(); var claims = _contextAccessor.HttpContext.User.Claims.ToList();
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0"); var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
if (subAccountId > 0) if (subAccountId > 0)
return (subAccountId, UserType.SubAccount, 0); return (subAccountId, UserType.SubAccount, 0);
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value); var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true") if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
{ {
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0"); var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
return (id, UserType.Admin, roleId); return (id, UserType.Admin, roleId);
} }
return (id, UserType.Client, 0); return (id, UserType.Client, 0);
} }
#endregion #endregion
} }

View File

@@ -385,27 +385,11 @@
/// </summary> /// </summary>
public const int SetWorkshopWorkingHoursPermissionCode = 10606; public const int SetWorkshopWorkingHoursPermissionCode = 10606;
#region حساب کاربری دوربین
/// <summary> /// <summary>
/// تنظیمات حساب کاربری دوربین /// تنظیمات حساب کاربری دوربین
/// </summary> /// </summary>
public const int CameraAccountSettingsPermissionCode = 10607; public const int CameraAccountSettingsPermissionCode = 10607;
/// <summary>
/// فعال/غیرفعال اکانت دوربین
/// </summary>
public const int CameraAccountActivationBtnPermissionCode = 1060701;
/// <summary>
/// ویرایش اکانت دوربین
/// </summary>
public const int CameraAccountEditPermissionCode = 1060702;
#endregion
#endregion #endregion
#region کارپوشه #region کارپوشه
@@ -760,22 +744,6 @@
Code = CameraAccountSettingsPermissionCode, Code = CameraAccountSettingsPermissionCode,
ParentId = RollCallOperationsPermissionCode ParentId = RollCallOperationsPermissionCode
}; };
public static SubAccountPermissionDto CameraAccountActivationBtn { get; } = new()
{
Id = CameraAccountActivationBtnPermissionCode,
Name = "فعال/غیرفعال حساب کاربری دوربین",
Code = CameraAccountActivationBtnPermissionCode,
ParentId = CameraAccountSettingsPermissionCode
};
public static SubAccountPermissionDto CameraAccountEdit { get; } = new()
{
Id = CameraAccountEditPermissionCode,
Name = "ویراش حساب کاربری دوربین",
Code = CameraAccountEditPermissionCode,
ParentId = CameraAccountSettingsPermissionCode
};
#endregion #endregion
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode #region کارپوشه,ParentId = WorkFlowOperationsPermissionCode

View File

@@ -1396,73 +1396,6 @@ public static class Tools
return false; return false;
return true; 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) public static DateTime FindFirstDayOfMonthGr(this DateTime date)
{ {
var pc = new PersianCalendar(); var pc = new PersianCalendar();

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ public class TaskSchedule:EntityBase
UnitType = unitType; UnitType = unitType;
UnitNumber = unitNumber; UnitNumber = unitNumber;
LastEndTaskDate = lastEndTaskDate; LastEndTaskDate = lastEndTaskDate;
IsActive = IsActive.True; IsActive = IsActive.False;
} }
public string Count { get; private set; } public string Count { get; private set; }
public TaskScheduleType Type { get; private set; } public TaskScheduleType Type { get; private set; }

View File

@@ -1,8 +1,5 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using _0_Framework.Application;
using _0_Framework.InfraStructure; using _0_Framework.InfraStructure;
using AccountManagement.Application.Contracts.Media; using AccountManagement.Application.Contracts.Media;
using AccountManagement.Domain.AdminResponseMediaAgg; using AccountManagement.Domain.AdminResponseMediaAgg;
@@ -10,35 +7,27 @@ using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.MediaAgg; using AccountManagement.Domain.MediaAgg;
using AccountManagement.Domain.TaskMediaAgg; using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TicketMediasAgg; using AccountManagement.Domain.TicketMediasAgg;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace AccountMangement.Infrastructure.EFCore.Repository; 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; private readonly AccountContext _accountContext;
public MediaRepository(AccountContext taskManagerContext, IWebHostEnvironment webHostEnvironment) : base(taskManagerContext) public MediaRepository( AccountContext taskManagerContext) : base(taskManagerContext)
{ {
_accountContext = taskManagerContext; _accountContext = taskManagerContext;
BasePath = webHostEnvironment.ContentRootPath + "/Storage";
} }
//ساخت جدول واسط بین مدیا و نسک //ساخت جدول واسط بین مدیا و نسک
//نکته: این متد ذخیره انجام نمیدهد //نکته: این متد ذخیره انجام نمیدهد
public void CreateMediaWithTaskMedia(long taskId, long mediaId) public void CreateMediaWithTaskMedia(long taskId, long mediaId)
{ {
var Taskmedias = new TaskMedia(taskId, mediaId); var Taskmedias = new TaskMedia(taskId,mediaId);
_accountContext.Add(Taskmedias); _accountContext.Add(Taskmedias);
} }
public void Remove(long id) public void Remove(long id)
{ {
var media = Get(id); var media = Get(id);
Remove(media); Remove(media);
} }
@@ -88,48 +77,6 @@ public class MediaRepository : RepositoryBase<long, Media>, IMediaRepository
{ {
return _accountContext.Medias.Where(x => mediaIds.Contains(x.id)).ToList(); 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 #endregion

View File

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

View File

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

View File

@@ -4,9 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using _0_Framework.Domain; using _0_Framework.Domain;
using Company.Domain.InsuranceListAgg.ValueObjects;
using Company.Domain.InsuranceWorkshopAgg; using Company.Domain.InsuranceWorkshopAgg;
using CompanyManagment.App.Contracts.InsuranceList.Enums;
namespace Company.Domain.InsuranceListAgg; namespace Company.Domain.InsuranceListAgg;
@@ -153,21 +151,6 @@ public class InsuranceList : EntityBase
/// </summary> /// </summary>
public double SumOfMarriedAllowance { get; private set; } 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 List<InsuranceListWorkshop> InsuranceListWorkshops { get; set; }
public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included, public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included,
@@ -191,22 +174,4 @@ public class InsuranceList : EntityBase
SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears; SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears;
} }
}
public void SetDebt(InsuranceListDebt debt)
{
Debt = debt;
}
public void SetInspection(InsuranceListInspection inspection)
{
Inspection = inspection;
}
public void SetEmployerApproval(InsuranceListEmployerApproval employerApproval)
{
EmployerApproval = employerApproval;
}
public void SetConfirmSentlist(bool confirmSentlist)
{
ConfirmSentlist = confirmSentlist;
}
}

View File

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

View File

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

View File

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

View File

@@ -52,8 +52,5 @@ public interface ILeftWorkInsuranceRepository : IRepository<long, LeftWorkInsura
/// <returns></returns> /// <returns></returns>
List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId); List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId);
LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId);
#endregion #endregion
} }

View File

@@ -16,19 +16,7 @@ namespace Company.Domain.RollCallAgg;
public interface IRollCallMandatoryRepository : IRepository<long, RollCall> public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
{ {
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout); ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
/// <summary>
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
/// </summary>
/// <param name="employeeId"></param>
/// <param name="workshopId"></param>
/// <param name="contractStart"></param>
/// <param name="contractEnd"></param>
/// <returns></returns>
(bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
DateTime contractStart, DateTime contractEnd);
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList); List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);

View File

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

View File

@@ -132,8 +132,6 @@ public class CheckoutViewModel
/// مدت مرخصی استحقاقی /// مدت مرخصی استحقاقی
/// </summary> /// </summary>
public string TotalPaidLeave { get; set; } public string TotalPaidLeave { get; set; }
public TimeSpan TotalHourlyLeave { get; set; }
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; } public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; } public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; } public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -38,5 +38,4 @@ public interface IRollCallEmployeeApplication
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId); (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
bool HasEmployees(long workshopId); bool HasEmployees(long workshopId);
#endregion #endregion
} }

View File

@@ -17,7 +17,5 @@ namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr); List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate); bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId); }
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -19,505 +19,490 @@ namespace CompanyManagment.Application;
public class CheckoutApplication : ICheckoutApplication public class CheckoutApplication : ICheckoutApplication
{ {
private readonly ICheckoutRepository _checkoutRepository; private readonly ICheckoutRepository _checkoutRepository;
private readonly IYearlySalaryRepository _yearlySalaryRepository; private readonly IYearlySalaryRepository _yearlySalaryRepository;
private readonly ILeftWorkRepository _leftWorkRepository; private readonly ILeftWorkRepository _leftWorkRepository;
private readonly IEmployerRepository _employerRepository; private readonly IEmployerRepository _employerRepository;
private readonly IPersonalContractingPartyApp _contractingPartyApp; private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly ILeaveApplication _leaveApplication; private readonly ILeaveApplication _leaveApplication;
private readonly IMandatoryHoursApplication _mandatoryHoursApplication; private readonly IMandatoryHoursApplication _mandatoryHoursApplication;
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository; private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository, public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository, ILeftWorkRepository leftWorkRepository,
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository) IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository)
{ {
_checkoutRepository = checkoutRepository; _checkoutRepository = checkoutRepository;
_yearlySalaryRepository = yearlySalaryRepository; _yearlySalaryRepository = yearlySalaryRepository;
_leftWorkRepository = leftWorkRepository; _leftWorkRepository = leftWorkRepository;
_employerRepository = employerRepository; _employerRepository = employerRepository;
_contractingPartyApp = contractingPartyApp; _contractingPartyApp = contractingPartyApp;
_leaveApplication = leaveApplication; _leaveApplication = leaveApplication;
_mandatoryHoursApplication = mandatoryHoursApplication; _mandatoryHoursApplication = mandatoryHoursApplication;
_rollCallMandatoryRepository = rollCallMandatoryRepository; _rollCallMandatoryRepository = rollCallMandatoryRepository;
} }
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")] [SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
public void Create(CreateCheckout command) public void Create(CreateCheckout command)
{ {
var operation = new OperationResult(); var operation = new OperationResult();
var syear = Convert.ToInt32(command.ContractStart.Substring(0, 4)); var syear = Convert.ToInt32(command.ContractStart.Substring(0, 4));
var smonth = Convert.ToInt32(command.ContractStart.Substring(5, 2)); var smonth = Convert.ToInt32(command.ContractStart.Substring(5, 2));
string month = string.Empty; string month = string.Empty;
switch (smonth) switch (smonth)
{ {
case 1: case 1:
month = "فروردین"; month = "فروردین";
break; break;
case 2: case 2:
month = "اردیبهشت"; month = "اردیبهشت";
break; break;
case 3: case 3:
month = "خرداد"; month = "خرداد";
break; break;
case 4: case 4:
month = "تیر"; month = "تیر";
break; break;
case 5: case 5:
month = "مرداد"; month = "مرداد";
break; break;
case 6: case 6:
month = "شهریور"; month = "شهریور";
break; break;
case 7: case 7:
month = "مهر"; month = "مهر";
break; break;
case 8: case 8:
month = "آبان"; month = "آبان";
break; break;
case 9: case 9:
month = "آذر"; month = "آذر";
break; break;
case 10: case 10:
month = "دی"; month = "دی";
break; break;
case 11: case 11:
month = "بهمن"; month = "بهمن";
break; break;
case 12: case 12:
month = "اسفند"; month = "اسفند";
break; break;
} }
var year = syear.ToString(); var year = syear.ToString();
#region SickLeav #region SickLeav
//var serachModel = new LeaveSearchModel() //var serachModel = new LeaveSearchModel()
//{ //{
// EmployeeId = command.EmployeeId, // EmployeeId = command.EmployeeId,
// WorkshopId = command.WorkshopId, // WorkshopId = command.WorkshopId,
// LeaveType = "استعلاجی", // LeaveType = "استعلاجی",
// StartLeave = command.ContractStart, // StartLeave = command.ContractStart,
// EndLeave = command.ContractEnd, // EndLeave = command.ContractEnd,
// IsAccepted = true, // IsAccepted = true,
//}; //};
//var leavList = _leaveApplication.search(serachModel); //var leavList = _leaveApplication.search(serachModel);
// int sickLeaveCount = 0; // int sickLeaveCount = 0;
//if (leavList.Count > 0) //if (leavList.Count > 0)
//{ //{
// foreach (var leave in leavList) // foreach (var leave in leavList)
// { // {
// if (leave.StartLeaveGr < command.ContractStartGr && leave.EndLeaveGr <= command.ContractEndGr) // if (leave.StartLeaveGr < command.ContractStartGr && leave.EndLeaveGr <= command.ContractEndGr)
// { // {
// int res = (int)((leave.EndLeaveGr - command.ContractStartGr).TotalDays +1); // int res = (int)((leave.EndLeaveGr - command.ContractStartGr).TotalDays +1);
// sickLeaveCount += res; // sickLeaveCount += res;
// } // }
// else if (leave.StartLeaveGr >= command.ContractStartGr && leave.EndLeaveGr > command.ContractEndGr) // else if (leave.StartLeaveGr >= command.ContractStartGr && leave.EndLeaveGr > command.ContractEndGr)
// { // {
// int res = (int)((command.ContractEndGr - leave.StartLeaveGr).TotalDays + 1); // int res = (int)((command.ContractEndGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res; // sickLeaveCount += res;
// } // }
// else // else
// { // {
// int res = (int)((leave.EndLeaveGr - leave.StartLeaveGr).TotalDays + 1); // int res = (int)((leave.EndLeaveGr - leave.StartLeaveGr).TotalDays + 1);
// sickLeaveCount += res; // sickLeaveCount += res;
// } // }
// } // }
//} //}
#endregion #endregion
var dayliWage = command.DayliWage.MoneyToDouble(); var dayliWage = command.DayliWage.MoneyToDouble();
// کمک هزینه اقلام // کمک هزینه اقلام
var consumableItem = command.ConsumableItems.MoneyToDouble(); var consumableItem = command.ConsumableItems.MoneyToDouble();
//حق اولاد //حق اولاد
var familyAllowance = command.FamilyAllowance.MoneyToDouble(); var familyAllowance = command.FamilyAllowance.MoneyToDouble();
//کمک هزینه مسکن //کمک هزینه مسکن
var housingAllowance = command.HousingAllowance.MoneyToDouble(); var housingAllowance = command.HousingAllowance.MoneyToDouble();
//حق تاهل //حق تاهل
var marriedAllowance = command.MarriedAllowance.MoneyToDouble(); var marriedAllowance = command.MarriedAllowance.MoneyToDouble();
var MontlyYearsBunos = var MontlyYearsBunos =
_yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork); _yearlySalaryRepository.GetMontlyBunosYears(command.WeeklyTime, command.ContractStartGr, command.ContractEndGr, dayliWage, command.WorkingWeeklyTime, command.officialholiday, command.friday, command.TotalHolidaysAndNotH, command.TotalHolidaysAndNotM, command.Basic, command.FridayStarttoEnd, command.DailFeeComplete, command.HasRollCall, command.HolidayWorking, command.ShiftWork);
//دستمزد ماهانه //دستمزد ماهانه
var monthlyWage = MontlyYearsBunos.MontlyWage; var monthlyWage = MontlyYearsBunos.MontlyWage;
//سنوات //سنوات
var years = command.YearsPay; var years = command.YearsPay;
//عیدی و پاداش //عیدی و پاداش
var bunos = command.BonusesPay; var bunos = command.BonusesPay;
//پایه سنوات //پایه سنوات
var bacicYears = MontlyYearsBunos.BasicYears; var bacicYears = MontlyYearsBunos.BasicYears;
var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay; var sumOfWorkingDays = MontlyYearsBunos.SumOfWorkingDay;
if (command.friday > 0) if (command.friday > 0)
{ {
var fridayPercent = dayliWage * 40 / 100; var fridayPercent = dayliWage * 40 / 100;
//فوق العاده جمعه کاری //فوق العاده جمعه کاری
command.FridayPay = fridayPercent * command.friday; command.FridayPay = fridayPercent * command.friday;
} }
//حق بیمه سهم کارگر //حق بیمه سهم کارگر
var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance) * 7 / 100; var insuranceDeduction = (monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance) * 7 / 100;
if (command.OvertimePay > 0 && command.AbsenceDeduction > 0) if (command.OvertimePay > 0 && command.AbsenceDeduction > 0)
{ {
if (command.AbsenceDeduction >= command.OvertimePay) if (command.AbsenceDeduction >= command.OvertimePay)
{ {
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay; command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
command.OvertimePay = 0; command.OvertimePay = 0;
} }
else else
{ {
command.OvertimePay = command.OvertimePay - command.AbsenceDeduction; command.OvertimePay = command.OvertimePay - command.AbsenceDeduction;
command.AbsenceDeduction = 0; command.AbsenceDeduction = 0;
} }
} }
var checkoutStart = $"{command.Year}/{command.Month}/01"; var checkoutStart = $"{command.Year}/{command.Month}/01";
var checkoutEnd = checkoutStart.FindeEndOfMonth(); var checkoutEnd = checkoutStart.FindeEndOfMonth();
var salaryAids = var salaryAids =
_rollCallMandatoryRepository.SalaryAidsForCheckout(command.EmployeeId, command.WorkshopId, checkoutStart.ToGeorgianDateTime(), checkoutEnd.ToGeorgianDateTime()) _rollCallMandatoryRepository.SalaryAidsForCheckout(command.EmployeeId, command.WorkshopId, checkoutStart.ToGeorgianDateTime(), checkoutEnd.ToGeorgianDateTime())
.Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList(); .Select(x => new CheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa, x.Id)).ToList();
command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble()); command.SalaryAidDeduction = salaryAids.Sum(x => x.Amount.MoneyToDouble());
var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId, var loanInstallments = _rollCallMandatoryRepository.LoanInstallmentForCheckout(command.EmployeeId,
command.WorkshopId, command.ContractStartGr, command.ContractEndGr) command.WorkshopId, command.ContractStartGr, command.ContractEndGr)
.Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList(); .Select(x => new CheckoutLoanInstallment(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount, x.Id)).ToList();
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble()); command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay + var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay; command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
var totalClaims = totalClaimsDouble.ToMoney(); var totalClaims = totalClaimsDouble.ToMoney();
var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction; var totalDeductionDouble = insuranceDeduction + command.AbsenceDeduction + command.InstallmentDeduction + command.SalaryAidDeduction;
var totalDeductions = totalDeductionDouble.ToMoney(); var totalDeductions = totalDeductionDouble.ToMoney();
var totalPayment = totalClaimsDouble - totalDeductionDouble; var totalPayment = totalClaimsDouble - totalDeductionDouble;
if (_checkoutRepository.Exists(x => if (_checkoutRepository.Exists(x =>
x.Month == command.Month && x.Year == command.Year && x.ContractNo == command.ContractNo)) x.Month == command.Month && x.Year == command.Year && x.ContractNo == command.ContractNo))
{ {
operation.Failed("امکان ثبت رکورد تکراری وجود ندارد"); operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
} }
else else
{ {
if (string.IsNullOrWhiteSpace(command.Signature)) if (string.IsNullOrWhiteSpace(command.Signature))
{ {
command.Signature = "0"; command.Signature = "0";
} }
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year, , command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays, , command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids); , command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids);
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult(); _checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
//_checkoutRepository.SaveChanges(); //_checkoutRepository.SaveChanges();
//var employeeFullName = new SqlParameter("@EmployeeFullName", SqlDbType.NVarChar, 50); //var employeeFullName = new SqlParameter("@EmployeeFullName", SqlDbType.NVarChar, 50);
//employeeFullName.Value = command.EmployeeFullName; //employeeFullName.Value = command.EmployeeFullName;
//var fathersName = new SqlParameter("@FathersName", SqlDbType.NVarChar, 20); //var fathersName = new SqlParameter("@FathersName", SqlDbType.NVarChar, 20);
//fathersName.Value = command.EmployeeFullName; //fathersName.Value = command.EmployeeFullName;
} }
} }
public OperationResult Edit(EditCheckout command) public OperationResult Edit(EditCheckout command)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public EditCheckout GetDetails(long id) public EditCheckout GetDetails(long id)
{ {
return _checkoutRepository.GetDetails(id); return _checkoutRepository.GetDetails(id);
} }
public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month, public async Task<CreateCheckoutListViewModel> GetContractResultToCreateCheckout(long workshopId, long employeeId, string year, string month,
string contractStart, string contractEnd) string contractStart, string contractEnd)
{ {
return await _checkoutRepository.GetContractResultToCreateCheckout(workshopId, employeeId, year, month, contractStart, return await _checkoutRepository.GetContractResultToCreateCheckout(workshopId, employeeId, year, month, contractStart,
contractEnd); contractEnd);
} }
public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel) public async Task<List<CheckoutViewModel>> Search(CheckoutSearchModel searchModel)
{ {
var result = new List<CheckoutViewModel>(); var result = new List<CheckoutViewModel>();
var query = await _checkoutRepository.SearchForMainCheckout(searchModel); var query = await _checkoutRepository.SearchForMainCheckout(searchModel);
query = query.Select(x => new CheckoutViewModel() query = query.Select(x => new CheckoutViewModel()
{ {
Id = x.Id, Id = x.Id,
EmployeeFullName = x.EmployeeFullName, EmployeeFullName = x.EmployeeFullName,
ContractStart = x.ContractStart, ContractStart = x.ContractStart,
ContractEnd = x.ContractEnd, ContractEnd = x.ContractEnd,
ContractStartGr = x.ContractStartGr, ContractStartGr = x.ContractStartGr,
ContractEndGr = x.ContractEndGr, ContractEndGr = x.ContractEndGr,
PersonnelCode = x.PersonnelCode, PersonnelCode = x.PersonnelCode,
PersonnelCodeInt = x.PersonnelCodeInt, PersonnelCodeInt = x.PersonnelCodeInt,
ArchiveCode = x.ArchiveCode, ArchiveCode = x.ArchiveCode,
SumOfWorkingDays = x.SumOfWorkingDays, SumOfWorkingDays = x.SumOfWorkingDays,
WorkshopName = x.WorkshopName, WorkshopName = x.WorkshopName,
Month = x.Month, Month = x.Month,
Year = x.Year, Year = x.Year,
ContractNo = x.ContractNo, ContractNo = x.ContractNo,
ContractId = x.ContractId, ContractId = x.ContractId,
WorkshopId = x.WorkshopId, WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId, EmployeeId = x.EmployeeId,
IsActiveString = x.IsActiveString, IsActiveString = x.IsActiveString,
Signature = x.Signature, Signature = x.Signature,
CreationDate = x.CreationDate, CreationDate = x.CreationDate,
EmployerName = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.EmployerFullName, EmployerName = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.EmployerFullName,
IsBlockCantracingParty = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.IsBlockContractingParty, IsBlockCantracingParty = _employerRepository.GetEmployerByWorkshopId(x.WorkshopId).FirstOrDefault()?.IsBlockContractingParty,
}).ToList(); }).ToList();
//foreach (var items in query) //foreach (var items in query)
//{ //{
// var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId); // var s = _employerRepository.GetEmployerByWorkshopId(items.WorkshopId);
// if (s != null) // if (s != null)
// { // {
// items.EmployerName = s.FirstOrDefault().EmployerFullName; // items.EmployerName = s.FirstOrDefault().EmployerFullName;
// } // }
// result.Add(items); // result.Add(items);
// //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId) // //var employeId = _context.WorkshopEmployers?.Where(x => x.WorkshopId == items.WorkshopId)
// // .Select(x => x.EmployerId).FirstOrDefault(); // // .Select(x => x.EmployerId).FirstOrDefault();
// //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName; // //var employerName = _context.Employers?.FirstOrDefault(x => x.id == employeId).FullName;
// // = employerName; // // = employerName;
//} //}
return query; return query;
} }
public List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel) public List<CheckoutViewModel> SimpleSearch(CheckoutSearchModel searchModel)
{ {
return _checkoutRepository.SimpleSearch(searchModel); return _checkoutRepository.SimpleSearch(searchModel);
} }
public List<CheckoutViewModel> PrintAll(List<long> id) public List<CheckoutViewModel> PrintAll(List<long> id)
{ {
var result = _checkoutRepository.PrintAll(id); var result = _checkoutRepository.PrintAll(id);
var oneRecord = result.FirstOrDefault(); var oneRecord = result.FirstOrDefault();
if (oneRecord == null) if (oneRecord == null)
return new(); return new();
result.ForEach(x => result.ForEach(x =>
{ {
int yearFa; int yearFa;
int monthFa; int monthFa;
try try
{ {
yearFa = int.Parse(oneRecord.Year); yearFa = int.Parse(oneRecord.Year);
monthFa = oneRecord.Month.ToMonthByStringValue(); monthFa = oneRecord.Month.ToMonthByStringValue();
} }
catch (Exception e) catch (Exception e)
{ {
return; return;
} }
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa); double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
int mandatoryWholeHours = (int)mandatoryHours; int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60); int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks)); var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks));
var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks)); var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks));
TimeSpan totalPresent = totalWorking + totalBreakTime; var totalPresent = totalWorking + totalBreakTime;
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
if (x.HasRollCall) x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
{ x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - x.TotalHourlyLeave; x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime ; });
} return result;
else }
{
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks)); public CheckoutViewModel PrintOne(long id)
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)); {
totalWorking = totalPresent - totalBreakTime; var result = _checkoutRepository.PrintOne(id);
}
int yearFa;
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-"); int monthFa;
x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-"); try
x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-"); {
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-"); yearFa = int.Parse(result.Year);
monthFa = result.Month.ToMonthByStringValue();
}); }
return result; catch (Exception e)
} {
return new();
public CheckoutViewModel PrintOne(long id) }
{ double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa);
var result = _checkoutRepository.PrintOne(id); int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
int yearFa; TimeSpan totalWorking;
int monthFa; TimeSpan totalBreakTime;
try TimeSpan totalPresent;
{ if (result.HasRollCall)
yearFa = int.Parse(result.Year); {
monthFa = result.Month.ToMonthByStringValue(); totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
} totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
catch (Exception e) totalPresent = totalWorking + totalBreakTime;
{ }
return new(); else
} {
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(yearFa, monthFa); totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
int mandatoryWholeHours = (int)mandatoryHours; totalPresent = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60); totalWorking = totalPresent - totalBreakTime;
TimeSpan totalWorking; }
TimeSpan totalBreakTime;
TimeSpan totalPresent; result.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
TimeSpan totalHoursLeave; result.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
if (result.HasRollCall) result.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
{ result.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - result.TotalHourlyLeave;
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks)); return result;
totalPresent = totalWorking + totalBreakTime ; }
}
else public CheckoutLeavePrintViewModel LeavePrint(long id)
{ {
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks)); return _checkoutRepository.PrintLeave(id);
totalPresent = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)); }
totalWorking = totalPresent - totalBreakTime;
} public OperationResult Sign(long id)
{
result.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-"); var opration = new OperationResult();
result.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-"); var contract = _checkoutRepository.Get(id);
result.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-"); if (contract == null)
result.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-"); return opration.Failed("رکورد مورد نظر یافت نشد");
return result; contract.Sign();
}
public CheckoutLeavePrintViewModel LeavePrint(long id) _checkoutRepository.SaveChanges();
{ opration.IsSuccedded = true;
return _checkoutRepository.PrintLeave(id); return opration.Succcedded();
} }
public OperationResult Sign(long id) public OperationResult UnSign(long id)
{ {
var opration = new OperationResult(); var opration = new OperationResult();
var contract = _checkoutRepository.Get(id); var contract = _checkoutRepository.Get(id);
if (contract == null) if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد"); return opration.Failed("رکورد مورد نظر یافت نشد");
contract.Sign(); contract.UnSign();
_checkoutRepository.SaveChanges(); _checkoutRepository.SaveChanges();
opration.IsSuccedded = true; opration.IsSuccedded = true;
return opration.Succcedded(); return opration.Succcedded();
} }
public OperationResult UnSign(long id) public OperationResult Active(long id)
{ {
var opration = new OperationResult(); var opration = new OperationResult();
var contract = _checkoutRepository.Get(id); var contract = _checkoutRepository.Get(id);
if (contract == null) if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد"); return opration.Failed("رکورد مورد نظر یافت نشد");
contract.UnSign(); contract.Active();
_checkoutRepository.SaveChanges();
_checkoutRepository.SaveChanges(); return opration.Succcedded();
opration.IsSuccedded = true; }
return opration.Succcedded();
} public OperationResult DeActive(long id)
{
public OperationResult Active(long id) var opration = new OperationResult();
{ var contract = _checkoutRepository.Get(id);
var opration = new OperationResult(); if (contract == null)
var contract = _checkoutRepository.Get(id); return opration.Failed("رکورد مورد نظر یافت نشد");
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد"); contract.DeActive();
contract.Active();
_checkoutRepository.SaveChanges();
_checkoutRepository.SaveChanges();
return opration.Succcedded(); return opration.Succcedded();
} }
public OperationResult DeActive(long id) public OperationResult RemoveCheckout(long id)
{ {
var opration = new OperationResult(); return _checkoutRepository.RemoveCheckout(id);
var contract = _checkoutRepository.Get(id); }
if (contract == null)
return opration.Failed("رکورد مورد نظر یافت نشد"); public OperationResult CustomSet(long id, double rewardPay, double salaryAidDeduction)
{
contract.DeActive(); var opration = new OperationResult();
var checkout = _checkoutRepository.Get(id);
var totalClaimsDouble = checkout.TotalClaims.MoneyToDouble();
_checkoutRepository.SaveChanges(); var totalDeductionsDouble = checkout.TotalDeductions.MoneyToDouble();
totalClaimsDouble = (double)(totalClaimsDouble - checkout.RewardPay);
return opration.Succcedded(); totalDeductionsDouble = totalDeductionsDouble - checkout.SalaryAidDeduction;
}
var totalClaims = totalClaimsDouble + rewardPay;
public OperationResult RemoveCheckout(long id) var totalDeductions = totalDeductionsDouble + salaryAidDeduction;
{
return _checkoutRepository.RemoveCheckout(id);
}
var totalClaimsString = totalClaims.ToMoney();
public OperationResult CustomSet(long id, double rewardPay, double salaryAidDeduction) var totalDeductionsString = totalDeductions.ToMoney();
{ var totalPayment = totalClaims - totalDeductions;
var opration = new OperationResult();
var checkout = _checkoutRepository.Get(id); checkout.CustomSet(rewardPay, salaryAidDeduction, totalClaimsString, totalDeductionsString, totalPayment);
var totalClaimsDouble = checkout.TotalClaims.MoneyToDouble();
var totalDeductionsDouble = checkout.TotalDeductions.MoneyToDouble(); _checkoutRepository.SaveChanges();
totalClaimsDouble = (double)(totalClaimsDouble - checkout.RewardPay); opration.IsSuccedded = true;
totalDeductionsDouble = totalDeductionsDouble - checkout.SalaryAidDeduction; return opration.Succcedded();
}
var totalClaims = totalClaimsDouble + rewardPay;
var totalDeductions = totalDeductionsDouble + salaryAidDeduction; #region Client
public List<CheckoutViewModel> SearchForClient(CheckoutSearchModel searchModel)
{
var totalClaimsString = totalClaims.ToMoney(); return _checkoutRepository.SearchForClient(searchModel);
var totalDeductionsString = totalDeductions.ToMoney(); }
var totalPayment = totalClaims - totalDeductions;
#endregion
checkout.CustomSet(rewardPay, salaryAidDeduction, totalClaimsString, totalDeductionsString, totalPayment); #region NewChangeByHeydari
public List<long> CheckHasSignature(List<long> ids)
_checkoutRepository.SaveChanges(); {
opration.IsSuccedded = true; return _checkoutRepository.CheckHasSignature(ids);
return opration.Succcedded(); }
} public OperationResult DeleteAllCheckouts(List<long> ids)
{
#region Client return _checkoutRepository.DeleteAllCheckouts(ids);
}
public List<CheckoutViewModel> SearchForClient(CheckoutSearchModel searchModel) public OperationResult DeleteCheckout(long id)
{ {
return _checkoutRepository.SearchForClient(searchModel); return _checkoutRepository.DeleteCheckout(id);
} }
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
#endregion {
#region NewChangeByHeydari return await _checkoutRepository.SearchForMainCheckout(searchModel);
public List<long> CheckHasSignature(List<long> ids) }
{ #endregion
return _checkoutRepository.CheckHasSignature(ids); #region Pooya
}
public OperationResult DeleteAllCheckouts(List<long> ids)
{ public List<(long EmployeeId, DateTime CheckoutStart, DateTime CheckoutEnd)> GetLastCheckoutsByWorkshopIdForWorkFlow(long workshopId, DateTime start, DateTime end)
return _checkoutRepository.DeleteAllCheckouts(ids); {
} return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
public OperationResult DeleteCheckout(long id) }
{
return _checkoutRepository.DeleteCheckout(id);
}
public async Task<List<CheckoutViewModel>> SearchForMainCheckout(CheckoutSearchModel searchModel)
{
return await _checkoutRepository.SearchForMainCheckout(searchModel);
}
#endregion
#region Pooya
public List<(long EmployeeId, DateTime CheckoutStart, DateTime CheckoutEnd)> GetLastCheckoutsByWorkshopIdForWorkFlow(long workshopId, DateTime start, DateTime end)
{
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
}
#endregion #endregion
} }

View File

@@ -30,7 +30,6 @@ using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
using Company.Domain.LeftWorkAgg; using Company.Domain.LeftWorkAgg;
using CompanyManagment.App.Contracts.Employee.DTO; using CompanyManagment.App.Contracts.Employee.DTO;
using Company.Domain.EmployeeAuthorizeTempAgg; using Company.Domain.EmployeeAuthorizeTempAgg;
using Company.Domain.LeftWorkInsuranceAgg;
namespace CompanyManagment.Application; namespace CompanyManagment.Application;
@@ -60,9 +59,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
private readonly IEmployeeClientTempRepository _employeeClientTempRepository; private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository; private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository; private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context) public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository) : base(context)
{ {
_context = context; _context = context;
_WorkShopRepository = workShopRepository; _WorkShopRepository = workShopRepository;
@@ -79,7 +77,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
_employeeClientTempRepository = employeeClientTempRepository; _employeeClientTempRepository = employeeClientTempRepository;
_leftWorkRepository = leftWorkRepository; _leftWorkRepository = leftWorkRepository;
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository; _employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
_EmployeeRepository = employeeRepository; _EmployeeRepository = employeeRepository;
} }
@@ -1012,9 +1009,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
var startLeftWork = command.StartLeftWork.ToGeorgianDateTime(); var startLeftWork = command.StartLeftWork.ToGeorgianDateTime();
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id); var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
PersonnelCodeDomain personnelCode = null;
PersonnelCodeDomain personnelCode = null;
if (leftWorkViewModel != null) if (leftWorkViewModel != null)
{ {
if (leftWorkViewModel.HasLeft == false && leftWorkViewModel.LeftWorkDate > DateTime.Now) if (leftWorkViewModel.HasLeft == false && leftWorkViewModel.LeftWorkDate > DateTime.Now)
@@ -1029,16 +1024,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
} }
else else
{ {
var insuranceLeftWork = var lastPersonnelCodeByWorkshop = _personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
_leftWorkInsuranceRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
if (insuranceLeftWork == null)
{
var lastPersonnelCodeByWorkshop =
_personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
personnelCode = new PersonnelCodeDomain(command.WorkshopId, personnelCode = new PersonnelCodeDomain(command.WorkshopId,
employee.id, lastPersonnelCodeByWorkshop + 1); employee.id, lastPersonnelCodeByWorkshop + 1);
}
} }
var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId); var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId);

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -17,206 +17,204 @@ namespace CompanyManagment.Application;
public class RollCallEmployeeApplication : IRollCallEmployeeApplication public class RollCallEmployeeApplication : IRollCallEmployeeApplication
{ {
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository; private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication; private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
private readonly IEmployeeRepository _employeeRepository; private readonly IEmployeeRepository _employeeRepository;
private readonly ILeftWorkRepository _leftWorkRepository; private readonly ILeftWorkRepository _leftWorkRepository;
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository; private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
private readonly IWebHostEnvironment _webHostEnvironment; private readonly IWebHostEnvironment _webHostEnvironment;
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment) public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
{ {
_rollCallEmployeeRepository = rollCallEmployeeRepository; _rollCallEmployeeRepository = rollCallEmployeeRepository;
_employeeRepository = employeeRepository; _employeeRepository = employeeRepository;
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
_leftWorkRepository = leftWorkRepository; _leftWorkRepository = leftWorkRepository;
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository; _rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
_webHostEnvironment = webHostEnvironment; _webHostEnvironment = webHostEnvironment;
} }
public OperationResult Create(CreateRollCallEmployee command) public OperationResult Create(CreateRollCallEmployee command)
{ {
var opreation = new OperationResult(); var opreation = new OperationResult();
if (_rollCallEmployeeRepository.Exists(x => if (_rollCallEmployeeRepository.Exists(x =>
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId)) x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId))
return opreation.Succcedded(); return opreation.Succcedded();
var fullname = _employeeRepository.GetDetails(command.EmployeeId); var fullname = _employeeRepository.GetDetails(command.EmployeeId);
if (fullname == null) if (fullname == null)
return opreation.Failed("پرسنل یافت نشد"); return opreation.Failed("پرسنل یافت نشد");
var create = new RollCallEmployee(command.WorkshopId, command.EmployeeId, fullname.FName, fullname.LName); var create = new RollCallEmployee(command.WorkshopId, command.EmployeeId, fullname.FName, fullname.LName);
_rollCallEmployeeRepository.Create(create); _rollCallEmployeeRepository.Create(create);
if (command.HasUploadedImage == "true") if (command.HasUploadedImage == "true")
create.HasImage(); create.HasImage();
_rollCallEmployeeRepository.SaveChanges(); _rollCallEmployeeRepository.SaveChanges();
return opreation.Succcedded(create.id); return opreation.Succcedded(create.id);
} }
public OperationResult Active(long id) public OperationResult Active(long id)
{ {
var opreation = new OperationResult(); var opreation = new OperationResult();
var emp = _rollCallEmployeeRepository.Get(id); var emp = _rollCallEmployeeRepository.Get(id);
if (emp == null) if (emp == null)
return opreation.Failed("پرسنل یافت نشد"); return opreation.Failed("پرسنل یافت نشد");
if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId && if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId &&
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now)) x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now))
return opreation.Failed("کارمند شروع به کار ندارد"); return opreation.Failed("کارمند شروع به کار ندارد");
if (emp.HasUploadedImage == "false") if (emp.HasUploadedImage == "false")
return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید"); return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید");
using var transaction = new TransactionScope(); using var transaction = new TransactionScope();
emp.Active(); emp.Active();
var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id }); var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id });
if (operation2.IsSuccedded == false) if (operation2.IsSuccedded == false)
return operation2; return operation2;
_rollCallEmployeeRepository.SaveChanges(); _rollCallEmployeeRepository.SaveChanges();
transaction.Complete(); transaction.Complete();
return operation2; return operation2;
} }
public OperationResult DeActive(long id) public OperationResult DeActive(long id)
{ {
var opreation = new OperationResult(); var opreation = new OperationResult();
var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id); var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id);
if (emp == null) if (emp == null)
return opreation.Failed("پرسنل یافت نشد"); return opreation.Failed("پرسنل یافت نشد");
var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate); var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate);
emp.DeActive(); emp.DeActive();
_rollCallEmployeeRepository.SaveChanges(); _rollCallEmployeeRepository.SaveChanges();
_rollCallEmployeeStatusApplication.Deactivate(lastStatus.id); _rollCallEmployeeStatusApplication.Deactivate(lastStatus.id);
return opreation.Succcedded(); return opreation.Succcedded();
} }
public OperationResult UploadedImage(long Employeeid, long WorkshopId) public OperationResult UploadedImage(long Employeeid, long WorkshopId)
{ {
var opreation = new OperationResult(); var opreation = new OperationResult();
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId); var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
if (emp == null) if (emp == null)
return opreation.Failed("پرسنل یافت نشد"); return opreation.Failed("پرسنل یافت نشد");
var rollCall = _rollCallEmployeeRepository.Get(emp.Id); var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
rollCall.HasImage(); rollCall.HasImage();
_rollCallEmployeeRepository.SaveChanges(); _rollCallEmployeeRepository.SaveChanges();
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString()); var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg"); var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
try try
{ {
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150); var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail)); System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
} }
catch catch
{ {
// ignored // ignored
} }
return opreation.Succcedded(); return opreation.Succcedded();
} }
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId) public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
{ {
return _rollCallEmployeeRepository.GetByWorkshopId(workshopId); return _rollCallEmployeeRepository.GetByWorkshopId(workshopId);
} }
public EditRollCallEmployee GetDetails(long id) public EditRollCallEmployee GetDetails(long id)
{ {
return _rollCallEmployeeRepository.GetDetails(id); return _rollCallEmployeeRepository.GetDetails(id);
} }
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId) public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
{ {
return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
} }
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command) public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
{ {
return _rollCallEmployeeRepository.GetPersonnelRollCallListPaginate(command); return _rollCallEmployeeRepository.GetPersonnelRollCallListPaginate(command);
} }
public int activedPerson(long workshopId) public int activedPerson(long workshopId)
{ {
return _rollCallEmployeeRepository.activedPerson(workshopId); return _rollCallEmployeeRepository.activedPerson(workshopId);
} }
#region Pooya #region Pooya
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId) public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
{ {
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId); return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
} }
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId) public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
{ {
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId); return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
} }
public bool IsEmployeeRollCallActive(long employeeId, long workshopId) public bool IsEmployeeRollCallActive(long employeeId, long workshopId)
{ {
RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true") if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true")
return false; return false;
var now = DateTime.Now; var now = DateTime.Now;
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now); return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
}
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
{
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
}
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
{
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
}
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
{
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
}
public bool HasEmployees(long workshopId)
{
return _rollCallEmployeeRepository.HasEmployees(workshopId);
}
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
{
OperationResult result = new();
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
fName = fName.Trim();
lName = lName.Trim();
var fullName = $"{fName} {lName}";
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
if (entity == null)
return result.Failed(ApplicationMessages.RecordNotFound);
} if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId) if (entity.IsActiveString != "true")
{ return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
}
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
{
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
}
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
{
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
}
public bool HasEmployees(long workshopId)
{
return _rollCallEmployeeRepository.HasEmployees(workshopId);
}
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
{
OperationResult result = new();
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
fName = fName.Trim();
lName = lName.Trim();
var fullName = $"{fName} {lName}";
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
if (entity == null) entity.ChangeName(fName, lName);
return result.Failed(ApplicationMessages.RecordNotFound); _rollCallEmployeeRepository.SaveChanges();
return result.Succcedded();
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId)) }
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
if (entity.IsActiveString != "true")
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
entity.ChangeName(fName, lName);
_rollCallEmployeeRepository.SaveChanges();
return result.Succcedded();
}
#endregion #endregion
} }

View File

@@ -134,38 +134,5 @@ namespace CompanyManagment.Application
{ {
return _employeeRollCallStatusRepository.GetAll(); return _employeeRollCallStatusRepository.GetAll();
} }
}
public void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId)
{
var rollCallEmployee = _rollCallEmployeeRepository.GetWithRollCallStatus(rollCallEmployeeId);
if (rollCallEmployee == null)
return;
var rollCallStatus = rollCallEmployee.EmployeesStatus.MaxBy(x => x.StartDate);
if (rollCallStatus == null)
return;
var today = DateTime.Today;
var firstDayOfMonth = today.FindFirstDayOfMonthGr();
var employeeId = rollCallEmployee.EmployeeId;
var workshopId = rollCallEmployee.WorkshopId;
var leftWork = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(workshopId, employeeId);
if (leftWork == null)
return;
var startWork = leftWork.StartWorkDate;
rollCallStatus.Edit(startWork < firstDayOfMonth ? firstDayOfMonth : startWork, rollCallStatus.EndDate);
_employeeRollCallStatusRepository.SaveChanges();
}
}
} }

View File

@@ -73,28 +73,10 @@ public class WorkshopAppliction : IWorkshopApplication
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode)) if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
return operation.Failed("موارد اجباری را پر کنید"); return operation.Failed("موارد اجباری را پر کنید");
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName)) //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
// return operation.Failed("نام کارگاه تکراری است"); // return operation.Failed("نام کارگاه تکراری است");
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True)) if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
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("کد بیمه کارگاه تکراری است"); return operation.Failed("کد بیمه کارگاه تکراری است");
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State)) if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
@@ -163,11 +145,7 @@ public class WorkshopAppliction : IWorkshopApplication
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
command.Address, command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay, ,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.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.Create(workshop);
_workshopRepository.SaveChanges(); _workshopRepository.SaveChanges();
@@ -233,28 +211,10 @@ public class WorkshopAppliction : IWorkshopApplication
return operation.Failed("لطفا کارفرما را انتخاب نمایید"); return operation.Failed("لطفا کارفرما را انتخاب نمایید");
var employer = command.EmployerIdList.ToList(); var employer = command.EmployerIdList.ToList();
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id)) //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
// return operation.Failed(" نام کارگاه تکراری است "); // return operation.Failed(" نام کارگاه تکراری است ");
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True)) if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
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("لطفا کد بیمه کارگاه را وارد کنید"); return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id)) if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
return operation.Failed("کد بیمه کارگاه تکراری است"); return operation.Failed("کد بیمه کارگاه تکراری است");
@@ -355,10 +315,7 @@ public class WorkshopAppliction : IWorkshopApplication
command.Address, command.Address,
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName, , command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified, 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.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.SaveChanges();
_workshopRepository.RemoveOldRelation(command.Id); _workshopRepository.RemoveOldRelation(command.Id);
@@ -578,169 +535,159 @@ public class WorkshopAppliction : IWorkshopApplication
{ {
return _workshopRepository.SearchForClient(searchModel); return _workshopRepository.SearchForClient(searchModel);
} }
public OperationResult CreateForClient(CreateWorkshop command) public OperationResult CreateForClient(CreateWorkshop command)
{ {
throw new NotImplementedException();
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) public OperationResult EditForClient(EditWorkshop command)
{ {
throw new NotImplementedException(); 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 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) public bool GetWorkshopAccountByAcountID(long acountID)
{ {

View File

@@ -160,7 +160,7 @@ public class YearlySalaryApplication : IYearlySalaryApplication
public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year) public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
{ {
return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year); return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
} }
#endregion #endregion
} }

View File

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

View File

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

View File

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

View File

@@ -1,51 +0,0 @@
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");
}
}
}

View File

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

View File

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

View File

@@ -1,6 +1,5 @@
// <auto-generated /> // <auto-generated />
using System; using System;
using System.Collections.Generic;
using CompanyManagment.EFCore; using CompanyManagment.EFCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
@@ -1809,24 +1808,12 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate") b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<long>("EmployeeId") b.Property<long>("EmployeeId")
.HasColumnType("bigint"); .HasColumnType("bigint");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<long>("WorkshopId") b.Property<long>("WorkshopId")
.HasColumnType("bigint"); .HasColumnType("bigint");
@@ -3363,64 +3350,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(4) .HasMaxLength(4)
.HasColumnType("nvarchar(4)"); .HasColumnType("nvarchar(4)");
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
{
b1.IsRequired();
b1.Property<double>("Amount")
.HasColumnType("float");
b1.Property<DateTime>("DebtDate")
.HasColumnType("datetime2");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
{
b1.IsRequired();
b1.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<string>("Status")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
{
b1.IsRequired();
b1.Property<bool>("IsDone")
.HasColumnType("bit");
b1.Property<DateTime>("LastInspectionDateTime")
.HasColumnType("datetime2");
b1.Property<long>("MediaId")
.HasColumnType("bigint");
b1.Property<string>("Type")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
});
b.HasKey("id"); b.HasKey("id");
b.ToTable("InsuranceLists", (string)null); b.ToTable("InsuranceLists", (string)null);
@@ -5658,20 +5587,9 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10) .HasMaxLength(10)
.HasColumnType("nvarchar(10)"); .HasColumnType("nvarchar(10)");
b.Property<bool>("CreateCheckout")
.HasColumnType("bit");
b.Property<bool>("CreateContract")
.HasColumnType("bit");
b.Property<DateTime>("CreationDate") b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("CutContractEndOfYear")
.IsRequired()
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<bool>("FixedSalary") b.Property<bool>("FixedSalary")
.HasColumnType("bit"); .HasColumnType("bit");
@@ -5709,12 +5627,6 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(25) .HasMaxLength(25)
.HasColumnType("nvarchar(25)"); .HasColumnType("nvarchar(25)");
b.Property<bool>("SignCheckout")
.HasColumnType("bit");
b.Property<bool>("SignContract")
.HasColumnType("bit");
b.Property<string>("State") b.Property<string>("State")
.HasMaxLength(100) .HasMaxLength(100)
.HasColumnType("nvarchar(100)"); .HasColumnType("nvarchar(100)");

View File

@@ -10,340 +10,329 @@ using AccountMangement.Infrastructure.EFCore;
using Company.Domain.AdminMonthlyOverviewAgg; using Company.Domain.AdminMonthlyOverviewAgg;
using CompanyManagment.App.Contracts.AdminMonthlyOverview; using CompanyManagment.App.Contracts.AdminMonthlyOverview;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Tools = _0_Framework_b.Application.Tools;
namespace CompanyManagment.EFCore.Repository; namespace CompanyManagment.EFCore.Repository;
public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository
{ {
private readonly CompanyContext _companyContext; private readonly CompanyContext _companyContext;
private readonly AccountContext _accountContext; private readonly AccountContext _accountContext;
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext) public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
{ {
_companyContext = companyContext; _companyContext = companyContext;
_accountContext = accountContext; _accountContext = accountContext;
} }
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel) public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
{ {
var year = searchModel.Year; var year = searchModel.Year;
var month = searchModel.Month; var month = searchModel.Month;
var accountId = searchModel.AdminAccountId; var accountId = searchModel.AdminAccountId;
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان // اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false) if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetDate) == false)
return []; return [];
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
// دریافت اطلاعات ادمین
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
// اگر ادمین پیدا نشد، لیست خالی برگردان
if (adminAccount == null)
return [];
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
.Where(c => c.ContractStartGr <= targetDate && c.ContractEndGr >= targetDate)
.Select(c => c.ContractingPartyId);
// دریافت کارگاه‌های مرتبط با اکانت
var workshopAccounts = _companyContext.WorkshopAccounts
.AsNoTracking()
.Where(w => w.AccountId == accountId)
.Select(w => w.WorkshopId).ToList();
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth); var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime(); ((x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate)
|| (x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
// دریافت اطلاعات ادمین
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
// اگر ادمین پیدا نشد، لیست خالی برگردان
if (adminAccount == null)
return [];
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
.Select(c => c.ContractingPartyId);
// دریافت کارگاه‌های مرتبط با اکانت
var workshopAccounts = _companyContext.WorkshopAccounts
.AsNoTracking()
.Where(w => w.AccountId == accountId)
.Select(w => w.WorkshopId).ToList();
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
// دریافت کارگاه‌های مربوط به طرف حساب و اکانت // دریافت کارگاه‌های مربوط به طرف حساب و اکانت
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty // Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
var workshopsWithContractingParty = await _companyContext.Workshops var workshopsWithContractingParty = await _companyContext.Workshops
.AsNoTracking() .AsNoTracking()
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive) .Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
.Include(w => w.WorkshopEmployers) .Include(w => w.WorkshopEmployers)
.ThenInclude(we => we.Employer) .ThenInclude(we => we.Employer)
.ThenInclude(e => e.ContractingParty).AsSplitQuery(). .ThenInclude(e => e.ContractingParty).AsSplitQuery().
Where(w => w.WorkshopEmployers.Any(we => Where(w => w.WorkshopEmployers.Any(we =>
we.Employer != null && we.Employer != null &&
contractingPartyIds.Contains(we.Employer.ContractingPartyId))) contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
.Select(w => new .Select(w => new
{ {
Workshop = w, Workshop = w,
ContractingParty = w.WorkshopEmployers ContractingParty = w.WorkshopEmployers
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId)) .Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
.Select(we => we.Employer.ContractingParty) .Select(we => we.Employer.ContractingParty)
.FirstOrDefault() .FirstOrDefault()
}) })
.ToListAsync(); .ToListAsync();
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList(); var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
// پیدا کردن کارگاه‌هایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند // پیدا کردن کارگاه‌هایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
.AsNoTracking() .AsNoTracking()
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year) .Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
.Select(x => x.WorkshopId) .Select(x => x.WorkshopId)
.ToListAsync(); .ToListAsync();
// پیدا کردن کارگاه‌هایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند // پیدا کردن کارگاه‌هایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
.Except(adminMonthlyOverviewWorkshopIds) .Except(adminMonthlyOverviewWorkshopIds)
.ToList(); .ToList();
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند // ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
if (notExistAdminMonthlyReviewsWorkshopIds.Any()) if (notExistAdminMonthlyReviewsWorkshopIds.Any())
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year); await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
// به‌روزرسانی وضعیت‌ها // به‌روزرسانی وضعیت‌ها
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate,targetEndDate, nextFirstMonth,nextEndMonth); await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetDate, nextMonth);
if (searchModel.ActivationStatus != IsActive.None) if (searchModel.ActivationStatus != IsActive.None)
{ {
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true"; var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
workshopsWithContractingParty = workshopsWithContractingParty workshopsWithContractingParty = workshopsWithContractingParty
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList(); .Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList(); workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
} }
// دریافت همه AdminMonthlyOverview برای این کارگاه‌ها/ماه/سال // دریافت همه AdminMonthlyOverview برای این کارگاه‌ها/ماه/سال
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year); .Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
if (searchModel.WorkshopId > 0) if (searchModel.WorkshopId > 0)
{ {
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId); adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
} }
if (searchModel.EmployerId > 0) if (searchModel.EmployerId > 0)
{ {
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList(); var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId)); adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
} }
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x => var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
x.StartWorkDate <= targetStartDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate && workshopIds.Contains(x.WorkshopId)) x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate && workshopIds.Contains(x.WorkshopId))
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList(); .GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
var employeeContractCounts = _companyContext.LeftWorkList.Where(x => var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
x.StartWorkDate <= nextFirstMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth && workshopIds.Contains(x.WorkshopId)) x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth && workshopIds.Contains(x.WorkshopId))
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList(); .GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync(); var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
var now = DateTime.Today; var now = DateTime.Today;
//پرسنل ادمین اجرایی //پرسنل ادمین اجرایی
var operatorAdminAccounts = _accountContext.AccountLeftWorks var operatorAdminAccounts = _accountContext.AccountLeftWorks
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now && .Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId }) x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
.Join(_accountContext.Accounts, .Join(_accountContext.Accounts,
x => x.AccountId, x =>x.AccountId,
account => account.id, (x, account) => new account=>account.id,(x, account) => new
{ {
x.WorkshopId, x.WorkshopId,
account.Fullname account.Fullname
}).ToList(); }).ToList();
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x => var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
{ {
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId); var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId); var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
var workshopWithContractingParty = var workshopWithContractingParty =
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId); workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId); var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
var workshop = workshopWithContractingParty?.Workshop; var workshop = workshopWithContractingParty?.Workshop;
var contractingParty = workshopWithContractingParty?.ContractingParty; var contractingParty = workshopWithContractingParty?.ContractingParty;
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer; var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
return new AdminMonthlyOverviewListViewModel return new AdminMonthlyOverviewListViewModel
{ {
WorkshopId = x.WorkshopId, WorkshopId = x.WorkshopId,
Status = x.Status, Status = x.Status,
Id = x.id, Id = x.id,
WorkshopName = workshop?.WorkshopFullName ?? "", WorkshopName = workshop?.WorkshopFullName ?? "",
WorkshopArchiveCode = workshop?.ArchiveCode ?? "", WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0, WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
Address = workshop?.Address ?? "", Address = workshop?.Address ?? "",
City = workshop?.City ?? "", City = workshop?.City ?? "",
Province = workshop?.State ?? "", Province = workshop?.State ?? "",
EmployerName = employer?.FullName ?? "", EmployerName = employer?.FullName ?? "",
EmployerPhoneNumber = employer?.Phone ?? "", EmployerPhoneNumber = employer?.Phone ?? "",
AdminFullName = operatorAccount?.Fullname ?? "", AdminFullName = operatorAccount?.Fullname??"",
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0, CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0, ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
AgentPhoneNumber = "", AgentPhoneNumber = "",
IsBlock = contractingParty?.IsBlock == "true" IsBlock = contractingParty?.IsBlock == "true"
}; };
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList(); }).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
return adminMonthlyOverviewList; return adminMonthlyOverviewList;
} }
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId) public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
{ {
var searchModel = new AdminMonthlyOverviewSearchModel() var searchModel = new AdminMonthlyOverviewSearchModel()
{ {
AdminAccountId = accountId, AdminAccountId = accountId,
Month = month, Month = month,
Year = year Year = year
}; };
var list = await GetWorkshopStatus(searchModel); var list = await GetWorkshopStatus(searchModel);
var allCount = list.Count; var allCount = list.Count;
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived); var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments); var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted); var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress); var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending); var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
return new AdminMonthlyOverViewCounterVm return new AdminMonthlyOverViewCounterVm
{ {
All = allCount, All = allCount,
Archived = archivedCount, Archived = archivedCount,
VisitPending = visitPendingCount, VisitPending = visitPendingCount,
VisitInProgress = visitInProgressCount, VisitInProgress = visitInProgressCount,
VisitCompleted = visitCompleteCount, VisitCompleted = visitCompleteCount,
CreateDocument = createDocCount CreateDocument = createDocCount
}; };
} }
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetStartDate,DateTime targetEndDate, DateTime nextStartMonth,DateTime nextEndMonth) private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetDate, DateTime nextMonth)
{ {
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117) var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
.Select(x => x.EmployeeId) .Select(x => x.EmployeeId)
.Except([5976]).ToList(); .Except([5976]).ToList();
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
.Join( var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
_companyContext.Contracts.AsNoTracking(), .Join(
leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId }, _companyContext.Contracts.AsNoTracking(),
contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds }, leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
(leftWork, contract) => new { leftWork, contract } contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
) (leftWork, contract) => new { leftWork, contract }
.Where(x => )
workshopIds.Contains(x.leftWork.WorkshopId) && .Where(x =>
x.leftWork.StartWorkDate <= targetEndDate && workshopIds.Contains(x.leftWork.WorkshopId) &&
x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate && x.leftWork.StartWorkDate <= targetDate &&
x.contract.ContarctStart <= targetEndDate && x.leftWork.LeftWorkDate.AddDays(-1) >= targetDate &&
x.contract.ContractEnd >= targetStartDate && x.contract.ContarctStart <= targetDate &&
!vipGroup.Contains(x.leftWork.EmployeeId) && x.contract.ContractEnd >= targetDate
!_companyContext.EmployeeClientTemps && !vipGroup.Contains(x.leftWork.EmployeeId)
.Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId) )
) .Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking() var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth && .Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth
!vipGroup.Contains(x.EmployeeId) && && !vipGroup.Contains(x.EmployeeId))
!_companyContext.EmployeeClientTemps .Select(x => new { x.WorkshopId, x.EmployeeId });
.Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId)
).Select(x => new { x.WorkshopId, x.EmployeeId });
var contractSet = (await _companyContext.Contracts.AsNoTracking() var contractSet = (await _companyContext.Contracts.AsNoTracking()
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds)) .Where(x => x.ContarctStart <= nextMonth && x.ContractEnd >= nextMonth && workshopIds.Contains(x.WorkshopIds))
.Select(x => new { x.WorkshopIds, x.EmployeeId }) .Select(x => new { x.WorkshopIds, x.EmployeeId })
.ToListAsync()) .ToListAsync())
.Select(x => (x.WorkshopIds, x.EmployeeId)) .Select(x => (x.WorkshopIds, x.EmployeeId))
.ToHashSet(); .ToHashSet();
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking() var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId)) .Where(x => x.ContractStart <= targetDate && x.ContractEnd >= targetDate && workshopIds.Contains(x.WorkshopId))
.Select(x => new { x.WorkshopId, x.EmployeeId }) .Select(x => new { x.WorkshopId, x.EmployeeId })
.ToListAsync()) .ToListAsync())
.Select(x => (x.WorkshopId, x.EmployeeId)) .Select(x => (x.WorkshopId, x.EmployeeId))
.ToHashSet(); .ToHashSet();
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList(); var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
{ {
WorkshopId = x.Key, WorkshopId = x.Key,
Data = x.ToList() Data = x.ToList()
}).ToList(); }).ToList();
var workshopsWithFullContracts = workingContractGrouping var workshopsWithFullContracts = workingContractGrouping
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId)))) .Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
.Select(g => g.WorkshopId) .Select(g => g.WorkshopId)
.ToList(); .ToList();
var list = workingContractEmployeeIds.ToList().Where(x=>!contractSet.Any(a=>a.EmployeeId== x.EmployeeId&&a.WorkshopIds == x.WorkshopId)).ToList(); var workshopsWithFullCheckout = workingCheckoutGrouping
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
var workshopsWithFullCheckout = workingCheckoutGrouping .Select(g => g.Key)
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId)))) .ToList();
.Select(g => g.Key)
.ToList();
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList(); var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
//var notFullyCoveredWorkshops = groupedCheckout //var notFullyCoveredWorkshops = groupedCheckout
// .Where(g => g.Any(emp => // .Where(g => g.Any(emp =>
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) || // !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId)))) // !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
// .Select(g => g.Key) // .Select(g => g.Key)
// .ToList(); // .ToList();
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops); var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
.Where(x => x.Month == month && x.Year == year); .Where(x => x.Month == month && x.Year == year);
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments) .Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
.ToListAsync(); .ToListAsync();
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments) .Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
.ToListAsync(); .ToListAsync();
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts) foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending); adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts) foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments); adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
await _companyContext.SaveChangesAsync(); await _companyContext.SaveChangesAsync();
} }
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year) private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
{ {
foreach (var workshopId in workshopIds) foreach (var workshopId in workshopIds)
{ {
var adminMonthlyOverview = var adminMonthlyOverview =
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments); new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
await _companyContext.AddAsync(adminMonthlyOverview); await _companyContext.AddAsync(adminMonthlyOverview);
} }
await _companyContext.SaveChangesAsync(); await _companyContext.SaveChangesAsync();
} }
} }

View File

@@ -1058,8 +1058,8 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
}); });
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans); var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-"); ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
@@ -1387,7 +1387,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
ch.TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-"); ch.TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");
var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan()).ToList(); var hourlyPaidLeaveTimeSpans = hourlyPaidLeave.Select(x => TimeOnly.Parse(x.LeaveHourses).ToTimeSpan());
var dailyPaidLeaveTimeSpans = dailyPaidLeave.Select(x => var dailyPaidLeaveTimeSpans = dailyPaidLeave.Select(x =>
{ {
@@ -1397,7 +1397,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
}); });
var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans); var totalPaidLeaveTimeSpans = hourlyPaidLeaveTimeSpans.Concat(dailyPaidLeaveTimeSpans);
ch.TotalHourlyLeave = new TimeSpan(hourlyPaidLeaveTimeSpans.Sum(x => x.Ticks));
ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-"); ch.TotalPaidLeave = new TimeSpan(totalPaidLeaveTimeSpans.Sum(x => x.Ticks)).ToFarsiDaysAndHoursAndMinutes("-");

View File

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

View File

@@ -1173,17 +1173,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
//RequiredDocuments = requiredDocs //RequiredDocuments = requiredDocs
}; };
}).ToList(); }).ToList();
result.ForEach(x =>
{
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
});
return result; return result;
} }
@@ -1204,7 +1194,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel() .GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
{ {
WorkshopId = x.Key, WorkshopId = x.Key,
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopFullName, WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
EmployeesWithoutDocumentCount = x.Count() EmployeesWithoutDocumentCount = x.Count()
}); });
@@ -1311,19 +1301,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
}; };
}).ToList(); }).ToList();
result.ForEach(x => return result;
{
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
});
return result;
} }
public async Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId) public async Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId)
@@ -1485,19 +1463,9 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
//RequiredDocuments = requiredDocs //RequiredDocuments = requiredDocs
}; };
}).ToList(); }).ToList();
result.ForEach(x =>
{
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
});
return result;
return result;
} }
public async Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId) public async Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId)
@@ -1600,18 +1568,8 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
//RequiredDocuments = requiredDocs //RequiredDocuments = requiredDocs
}; };
}).ToList(); }).ToList();
result.ForEach(x =>
{ return result;
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
});
return result;
} }
//ToDo آپلود مدارک و افزودن پرسنل //ToDo آپلود مدارک و افزودن پرسنل
@@ -1688,12 +1646,8 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
}; };
} }
private static string GetThumbnailPathFromFilePath(string filePath)
{
return string.IsNullOrWhiteSpace(filePath) ? string.Empty : Path.Combine(Path.GetDirectoryName(filePath)!, Path.GetFileNameWithoutExtension(filePath) + $"-thumbnail{Path.GetExtension(filePath)}");
}
private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items, private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items,
List<MediaViewModel> medias, DocumentItemLabel label) List<MediaViewModel> medias, DocumentItemLabel label)
{ {
if (items == null || items.Count == 0) if (items == null || items.Count == 0)

View File

@@ -1,14 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
using _0_Framework.Application; using _0_Framework.Application;
using _0_Framework.InfraStructure; using _0_Framework.InfraStructure;
using AccountMangement.Infrastructure.EFCore;
using Company.Domain.EmployeeAgg; using Company.Domain.EmployeeAgg;
using Company.Domain.EmployeeChildrenAgg; using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsurancListDataAgg; using Company.Domain.EmployeeInsurancListDataAgg;
@@ -20,7 +16,6 @@ using CompanyManagment.App.Contracts.EmployeeInsurancListData;
using CompanyManagment.App.Contracts.InsuranceList; using CompanyManagment.App.Contracts.InsuranceList;
using CompanyManagment.App.Contracts.InsuranceWorkshopInfo; using CompanyManagment.App.Contracts.InsuranceWorkshopInfo;
using CompanyManagment.App.Contracts.PersonalContractingParty; using CompanyManagment.App.Contracts.PersonalContractingParty;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Identity.Client; using Microsoft.Identity.Client;
using PersianTools.Core; using PersianTools.Core;
@@ -37,10 +32,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
private readonly IAuthHelper _authHelper; private readonly IAuthHelper _authHelper;
private readonly IPersonalContractingPartyApp _contractingPartyApp; private readonly IPersonalContractingPartyApp _contractingPartyApp;
private readonly IInsuranceYearlySalaryRepository _insuranceYearlySalaryRepository; private readonly IInsuranceYearlySalaryRepository _insuranceYearlySalaryRepository;
private readonly IWebHostEnvironment _webHostEnvironment; public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository , IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository) : base(context)
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; _context = context;
_employeeInsurancListDataRepository = employeeInsurancListDataRepository; _employeeInsurancListDataRepository = employeeInsurancListDataRepository;
@@ -49,22 +41,20 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
_authHelper = authHelper; _authHelper = authHelper;
_contractingPartyApp = contractingPartyApp; _contractingPartyApp = contractingPartyApp;
_insuranceYearlySalaryRepository = insuranceYearlySalaryRepository; _insuranceYearlySalaryRepository = insuranceYearlySalaryRepository;
_webHostEnvironment = webHostEnvironment;
_accountContext = accountContext;
} }
public OperationResult CreateInsuranceListworkshop(long id, List<long> workshopIds) public OperationResult CreateInsuranceListworkshop(long id, List<long> workshopIds)
{ {
var operation = new OperationResult(); var operation = new OperationResult();
//try //try
//{ //{
var list = new List<InsuranceListWorkshop>(); var list= new List<InsuranceListWorkshop>();
foreach (var item in workshopIds) foreach (var item in workshopIds)
{ {
list.Add(new InsuranceListWorkshop() list.Add(new InsuranceListWorkshop()
{ {
WorkshopId = item, WorkshopId =item,
InsurancListId = id InsurancListId= id
}); });
} }
@@ -86,11 +76,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
public OperationResult CreateInsuranceListworkshopInfo(CreateInsuranceWorkshopInfo command) public OperationResult CreateInsuranceListworkshopInfo(CreateInsuranceWorkshopInfo command)
{ {
var operation = new OperationResult(); 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) 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(); _context.SaveChanges();
} }
else else
@@ -101,7 +91,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
_context.SaveChanges(); _context.SaveChanges();
} }
return operation; return operation;
} }
@@ -113,9 +103,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
try try
{ {
var insuranceListObj = Get(command.Id); var insuranceListObj = Get(command.Id);
insuranceListObj.Edit(command.SumOfEmployees, command.SumOfWorkingDays, command.SumOfSalaries, command.SumOfBenefitsIncluded, command.Included, command.IncludedAndNotIncluded, command.InsuredShare, 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); command.EmployerShare,command.UnEmploymentInsurance,command.DifficultJobsInsuranc,command.StartDate,command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance, command.ConfirmSentlist);
var id = insuranceListObj.id; var id = insuranceListObj.id;
if (command.EmployeeInsurancListDataList != null && command.EmployeeInsurancListDataList.Count > 0) if (command.EmployeeInsurancListDataList != null && command.EmployeeInsurancListDataList.Count > 0)
{ {
@@ -131,14 +121,14 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
item.BenefitsIncludedContinuous, item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous, item.BenefitsIncludedNonContinuous,
item.InsuranceShare, item.StartWorkDate, 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.Create(employeeInsurancListData);
} }
else else
{ {
var employeeInsurancListDataObj = _employeeInsurancListDataRepository.Get(item.EmployeeInsurancListDataId); var employeeInsurancListDataObj = _employeeInsurancListDataRepository.Get(item.EmployeeInsurancListDataId);
employeeInsurancListDataObj.Edit(item.WorkingDays, item.DailyWage, item.MonthlySalary, item.MonthlyBenefits, item.MonthlyBenefitsIncluded, item.BenefitsIncludedContinuous, 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); item.BenefitsIncludedNonContinuous,item.InsuranceShare,item.StartWorkDate,item.LeftWorkDate,item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
} }
} }
_employeeInsurancListDataRepository.SaveChanges(); _employeeInsurancListDataRepository.SaveChanges();
@@ -220,7 +210,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
// نام کارفرما // نام کارفرما
EmployerName = x.EmployerName, EmployerName = x.EmployerName,
//آدرس کارگاه //آدرس کارگاه
Address = x.Address, Address = x.Address,
ListNumber = x.ListNumber, ListNumber = x.ListNumber,
}).FirstOrDefault(); }).FirstOrDefault();
#endregion #endregion
@@ -244,7 +234,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//مزایای ماهانه //مزایای ماهانه
employeeInsurancListData.MonthlyBenefits = item.MonthlyBenefits; employeeInsurancListData.MonthlyBenefits = item.MonthlyBenefits;
//دستمزد و مزایای ماهانه مشمول //دستمزد و مزایای ماهانه مشمول
employeeInsurancListData.MonthlyBenefitsIncluded = item.MonthlyBenefitsIncluded; employeeInsurancListData.MonthlyBenefitsIncluded =item.MonthlyBenefitsIncluded;
// مزایای مشمول و غیر مشمول // مزایای مشمول و غیر مشمول
employeeInsurancListData.BenefitsIncludedContinuous = item.BenefitsIncludedContinuous; employeeInsurancListData.BenefitsIncludedContinuous = item.BenefitsIncludedContinuous;
//مزایای مشمول غیر مستمر //مزایای مشمول غیر مستمر
@@ -262,8 +252,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty; ; employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty; ;
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty; ; employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty; ;
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi(); employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
if (item.LeftWorkDate != null) if(item.LeftWorkDate!=null)
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi(); employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
@@ -276,7 +266,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
#endregion #endregion
#region WorkshopIds #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 #endregion
#region InsuranceEmployeeInformation #region InsuranceEmployeeInformation
@@ -296,7 +286,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
employeeDetails.DateOfBirthGr = item.DateOfBirth; employeeDetails.DateOfBirthGr = item.DateOfBirth;
employeeDetails.DateOfIssueGr = item.DateOfIssue; employeeDetails.DateOfIssueGr = item.DateOfIssue;
employeeDetails.DateOfBirth = item.DateOfBirth.ToFarsi(); 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.PlaceOfIssue = item.PlaceOfIssue;
employeeDetails.NationalCode = item.NationalCode; employeeDetails.NationalCode = item.NationalCode;
//employeeDetails.Nationality = item.Nationality; //employeeDetails.Nationality = item.Nationality;
@@ -339,7 +329,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
public List<InsuranceListViewModel> OptimizedSearch(InsuranceListSearchModel searchModel) public List<InsuranceListViewModel> OptimizedSearch(InsuranceListSearchModel searchModel)
{ {
var acountId = _authHelper.CurrentAccountId(); var acountId = _authHelper.CurrentAccountId();
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountId).Select(x => x.WorkshopId); var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountId).Select(x => x.WorkshopId);
@@ -390,7 +380,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
result => result.workshop.id, result => result.workshop.id,
employer => employer.WorkshopId, employer => employer.WorkshopId,
(result, employer) => new { result.insurance, result.workshop, employer }) (result, employer) => new { result.insurance, result.workshop, employer })
.Select(result => new InsuranceListViewModel .Select(result => new InsuranceListViewModel
{ {
Id = result.insurance.id, Id = result.insurance.id,
Year = result.insurance.Year, Year = result.insurance.Year,
@@ -412,28 +402,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
.Where(p => p.Employers.Any(e => e.id == result.employer.First().EmployerId)) .Where(p => p.Employers.Any(e => e.id == result.employer.First().EmployerId))
.Select(p => p.IsBlock) .Select(p => p.IsBlock)
.FirstOrDefault(), .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") 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); query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month).OrderByDescending(x => x.Id);
@@ -485,7 +456,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//var testquery = query.Where(x => x.Year == searchModel.Year).AsEnumerable(); //var testquery = query.Where(x => x.Year == searchModel.Year).AsEnumerable();
return query.Skip(searchModel.PageIndex).Take(30).ToList(); return query.ToList();
} }
public List<InsuranceListViewModel> Search(InsuranceListSearchModel searchModel) public List<InsuranceListViewModel> Search(InsuranceListSearchModel searchModel)
{ {
@@ -494,9 +465,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var acountID = _authHelper.CurrentAccountId(); var acountID = _authHelper.CurrentAccountId();
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountID).Select(x => x.WorkshopId).ToList(); var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountID).Select(x => x.WorkshopId).ToList();
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>(); 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 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) foreach (var item in query)
{ {
@@ -504,7 +475,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var workshop = workshopList.FirstOrDefault(u => u.id == item.WorkshopId); var workshop = workshopList.FirstOrDefault(u => u.id == item.WorkshopId);
var employerId = _context.WorkshopEmployers.Where(x => x.WorkshopId == item.WorkshopId) var employerId = _context.WorkshopEmployers.Where(x => x.WorkshopId == item.WorkshopId)
.Select(x => x.EmployerId).FirstOrDefault(); .Select(x => x.EmployerId).FirstOrDefault();
string typeOfInsuranceSend = ""; string typeOfInsuranceSend = "";
if (workshop.TypeOfInsuranceSend == "NormalList") if (workshop.TypeOfInsuranceSend == "NormalList")
{ {
@@ -518,20 +489,20 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{ {
typeOfInsuranceSend = "خانوادگی"; typeOfInsuranceSend = "خانوادگی";
} }
var insuranceListViewModel = new InsuranceListViewModel() var insuranceListViewModel =new InsuranceListViewModel()
{ {
Id = item.id, Id = item.id,
Year = item.Year, Year = item.Year,
Month = item.Month, Month = item.Month,
MonthNumber = 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, WorkShopName = insuranceWorkshopInformation == null ? workshop.WorkshopName : insuranceWorkshopInformation.WorkshopName,
WorkShopId = workshop.id, WorkShopId = workshop.id ,
TypeOfInsuranceSend = typeOfInsuranceSend, TypeOfInsuranceSend = typeOfInsuranceSend,
FixedSalary = workshop.FixedSalary, FixedSalary = workshop.FixedSalary,
StrFixedSalary = workshop.FixedSalary ? "دارد" : "ندارد", StrFixedSalary = workshop.FixedSalary?"دارد":"ندارد",
EmployerName = insuranceWorkshopInformation == null ? workshop.WorkshopFullName : insuranceWorkshopInformation.EmployerName, EmployerName = insuranceWorkshopInformation == null? workshop.WorkshopFullName: insuranceWorkshopInformation.EmployerName,
Branch = "", Branch = "",
City = "", City = "",
ConfirmSentlist = item.ConfirmSentlist, ConfirmSentlist = item.ConfirmSentlist,
@@ -559,7 +530,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(); 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)) 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) if (searchModel.WorkshopId > 0)
@@ -582,7 +553,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(); 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(); list = list.Where(x => x.FixedSalary == searchModel.FixedSalary).ToList();
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0") if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
@@ -603,7 +574,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
OperationResult result = new OperationResult(); OperationResult result = new OperationResult();
using (var transaction = _context.Database.BeginTransaction()) using (var transaction = _context.Database.BeginTransaction())
{ {
try try
{ {
//var employeeInsurancList= _context.EmployeeInsurancListDataSet.Where(x => x.InsuranceListId == id).ToList(); //var employeeInsurancList= _context.EmployeeInsurancListDataSet.Where(x => x.InsuranceListId == id).ToList();
@@ -613,10 +584,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//var insuranceListWorkshopList = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).ToList(); //var insuranceListWorkshopList = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).ToList();
//if (insuranceListWorkshopList != null && insuranceListWorkshopList.Count > 0) //if (insuranceListWorkshopList != null && insuranceListWorkshopList.Count > 0)
_insuranceListWorkshopRepository.RemoveRange(id); _insuranceListWorkshopRepository.RemoveRange(id);
var insuranceListObj = _context.InsuranceListSet.Where(x => x.id == id).FirstOrDefault(); var insuranceListObj = _context.InsuranceListSet.Where(x => x.id == id).FirstOrDefault();
if (insuranceListObj != null) if(insuranceListObj!=null)
Remove(insuranceListObj); Remove(insuranceListObj);
SaveChanges(); SaveChanges();
@@ -635,11 +606,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
return result; return result;
} }
/// <summary> /// <summary>
/// ایجاد لیست بیمه /// ایجاد لیست بیمه
/// </summary> /// </summary>
/// <param name="command"></param> /// <param name="command"></param>
/// <returns></returns> /// <returns></returns>
public OperationResult CreateInsuranceList(CreateInsuranceList command) public OperationResult CreateInsuranceList(CreateInsuranceList command)
{ {
OperationResult result = new OperationResult(); OperationResult result = new OperationResult();
@@ -654,7 +625,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
command.InsuredShare, command.InsuredShare,
command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc, command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc,
command.StartDate, command.StartDate,
command.EndDate, command.SumOfDailyWage, command.SumOfBaseYears, command.SumOfMarriedAllowance); command.EndDate, command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance);
Create(insuranceListObj); Create(insuranceListObj);
SaveChanges(); SaveChanges();
var id = insuranceListObj.id; var id = insuranceListObj.id;
@@ -670,11 +641,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
item.BenefitsIncludedContinuous, item.BenefitsIncludedContinuous,
item.BenefitsIncludedNonContinuous, item.BenefitsIncludedNonContinuous,
item.InsuranceShare, item.StartWorkDate, 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.Create(employeeInsurancListData);
} }_employeeInsurancListDataRepository.SaveChanges();
_employeeInsurancListDataRepository.SaveChanges();
} }
if (command.WorkshopIds != null && command.WorkshopIds.Count > 0) if (command.WorkshopIds != null && command.WorkshopIds.Count > 0)
@@ -861,10 +831,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
editInsuranceList.WorkshopIds = workshopIds; editInsuranceList.WorkshopIds = workshopIds;
return editInsuranceList; return editInsuranceList;
} }
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel) public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel )
{ {
var employeeDetailsViewModel = new MainEmployeeDetailsViewModel(); var employeeDetailsViewModel = new MainEmployeeDetailsViewModel();
@@ -875,7 +845,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{ {
var leftWorkInsurance = _context.LeftWorkInsuranceList var leftWorkInsurance = _context.LeftWorkInsuranceList
.Where(i => i.EmployeeId == item.EmployeeId && i.WorkshopId == searchModel.WorkshopId) .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 job = _context.Jobs.Where(i => i.id == item.JobId).AsNoTracking().FirstOrDefault();
var employeeInsurancListData = new EmployeeInsurancListDataViewModel(); var employeeInsurancListData = new EmployeeInsurancListDataViewModel();
employeeInsurancListData.EmployeeInsurancListDataId = item.id; employeeInsurancListData.EmployeeInsurancListDataId = item.id;
@@ -896,7 +866,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//// مزایای ماهیانه مشمول //// مزایای ماهیانه مشمول
employeeInsurancListData.BenefitsIncludedNonContinuous = item.BenefitsIncludedNonContinuous; employeeInsurancListData.BenefitsIncludedNonContinuous = item.BenefitsIncludedNonContinuous;
//// حقوق و مزایای ماهیانه مشمول و غیر مشمول ** //// حقوق و مزایای ماهیانه مشمول و غیر مشمول **
employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous; employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous;
employeeInsurancListData.BaseYears = item.BaseYears; employeeInsurancListData.BaseYears = item.BaseYears;
employeeInsurancListData.MarriedAllowance = item.MarriedAllowance; employeeInsurancListData.MarriedAllowance = item.MarriedAllowance;
@@ -905,7 +875,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//سهم بیمه حق کارگر //سهم بیمه حق کارگر
employeeInsurancListData.InsuranceShare = item.InsuranceShare; employeeInsurancListData.InsuranceShare = item.InsuranceShare;
// تاریخ شروع به کار // تاریخ شروع به کار
employeeInsurancListData.StartWorkDate = item.StartWorkDate; employeeInsurancListData.StartWorkDate =item.StartWorkDate;
//تاریخ ترک کار //تاریخ ترک کار
employeeInsurancListData.LeftWorkDate = item.LeftWorkDate; employeeInsurancListData.LeftWorkDate = item.LeftWorkDate;
// آی دی شغل // آی دی شغل
@@ -913,7 +883,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty; employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty;
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty; employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty;
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi(); employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
if (item.LeftWorkDate != null) if (item.LeftWorkDate != null)
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi(); employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
@@ -923,7 +893,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; employeeInsurancListData.HasConfilictLeftWork = true;
if (leftWorkInsurance.LeftWorkDate != null) if (leftWorkInsurance.LeftWorkDate != null)
@@ -954,7 +924,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
var employeeDetailsForInsuranceList = new List<EmployeeDetailsForInsuranceListViewModel>(); var employeeDetailsForInsuranceList = new List<EmployeeDetailsForInsuranceListViewModel>();
foreach (var item in insuranceEmployeeInformationList) 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 employeeInsurancListData = employeeInsurancListDataViewModelList.Where(x => x.EmployeeId == item.EmployeeId)?.FirstOrDefault();
var employeeDetails = new EmployeeDetailsForInsuranceListViewModel(); var employeeDetails = new EmployeeDetailsForInsuranceListViewModel();
employeeDetails.EmployeeId = item.EmployeeId; employeeDetails.EmployeeId = item.EmployeeId;
@@ -1023,13 +993,13 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
public OperationResult ConfirmInsuranceList(long id) public OperationResult ConfirmInsuranceList(long id)
{ {
OperationResult result = new OperationResult(); OperationResult result = new OperationResult();
try try
{ {
var insuranceListObj = Get(id); var insuranceListObj = Get(id);
insuranceListObj.Edit(insuranceListObj.SumOfEmployees, insuranceListObj.SumOfWorkingDays, insuranceListObj.SumOfSalaries, insuranceListObj.SumOfBenefitsIncluded, insuranceListObj.Included, insuranceListObj.IncludedAndNotIncluded, insuranceListObj.InsuredShare, 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(); SaveChanges();
@@ -1039,9 +1009,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{ {
result.Message = "تایید ارسال لیست بیمه با موفقیت انجام شد"; result.Message = "تایید ارسال لیست بیمه با موفقیت انجام شد";
} }
return result; return result;
} }
@@ -1050,7 +1020,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
{ {
var insuranceListViewModel = new InsuranceListViewModel(); 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) if (insuranceList != null)
{ {
@@ -1061,7 +1031,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
insuranceListViewModel.WorkShopId = insuranceList.WorkshopId; insuranceListViewModel.WorkShopId = insuranceList.WorkshopId;
insuranceListViewModel.ConfirmSentlist = insuranceList.ConfirmSentlist; insuranceListViewModel.ConfirmSentlist = insuranceList.ConfirmSentlist;
} }
return insuranceListViewModel; return insuranceListViewModel;
} }
#region client #region client
@@ -1143,46 +1113,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
default: return query.OrderByDescending(x => x.Id).Skip(searchModel.PageIndex).ToList(); 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) public List<InsuranceListViewModel> SearchForClientOld(InsuranceListSearchModel searchModel)
{ {
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>(); 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) foreach (var item in query)
{ {
var insuranceWorkshopInformation = _context.InsuranceWorkshopInformationSet.FirstOrDefault(u => u.WorkshopId == item.WorkshopId); var insuranceWorkshopInformation = _context.InsuranceWorkshopInformationSet.FirstOrDefault(u => u.WorkshopId == item.WorkshopId);
@@ -1259,16 +1194,16 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
#endregion #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 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, startWork = x.StartWorkDate,
leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value, leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value,
}).OrderBy(x => x.startWork).ToList(); }).OrderBy(x=>x.startWork).ToList();
int countDay = 0; int countDay = 0;
foreach (var left in lefts) foreach (var left in lefts)
{ {
@@ -1277,12 +1212,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//شمارش فقط تا روز قبل از شروع لیست انجام شود //شمارش فقط تا روز قبل از شروع لیست انجام شود
if (left.leftWork >= listStartDate) if (left.leftWork >= listStartDate)
{ {
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day); var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
end = endBeforStartList.AddDays(-1).ToPersianDateTime(); end = endBeforStartList.AddDays(-1).ToPersianDateTime();
} }
var count = (int)(end - start).TotalDays + 1; var count = (int)(end - start).TotalDays +1;
countDay += count; countDay += count;
} }
@@ -1291,12 +1226,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//تعداد سال های سابقه بیمه //تعداد سال های سابقه بیمه
int yearsCount = countDay / 365; int yearsCount = countDay / 365;
//بدست آوردن مزد سنوات بر اساس سابقه به سال //بدست آوردن مزد سنوات بر اساس سابقه به سال
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount); var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
if (baseYear == 0) if(baseYear == 0)
return (0, 0); return (0, 0);
//اگر ترک کار کرده بود //اگر ترک کار کرده بود
//یا //یا
@@ -1315,7 +1250,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
//} //}
return (yearsCount, baseYear); return (yearsCount, baseYear);
} }
@@ -1343,109 +1278,109 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
public List<EmployeeDetailsForInsuranceListViewModel> GetEmployeeInsuranceDataForEdit(long insuranceListId, DateTime startDate, DateTime endDate) public List<EmployeeDetailsForInsuranceListViewModel> GetEmployeeInsuranceDataForEdit(long insuranceListId, DateTime startDate, DateTime endDate)
{ {
var res = _context.EmployeeInsurancListDataSet
.Where(x => x.InsuranceListId == insuranceListId)
.Join(_context.LeftWorkInsuranceList
.Where(x =>
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
((DateTime)x.LeftWorkDate >= startDate &&
(DateTime)x.LeftWorkDate <= endDate)) ||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
(DateTime)x.LeftWorkDate >= endDate) ||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue))
.Where(x => x.StartWorkDate <= endDate)
.Include(x => x.Employee),
employeeData => employeeData.EmployeeId,
leftwork => leftwork.EmployeeId,
(employeeData, leftwork) => new { employeeData, leftwork })
.Join(_context.Jobs,
result => result.leftwork.JobId,
job => job.id,
(result, job) => new { result, job })
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(),
allResult => allResult.result.employeeData.EmployeeId,
employeeInfo => employeeInfo.EmployeeId,
(allResult, employeeInfo) => new
{
allResult.result,
allResult.job,
employeeInfo
})
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo })
.Select(result => new EmployeeDetailsForInsuranceListViewModel
{
StartWorkDateNew = result.x.result.leftwork.StartWorkDate,
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate,
JobIdNew = result.x.result.leftwork.JobId,
var res = _context.EmployeeInsurancListDataSet StartWorkDateGr = result.x.result.leftwork.StartWorkDate,
.Where(x => x.InsuranceListId == insuranceListId) LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate,
.Join(_context.LeftWorkInsuranceList IncludeStatus = result.x.result.employeeData.IncludeStatus,
.Where(x => JobId = result.x.result.employeeData.JobId,
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && JobName = result.x.job != null ? result.x.job.JobName : string.Empty,
((DateTime)x.LeftWorkDate >= startDate && JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty,
(DateTime)x.LeftWorkDate <= endDate)) || InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0,
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) && EmployeeId = result.x.result.employeeData.EmployeeId,
(DateTime)x.LeftWorkDate >= endDate) ||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue)) //اطلاعات هویتی
.Where(x => x.StartWorkDate <= endDate) FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.result.leftwork.Employee.FName,
.Include(x => x.Employee), LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.result.leftwork.Employee.LName,
employeeData => employeeData.EmployeeId, FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.result.leftwork.Employee.FatherName,
leftwork => leftwork.EmployeeId, DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.result.leftwork.Employee.DateOfBirth,
(employeeData, leftwork) => new { employeeData, leftwork }) DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.result.leftwork.Employee.DateOfIssue,
.Join(_context.Jobs, PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.result.leftwork.Employee.PlaceOfIssue,
result => result.leftwork.JobId, IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.result.leftwork.Employee.IdNumber,
job => job.id, Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.result.leftwork.Employee.Gender,
(result, job) => new { result, job }) NationalCode = result.x.result.leftwork.Employee.NationalCode,
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(), Nationality = result.x.result.leftwork.Employee.Nationality,
allResult => allResult.result.employeeData.EmployeeId, InsuranceCode = result.x.result.leftwork.Employee.InsuranceCode,
employeeInfo => employeeInfo.EmployeeId, MaritalStatus = result.x.result.leftwork.Employee.MaritalStatus,
(allResult, employeeInfo) => new IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.result.leftwork.Employee.MaritalStatus),
{
allResult.result, //اطاعات محاسباتی
allResult.job, EmployeeInsurancListDataId = result.x.result.employeeData.id,
employeeInfo DailyWage = result.x.result.employeeData.DailyWage,
}) // LeftWorkDateGr = x.LeftWorkDate,
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo }) // StartWorkDateGr = x.StartWorkDate,
.Select(result => new EmployeeDetailsForInsuranceListViewModel MonthlyBenefitsIncluded = result.x.result.employeeData.MonthlyBenefitsIncluded,
{ // JobId = x.JobId,
StartWorkDateNew = result.x.result.leftwork.StartWorkDate, WorkingDays = result.x.result.employeeData.WorkingDays,
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate, //پایه سنوات
JobIdNew = result.x.result.leftwork.JobId, BaseYears = result.x.result.employeeData.BaseYears,
//مجموع مزد روزانه و پایه سنوات
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
//حق تاهل
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
//دستمزد ماهانه
MonthlySalary = result.x.result.employeeData.MonthlySalary,
StartWorkDateGr = result.x.result.leftwork.StartWorkDate, //مزایای ماهانه
LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate, MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
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, BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
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, BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
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, IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
//حق تاهل //حق بیمه سهم بیمه شده
MarriedAllowance = result.x.result.employeeData.MarriedAllowance, InsuranceShare = result.x.result.employeeData.InsuranceShare,
//دستمزد ماهانه //اضافه کار فیش حقوقی
MonthlySalary = result.x.result.employeeData.MonthlySalary, OverTimePay = result.x.result.employeeData.OverTimePay,
//حق اولا فیش حقوقی
//مزایای ماهانه 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 //.Select(x => new EmployeeDetailsForInsuranceListViewModel
@@ -1492,120 +1427,4 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
return res.ToList(); return res.ToList();
} }
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
{
var acountId = _authHelper.CurrentAccountId();
var workshopIds = _context.WorkshopAccounts
.Where(a => a.AccountId == acountId)
.Select(a => a.WorkshopId);
var query = _context.InsuranceListSet
.Where(x => workshopIds.Contains(x.WorkshopId))
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
insurance => insurance.WorkshopId,
workshop => workshop.id,
(insurance, workshop) => new { insurance, workshop })
.GroupJoin(_context.WorkshopEmployers,
result => result.workshop.id,
employer => employer.WorkshopId,
(result, employer) => new { result.insurance, result.workshop, employer })
.Select(result => new InsuranceListViewModel
{
Id = result.insurance.id,
Year = result.insurance.Year,
Month = result.insurance.Month,
WorkShopId = result.insurance.WorkshopId,
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
FixedSalary = result.workshop.FixedSalary,
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
ConfirmSentlist = result.insurance.ConfirmSentlist,
EmployerId = result.employer.First().EmployerId,
DebtDone = result.insurance.Debt.IsDone,
EmployerApproved = result.insurance.EmployerApproval.IsDone,
InspectionDone = result.insurance.Inspection.IsDone
});
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
else
{
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Month == searchModel.Month);
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
query = query.Where(x => x.Year == searchModel.Year);
}
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
if (searchModel.WorkshopId > 0)
{
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
query = query.Where(x => x.WorkShopName.Contains(workshopName));
}
if (searchModel.EmployerId > 0)
{
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
query = query.Where(x => x.EmployerName.Contains(employerName));
}
if (!string.IsNullOrEmpty(searchModel.EmployerName))
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
if (searchModel.FixedSalary != null)
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
query = query.Where(x => x.City == searchModel.City);
if (!string.IsNullOrEmpty(searchModel.Branch))
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
var res = await query.GroupBy(x => 1)
.Select(g => new InsuranceListTabsCountViewModel
{
NotStarted = g.Count(x =>
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
InProgress = g.Count(x =>
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
ReadyToSendList = g.Count(x =>
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
Done = g.Count(x => x.ConfirmSentlist)
})
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
return res;
}
/// <summary>
///
/// </summary>
/// <param name="year"></param>
/// <param name="month"></param>
/// <param name="insuranceListId"></param>
/// <param name="type">debt / inspection</param>
/// <returns></returns>
private string GetInsuranceListFilePath(long mediaId)
{
return _accountContext.Medias.FirstOrDefault(x => x.id == mediaId)?.Path ?? "";
}
} }

View File

@@ -796,11 +796,5 @@ public class LeftWorkInsuranceRepository : RepositoryBase<long, LeftWorkInsuranc
return insuranceLeftWorkWithContractExitOnly.ToList(); return insuranceLeftWorkWithContractExitOnly.ToList();
} }
public LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId)
{
return _context.LeftWorkInsuranceList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
.OrderByDescending(x => x.StartWorkDate).FirstOrDefault();
}
#endregion #endregion
} }

View File

@@ -654,10 +654,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117) var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
.Select(x => x.EmployeeId) .Select(x => x.EmployeeId)
.Except([5976]).ToList(); .Except([5976]).ToList();
var clientTemps = _context.EmployeeClientTemps.Where(x => x.WorkshopId == searchModel.WorkshopId) var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
.Select(x => x.EmployeeId);
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
{ {
Id = x.id, Id = x.id,
LeftWorkDate = x.LeftWorkDate.ToFarsi(), LeftWorkDate = x.LeftWorkDate.ToFarsi(),
@@ -675,7 +672,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName 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));
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0) if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId); query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0) if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)

View File

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

View File

@@ -33,7 +33,6 @@ using CompanyManagment.App.Contracts.Reward.Enums;
using static System.Runtime.InteropServices.JavaScript.JSType; using static System.Runtime.InteropServices.JavaScript.JSType;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
using Company.Domain.HolidayItemAgg; using Company.Domain.HolidayItemAgg;
using Company.Domain.RollCallEmployeeAgg;
using PersianTools.Core; using PersianTools.Core;
@@ -50,7 +49,6 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
private readonly TestDbContext _testDbContext; private readonly TestDbContext _testDbContext;
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository, public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context) ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context)
{ {
@@ -60,7 +58,6 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
_leaveRepository = leaveRepository; _leaveRepository = leaveRepository;
_holidayItemRepository = holidayItemRepository; _holidayItemRepository = holidayItemRepository;
_testDbContext = testDbContext; _testDbContext = testDbContext;
} }
#region OfficialChckout #region OfficialChckout
@@ -108,8 +105,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x => .Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId); x.WorkshopId == workshopId && x.EmployeeId == employeeId);
//اگر ساعت استراحت پرسنل وجود نداشت صفر است //اگر ساعت استراحت پرسنل وجود نداشت صفر است
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime; var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
#endregion #endregion
@@ -145,31 +142,16 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
BreakTimeSpan = x.BreakTimeSpan BreakTimeSpan = x.BreakTimeSpan
}).ToList(); }).ToList();
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
{ {
TimeSpan breakTime; CreationDate = x.Key,
if (contractStart > endOfFarvardin) 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)),
breakTime = CalculateBreakTime( SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
} 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 })
.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(); }).OrderBy(x => x.CreationDate).ToList();
} }
@@ -636,75 +618,45 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
} }
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
{ {
validCount = 6; validCount = 8;
} }
else else
{ {
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است // تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
validCount = (int)((totalDays * 6) / 28); validCount = (int)((totalDays * 8) / 28);
} }
string maxName;
int maxValue = moriningCount;
maxName = "moriningCount"; if (moriningCount >= validCount)
if (eveningCount > maxValue) RotatingfaName.Add("صبح");
{ if (eveningCount >= validCount)
maxValue = eveningCount; RotatingfaName.Add("عصر");
maxName = "eveningCount"; if (nightCount >= validCount)
} RotatingfaName.Add("شب");
if (nightCount > maxValue) var rotatingFaResult = "";
{ if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
maxValue = nightCount; {
maxName = "nightCount"; 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 = "نوبت کاری ندارد";
int countOutOfRange = 0; var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
switch (maxName) }
{
case "moriningCount":
countOutOfRange = eveningCount + nightCount;
break;
case "eveningCount":
countOutOfRange = moriningCount + nightCount;
break;
case "nightCount":
countOutOfRange = moriningCount + eveningCount;
break;
}
var rotatingFaResult = "";
if (countOutOfRange >= validCount)
{
shiftOver22Hours = "0";
shiftOver22Minuts = "0";
if (moriningCount >= 1)
RotatingfaName.Add("صبح");
if (eveningCount >= 1)
RotatingfaName.Add("عصر");
if (nightCount >= 1)
RotatingfaName.Add("شب");
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
{
if (rotateNumber == 0)
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
if (rotateNumber == 1)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (rotateNumber == 2)
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
}
}
else
{
rotatingFaResult = "نوبت کاری ندارد";
var over22Hours = (int)over22.TotalHours;
var over22Minuts = (int)(over22.TotalMinutes % 60);
shiftOver22Hours = over22Hours.ToString();
shiftOver22Minuts = over22Minuts.ToString();
}
#endregion #endregion
//******* محاسبه مبلغ نوبت کاری ************* //******* محاسبه مبلغ نوبت کاری *************
#region ShiftPayPercent #region ShiftPayPercent
@@ -772,55 +724,6 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
return res; 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();
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) public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
{ {
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>(); List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
@@ -909,7 +812,20 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
// شبکاری // شبکاری
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks)); TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
var RotatingfaName = new List<string>(); 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; var totalDays = (int)(contractEnd - contractStart).TotalDays + 1;
int validCount = 0; int validCount = 0;
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
@@ -926,66 +842,37 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
validCount = (int)((totalDays * 6) / 28); validCount = (int)((totalDays * 6) / 28);
} }
Console.WriteLine(validCount);
if (moriningCount >= validCount)
RotatingfaName.Add("صبح");
if (eveningCount >= validCount)
RotatingfaName.Add("عصر");
if (nightCount >= validCount)
RotatingfaName.Add("شب");
string maxName; var rotatingFaResult = "";
int maxValue = moriningCount; if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
{
maxName = "moriningCount"; for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
if (eveningCount > maxValue) {
{ if (rotateNumber == 0)
maxValue = eveningCount; rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
maxName = "eveningCount"; if (rotateNumber == 1)
} rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
if (nightCount > maxValue) if (rotateNumber == 2)
{ rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
maxValue = nightCount; }
maxName = "nightCount"; }
} else if (RotatingfaName.Count <= 1)
{
int countOutOfRange = 0; rotatingFaResult = "نوبت کاری ندارد";
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 return new ComputingViewModel
{ {
@@ -1000,19 +887,19 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan) //public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
{ //{
if (breakTime.BreakTimeType != BreakTimeType.WithTime) // if (breakTime.BreakTimeType != BreakTimeType.WithTime)
return new TimeSpan(); // return new TimeSpan();
var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan(); // var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
if (breakTimeSpan * 2 >= sumOneDaySpan) // if (breakTimeSpan * 2 >= sumOneDaySpan)
return new TimeSpan(); // return new TimeSpan();
return breakTimeSpan; ; // return breakTimeSpan; ;
} //}
public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan) public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
{ {
if (breakTimeSpan * 2 >= sumOneDaySpan) if (breakTimeSpan * 2 >= sumOneDaySpan)
@@ -2151,7 +2038,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var starTimeSingel1 = Convert.ToDateTime(shift1Start); var starTimeSingel1 = Convert.ToDateTime(shift1Start);
var endTimeSingel2 = Convert.ToDateTime(shift1End); 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); shift1StartGr = new DateTime(cuurentDate.Year, cuurentDate.Month, cuurentDate.Day, starTimeSingel1.Hour, starTimeSingel1.Minute, 0);
@@ -2160,92 +2047,92 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay) if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay)
shift1EndGr = shift1EndGr.AddDays(1); shift1EndGr = shift1EndGr.AddDays(1);
var shiftEndWithoutRest = shift1EndGr; var shiftEndWithoutRest = shift1EndGr;
var shiftSpan = (shift1EndGr - shift1StartGr); var shiftSpan = (shift1EndGr - shift1StartGr);
if (restTime > TimeSpan.Zero && shiftSpan >= restTime) if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
{ {
hasRestTime = true; hasRestTime = true;
shift1EndGr = shift1EndGr.Subtract(restTime); shift1EndGr = shift1EndGr.Subtract(restTime);
shiftSpan = (shift1EndGr - shift1StartGr); shiftSpan = (shift1EndGr - shift1StartGr);
}
} if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType =="روزانه"))
{
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 == "ساعتی");
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x => if (hourseLeaveTypeResult == null)
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی"); {
if (hourseLeaveTypeResult == null) result.Add(new RollCallViewModel()
{ {
result.Add(new RollCallViewModel() BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
{ StartDate = shift1StartGr,
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero, EndDate = shift1EndGr,
StartDate = shift1StartGr, ShiftSpan = shiftSpan,
EndDate = shift1EndGr, ShiftDate = shift1StartGr,
ShiftSpan = shiftSpan,
ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest ShiftEndWithoutRest = shiftEndWithoutRest
}); });
} }
else else
{ {
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr) if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{ {
//leave <--------------------> //leave <-------------------->
//shift <----------------------------------> //shift <---------------------------------->
result.Add(new RollCallViewModel() result.Add(new RollCallViewModel()
{ {
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero, BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr, StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr, EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr), ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr, ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest ShiftEndWithoutRest = shiftEndWithoutRest
}); });
} }
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr) else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
{ {
//leave <--------------------> //leave <-------------------->
//shift <----------------------------------> //shift <---------------------------------->
result.Add(new RollCallViewModel() result.Add(new RollCallViewModel()
{ {
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero, BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr, StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr, EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr), ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr, ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
}); });
result.Add(new RollCallViewModel() result.Add(new RollCallViewModel()
{ {
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero, BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = hourseLeaveTypeResult.EndLeaveGr, StartDate = hourseLeaveTypeResult.EndLeaveGr,
EndDate = shift1EndGr, EndDate = shift1EndGr,
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr), ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
ShiftDate = shift1StartGr, ShiftDate = shift1StartGr,
ShiftEndWithoutRest = shiftEndWithoutRest ShiftEndWithoutRest = shiftEndWithoutRest
}); });
} }
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr) else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
{ {
//leave <--------------------> //leave <-------------------->
//shift <----------------------------------> //shift <---------------------------------->
result.Add(new RollCallViewModel() result.Add(new RollCallViewModel()
{ {
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero, BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
StartDate = shift1StartGr, StartDate = shift1StartGr,
EndDate = hourseLeaveTypeResult.StartLeaveGr, EndDate = hourseLeaveTypeResult.StartLeaveGr,
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr), ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
ShiftDate = shift1StartGr, ShiftDate = shift1StartGr,
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
}); });
} }
@@ -2376,7 +2263,6 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
#endregion #endregion
#region CustomizeCheckout #region CustomizeCheckout
/// <summary> /// <summary>
@@ -3082,13 +2968,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
var endFarvarding = new DateTime(2025, 4, 20); var endFarvarding = new DateTime(2025, 4, 20);
if (contractStart > endFarvarding) if (contractStart>endFarvarding)
{ {
customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings customizeWorkshopEmployeeSettings=_context.CustomizeWorkshopEmployeeSettings
.AsSplitQuery().AsNoTracking().FirstOrDefault(x => .AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId); 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 else
@@ -4043,40 +3929,40 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}).ToList(); }).ToList();
} }
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd) public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
{ {
return _context.Loans return _context.Loans
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId) .Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
.SelectMany(x => x.LoanInstallments) .SelectMany(x => x.LoanInstallments)
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True) .Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
.Select(x => new LoanInstallmentViewModel() .Select(x => new LoanInstallmentViewModel()
{ {
Id = x.Id, Id = x.Id,
Month = x.Month, Month = x.Month,
IsActive = x.IsActive, IsActive = x.IsActive,
Amount = x.AmountForMonth.ToMoney(), Amount = x.AmountForMonth.ToMoney(),
Year = x.Year, Year = x.Year,
AmountDouble = x.AmountForMonth, AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate) 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(), .Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney() LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList(); }).ToList();
} }
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd) public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
{ {
return _context.SalaryAids return _context.SalaryAids
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel() .Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
{ {
Amount = x.Amount.ToMoney(), Amount = x.Amount.ToMoney(),
AmountDouble = x.Amount, AmountDouble = x.Amount,
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(), SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
SalaryAidDateTimeGe = x.SalaryAidDateTime, SalaryAidDateTimeGe = x.SalaryAidDateTime,
CalculationDateTimeGe = x.CalculationDate, CalculationDateTimeGe = x.CalculationDate,
CalculationDateTimeFa = x.CalculationDate.ToFarsi(), CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
Id = x.id Id = x.id
}).ToList(); }).ToList();
} }
private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year, private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year,
DateTime contractStart) DateTime contractStart)

View File

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

View File

@@ -197,14 +197,9 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
HasRollCallFreeVip = x.HasRollCallFreeVip, HasRollCallFreeVip = x.HasRollCallFreeVip,
WorkshopHolidayWorking = x.WorkshopHolidayWorking, WorkshopHolidayWorking = x.WorkshopHolidayWorking,
InsuranceCheckoutOvertime = x.InsuranceCheckoutOvertime, 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) public List<long> GetRelation(long workshopid)

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,2 @@
<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"> <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> <s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -18,10 +18,6 @@
margin-right: 80px; margin-right: 80px;
} }
.level4 {
margin-right: 120px;
}
.parent { .parent {
border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px;
min-width: 220px; min-width: 220px;
@@ -46,16 +42,6 @@
border: 1px solid #666666 !important; border: 1px solid #666666 !important;
margin-right: -4px; margin-right: -4px;
} }
.parentLevel3 {
border-radius: 10px 0px 0px 10px;
min-width: 220px !important;
text-align: start;
background-color: #666666 !important;
border: 1px solid #666666 !important;
margin-right: -4px;
}
.ion-plus { .ion-plus {
position: relative !important; position: relative !important;
top: 4px !important; top: 4px !important;
@@ -550,45 +536,15 @@
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
</label> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
@*لیست کاربران کلاینت*@ </div>
<div class="child-check level3"> @* تشخیص چهره *@
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <div class="child-check level2">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
</label> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div>
</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="30601" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> نقش ها </span> </label>
</div>
</div> </div>
@* گزارشات *@ @* گزارشات *@
<div class="child-check level2"> <div class="child-check level2">
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
@@ -770,28 +726,15 @@
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" /> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
</label> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80217" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام نشده </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80218" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب در حال انجام </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80219" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب آماده ارسال لیست </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80220" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام بیمه </span> </label>
</div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد لیست بیمه </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مراحل تایید </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تایید ارسال </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>

View File

@@ -18,11 +18,6 @@
margin-right: 80px; margin-right: 80px;
} }
.level4 {
margin-right: 120px;
}
.parent { .parent {
border-radius: 10px 0px 0px 10px; border-radius: 10px 0px 0px 10px;
min-width: 220px; min-width: 220px;
@@ -47,15 +42,6 @@
margin-right: -4px; margin-right: -4px;
} }
.parentLevel3 {
border-radius: 10px 0px 0px 10px;
min-width: 220px !important;
text-align: start;
background-color: #666666 !important;
border: 1px solid #666666 !important;
margin-right: -4px;
}
.ion-plus { .ion-plus {
position: relative !important; position: relative !important;
top: 4px !important; top: 4px !important;
@@ -492,15 +478,7 @@
</div> </div>
</div> </div>
@*حضورغیاب*@ @*ایجاد عناوین مقادیر سالانه*@
<div class="child-check level2">
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
</label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حضورغیاب </span> </label>
</div>
@*ایجاد عناوین مقادیر سالانه*@
<div class="child-check level2"> <div class="child-check level2">
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
@@ -561,45 +539,15 @@
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
</label> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
@*لیست کاربران کلاینت*@ </div>
<div class="child-check level3"> @* تشخیص چهره *@
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <div class="child-check level2">
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
</label> <i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label> </label>
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>
</div>
<div class="child-check level4">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div>
</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="30601" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> نقش ها </span> </label>
</div>
</div> </div>
@* گزارشات *@ @* گزارشات *@
<div class="child-check level2"> <div class="child-check level2">
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close"> <label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
@@ -783,26 +731,13 @@
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="802" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> صفحه اصلی </span> </label>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80217" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام نشده </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80218" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب در حال انجام </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80219" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب آماده ارسال لیست </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80220" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تب انجام بیمه </span> </label>
</div>
<div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80210" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ایجاد لیست بیمه </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="80211" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> حذف </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> مراحل تایید </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80212" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> تایید ارسال </span> </label>
</div> </div>
<div class="child-check level3"> <div class="child-check level3">
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label> <label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="80213" class="check-btn"> &nbsp;<span style="bottom: 2px;position: relative"> ویرایش </span> </label>

View File

@@ -3,14 +3,12 @@
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using _0_Framework.Application @using _0_Framework.Application
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel @model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
@inject IAuthHelper _AuthHelper;
@{ @{
var i = 1; var i = 1;
var j = 1; var j = 1;
var r = 1; var r = 1;
var permissionList = _AuthHelper.GetPermissions();
//string colaps = "in"; //string colaps = "in";
//string act = "active"; //string act = "active";
} }
@@ -66,11 +64,11 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p class="pull-right" permission="30601"> <p class="pull-right">
<a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a> <a href="#showmodal=@Url.Page("./Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a>
</p> </p>
<p class="pull-right" permission="30602"> <p class="pull-right">
<a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a> <a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a>
</p> </p>
@@ -101,17 +99,17 @@
<ul class="nav nav-tabs tabs" id="myTab"> <ul class="nav nav-tabs tabs" id="myTab">
@* ============================================RolesTab=================*@ @* ============================================RolesTab=================*@
<li class="tab @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " permission="30605"> <li class="tab">
<a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac"> <a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac">
<span class="visible-xs"> <span class="visible-xs">
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i> <i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
<span class="textMenu">نقش ها</span> <span class="textMenu">نقش ها</span>
</span> </span>
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> نقش ها</h3> <h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> نقش ها</h3>
</a> </a>
</li> </li>
@* ===============================================AdminTab=================*@ @* ===============================================AdminTab=================*@
<li class="tab active" permission="30604"> <li class="tab active">
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac"> <a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
<span class="visible-xs"> <span class="visible-xs">
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i> <i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
@@ -121,21 +119,20 @@
</a> </a>
</li> </li>
@* ===============================================ClientTab=================*@ @* ===============================================ClientTab=================*@
<li class="tab @(permissionList.All(x => x != 30604) ? "active" : "")" permission="30603"> <li class="tab">
<a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac"> <a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac">
<span class="visible-xs" > <span class="visible-xs" >
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i> <i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
<span class="textMenu">لیست کلاینت</span> <span class="textMenu">لیست موازی</span>
</span> </span>
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( کلاینت) (@Model.ClientAccounts.Count) </h3> <h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( موازی) (@Model.ClientAccounts.Count) </h3>
</a> </a>
</li> </li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@*==================================================================Adminusers=====*@ @*==================================================================Adminusers=====*@
<div class="tab-pane active" id="home-21" permission="30604"> <div class="tab-pane active" id="home-21">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -301,7 +298,7 @@
</div> </div>
@*==================================================================roles=====*@ @*==================================================================roles=====*@
<div class="tab-pane @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " id="profile-21" permission="30605"> <div class="tab-pane" id="profile-21">
@@ -370,7 +367,7 @@
</div> </div>
@*==================================================================Clientusers=====*@ @*==================================================================Clientusers=====*@
<div class="tab-pane @(permissionList.All(x => x != 30604) ? "active" : "")" id="Client-21" permission="30603"> <div class="tab-pane" id="Client-21">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -488,27 +485,27 @@
j++; j++;
} }
<td> <td>
<a permission="3060301" class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)"> <a class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
<i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span> <i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span>
</a> </a>
<a permission="3060302" class="btn btn-info pull-right m-rl-5 red" <a class="btn btn-info pull-right m-rl-5 red"
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })"> href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })">
<i class="fa fa-key faSize"></i> <i class="fa fa-key faSize"></i>
</a> </a>
<a permission="3060303" class="btn btn-warning pull-right m-rl-5 red" <a class="btn btn-warning pull-right m-rl-5 red"
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })"> href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
<i class="fa fa-edit faSize"></i> <i class="fa fa-edit faSize"></i>
</a> </a>
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم") @if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
{ {
<a permission="3060304" onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red"> <a onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
<i class="fa faSize fa-trash"></i> <i class="fa faSize fa-trash"></i>
</a> </a>
} }
else if (item.IsActiveString == "false") else if (item.IsActiveString == "false")
{ {
<a permission="3060304" onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red"> <a onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
<i class="fa faSize fa-rotate-left"></i> <i class="fa faSize fa-rotate-left"></i>
</a> </a>
} }

View File

@@ -1013,7 +1013,7 @@ public class IndexModel : PageModel
public IActionResult OnGetPrintOne(long id) public IActionResult OnGetPrintOne(long id)
{ {
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault(); var res = _checkoutApplication.PrintOne(id);
//var res = _contractApplication.PrintAll(ids); //var res = _contractApplication.PrintAll(ids);
if (res.HasRollCall) return Partial("PrintDetailsRollCall", res); if (res.HasRollCall) return Partial("PrintDetailsRollCall", res);

View File

@@ -1,7 +1,7 @@
@using _0_Framework.Application @using _0_Framework.Application
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel @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" /> <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="modal-body print" id="printThis">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<fieldset style="border: 1px solid black; <fieldset style="border: 1px solid black;
padding: revert; padding: revert;
border-radius: 10px; border-radius: 10px;
height: 28cm; height: 28cm;
margin: 3mm 5mm 0 5mm; "> margin: 3mm 5mm 0 5mm; ">
<div class="row" dir="rtl"> <div class="row" dir="rtl">
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 70%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div> <div class="col-xs-3 d-inline-block"></div>
<div class="col-xs-6 d-inline-block text-center"> <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: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p>
<p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p> <p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
</div> </div>
<div class="col-xs-3 d-inline-block"></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> </div>
@@ -54,336 +54,340 @@
{ {
<span>@Model.FathersName</span> <span>@Model.FathersName</span>
} }
</div> </div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;"> <div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">به کد ملی<span>:</span></span> <span class="cusSpanTitle">به کد ملی<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.NationalCode)) @if (string.IsNullOrWhiteSpace(@Model.NationalCode))
{ {
<span style="margin-left: 15px; visibility: hidden"></span> <span style="margin-left: 15px; visibility: hidden"></span>
} }
else else
{ {
<span> <span>
@Model.NationalCode @Model.NationalCode
</span> </span>
} }
</div> </div>
<div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;"> <div style="width: 22%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">متولد<span>:</span></span> <span class="cusSpanTitle">متولد<span>:</span></span>
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth)) @if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
{ {
<span style="visibility: hidden">1401/01/01</span> <span style="visibility: hidden">1401/01/01</span>
} }
else else
{ {
<span>@Model.DateOfBirth</span> <span>@Model.DateOfBirth</span>
} }
</div> </div>
</div> </div>
</div> </div>
<div class="col-xs-12" style="font-size: 12px; text-align: justify; padding: 0 10px;"> <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;"> <div style="display: flex;align-items: center;border-bottom: 1px solid #000000 !important;height: 23px; padding: 0;">
@{ @{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی") if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{ {
<div style="width: 50%; padding: 3px 0 !important;"> <div style="width: 50%; padding: 3px 0 !important;">
<div> <div>
<span class="cusSpanTitle">نام کارگاه<span>:</span> </span> <span class="cusSpanTitle">نام کارگاه<span>:</span> </span>
<span>@Model.WorkshopName</span> <span>@Model.WorkshopName</span>
</div>
</div> </div>
</div>
<div style="width: 50%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;"> <div style="width: 50%; padding: 3px 0 !important; border-right: 1px solid #000000 !important;">
<span class="cusSpanTitle">نام کارفرما<span>:</span> </span> <span class="cusSpanTitle">نام کارفرما<span>:</span> </span>
@if (Model.EmployerList.Count > 1) @if (Model.EmployerList.Count > 1)
{ {
<span>
@Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span>
}
else
{
<span>
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
}
</div>
}
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
{
<div style="width: 100%; padding: 3px 0 !important;">
<span class="cusSpanTitle">پـرسنل شرکت/موسسه<span>:</span> </span>
<span> <span>
@Model.WorkshopName @Model.EmployerList[0].EmployerFullName <span>،</span>
<span>&nbsp;</span>@Model.EmployerList[1].EmployerFullName
@if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
</span> </span>
</div> }
} else
{
<span>
@Model.EmployerList.FirstOrDefault().EmployerFullName
</span>
}
</div>
} }
</div> else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
<div style="text-align: justify; padding: 0 6px;"> {
@{ <div style="width: 100%; padding: 3px 0 !important;">
var items = new List<string>(); <span class="cusSpanTitle">پـرسنل شرکت/موسسه<span>:</span> </span>
<span>
if (Model.MonthlySalary != "0") items.Add("حقوق و مزد"); @Model.WorkshopName
if (Model.ConsumableItems != "0") items.Add("کمک هزینه اقلام مصرفی خانوار"); </span>
if (Model.HousingAllowance != "0") items.Add("کمک هزینه مسکن"); </div>
if (!string.IsNullOrWhiteSpace(Model.OvertimePay) && Model.OvertimePay != "0") items.Add("فوق العاده اضافه کاری");
if (!string.IsNullOrWhiteSpace(Model.NightworkPay) && Model.NightworkPay != "0") items.Add("فوق العاده شب کاری");
if (!string.IsNullOrWhiteSpace(Model.FridayPay) && Model.FridayPay != "0") items.Add("فوق العاده جمعه کاری");
if (Model.MissionPay != "0") items.Add("فوق العاده ماموریت");
if (Model.ShiftPay != "0") items.Add("فوق العاده نوبت کاری");
if (Model.FamilyAllowance != "0") items.Add("کمک هزینه عائله مندی");
if (Model.MarriedAllowance != "0") items.Add("حق تاهل");
if (Model.RewardPay != "0") items.Add("پاداش");
if (Model.BonusesPay != "0") items.Add("عیدی و پاداش");
if (Model.YearsPay != "0") items.Add("سنوات");
if (Model.LeavePay != "0") items.Add("مزد مرخصی");
string finalText = "";
if (items.Count == 1)
{
finalText = items[0];
}
else if (items.Count > 1)
{
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
}
} }
}
<span>
کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
</span>
</div>
</div> </div>
</div> <div style="text-align: justify; padding: 0 6px;">
</div> @{
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("مزد مرخصی");
<div class="row m-t-20"> string finalText = "";
<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"> if (items.Count == 1)
<table style="/* table-layout: fixed; */ width: 100%"> {
finalText = items[0];
}
else if (items.Count > 1)
{
finalText = string.Join("<span>،</span> ", items.Take(items.Count - 1)) + " و " + items.Last();
}
}
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; "> <span>
@* <th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th> *@ کلیه حق السعی خود اعم از @Html.Raw(finalText) @Model.Month ماه سال @Model.Year برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام.
<th colspan="4" style="text-align: center; position: relative ; font-size: 13px;padding-top:4px;border-left: 2px solid #000;"> مطالبات </th> </span>
@* <th style="text-align: center;"> </th> </div>
</div>
</div>
</div>
<div style="padding-top: 10px" class="print-qrcode">
<img src="https://bwipjs-api.metafloor.com/?bcid=code128&text=Chkt_@Model.Id&includetext=false" alt="Barcode">
@* <img src="https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=Chkt_@Model.Id" alt="QR Code"> *@
</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>
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </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 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: 0px 0px 0px 0px;"> </th>
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 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; "> <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: 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: 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: 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: 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: 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: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th> <th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
</tr> </tr>
<tr style="font-size: 12px; "> <tr style="font-size: 12px; ">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td> <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="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: 1px solid #000;"> @Model.SumOfWorkingDays </td>
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </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="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: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td> <td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
</tr> </tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; "> <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="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="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: 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="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="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: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td> <td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
</tr> </tr>
<tr style="font-size: 12px;"> <tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td> <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="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: 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="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="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: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td> <td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
</tr> </tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; "> <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="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="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: 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="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="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: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td> <td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
</tr> </tr>
<tr style="font-size: 12px;"> <tr style="font-size: 12px;">
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td> <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="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: 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="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="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: 1px solid #000;"> - </td>
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td> <td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
</tr> </tr>
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; "> <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="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="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: 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="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
{
<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: 1px solid #000;"> </td> <td style="text-align: center; border-left: 1px solid #000;"> </td>
<td style="text-align: center;"> </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>
@{ </tr>
if (Model.IsLeft) <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="text-align: center; background-color: #ffffff !important;" colspan="3" rowspan="3"> <td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
<div style="border-top: 1px solid #000;border-top-left-radius: 15px;border-top-right-radius: 15px; height: 65px;"> <td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays)</td>
<div style="padding: 0 6px; text-align: start;display: block;align-items: center;height: 64px;margin: 6px;"> <td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
<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; "> if (!Model.IsLeft)
<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="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-left: 1px solid #000;"> </td>
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td> <td style="text-align: center;"> </td>
</tr> }
</table> }
</fieldset> </tr>
</div> <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 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: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
@@ -580,47 +584,47 @@
<div class="" style="margin: 10px 0 0 0;display: flex;gap: 0px;"> <div class="" style="margin: 10px 0 0 0;display: flex;gap: 0px;">
<div style="width: 65%;"> <div style="width: 65%;">
<div style="display: flex; gap: 10px;"> <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%;"> <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"> <div class="table-container">
<table style="width: 100%;"> <table style="width: 100%;">
<colgroup> <colgroup>
<col style="width: 50%;"> <col style="width: 50%;">
<col style="width: 50%;"> <col style="width: 50%;">
</colgroup> </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;"> <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> <th colspan="3" style="text-align: center; font-size: 11px;">مساعده</th>
</tr> </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;"> <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; 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> <th style="padding: 1px 4px; text-align: center; min-width: 4rem; font-size: 11px;">مبلغ</th>
</tr> </tr>
@for (int i = 0; i < 5; i++) @for (int i = 0; i < 5; i++)
{ {
<tr class="trTable" style="text-align: right; font-size: 10px; height: 15px;"> <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"> <td style="font-size: 8px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count @(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? "" ? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
: "") : "")
</td> </td>
<td style="font-size: 8px; text-align: center;"> <td style="font-size: 8px; text-align: center;">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count @(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.Amount ?? "" ? Model.SalaryAidViewModels[i]?.Amount ?? ""
: "") : "")
</td> </td>
</tr> </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%;"> <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"> <div class="table-container">
@@ -680,7 +684,7 @@
</div> </div>
</div> </div>
</fieldset> </fieldset>
</div> </div>
</div> </div>
</div> </div>
@@ -690,7 +694,7 @@
<input type="hidden" asp-for="Id" value="@Model.Id" /> <input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork"> <input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">

View File

@@ -15,7 +15,7 @@
<p style="font-size: 18px; font-family: 'IranNastaliq' !important; margin-top:0 !important;">بسمه تعالی</p> <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> <p style="font-size: 15px; font-weight: bold; margin: 2px;">فیش حقوقی و رسید پرداخت حقوق</p>
</div> </div>
<div class="col-xs-3 d-inline-block"></div> <div class="col-xs-3 d-inline-block"></div>
</div> </div>
<div class="headerInfo"> <div class="headerInfo">

View File

@@ -2,204 +2,620 @@
@model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel @model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel
@{ @{
Layout = "Shared/_AdminLayout"; Layout = "Shared/_AdminLayout";
ViewData["title"] = "لیست پرسنل‌های " + @Model.WorkshopFullName; ViewData["title"] = "لیست پرسنل‌های " + Model.WorkshopFullName;
string adminVersion = _0_Framework.Application.Version.AdminVersion;
int i = 1; 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>
} }
@section Styles @section Styles
{ {
<link href="@Href("~/admintheme/css/moreBtnsPopup.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/dataTables.bootstrap4.min.css" rel="stylesheet"/>
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet" /> <link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet"/>
<link href="~/assetsadmin/page/connectedpersonnels/css/index.css?ver=@adminVersion" rel="stylesheet" />
} }
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId" />
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId"/>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div permission="10312" class="panel panel-default"> <div permission="10312" class="panel panel-default">
<div class="panel-heading" style="background-color: #465149"> <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> <h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنل‌های @Model.WorkshopFullName</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12"> <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"> <table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
<thead> <thead>
<tr> <tr>
<th>ردیف</th> <th>ردیف</th>
<th>نام و نام خانوادگی</th> <th>نام و نام خانوادگی</th>
<th>کد پرسنلی</th> <th>کد پرسنلی</th>
<th>دارای قرارداد</th> <th>دارای قرارداد</th>
<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>
<th>عدم قرارداد</th> </tr>
<th>عدم تصفیه حساب</th> }
</tbody>
</table>
<th>عملیات</th> </div>
</tr> </div>
</thead> </div>
<tbody> </div>
@foreach (var item in @Model.PersonnelList.ConnectedPersonnelViewModels) </div>
{
<tr class="tableFindBtn @(item.Black ? "black" : "")">
<td class="text-center">
<div class="border-index">@i</div>
</td>
@{
i++;
}
<td>
<h6>@item.PersonName</h6>
</td>
<td class="text-center">
<h6>@item.PersonelCode</h6>
</td>
<td class="text-center">
@if (@item.ContractPerson && !@item.ContractLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td class="text-center">
@if (@item.InsurancePerson && !@item.InsurancetLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 170px;font-size: 12px;">
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 170px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 170px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
</select>
}
</td>
<td style="user-select: none">
@if (@item.ContractPerson)
{
<div>
<label for="FailureCreateContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureCreateContract_@item.EmployeeId" @(!item.CreateContract ? "checked" : "") />
عدم ایجاد قرارداد
</label>
</div>
<div>
<label for="FailureSignContract_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureSignContract_@item.EmployeeId" @(!item.SignContract ? "checked" : "") />
عدم امضا قرارداد
</label>
</div>
}
</td>
<td style="user-select: none">
@if (@item.ContractPerson)
{
<div>
<label for="FailureCreateCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureCreateCheckout_@item.EmployeeId" @(!item.CreateCheckout ? "checked" : "") />
عدم ایجاد تصفیه حساب
</label>
</div>
<div>
<label for="FailureSignCheckout_@item.EmployeeId" style="display: flex; align-items: center; gap: 5px;">
<input type="checkbox" id="FailureSignCheckout_@item.EmployeeId" @(!item.SignCheckout ? "checked" : "") />
عدم امضا تصفیه حساب
</label>
</div>
}
</td>
<td>
@if (@item.ContractPerson)
{
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
}
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId})">
<i class="ion-information-circled ionSize"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div> </div>
@section Script { @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/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.bootstrap4.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.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 src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script> *@
<script>
var AntiForgeryToken = $('@Html.AntiForgeryToken()').val(); <script type="text/javascript">
var saveCreateUrl = `@Url.Page("./Index", "Create")`;
$(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> </script>
<script src="~/AssetsAdmin/page/ConnectedPersonnels/js/Index.js?ver=@adminVersion"></script>
} }

View File

@@ -1,204 +1,170 @@
using _0_Framework.Application; using _0_Framework.Application;
using CompanyManagment.App.Contracts.EmployeeComputeOptions; using CompanyManagment.App.Contracts.EmployeeComputeOptions;
using CompanyManagment.App.Contracts.RollCallEmployee;
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
using CompanyManagment.App.Contracts.Workshop; using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages; 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 namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels;
public class IndexModel : PageModel
{ {
public class IndexModel : PageModel private readonly IAuthHelper _authHelper;
{ private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
public ConnectedPersonnelViewModel PersonnelList; private readonly IWebHostEnvironment _webHostEnvironment;
public string WorkshopFullName; private readonly IWorkshopApplication _workshopApplication;
private readonly IWorkshopApplication _workshopApplication; public ConnectedPersonnelViewModel PersonnelList;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication; public string WorkshopFullName;
private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication; public long workshopId;
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, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IEmployeeApplication employeeApplication) public IndexModel(IAuthHelper authHelper, IWorkshopApplication workshopApplication,
{ IEmployeeComputeOptionsApplication employeeComputeOptionsApplication, IWebHostEnvironment webHostEnvironment)
_authHelper = authHelper; {
_workshopApplication = workshopApplication; _authHelper = authHelper;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication; _workshopApplication = workshopApplication;
_webHostEnvironment = webHostEnvironment; _employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_rollCallEmployeeApplication = rollCallEmployeeApplication; _webHostEnvironment = webHostEnvironment;
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; }
_employeeApplication = employeeApplication;
}
public void OnGet(long workshopID) public void OnGet(long workshopID)
{ {
var workshop = _workshopApplication.GetWorkshopInfo(workshopID); var workshop = _workshopApplication.GetWorkshopInfo(workshopID);
WorkshopFullName = workshop.WorkshopFullName; WorkshopFullName = workshop.WorkshopFullName;
workshopId = workshopID; 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>(); var final = new List<ConnectedPersonnelViewModel>();
foreach (var item in result) foreach (var item in result)
{ {
var option = new EmployeeComputeOptionsViewModel(); var option = new EmployeeComputeOptionsViewModel();
if (item.ContractPerson) if (item.ContractPerson)
{ option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
}
var finalResult = new ConnectedPersonnelViewModel() var finalResult = new ConnectedPersonnelViewModel
{ {
WorkshopId = item.WorkshopId, WorkshopId = item.WorkshopId,
EmployeeId = item.EmployeeId, EmployeeId = item.EmployeeId,
PersonName = item.PersonName, PersonName = item.PersonName,
PersonelCode = item.PersonelCode, PersonelCode = item.PersonelCode,
ContractPerson = item.ContractPerson, ContractPerson = item.ContractPerson,
InsurancePerson = item.InsurancePerson, InsurancePerson = item.InsurancePerson,
ContractLeft = item.ContractLeft, ContractLeft = item.ContractLeft,
InsurancetLeft = item.InsurancetLeft, InsurancetLeft = item.InsurancetLeft,
Black = item.Black, Black = item.Black,
StartWork = item.StartWork, StartWork = item.StartWork,
BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null", BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null",
ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null", ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null",
YearsOptions = item.ContractPerson ? option.YearsOptions : "null", YearsOptions = item.ContractPerson ? option.YearsOptions : "null"
CreateContract = item.ContractPerson ? option.CreateContract :false, };
CreateCheckout = item.ContractPerson ? option.CreateCheckout : false,
SignContract = item.ContractPerson ? option.SignContract : false,
SignCheckout = item.ContractPerson ? option.SignCheckout : false
};
final.Add(finalResult); final.Add(finalResult);
} }
PersonnelList = new ConnectedPersonnelViewModel() PersonnelList = new ConnectedPersonnelViewModel
{ {
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(), ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList()
}; };
} }
public IActionResult OnPostCreate(CreateEmployeeComputeOptions command) public IActionResult OnGetCreate(CreateEmployeeComputeOptions command)
{ {
var result = _employeeComputeOptionsApplication.Create(command); var result = _employeeComputeOptionsApplication.Create(command);
return new JsonResult(new return new JsonResult(new
{ {
isSuccedded = result.IsSuccedded, isSuccedded = result.IsSuccedded,
message = result.Message message = result.Message
}); });
} }
public IActionResult OnGetTakePicture(long employeeId, long workshopId) public IActionResult OnGetTakePicture(long employeeId, long workshopId)
{ {
var res = new TakePictureModel() var res = new TakePictureModel
{ {
EmployeeId = employeeId, EmployeeId = employeeId,
WorkshopId = workshopId 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 void CreateImageFromBase64(string base64, string imagePathWithExtension) public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
{ {
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1); try
//Convert the base64 to byte array {
byte[] bytes = Convert.FromBase64String(subBase64); var directoryPath = $"{_webHostEnvironment.WebRootPath}\\Faces\\{workshopId}\\{employeeId}";
//Here you can save the byte array to the SQL database. You can use your own function if (!Directory.Exists(directoryPath))
//bool saved = DAL.SaveUserPhoto(bytes); Directory.CreateDirectory(directoryPath);
//Create the physical image from the byte array
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes); 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);
}
}

View File

@@ -1483,8 +1483,8 @@ public class IndexModel : PageModel
return Partial("../Error/_ErrorModal", resultError); return Partial("../Error/_ErrorModal", resultError);
} }
//var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult(); var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) /*|| clientTemps.Any()*/) if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
{ {
var resultError = new ErrorViewModel() var resultError = new ErrorViewModel()
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,215 +0,0 @@
@using CompanyManagment.App.Contracts.InsuranceList.Enums
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model CompanyManagment.App.Contracts.InsuranceList.InsuranceListConfirmOperation
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
<link href="~/assetsadmin/page/insurancelist/css/operationsmodal.css?ver=@adminVersion" rel="stylesheet" />
}
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
<div class="container">
<div class="modal-custom">
<div class="modal__header">
<h2 class="modal__title">تکمیل اطلاعات بیمه</h2>
<button type="button" class="modal__close" data-dismiss="modal" aria-hidden="true">
<svg width="35" height="35" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22 38.5C19.8332 38.5 17.6876 38.0732 15.6857 37.244C13.6839 36.4148 11.8649 35.1994 10.3327 33.6673C8.80057 32.1351 7.58519 30.3161 6.75599 28.3143C5.92678 26.3124 5.5 24.1668 5.5 22C5.5 19.8332 5.92679 17.6876 6.75599 15.6857C7.58519 13.6838 8.80057 11.8649 10.3327 10.3327C11.8649 8.80057 13.6839 7.58519 15.6857 6.75599C17.6876 5.92678 19.8332 5.5 22 5.5C24.1668 5.5 26.3124 5.92679 28.3143 6.75599C30.3162 7.58519 32.1351 8.80057 33.6673 10.3327C35.1994 11.8649 36.4148 13.6839 37.244 15.6857C38.0732 17.6876 38.5 19.8332 38.5 22C38.5 24.1668 38.0732 26.3124 37.244 28.3143C36.4148 30.3162 35.1994 32.1351 33.6673 33.6673C32.1351 35.1994 30.3161 36.4148 28.3143 37.244C26.3124 38.0732 24.1668 38.5 22 38.5L22 38.5Z" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
<path d="M16.5 16.5L27.5 27.5" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
<path d="M27.5 16.5L16.5 27.5" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
</div>
<div class="modal__content">
<input type="hidden" asp-for="@Model.InsuranceListId" />
<div class="card-action @(Model.Inspection.Type == InsuranceListInspectionType.None ? "" : "card-action__success")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
<div class="card-action__title">بازرسی</div>
<div class="card-action__container">
<div class="card-action__container-right">
<div class="card-action__status @(Model.Inspection.Type == InsuranceListInspectionType.None ? "" : "card-action__status-success")">
<div class="card-action__status-icon">
<svg class="card-action__status-icon-svg" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Inspection.Type == InsuranceListInspectionType.None ? "none" : "block")">
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
</svg>
</div>
</div>
<div class="card-action__inspection-type">
<label class="card-action__checkbox">
<input name="Inspection.Type" type="checkbox" @(Model.Inspection.Type == InsuranceListInspectionType.Old ? "checked" : "") value="1" />
بازرسی قدیمی
</label>
<label class="card-action__checkbox">
<input name="Inspection.Type" type="checkbox" @(Model.Inspection.Type == InsuranceListInspectionType.New ? "checked" : "") value="2" />
بازرسی جدید
</label>
</div>
</div>
<div class="card-action__container-left">
<div class="card-action__date">
<label class="card-action__label" for="last-inspection-date">تاریخ آخرین بازرسی</label>
<input type="text" id="last-inspection-date" class="card-action__input date" placeholder="____/__/__" asp-for="@Model.Inspection.LastInspectionDate">
</div>
<div class="card-action__upload" id="card-inspection">
<div class="card-action__upload-icon">
<img src="~/assetsclient/images/icons/upload.png" style="width: 35px;" />
</div>
@if (Model.Inspection.InspectionFileMediaId != 0)
{
<button type="button" class="card-action__upload-btn remove-file-btn" data-type="inspection">حذف فایل</button>
}
else
{
<button type="button" class="card-action__upload-btn choose-file-btn" data-type="inspection">انتخاب فایل</button>
}
<input type="file" name="Inspection.InspectionFile" style="display: none;" data-type="inspection">
<input type="hidden" class="mediaIds" asp-for="@Model.Inspection.InspectionFileMediaId" />
</div>
</div>
</div>
</div>
<div class="card-action @(Model.Debt.Type == InsuranceListDebtType.None ? "" : "card-action__success")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
<div class="card-action__title">بدهی</div>
<div class="card-action__container">
<div class="card-action__container-right">
<div class="card-action__status @(Model.Debt.Type == InsuranceListDebtType.None ? "" : "card-action__status-success")">
<div class="card-action__status-icon">
<svg class="card-action__status-icon-svg" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Debt.Type == InsuranceListDebtType.None ? "none" : "block")">
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
</svg>
</div>
</div>
<div class="card-action__inspection-type">
<label class="card-action__checkbox">
<input name="Debt.Type" type="checkbox" @(Model.Debt.Type == InsuranceListDebtType.Old ? "checked" : "") value="1" />
بدهی قدیمی
</label>
<label class="card-action__checkbox">
<input name="Debt.Type" type="checkbox" @(Model.Debt.Type == InsuranceListDebtType.New ? "checked" : "") value="2" />
بدهی جدید
</label>
</div>
</div>
<div class="card-action__container-left">
<div class="card-action__inspection-type">
<div class="card-action__date--group">
<div class="card-action__date">
<label class="card-action__label" for="last-inspection-date">تاریخ</label>
<input type="text" asp-for="@Model.Debt.DebtDate" class="card-action__input date" placeholder="____/__/__">
</div>
<div class="card-action__price">
<label class="card-action__label" for="last-inspection-date">مبلغ</label>
<input type="text" asp-for="@Model.Debt.Amount" class="card-action__input" placeholder="">
<span class="card-action__price-rial">ریال</span>
</div>
</div>
</div>
<div class="card-action__upload" id="card-debt">
<div class="card-action__upload-icon">
<img src="~/assetsclient/images/icons/upload.png" style="width: 35px;" />
</div>
@if (Model.Debt.DebtFileMediaId != 0)
{
<button type="button" class="card-action__upload-btn remove-file-btn" data-type="debt">حذف فایل</button>
}
else
{
<button type="button" class="card-action__upload-btn choose-file-btn" data-type="debt">انتخاب فایل</button>
}
<input type="file" name="Debt.DebtFile" style="display: none;" data-type="debt">
<input type="hidden" class="mediaIds" asp-for="@Model.Debt.DebtFileMediaId" />
</div>
</div>
</div>
</div>
<div class="card-action @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "card-action__success" : "")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
<div class="card-action__title">تاییده کارفرما</div>
<div class="card-action__container">
<div class="card-action__container-right">
<div class="card-action__status @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "" : "card-action__status-success")">
<div class="card-action__status-icon">
<svg class="card-action__status-icon-svg d-none" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "none" : "block")">
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
</svg>
</div>
</div>
<div class="card-action__inspection-type">
<label class="card-action__checkbox">
<input type="checkbox" name="Approval.ApprovalStatus" class="WrittenVerbal" id="Written" @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "checked" : "") value="2" />
کاغذی
</label>
<label class="card-action__checkbox">
<input type="checkbox" name="Approval.ApprovalStatus" class="WrittenVerbal" id="Verbal" @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.VerbalApproval ? "checked" : "") value="1" />
اذنی
</label>
</div>
</div>
<div class="card-action__container-left">
<div id="descriptionSection" class="card-action__date disable">
<label class="card-action__label" for="description">توضیحات</label>
<textarea class="card-action__textarea" asp-for="@Model.Approval.Description" id="description"></textarea>
</div>
</div>
</div>
</div>
<div id="sendListSection" class="card-action @(Model.Inspection.Type == InsuranceListInspectionType.None || Model.Debt.Type == InsuranceListDebtType.None || Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.None ? "disable-blur" : "")">
<div class="card-action__title">ارسال لیست</div>
<div class="card-action__container">
<div class="card-action__container-right">
<div class="card-action__status @(Model.ConfirmSentList ? "card-action__status-success" : "")">
<div class="card-action__status-icon">
<svg class="card-action__status-icon-svg d-none" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.ConfirmSentList ? "block" : "none")">
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
</svg>
</div>
</div>
<div class="card-action__inspection-type">
<label class="card-action__checkbox">
<input name="ConfirmSentList" type="checkbox" @(Model.ConfirmSentList ? "checked" : "") value="true"/>
ارسال لیست به سازمان تامین اجتماعی انجام شد
</label>
</div>
</div>
</div>
</div>
</div>
<div class="modal__footer">
<button type="button" class="modal__button modal__button--cancel" data-dismiss="modal" aria-hidden="true">انصراف</button>
<button type="button" class="modal__button modal__button--success" onclick="SaveData()">ثبت</button>
</div>
</div>
</div>
</form>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var saveOperationsModal = "@Url.Page("./Index", "SaveOperationsModal")";
</script>
<script src="~/assetsadmin/page/insurancelist/js/operationsmodal.js?ver=@adminVersion"></script>

View File

@@ -51,8 +51,7 @@ namespace ServiceHost.Areas.Admin.Pages.Company.Workshops
SeniorInsuranceAccountList = accounts.Where(x => x.RoleId == 7).ToList(), SeniorInsuranceAccountList = accounts.Where(x => x.RoleId == 7).ToList(),
JuniorInsuranceAccountsList = accounts.Where(x => x.RoleId == 8).ToList(), JuniorInsuranceAccountsList = accounts.Where(x => x.RoleId == 8).ToList(),
InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle"), InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle"),
CutContractEndOfYear = IsActive.None };
};
var res = _workshopApplication.GetWorkshop(); var res = _workshopApplication.GetWorkshop();
var checkOk = res.Any(); var checkOk = res.Any();

View File

@@ -1,10 +1,457 @@
@page @page
@using _0_Framework.Application
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ServiceHost.Areas.Admin.Pages.Company.Workshops.EditWorkshopModel @model ServiceHost.Areas.Admin.Pages.Company.Workshops.EditWorkshopModel
@{ @{
string adminVersion = _0_Framework.Application.Version.AdminVersion; <link href="~/admintheme/css/workshop-create.css" rel="stylesheet" />
<link href="~/admintheme/css/workshop-create.css?ver=@adminVersion" rel="stylesheet" />
<style>
#titleHead {
font-size: 20px;
margin: 0 0 5px 0;
}
input[type=checkbox], input[type=radio]
{
accent-color: #495d2b;
}
#radio2, #radio3, #radio4 {
position:relative;
margin: 25px 0 0 0;
display:flex;
flex-direction:column;
justify-content:center
}
#radio2 h4, #radio3 h4,#radio4 h4{
font-size: 14px;
font-weight: 400;
position: absolute;
top: -24px;
background-color: white;
padding: 1px 3px;
}
#radio2 label, #radio3 label, #radio4 label{
font-size: 12px;
font-weight: 300;
margin: 0 0 0px 0;
}
.textFloat {
position:relative;
margin: 25px 0 0 0;
}
.textFloat h5{
font-size: 13px;
font-weight: 400;
position: absolute;
top: -10px;
background-color: white;
padding: 0;
margin: 0 20px;
}
.box {
height: 500px !important;
}
#form1 {
right: 0px;
}
#form2 {
left: 0px;
}
#form3 {
right: 0px;
}
#form4 {
right: 0px;
}
#progress {
width: 20%;
}
.btn-default.btn-on-2.active {
background-color: #00d554;
color: white;
}
.btn-default.btn-off-2.active {
background-color: #A7A7A7;
color: white;
}
.classifidedField1 {
margin: 7px;
border-radius: 15px;
border: 2px dotted #4b9082;
margin-top: 14px;
background-color: #88aba58a;
height: 90px;
}
.classifidedField1 input {
background-color: #ecfcfc !important;
}
.classifidedField1 label {
color: #0a4c53;
}
.classifidedField2 {
margin: 7px;
border: 1px solid #939393;
border-radius: 15px;
margin-top: 14px;
height: 230px;
}
.blured {
filter: blur(2px);
}
.cat {
background: #8fceb8;
padding: 7px 0px;
color: aliceblue;
width: 100.2%;
border: 1px solid #939393;
border-radius: 15px 15px 0px 0px;
position: relative;
right: -1px;
left: -6px;
top: -11px;
}
.cat1 {
padding: 7px 16px;
border-left: 1px solid #939393;
text-align: center;
}
.cat2 {
padding: 7px 140px;
border-left: 1px solid #939393;
text-align: center;
}
.cat3 {
padding: 7px 42px;
border-left: 1px solid #939393;
text-align: center;
}
.cat4 {
padding: 7px 38px;
border-left: 1px solid #939393;
text-align: center;
}
.cat5 {
padding: 7px 30px;
text-align: center;
}
.trContainer {
display: inline-block;
height: 190px;
width: 100.4%;
overflow-y: auto;
position: relative;
top: -8px;
left: 0px;
border-radius: 0px 0px 18px 18px;
}
.groupTr {
display: flex;
position: relative;
margin: 1px auto;
top: -3px;
padding: 5px 0px;
/* min-height: 44px; */
/* height: auto; */
background-color: #b8dfdf;
}
.groupTr input {
background-color: #ecfcfc !important;
}
.groupTr:nth-child(even) {
background-color: #aad5cd !important;
}
.groupTr:nth-child(even) select {
background-color: #ecfcf8 !important;
}
.groups {
width: 9.5%;
margin: 0px 5px;
text-align: center;
padding: 7px 9px;
color: #3aa892;
background: #cff3e75c;
border-radius: 8px;
}
.jobTitles {
width: 366px;
max-width: 366px;
overflow-y: hidden;
padding: 0px 3px;
z-index: 999;
}
.jobSalary {
width: 16.33%;
padding: 0px 3px;
direction: ltr;
}
.baseSalary {
width: 17%;
padding: 0px 3px;
direction: ltr;
}
.mabna {
width: 14.4%;
padding: 0px 3px;
direction: ltr;
}
.trContainer.hide-scrollbar::-webkit-scrollbar {
width: 0px;
}
.trContainer::-webkit-scrollbar {
width: 6px;
}
.trContainer::-webkit-scrollbar-track {
background-color: #3aa89200;
}
.trContainer::-webkit-scrollbar-thumb {
background-color: #3aa892;
border-radius: 10px;
}
.trContainer::-webkit-scrollbar-thumb:hover {
background-color: #1bba9a;
margin-right: 5px !important
}
.ul-search {
list-style: none;
display: revert;
width: 106%;
right: 2.6rem;
position: relative;
}
.ul-search li:last-of-type {
float: right;
}
.custom-select {
position: relative;
display: block;
width: 100%;
height: 100%;
padding: 5px 0px;
border-radius: 5px;
background-color: #fff;
text-align: left;
cursor: pointer;
border: 1px solid #ccc;
}
.options {
right: 0px !important;
border: 1px solid #0000002e;
border-top: 0;
width: 100% !important;
top: 13px;
position: relative;
z-index: 10;
margin: 0;
padding: 0;
list-style: none;
max-height: 156px;
overflow-y: scroll;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 13px;
}
.options::-webkit-scrollbar {
width: 6px;
}
.options::-webkit-scrollbar-track {
background-color: #8bd8ed42;
border-radius: 12px;
}
.options::-webkit-scrollbar-thumb {
background-color: #3159adb8;
border-radius: 12px;
}
.options::-webkit-scrollbar-thumb:hover {
background-color: #aaa;
}
.options.visible {
display: block;
}
.options li {
padding: 12px 20px 27px 20px;
box-shadow: 0 2px 2px 0 rgb(136 137 141), 0 -1px 3px 0 rgba(0, 0, 0, 0.12);
border-top: none;
background-color: #fff;
cursor: pointer;
}
.options li:hover {
background-color: #f5f5f5;
}
.input-text {
padding-right: 5px;
border: 0;
direction: rtl;
background: inherit;
}
.input-text {
width: 2.4rem;
}
.items-selected {
float: right;
border: 1px solid #a7a6a6;
background: #e5e5e5;
margin: 2px;
border-radius: 7px;
padding-right: 0px;
padding-left: 2px;
font-size: 13px;
color: #343434;
position: relative;
bottom: 3px;
}
.del-selected {
margin: 0px 4px;
color: #e11414;
font-size: 12px;
}
.select2-container .select2-search--inline {
float: right !important;
}
.name-right {
position: absolute;
right: 10px;
max-width: 23rem;
overflow: hidden;
white-space: nowrap !important;
direction: rtl;
}
.code-left {
position: absolute;
left: 10px;
}
.job-item {
position: relative;
}
.groupTr .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #f06f3d !important;
}
.groupTr .select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice {
color: #458c73 !important;
background-color: #d7f6e9 !important;
border-color: #d7f6e9 !important;
font-size: 13px !important;
}
#form5 {
display: inline-block;
}
.disabled {
filter: blur(1px);
}
</style>
@*select2 css start*@
<style>
.opt {
background-color: #f5f5f5;
border-radius: 10px;
text-align: right;
padding: 2px 5px;
text-overflow: ellipsis;
overflow-x: hidden;
width: 100%;
}
.opt:hover {
background-color: #d3f3f5 !important;
}
.selectDiv {
position: relative;
z-index: 2;
border-radius: 10px;
min-height: 20px;
max-height: 190px;
overflow: hidden scroll;
width: 100%;
background-color: rgb(255 255 255);
display: block;
box-shadow: 0px -1px 12px 0px rgba(0,0,0,.16), 2px 1px 10px 0 rgba(0,0,0,.12);
}
.selectedOption {
color: #04556a !important;
background-color: #e0f8ff !important;
}
.keyboardSelected {
color: #04556a !important;
background-color: #e0f8ff !important;
}
.handle-title {
display: flex;
align-items: center;
justify-content: space-between;
}
.handle-title a {
background-color: #1e293b;
color: #ffffff;
border-radius: 7px;
padding: 3px 5px;
font-size: 12px;
}
.handle-title a:hover {
color: #ffffff !important;
}
</style>
} }
<div class="container"> <div class="container">
@@ -223,11 +670,11 @@
<div class="col-md-4 col-sm-4 col-xs-12"> <div class="col-md-4 col-sm-4 col-xs-12">
<div class="form-group"> <div class="form-group">
@* <div class="neighborField"> @* <div class="neighborField">
<input type="text" asp-for="ZoneName" class="neighborInput form-control"> <input type="text" asp-for="ZoneName" class="neighborInput form-control">
<a class="addNeighbor"> <a class="addNeighbor">
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
</a> </a>
</div> *@ </div> *@
<div class="neighborField"> <div class="neighborField">
<input type="text" class="neighborInput form-control" disabled="disabled"> <input type="text" class="neighborInput form-control" disabled="disabled">
@@ -319,12 +766,12 @@
<div style="@(Model.HasPermissionContract ? "" : "display: none;")"> <div style="@(Model.HasPermissionContract ? "" : "display: none;")">
<div class="col-lg-12 col-md-12 col-xs-12"> <div class="col-lg-12 col-md-12 col-xs-12">
@* <div class="" style="margin-top: 5px;"> @* <div class="" style="margin-top: 5px;">
<label>تعیین سطح دسترسی برای قرارداد </label> <label>تعیین سطح دسترسی برای قرارداد </label>
<select class="form-control select-city" multiple asp-for="@Model.Command.AccountIdsList" asp-items='new SelectList(Model.Command.AccountsList, "Id", "Fullname")'> <select class="form-control select-city" multiple asp-for="@Model.Command.AccountIdsList" asp-items='new SelectList(Model.Command.AccountsList, "Id", "Fullname")'>
</select> </select>
</div> *@ </div> *@
<div class="" style="display: flex; align-items: center;"> <div class="" style="display: flex; align-items: center;">
<input type="checkbox" asp-for="Command.WorkshopHolidayWorking" class="form-control" style="width: 15px;margin: 0 0 0 10px;" /> <input type="checkbox" asp-for="Command.WorkshopHolidayWorking" class="form-control" style="width: 15px;margin: 0 0 0 10px;"/>
<label asp-for="Command.WorkshopHolidayWorking" style="margin: 0;">این کارگاه در ایام تعطیلات رسمی باز است</label> <label asp-for="Command.WorkshopHolidayWorking" style="margin: 0;">این کارگاه در ایام تعطیلات رسمی باز است</label>
</div> </div>
</div> </div>
@@ -381,106 +828,32 @@
</div> </div>
</div> </div>
<div class="col-xs-12" style="margin: 13px 0 0 0;">
<div class="card area-workshop-3">
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="createContract" asp-for="Command.CreateContract" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
ایجاد قرارداد
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="signContract" asp-for="Command.SignContract" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
امضا قرارداد
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="createCheckout" asp-for="Command.CreateCheckout" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
ایجاد تصفیه حساب
</label>
<label class="circle-checkbox">
<input type="checkbox" class="real-checkbox" data-role="signCheckout" asp-for="Command.SignCheckout" />
<span class="fake-checkbox">
<svg class="icon check-icon" viewBox="0 0 24 24">
<path d="M5 13l4 4L19 7" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<svg class="icon cross-icon" viewBox="0 0 24 24">
<path d="M6 6L18 18M6 18L18 6" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</span>
امضا تصفیه حساب
</label>
</div>
</div>
<div class="col-xs-12 area-workshop-2"> <div class="col-xs-12 area-workshop-2">
<div class="card textFloat"> <div class="card textFloat">
<h5 class="title-contract">لطفا مدت قرارداد خود را انتخاب کنید :</h5> <h5 class="title-contract">لطفا مدت قرارداد خود را انتخاب کنید :</h5>
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 col-xs-12 spanBox1"> <div class="col-md-12 col-sm-12 col-xs-12 spanBox1">
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="1">1 ماهه</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">1 ماهه</span>
</div> </div>
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="2">2 ماهه</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">2 ماهه</span>
</div> </div>
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="3">3 ماهه</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">3 ماهه</span>
</div> </div>
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="6">6 ماهه</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">6 ماهه</span>
</div> </div>
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="12">1 ساله</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">1 ساله</span>
</div> </div>
<div> <div>
<span class="btn btn-deactive waves-effect waves-light contractDuration" data-duration="permanent">دائمی</span> <span class="btn btn-deactive waves-effect waves-light contractDuration">دائمی</span>
</div> </div>
<input type="hidden" id="asp-contract-hidden" asp-for="Command.ContractTerm" /> <input type="hidden" id="asp-contract-hidden" asp-for="Command.ContractTerm" />
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<input type="hidden" id="CutContractEndOfYear" asp-for="Command.CutContractEndOfYear" />
<div style="display: flex; align-items: center; gap: 14px;">
آیا قراردادهای بالای یک ماه منتهی به پایان سال باشد یا نباشد؟
<div style="display: flex; align-items: center; gap: 15px;">
<label class="@(Model.Command.CutContractEndOfYear == IsActive.None ? "disable" : "")" style="display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; margin: 0;">
<input type="checkbox" class="form-control single-check" style="margin: 0;" value="@IsActive.True" @(Model.Command.CutContractEndOfYear == IsActive.True ? "checked" : "")/>
باشد
</label>
<label class="@(Model.Command.CutContractEndOfYear == IsActive.None ? "disable" : "")" style="display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; margin: 0;">
<input type="checkbox" class="form-control single-check" style="margin: 0;" value="@IsActive.False" @(Model.Command.CutContractEndOfYear == IsActive.False ? "checked" : "")/>
نباشد
</label>
</div>
</div>
</div>
</div>
</div> </div>
<div class="card textFloat"> <div class="card textFloat">
<h5>در صورت تمایل به محاسبه ی عناوین ذیل در فیش حقوقی، گزینه های موردنظر را فعال نمایید</h5> <h5>در صورت تمایل به محاسبه ی عناوین ذیل در فیش حقوقی، گزینه های موردنظر را فعال نمایید</h5>
@@ -510,11 +883,11 @@
<label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutOvertime" class="checkboxes"> <span>اضافه کار فیش حقوقی در لیست بیمه محاسبه گردد</span></label> <label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutOvertime" class="checkboxes"> <span>اضافه کار فیش حقوقی در لیست بیمه محاسبه گردد</span></label>
</div> </div>
<div> <div>
<label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutFamilyAllowance" class="checkboxes"><span class="m-r-5">حق عائله مندی فیش حقوقی در لیست بیمه محاسبه گردد </span></label> <label class="input-label"><input type="checkbox" asp-for="Command.InsuranceCheckoutFamilyAllowance" class="checkboxes"><span class="m-r-5">حق عائله مندی فیش حقوقی در لیست بیمه محاسبه گردد </span></label>
</div> </div>
</div> </div>
</div> </div>
<div class="row card"> <div class="row card">
<div class="col-md-6 col-xs-12"> <div class="col-md-6 col-xs-12">
@@ -528,7 +901,7 @@
<div> <div>
<label class="form-control-label"><input type="checkbox" value="Familylist" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه خانوادگی</label> <label class="form-control-label"><input type="checkbox" value="Familylist" class="myCheckbox checkboxes sendList"> ارسال لیست بیمه کارگاه خانوادگی</label>
</div> </div>
<input type="hidden" asp-for="Command.TypeOfInsuranceSend" id="asp-hidden" /> <input type="hidden" asp-for="Command.TypeOfInsuranceSend" id="asp-hidden"/>
</div> </div>
<div class="col-md-3 col-xs-12 disabled" id="myDiv4"> <div class="col-md-3 col-xs-12 disabled" id="myDiv4">
<label class="input-label">کد کارگاهی بیمه</label> <label class="input-label">کد کارگاهی بیمه</label>
@@ -625,12 +998,12 @@
<script> <script>
$("#hasRollCall").on("click", function () { $("#hasRollCall").on("click", function () {
if ($(this).is(":checked")) { if ($(this).is(":checked")) {
$("#hasChekoutService").removeAttr("disabled"); $("#hasChekoutService").removeAttr("disabled");
} else { }else{
$("#hasChekoutService").attr("disabled", "disabled"); $("#hasChekoutService").attr("disabled", "disabled");
} }
}); });
</script> </script>
</div> </div>
</div> </div>
@@ -788,20 +1161,20 @@
</div> </div>
<div class="col-md-12 col-sm-12 col-xs-12"> <div class="col-md-12 col-sm-12 col-xs-12">
@* <div class="card"> @* <div class="card">
<div class="d-flex align-items-center text-white"> <div class="d-flex align-items-center text-white">
<div class="header">گروه بندی</div> <div class="header">گروه بندی</div>
<div class="header">عناوین شغلی</div> <div class="header">عناوین شغلی</div>
<div class="header">مزد شغل</div> <div class="header">مزد شغل</div>
<div class="header">مزد سنوات</div> <div class="header">مزد سنوات</div>
<div class="header">مزد مبنا</div> <div class="header">مزد مبنا</div>
</div> </div>
<div class="d-flex align-items-center text-white"> <div class="d-flex align-items-center text-white">
<div class="row-col">گروه بندی</div> <div class="row-col">گروه بندی</div>
<div class="row-col">عناوین شغلی</div> <div class="row-col">عناوین شغلی</div>
<div class="row-col">مزد شغل</div> <div class="row-col">مزد شغل</div>
<div class="row-col">مزد سنوات</div> <div class="row-col">مزد سنوات</div>
<div class="row-col">مزد مبنا</div> <div class="row-col">مزد مبنا</div>
</div> </div>
</div> *@ </div> *@
</div> </div>
@@ -853,4 +1226,4 @@
var employerIdList = Number(@Model.Command.EmployerIdList[0]); var employerIdList = Number(@Model.Command.EmployerIdList[0]);
</script> </script>
<script src="~/AssetsAdmin/page/Workshop/js/EditWorkshopAdmin.js?ver=@adminVersion"></script> <script src="~/AssetsAdmin/page/Workshop/js/EditWorkshopAdmin.js"></script>

View File

@@ -60,14 +60,6 @@
.sweet-alert { .sweet-alert {
font-family: 'IranSans' !important font-family: 'IranSans' !important
} }
table.dataTable tbody tr {
transition: all .1s ease-in
}
table.dataTable tbody tr:hover {
background-color: #d5e5e5 !important;
}
</style> </style>
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet"> <link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
<link href="~/AdminTheme/assets/css/alert.css" rel="stylesheet"> <link href="~/AdminTheme/assets/css/alert.css" rel="stylesheet">
@@ -135,8 +127,8 @@
} }
<div> <div>
<p class="fw-bold text-nowrap text-right" style="font-size: 14px;color: #7b7b7b;font-weight: 600;">@currentAccount.Fullname</p> <p class="text-right fw-bold text-nowrap" style="font-size: 14px;color: #7b7b7b;font-weight: 600;">@currentAccount.Fullname</p>
<p class="fw-bold text-nowrap text-right">@currentAccount.Role</p> <p class="text-right fw-bold text-nowrap">@currentAccount.Role</p>
</div> </div>
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="10" viewBox="0 0 12 10" fill="none"> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="10" viewBox="0 0 12 10" fill="none">
@@ -170,7 +162,7 @@
<i class="md md-notifications"></i> <span class="badge badge-xs badge-danger">3</span> <i class="md md-notifications"></i> <span class="badge badge-xs badge-danger">3</span>
</a> </a>
<ul class="dropdown-menu dropdown-menu-lg"> <ul class="dropdown-menu dropdown-menu-lg">
<li class="notifi-title text-center">Notification</li> <li class="text-center notifi-title">Notification</li>
<li class="list-group">--> <li class="list-group">-->
<!-- list item--> <!-- list item-->
<!--<a href="javascript:void(0);" class="list-group-item"> <!--<a href="javascript:void(0);" class="list-group-item">
@@ -280,8 +272,8 @@
</div> </div>
<!-- END wrapper --> <!-- END wrapper -->
<script> <script>
var resizefunc = []; var resizefunc = [];
</script> </script>
<div id="MainModal" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> <div id="MainModal" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
@@ -309,10 +301,7 @@
<script src="~/AdminTheme/assets/fastclick/fastclick.js"></script> <script src="~/AdminTheme/assets/fastclick/fastclick.js"></script>
<script src="~/AdminTheme/assets/jquery-slimscroll/jquery.slimscroll.js"></script> <script src="~/AdminTheme/assets/jquery-slimscroll/jquery.slimscroll.js"></script>
<script src="~/AdminTheme/assets/jquery-blockui/jquery.blockUI.js"></script> <script src="~/AdminTheme/assets/jquery-blockui/jquery.blockUI.js"></script>
<script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script>
<script src="~/assetsclient/js/services/url-params-builder.js?ver=@Version.AdminVersion"></script>
<script src="~/assetsclient/js/services/jalali-date-validator.js?ver=@Version.AdminVersion"></script>
<!-- sweet alerts --> <!-- sweet alerts -->
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script> <script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
@@ -377,281 +366,261 @@
</script>*@ </script>*@
<script> <script>
$.fn.modal.Constructor.prototype.enforceFocus = function () { }; $.fn.modal.Constructor.prototype.enforceFocus = function () { };
$(document).ready(function () { $(document).ready(function () {
$(".select-city").select2({ $(".select-city").select2({
language: "fa", language: "fa",
dir: "rtl" dir: "rtl"
}); });
$('.has_sub.active').find(".md-add").removeClass("md-add").addClass("md-remove"); $('.has_sub.active').find(".md-add").removeClass("md-add").addClass("md-remove");
$('.has_sub.active').find('.MainMenuItem').addClass('active'); $('.has_sub.active').find('.MainMenuItem').addClass('active');
}); })
</script> </script>
<script> <script>
function convertPersianNumbersToEnglish(input) { var antiForgeryTokenLayout = $('@Html.AntiForgeryToken()').val();
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g]; //vafa After Modal fix
var arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g]; // $('#MainModal').on('hidden.bs.modal', function () {
// $("#ModalContent").html("");
var str = input; // $("#printSection").html("");
for (var i = 0; i < 10; i++) { // });
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i); var url = window.location.href.split('?')[0];
} var url2 = window.location.href.split('#')[0];
return str;
}
var antiForgeryTokenLayout = $('@Html.AntiForgeryToken()').val();
//vafa After Modal fix
// $('#MainModal').on('hidden.bs.modal', function () {
// $("#ModalContent").html("");
// $("#printSection").html("");
// });
var url = window.location.href.split('?')[0];
var url2 = window.location.href.split('#')[0];
$('.btnDashboard').filter(function() { $('.btnDashboard').filter(function() {
if (this.href == url || this.href == url2) { if (this.href == url || this.href == url2) {
$(this).addClass('active'); $(this).addClass('active');
}; };
}); });
$('.btnWorkFlow').filter(function () { $('.clik').filter(function() {
if (this.href === url || this.href === url2) { if (this.href == url || this.href == url2) {
$(this).addClass('active'); $(".sdf1").slideDown(1);
}; /*$(".wav").addClass("subdrop");*/
}); $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
$('.clik').filter(function() { };
if (this.href == url || this.href == url2) { });
$(".sdf1").slideDown(1); $('.clik2').filter(function() {
/*$(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active'); $(".sdf2").slideDown(350);
}; /* $(".wav").addClass("subdrop");*/
}); $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
$('.clik2').filter(function() { };
if (this.href == url || this.href == url2) { });
$(".sdf2").slideDown(350); $('.clik3').filter(function () {
/* $(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active'); $(".sdf3").slideDown(350);
}; /* $(".wav").addClass("subdrop");*/
}); $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
$('.clik3').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf3").slideDown(350); $('.clik4').filter(function () {
/* $(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active'); $(".sdf4").slideDown(350);
}; /* $(".wav").addClass("subdrop");*/
}); $(this).closest("li").addClass('active');
$('.clik4').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf4").slideDown(350); $('.clik5').filter(function () {
/* $(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).closest("li").addClass('active'); $(".sdf5").slideDown(350);
}; /*$(".wav").addClass("subdrop");*/
}); $(this).closest("li").addClass('active');
$('.clik5').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf5").slideDown(350); $('.clik6').filter(function () {
/*$(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).closest("li").addClass('active'); $(".sdf6").slideDown(350);
}; /*$(".wav").addClass("subdrop");*/
}); $(this).closest("li").addClass('active');
$('.clik6').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf6").slideDown(350); $('.clik7').filter(function () {
/*$(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).closest("li").addClass('active'); $(".sdf7").slideDown(350);
}; /*$(".wav").addClass("subdrop");*/
}); $(this).closest("li").addClass('active');
$('.clik7').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf7").slideDown(350); $('.clik8').filter(function () {
/*$(".wav").addClass("subdrop");*/ if (this.href == url || this.href == url2) {
$(this).closest("li").addClass('active'); $(".sdf8").slideDown(350);
}; /*$(".wav").addClass("subdrop");*/
}); $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
$('.clik8').filter(function () { };
if (this.href == url || this.href == url2) { });
$(".sdf8").slideDown(350);
/*$(".wav").addClass("subdrop");*/
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
};
});
$('.clik9').filter(function () {
if (this.href == url || this.href == url2) {
$(".sdf9").slideDown(350);
/*$(".wav").addClass("subdrop");*/
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
};
});
$(document).ready(function () {
$(document).on('click', function (e) {
var $target = $(e.target);
if (!$target.closest('.dropdown').length &&
$('.dropdown-menu').is(':visible')) {
$('.dropdown-menu').removeClass('show');
}
});
$('.profile-box').on('click', function (e) { $(document).ready(function () {
e.stopPropagation(); $(document).on('click', function (e) {
var $dropdownMenu = $(this).siblings('.dropdown-menu'); var $target = $(e.target);
if ($dropdownMenu.hasClass('show')) { if (!$target.closest('.dropdown').length &&
$dropdownMenu.removeClass('show'); $('.dropdown-menu').is(':visible')) {
} else { $('.dropdown-menu').removeClass('show');
$('.dropdown-menu').removeClass('show'); }
$dropdownMenu.addClass('show'); });
}
});
});
//$('ul.sdf3 a').filter(function() { $('.profile-box').on('click', function (e) {
// if (this.href == url || this.href == url2) { e.stopPropagation();
var $dropdownMenu = $(this).siblings('.dropdown-menu');
if ($dropdownMenu.hasClass('show')) {
$dropdownMenu.removeClass('show');
} else {
$('.dropdown-menu').removeClass('show');
$dropdownMenu.addClass('show');
}
});
});
//$('ul.sdf3 a').filter(function() {
// if (this.href == url || this.href == url2) {
// $(".sdf1").slideDown(350); // $(".sdf1").slideDown(350);
// $(".wav").addClass("subdrop"); // $(".wav").addClass("subdrop");
// $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active'); // $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
// }; // };
//}); //});
//$(".waves-effect").click(function () { //$(".waves-effect").click(function () {
// if ($("div, ul, li").hasClass("active")) { // if ($("div, ul, li").hasClass("active")) {
// $("div, ul, li").removeClass("active"); // $("div, ul, li").removeClass("active");
// } // }
//}); //});
_RefreshTaskCountMenu(); _RefreshTaskCountMenu();
function _RefreshTaskCountMenu() { function _RefreshTaskCountMenu() {
$.ajax({ $.ajax({
async: true, async: true,
dataType: 'json', dataType: 'json',
url: '/AdminNew?handler=LayoutCountTask', url: '/AdminNew?handler=LayoutCountTask',
headers: { "RequestVerificationToken": antiForgeryTokenLayout }, headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET', type: 'GET',
success: function (response) { success: function (response) {
if (response.success) { if (response.success) {
if (response.data === 0) { if (response.data === 0) {
$('#_taskCountSection').hide(); $('#_taskCountSection').hide();
$('#_taskCount').hide(); $('#_taskCount').hide();
$('#spinnerTask').hide(); $('#spinnerTask').hide();
} else { } else {
$('#_taskCountSection').show(); $('#_taskCountSection').show();
$('#spinnerTask').hide(); $('#spinnerTask').hide();
$('#_taskCount').show(); $('#_taskCount').show();
$('#_taskCount').text(response.data); $('#_taskCount').text(response.data);
} }
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error(xhr.responseText); console.error(xhr.responseText);
} }
}); });
} }
_RefreshTicketCountMenu(); _RefreshTicketCountMenu();
function _RefreshTicketCountMenu() { function _RefreshTicketCountMenu() {
$.ajax({ $.ajax({
async: true, async: true,
dataType: 'json', dataType: 'json',
url: '/AdminNew?handler=LayoutCountTicket', url: '/AdminNew?handler=LayoutCountTicket',
headers: { "RequestVerificationToken": antiForgeryTokenLayout }, headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET', type: 'GET',
success: function (response) { success: function (response) {
if (response.success) { if (response.success) {
if (response.data === 0) { if (response.data === 0) {
$('#_ticketCountSection').hide(); $('#_ticketCountSection').hide();
$('#spinnerTicket').hide(); $('#spinnerTicket').hide();
$('#_ticketCount').hide(); $('#_ticketCount').hide();
} else { } else {
$('#_ticketCountSection').show(); $('#_ticketCountSection').show();
$('#spinnerTicket').hide(); $('#spinnerTicket').hide();
$('#_ticketCount').show(); $('#_ticketCount').show();
$('#_ticketCount').text(response.data); $('#_ticketCount').text(response.data);
} }
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error(xhr.responseText); console.error(xhr.responseText);
} }
}); });
} }
_RefreshWorkFlowCountMenu(); _RefreshWorkFlowCountMenu();
function _RefreshWorkFlowCountMenu() { function _RefreshWorkFlowCountMenu() {
$.ajax({ $.ajax({
async: true, async: true,
dataType: 'json', dataType: 'json',
url: '/AdminNew?handler=LayoutCountWorkFlow', url: '/AdminNew?handler=LayoutCountWorkFlow',
headers: { "RequestVerificationToken": antiForgeryTokenLayout }, headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET', type: 'GET',
success: function (response) { success: function (response) {
if (response.success) { if (response.success) {
if (response.data === 0) { if (response.data === 0) {
$('#_workFlowCountSection').hide(); $('#_workFlowCountSection').hide();
$('#spinnerWorkFlow').hide(); $('#spinnerWorkFlow').hide();
$('#_workFlowCount').hide(); $('#_workFlowCount').hide();
} else { } else {
$('#_workFlowCountSection').show(); $('#_workFlowCountSection').show();
$('#spinnerWorkFlow').hide(); $('#spinnerWorkFlow').hide();
$('#_workFlowCount').show(); $('#_workFlowCount').show();
$('#_workFlowCount').text(response.data); $('#_workFlowCount').text(response.data);
} }
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
console.error(xhr.responseText); console.error(xhr.responseText);
} }
}); });
} }
_RefreshCheckerCountMenu(); _RefreshCheckerCountMenu();
function _RefreshCheckerCountMenu() { function _RefreshCheckerCountMenu() {
$.ajax({ $.ajax({
//async: true, //async: true,
dataType: 'json', dataType: 'json',
url: '/AdminNew?handler=LayoutCountChecker', url: '/AdminNew?handler=LayoutCountChecker',
headers: { "RequestVerificationToken": antiForgeryTokenLayout }, headers: { "RequestVerificationToken": antiForgeryTokenLayout },
type: 'GET', type: 'GET',
success: function (response) { success: function (response) {
if (response.success) { console.log(response);
if (response.data === 0) {
$('#_checkerCountSection').hide();
$('#_checkerCount').hide();
$('#spinnerChecker').hide();
} else {
$('#_checkerCountSection').show();
$('#spinnerChecker').hide();
$('#_checkerCount').show();
$('#_checkerCount').text(response.data);
}
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
// Override the global fetch function to handle errors if (response.success) {
$.ajaxSetup({ if (response.data === 0) {
error: function (jqXHR, textStatus, errorThrown) { $('#_checkerCountSection').hide();
if (jqXHR.status === 500) { $('#_checkerCount').hide();
try { $('#spinnerChecker').hide();
const errorData = jqXHR.responseJSON; } else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', errorData.message || "خطای سمت سرور"); $('#_checkerCountSection').show();
} catch (e) { $('#spinnerChecker').hide();
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطای سمت سرور"); $('#_checkerCount').show();
console.error("Error parsing response:", e); $('#_checkerCount').text(response.data);
} }
} }
} },
}); error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
// Override the global fetch function to handle errors
$.ajaxSetup({
error: function (jqXHR, textStatus, errorThrown) {
if (jqXHR.status === 500) {
try {
const errorData = jqXHR.responseJSON;
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', errorData.message || "خطای سمت سرور");
} catch (e) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطای سمت سرور");
console.error("Error parsing response:", e);
}
}
}
});
</script> </script>
</body> </body>

View File

@@ -23,8 +23,6 @@
} }
</style> </style>
var accountId = AuthHelper.CurrentAccountId();
} }
<div class="left side-menu"> <div class="left side-menu">
<div class="sidebar-inner slimscrollleft"> <div class="sidebar-inner slimscrollleft">
@@ -179,24 +177,19 @@
</svg> </svg>
حضورغیاب </a> حضورغیاب </a>
</li> </li>
@if (accountId is 2 or 3) <li permission="306">
{ <a class="clik3" href="/AdminNew/Company/Bank">
<li permission="307"> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<a class="clik3" href="/AdminNew/Company/Bank"> <circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> </svg>
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/> بانک ها </a>
</svg> </li>
بانک ها </a> <li permission="306"><a class="clik3" asp-page="/Company/SmsResult/Index">
</li> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<li permission="307"> <circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
<a class="clik3" asp-page="/Company/SmsResult/Index"> </svg>
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> گزارش پیامک خودکار</a>
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/> </li>
</svg>
گزارش پیامک خودکار</a>
</li>
}
<li permission="301"><a class="clik3" asp-page="/Company/YearlySalaryTitles/Index"> <li permission="301"><a class="clik3" asp-page="/Company/YearlySalaryTitles/Index">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/> <circle cx="6.5" cy="6.5" r="6.5" fill="white"/>

View File

@@ -5,13 +5,13 @@
} }
<h1>Upload File</h1> <h1>Upload File</h1>
<form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data"> @* <form asp-page-handler="Upload" id="1" method="post" enctype="multipart/form-data">
<div> <div>
<label asp-for="File">Choose a file:</label> <label asp-for="File">Choose a file:</label>
<input asp-for="File" type="file" required> <input asp-for="File" type="file" required>
</div> </div>
<button type="submit">Upload</button> <button type="submit">Upload</button>
</form> </form> *@
<form asp-page-handler="ShiftDate" id="8" method="post"> <form asp-page-handler="ShiftDate" id="8" method="post">

View File

@@ -21,6 +21,7 @@
<link href="~/AssetsClient/libs/font-awesome/css/font-awesome.min.css?ver=@Version.AdminVersion" rel="stylesheet" /> <link href="~/AssetsClient/libs/font-awesome/css/font-awesome.min.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/AdminTheme/assets/ionicon/css/ionicons.min.css" rel="stylesheet" /> <link href="~/AdminTheme/assets/ionicon/css/ionicons.min.css" rel="stylesheet" />
<link href="~/AssetsClient/css/material-design-iconic-font.min.css?ver=@Version.AdminVersion" rel="stylesheet" /> <link href="~/AssetsClient/css/material-design-iconic-font.min.css?ver=@Version.AdminVersion" rel="stylesheet" />
<link href="~/AssetsClient/libs/select2/css/select2.min.css" rel="stylesheet" /> <link href="~/AssetsClient/libs/select2/css/select2.min.css" rel="stylesheet" />
<script src="~/assetsadminnew/assets/js/jquery-3.7.1.min.js"></script> <script src="~/assetsadminnew/assets/js/jquery-3.7.1.min.js"></script>
@@ -34,7 +35,7 @@
<partial name="_Menu" /> <partial name="_Menu" />
<partial name="_header" /> <partial name="_header" />
<div class="content-container p-2"> <div class="p-2 content-container">
<div class="container-fluid"> <div class="container-fluid">
@RenderBody() @RenderBody()
</div> </div>
@@ -45,7 +46,7 @@
<script src="~/assetsadminnew/assets/js/bootstrap.bundle.min.js"></script> <script src="~/assetsadminnew/assets/js/bootstrap.bundle.min.js"></script>
<script src="~/AssetsClient/libs/select2/js/select2.js"></script> <script src="~/AssetsClient/libs/select2/js/select2.js"></script>
<script src="~/AssetsClient/libs/select2/js/i18n/fa.js"></script> <script src="~/AssetsClient/libs/select2/js/i18n/fa.js"></script>
<script src="~/assetsadminnew/assets/js/jquery.mask_1.14.16.min.js"></script> <script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/assetsadminnew/assets/js/datevalidation.js"></script> <script src="~/assetsadminnew/assets/js/datevalidation.js"></script>
@@ -58,10 +59,11 @@
<script src="~/AdminTheme/assets/notifications/notify.min.js"></script> <script src="~/AdminTheme/assets/notifications/notify.min.js"></script>
<script src="~/AdminTheme/assets/notifications/notify-metro.js"></script> <script src="~/AdminTheme/assets/notifications/notify-metro.js"></script>
<script src="~/AdminTheme/assets/notifications/notifications.js"></script> <script src="~/AdminTheme/assets/notifications/notifications.js"></script>
<script src="~/assetsadminnew/sidbar_adminnew/sidebar_admin.js"></script> <script src="~/assetsadminnew/sidbar_adminnew/sidebar_admin.js"></script>
<script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script> <script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script>
@* <script src="~/assetsclient/js/smooth-scrollbar.js"></script> *@ @* <script src="~/assetsclient/js/smooth-scrollbar.js"></script> *@
<script> <script>

View File

@@ -3,7 +3,7 @@
@inject ITicketAccessAccountRepository TicketAccessAccount; @inject ITicketAccessAccountRepository TicketAccessAccount;
@inject _0_Framework.Application.IAuthHelper AuthHelper; @inject _0_Framework.Application.IAuthHelper AuthHelper;
@{ @{
var accountId = AuthHelper.CurrentAccountId();
<style> <style>
.showCount span { .showCount span {
background-color: #dd2a2a; background-color: #dd2a2a;
@@ -241,25 +241,21 @@
</svg> </svg>
حضورغیاب </a> حضورغیاب </a>
</li> </li>
@if (accountId is 2 or 3) <li permission="306">
{ <a class="clik3" href="/AdminNew/Company/Bank">
<li permission="307"> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<a class="clik3" href="/AdminNew/Company/Bank"> <circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> </svg>
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/> بانک ها </a>
</svg> </li>
بانک ها </a> <li permission="306">
</li> <a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index">
<li permission="307"> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
<a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index"> <circle cx="6.5" cy="6.5" r="6.5" fill="white" />
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> </svg>
<circle cx="6.5" cy="6.5" r="6.5" fill="white" /> گزارش پیامک خودکار
</svg> </a>
گزارش پیامک خودکار </li>
</a>
</li>
}
<li permission="301"> <li permission="301">
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index"> <a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;"> <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">

View File

@@ -233,7 +233,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOne(long id) public IActionResult OnGetPrintOne(long id)
{ {
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault(); var res = _checkoutApplication.PrintOne(id);
if (res.HasRollCall) if (res.HasRollCall)
return Partial("PrintOneRollCall", res); return Partial("PrintOneRollCall", res);
@@ -246,7 +246,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.Checkouts
public IActionResult OnGetPrintOneMobile(long id) public IActionResult OnGetPrintOneMobile(long id)
{ {
var res = _checkoutApplication.PrintAll([id]).FirstOrDefault(); var res = _checkoutApplication.PrintOne(id);
if (res.HasRollCall) if (res.HasRollCall)
return Partial("PrintOneRollCall", res); return Partial("PrintOneRollCall", res);

View File

@@ -1,8 +1,6 @@
@page @page
@using _0_Framework.Application
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel @model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
@inject _0_Framework.Application.IAuthHelper authHelper
@{ @{
string clientVersion = _0_Framework.Application.Version.StyleVersion; string clientVersion = _0_Framework.Application.Version.StyleVersion;
ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین"; ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین";
@@ -209,9 +207,6 @@
// check and show modal Camera Account And Workshop Setting // check and show modal Camera Account And Workshop Setting
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`; var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`; var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
var hasActiveDeActvePersmission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountActivationBtnPermissionCode) ? "true" : "false");
var hasEditCameraAccountPermission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountEditPermissionCode) ? "true" : "false");
</script> </script>
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script> <script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
} }

View File

@@ -360,10 +360,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
message = createRollCallEmployeeStatus.Message, message = createRollCallEmployeeStatus.Message,
}); });
} }
_rollCallEmployeeStatusApplication.SyncRollCallEmployeeWithLeftWork(result.SendId); }
else
}
else
{ {
if ( rollCallEmployee.Statuses == null || rollCallEmployee.Statuses?.Any(x => x.StartDateGr <= DateTime.Now.Date && x.EndDateGr >= DateTime.Now.Date)== false) if ( rollCallEmployee.Statuses == null || rollCallEmployee.Statuses?.Any(x => x.StartDateGr <= DateTime.Now.Date && x.EndDateGr >= DateTime.Now.Date)== false)
{ {

View File

@@ -100,7 +100,7 @@
<div class="card p-0"> <div class="card p-0">
<div class="card-section-btn bg-white"> <div class="card-section-btn bg-white">
<div class="content btn-group"> <div class="content btn-group">
<a href="/apk/android?@Guid.NewGuid()" type="button" class="btn-download-android d-flex align-items-center justify-content-center"> <a href="/apk/android" type="button" class="btn-download-android d-flex align-items-center justify-content-center">
<svg width="30" height="30" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg"> <svg width="30" height="30" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g> <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g> <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

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