Compare commits
77 Commits
Fix/LeftWo
...
Fix/RollCa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbf367677c | ||
|
|
8e8e9ef5de | ||
|
|
1e18fe1067 | ||
|
|
d1aef862cf | ||
|
|
fc18985334 | ||
|
|
92d36f2966 | ||
|
|
0c6a8821ac | ||
|
|
4b9d39f1e7 | ||
|
|
9e5e7b57c7 | ||
|
|
a6984e5f1b | ||
|
|
fe8eb5d92b | ||
|
|
24e661252c | ||
|
|
e7d5716317 | ||
|
|
a6be044dbb | ||
|
|
c91f7e7a90 | ||
|
|
42de15b3db | ||
|
|
ffcfb4ea3f | ||
|
|
a49e2dbb75 | ||
|
|
d8cd33732a | ||
|
|
5aa714e81d | ||
|
|
6eec454685 | ||
|
|
13cad28356 | ||
|
|
9cdb922aa1 | ||
|
|
6699909b2f | ||
|
|
718a7d42b7 | ||
|
|
9637b6a581 | ||
|
|
ec29d3b869 | ||
|
|
4648113a28 | ||
|
|
f4f6fd1bf6 | ||
|
|
d9b7245cee | ||
|
|
85bec9d7fb | ||
|
|
f93d0b7e89 | ||
|
|
f8f7e7d3cf | ||
|
|
e159738b3d | ||
|
|
ebde36ad8d | ||
|
|
6f160a85ab | ||
|
|
ebaef13c4d | ||
|
|
a29e148753 | ||
|
|
625200bed1 | ||
|
|
4e81b6a2ef | ||
|
|
e03aabf88b | ||
|
|
d1158b95cb | ||
|
|
dbc73509b5 | ||
|
|
b6ac3073d3 | ||
|
|
9592960a40 | ||
|
|
4ec4935a1d | ||
|
|
e423df6fbb | ||
|
|
7bc7cd3422 | ||
|
|
dec934214d | ||
|
|
dd922a72d5 | ||
|
|
76f32c5c38 | ||
|
|
8f015aa124 | ||
|
|
1a8886be50 | ||
|
|
cf6f677816 | ||
|
|
366d42dec9 | ||
|
|
5bce350701 | ||
|
|
d322f2b8db | ||
|
|
cd83ca4379 | ||
|
|
edc017b4d4 | ||
|
|
4a0153e1e8 | ||
|
|
7f9a2ac597 | ||
|
|
f9298e1320 | ||
|
|
ce088fc432 | ||
|
|
3e02cd711f | ||
|
|
64dffd6d25 | ||
|
|
ffdc71401e | ||
|
|
21f8a399b4 | ||
|
|
cad2c152e5 | ||
|
|
247e2f2069 | ||
|
|
cb845afdf6 | ||
|
|
530a263fd8 | ||
|
|
aba8960b1d | ||
|
|
e2ba7d9450 | ||
|
|
a316b2a5f1 | ||
|
|
4b045440c4 | ||
|
|
af30c7f088 | ||
|
|
d95ca28cd4 |
@@ -245,21 +245,24 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
#region Pooya
|
||||
|
||||
public (long Id, UserType userType) GetUserTypeWithId()
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous);
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount);
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
return (id, UserType.Admin);
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
|
||||
return (id, UserType.Client);
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -23,5 +23,5 @@ public interface IAuthHelper
|
||||
long CurrentSubAccountId();
|
||||
string GetWorkshopSlug();
|
||||
string GetWorkshopName();
|
||||
(long Id, UserType userType) GetUserTypeWithId();
|
||||
(long Id, UserType userType, long roleId) GetUserTypeWithId();
|
||||
}
|
||||
@@ -320,8 +320,16 @@ public class SmsService : ISmsService
|
||||
|
||||
public async Task<double> GetCreditAmount()
|
||||
{
|
||||
var credit = await SmsIr.GetCreditAsync();
|
||||
return (double)credit.Data;
|
||||
try
|
||||
{
|
||||
var credit = await SmsIr.GetCreditAsync();
|
||||
return (double)credit.Data;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,15 @@ public static class StaticWorkshopAccounts
|
||||
/// </summary>
|
||||
public static List<long> SelectedAccountsRoleIds = [3, 5, 7, 8];
|
||||
|
||||
/// <summary>
|
||||
/// لیستی آی دی نقش هایی که دردسترسی به تب افزودن پرسنل و مدارک کلاینت دارند
|
||||
/// 3 : قرارداد ارشد
|
||||
/// 5 : قرارداد ساده
|
||||
/// 19 : برنامه نویسان
|
||||
/// 1 : مدیر سیستم
|
||||
/// </summary>
|
||||
public static List<long> EmployeeDocumentWorkFlowRoleIds = [1,3, 5, 19];
|
||||
|
||||
/// <summary>
|
||||
/// لیست اکانتهایی که به همه کارگاه ها باید دسترسی داشته باشند
|
||||
/// 2 - صادق فرخی
|
||||
|
||||
@@ -598,90 +598,90 @@ public static class Tools
|
||||
/// <returns></returns>
|
||||
public static int YearTotalDays(this string date)
|
||||
{
|
||||
int y2 = 365;
|
||||
int y2 = 366;
|
||||
var year = Convert.ToInt32(date.Substring(0, 4));
|
||||
|
||||
|
||||
switch (year)
|
||||
{
|
||||
case 1346:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1350:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1354:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1358:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1362:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1366:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1370:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1375:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1379:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1383:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1387:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1391:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1395:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1399:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1403:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1408:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1412:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1416:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1420:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1424:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1428:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1432:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1436:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1441:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
case 1445:
|
||||
y2 = 366;
|
||||
y2 = 367;
|
||||
break;
|
||||
|
||||
default:
|
||||
y2 = 365;
|
||||
y2 = 366;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -32,20 +32,22 @@ public class UidService : IUidService
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName.ToPersian();
|
||||
|
||||
if (responseResult.BasicInformation != null)
|
||||
{
|
||||
responseResult.BasicInformation.FirstName = responseResult.BasicInformation.FirstName?.ToPersian();
|
||||
responseResult.BasicInformation.LastName = responseResult.BasicInformation.LastName?.ToPersian();
|
||||
responseResult.BasicInformation.FatherName = responseResult.BasicInformation.FatherName?.ToPersian();
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception)
|
||||
catch
|
||||
{
|
||||
|
||||
return null;
|
||||
@@ -63,19 +65,12 @@ public class UidService : IUidService
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
}
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
@@ -1866,7 +1866,7 @@ public class TaskRepository : RepositoryBase<long, Tasks>, ITaskRepository
|
||||
.Include(x => x.Task).ThenInclude(x => x.TaskSchedule)
|
||||
.Where(x =>
|
||||
x.Task.IsActiveString == "true" && x.Task.SenderId == accountId
|
||||
&& x.Task.TaskScheduleId != null && x.Task.TaskScheduleId > 0 && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest));
|
||||
&& x.Task.TaskScheduleId != null && x.Task.TaskScheduleId > 0 && (!x.IsCanceledRequest && !x.TimeRequest && !x.IsDoneRequest) && x.Task.TaskSchedule.IsActive == IsActive.True);
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.GeneralSearch))
|
||||
{
|
||||
raw = raw.Where(x =>
|
||||
|
||||
@@ -15,4 +15,5 @@ public interface ICustomizeWorkshopEmployeeSettingsRepository : IRepository<long
|
||||
List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingNotInMainGroup(long entityWorkshopId);
|
||||
void RemoveByWorkshopIdAndEmployeeId(long workshopId, long employeeId);
|
||||
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -20,14 +20,14 @@ public class Employee : EntityBase
|
||||
{
|
||||
public Employee(string fName, string lName, string fatherName,
|
||||
DateTime dateOfBirth, DateTime dateOfIssue, string placeOfIssue,
|
||||
string nationalCode, string idNumber, string gender, string nationality,
|
||||
string nationalCode, string idNumber, string gender, string nationality, string idNumberSerial , string idNumberSeri ,
|
||||
string phone = null, string address = null, string state = null, string city = null,
|
||||
string maritalStatus = null, string militaryService = null, string levelOfEducation = null, string fieldOfStudy = null,
|
||||
string bankCardNumber = null, string bankBranch = null, string insuranceCode = null, string insuranceHistoryByYear = null,
|
||||
string insuranceHistoryByMonth = null, string numberOfChildren = null, string officePhone = null,
|
||||
string mclsUserName = null, string mclsPassword = null,
|
||||
string eserviceUserName = null, string eservicePassword = null,
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null)
|
||||
string taxOfficeUserName = null, string taxOfficepassword = null, string sanaUserName = null, string sanaPassword = null )
|
||||
{
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
@@ -146,6 +146,15 @@ public class Employee : EntityBase
|
||||
/// آیا پرسنل احراز هویت شده است
|
||||
/// </summary>
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -234,5 +243,39 @@ public class Employee : EntityBase
|
||||
IsAuthorized = true;
|
||||
}
|
||||
|
||||
public void EditAuthorizeEmployee(DateTime dateOfIssue, string placeOfIssue,
|
||||
string phone, string address, string state, string citi,
|
||||
string maritalStatus, string militaryService, string levelOfEducation, string fieldOfStudy,
|
||||
string bankCardNumber, string bankBranch, string insuranceCode, string insuranceHistoryByYear,
|
||||
string insuranceHistoryByMonth, string numberOfChildren, string officePhone,
|
||||
string mclsUserName, string mclsPassword, string eserviceUserName, string eservicePassword, string taxOfficeUserName, string taxOfficepassword, string sanaUserName, string sanaPassword)
|
||||
{
|
||||
DateOfIssue = dateOfIssue;
|
||||
PlaceOfIssue = placeOfIssue;
|
||||
Phone = phone;
|
||||
Address = address;
|
||||
State = state;
|
||||
City = citi;
|
||||
MaritalStatus = maritalStatus;
|
||||
MilitaryService = militaryService;
|
||||
LevelOfEducation = levelOfEducation;
|
||||
FieldOfStudy = fieldOfStudy;
|
||||
BankCardNumber = bankCardNumber;
|
||||
BankBranch = bankBranch;
|
||||
InsuranceCode = insuranceCode;
|
||||
InsuranceHistoryByYear = insuranceHistoryByYear;
|
||||
InsuranceHistoryByMonth = insuranceHistoryByMonth;
|
||||
NumberOfChildren = numberOfChildren;
|
||||
OfficePhone = OfficePhone;
|
||||
MclsUserName = mclsUserName;
|
||||
MclsPassword = mclsPassword;
|
||||
EserviceUserName = eserviceUserName;
|
||||
EservicePassword = eservicePassword;
|
||||
TaxOfficeUserName = taxOfficeUserName;
|
||||
TaxOfficepassword = taxOfficepassword;
|
||||
SanaUserName = sanaUserName;
|
||||
SanaPassword = sanaPassword;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public class EmployeeAuthorizeTemp:EntityBase
|
||||
{
|
||||
public EmployeeAuthorizeTemp(Gender gender, string fName, string lName, string fatherName, DateTime birthDate, string nationalCode, string idNumber, string idNumberSerial, string idNumberSeri)
|
||||
{
|
||||
Gender = gender;
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
FatherName = fatherName;
|
||||
BirthDate = birthDate;
|
||||
NationalCode = nationalCode;
|
||||
IdNumber = idNumber;
|
||||
IdNumberSerial = idNumberSerial;
|
||||
IdNumberSeri = idNumberSeri;
|
||||
}
|
||||
|
||||
public Gender Gender { get; private set; }
|
||||
public string FName { get; private set; }
|
||||
public string LName { get; private set; }
|
||||
public string FatherName { get; private set; }
|
||||
public DateTime BirthDate { get; private set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
public interface IEmployeeAuthorizeTempRepository:IRepository<long,EmployeeAuthorizeTemp>
|
||||
{
|
||||
Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode);
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using _0_Framework.Domain;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
|
||||
namespace Company.Domain.EmployeeClientTempAgg;
|
||||
@@ -8,4 +10,5 @@ public interface IEmployeeClientTempRepository : IRepository<long, EmployeeClien
|
||||
EmployeeClientTemp GetByEmployeeIdAndWorkshopId(long employeeId, long commandWorkshopId);
|
||||
EmployeeClientTempGetDetailsViewModel GetDetails(long employeeId, long workshopId);
|
||||
void Remove(EmployeeClientTemp entity);
|
||||
Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId);
|
||||
}
|
||||
@@ -7,100 +7,105 @@ using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using Microsoft.AspNetCore.JsonPatch.Operations;
|
||||
|
||||
namespace Company.Domain.EmployeeDocumentItemAgg
|
||||
namespace Company.Domain.EmployeeDocumentItemAgg;
|
||||
|
||||
public class EmployeeDocumentItem : EntityBase
|
||||
{
|
||||
public class EmployeeDocumentItem : EntityBase
|
||||
private EmployeeDocumentItem() { }
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
public long UploaderId { get; private set; }
|
||||
public UserType UploaderType { get; private set; }
|
||||
public long UploaderRoleId { get; set; }
|
||||
|
||||
|
||||
public long ReviewedById { get; private set; }
|
||||
public string RejectionReason { get; private set; }
|
||||
public DocumentStatus DocumentStatus { get; private set; }
|
||||
public long MediaId { get; private set; }
|
||||
|
||||
public DateTime? ConfirmationDateTime { get; private set; }
|
||||
public DocumentItemLabel DocumentLabel { get; private set; }
|
||||
|
||||
public long EmployeeDocumentId { get; private set; }
|
||||
public virtual EmployeeDocuments EmployeeDocuments { get; private set; }
|
||||
|
||||
public long? EmployeeDocumentsAdminViewId { get; private set; }
|
||||
public EmployeeDocumentsAdminSelection EmployeeDocumentsAdminSelection { get; private set; }
|
||||
|
||||
public List<EmployeeDocumentItemLog> ItemLogs { get; private set; }
|
||||
|
||||
|
||||
public EmployeeDocumentItem(long workshopId, long employeeId, long mediaId, long employeeDocumentId, DocumentItemLabel documentLabel, long uploaderId,
|
||||
UserType uploaderType, long roleId, DocumentStatus documentStatus = DocumentStatus.Unsubmitted)
|
||||
{
|
||||
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
public long UploaderId { get; private set; }
|
||||
public UserType UploaderType { get; private set; }
|
||||
|
||||
|
||||
public long ReviewedById { get; private set; }
|
||||
public string RejectionReason { get; private set; }
|
||||
public DocumentStatus DocumentStatus { get; private set; }
|
||||
public long MediaId { get; private set; }
|
||||
|
||||
public DateTime? ConfirmationDateTime { get; private set; }
|
||||
public DocumentItemLabel DocumentLabel { get; private set; }
|
||||
|
||||
public long EmployeeDocumentId { get; private set; }
|
||||
public virtual EmployeeDocuments EmployeeDocuments { get; private set; }
|
||||
|
||||
public long? EmployeeDocumentsAdminViewId { get; private set; }
|
||||
public EmployeeDocumentsAdminSelection EmployeeDocumentsAdminSelection { get; private set; }
|
||||
|
||||
public List<EmployeeDocumentItemLog> ItemLogs { get; private set; }
|
||||
|
||||
|
||||
public EmployeeDocumentItem(long workshopId,long employeeId, long mediaId, long employeeDocumentId, DocumentItemLabel documentLabel, long uploaderId,
|
||||
UserType uploaderType, DocumentStatus documentStatus = DocumentStatus.Unsubmitted)
|
||||
{
|
||||
MediaId = mediaId;
|
||||
UploaderId = uploaderId;
|
||||
UploaderType = uploaderType;
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
DocumentStatus = documentStatus;
|
||||
if (documentStatus == DocumentStatus.Confirmed)
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
DocumentLabel = documentLabel;
|
||||
EmployeeDocumentId = employeeDocumentId;
|
||||
ItemLogs =
|
||||
[
|
||||
new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.CreatedNewItem, uploaderId, uploaderType)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public void Confirm(long operatorId, UserType userType)
|
||||
{
|
||||
ReviewedById = operatorId;
|
||||
DocumentStatus = DocumentStatus.Confirmed;
|
||||
MediaId = mediaId;
|
||||
UploaderId = uploaderId;
|
||||
UploaderType = uploaderType;
|
||||
UploaderRoleId = uploaderType == UserType.Admin ? roleId : -1;
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
DocumentStatus = documentStatus;
|
||||
if (documentStatus == DocumentStatus.Confirmed)
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.ConfirmedItem, operatorId, userType));
|
||||
}
|
||||
|
||||
public void Reject(long operatorId, string rejectionReason, UserType userType)
|
||||
{
|
||||
RejectionReason = rejectionReason;
|
||||
DocumentStatus = DocumentStatus.Rejected;
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
ReviewedById = operatorId;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.RejectedItem, operatorId, userType, rejectionReason));
|
||||
}
|
||||
|
||||
public void Delete(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.Deleted;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.DeletedItem, operatorId, operatorType));
|
||||
}
|
||||
|
||||
public void AdminSelect(long adminViewId)
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = adminViewId;
|
||||
}
|
||||
|
||||
public void AdminDeselect()
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = 0;
|
||||
}
|
||||
public void SubmitByClient(long operatorId,UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByClient;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SubmitByAdmin(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByAdmin;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
DocumentLabel = documentLabel;
|
||||
EmployeeDocumentId = employeeDocumentId;
|
||||
ItemLogs =
|
||||
[
|
||||
new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.CreatedNewItem, uploaderId, uploaderType)
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Confirm(long operatorId, UserType userType)
|
||||
{
|
||||
ReviewedById = operatorId;
|
||||
DocumentStatus = DocumentStatus.Confirmed;
|
||||
ConfirmationDateTime = DateTime.Now;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.ConfirmedItem, operatorId, userType));
|
||||
}
|
||||
|
||||
public void Reject(long operatorId, string rejectionReason, UserType userType)
|
||||
{
|
||||
RejectionReason = rejectionReason;
|
||||
DocumentStatus = DocumentStatus.Rejected;
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
ReviewedById = operatorId;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.RejectedItem, operatorId, userType, rejectionReason));
|
||||
}
|
||||
|
||||
public void Delete(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.Deleted;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.DeletedItem, operatorId, operatorType));
|
||||
}
|
||||
|
||||
public void AdminSelect(long adminViewId)
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = adminViewId;
|
||||
}
|
||||
|
||||
public void AdminDeselect()
|
||||
{
|
||||
EmployeeDocumentsAdminViewId = 0;
|
||||
}
|
||||
public void SubmitByClient(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByClient;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SubmitByAdmin(long operatorId, UserType operatorType)
|
||||
{
|
||||
DocumentStatus = DocumentStatus.SubmittedByAdmin;
|
||||
ItemLogs.Add(new EmployeeDocumentItemLog(EmployeeDocumentItemOperation.SubmittedItems, operatorId, operatorType));
|
||||
EmployeeDocuments.UpdateHasRejectedItems();
|
||||
}
|
||||
|
||||
public void SetRoleId(long roleId)
|
||||
{
|
||||
UploaderRoleId = roleId;
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,12 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
||||
{
|
||||
List<DocumentItemLabel> requiredDocuments =
|
||||
[
|
||||
DocumentItemLabel.IdCardPage1, DocumentItemLabel.IdCardPage2, DocumentItemLabel.IdCardPage3, DocumentItemLabel.NationalCardRear,
|
||||
DocumentItemLabel.NationalCardFront,DocumentItemLabel.EmployeePicture
|
||||
DocumentItemLabel.IdCardPage1,/* DocumentItemLabel.IdCardPage2, DocumentItemLabel.IdCardPage3, DocumentItemLabel.NationalCardRear,*/
|
||||
DocumentItemLabel.NationalCardFront,/*DocumentItemLabel.EmployeePicture*/
|
||||
];
|
||||
|
||||
if (gender == "مرد")
|
||||
requiredDocuments.Add(DocumentItemLabel.MilitaryServiceCard);
|
||||
//if (gender == "مرد")
|
||||
// requiredDocuments.Add(DocumentItemLabel.MilitaryServiceCard);
|
||||
|
||||
return requiredDocuments;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ using CompanyManagment.App.Contracts.Workshop;
|
||||
namespace Company.Domain.EmployeeDocumentsAgg
|
||||
{
|
||||
public interface IEmployeeDocumentsRepository : IRepository<long, EmployeeDocuments>
|
||||
{
|
||||
{
|
||||
EmployeeDocuments GetByEmployeeIdWorkshopId(long employeeId, long workshopId);
|
||||
EmployeeDocumentsViewModel GetViewModelByEmployeeIdWorkshopId(long employeeId, long workshopId);
|
||||
List<EmployeeDocumentsViewModel> SearchForClient(SearchEmployeeDocuments cmd);
|
||||
@@ -30,5 +30,76 @@ namespace Company.Domain.EmployeeDocumentsAgg
|
||||
Task<int> GetAdminWorkFlowCountForNewEmployees(List<long> workshopIds);
|
||||
Task<int> GetAdminWorkFlowCountForSubmittedAndRejectedDocuments(List<long> workshopIds);
|
||||
List<EmployeeDocumentsViewModel> GetDocumentsAwaitingReviewByWorkshopIdForCheckerWorkFlow(long workshopId);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// کارگاهی که افزودن پرسنل کرده اند. بر اساس نقش فیلتر میشوند
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
///کارگاه های مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId,
|
||||
long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// کارگاه هایی که افزودن پرسنل کرده اند و مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops,long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// پرسنلی که افزوده شده اند در کارگاه و آپلود مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که مدارک آپلود شده توسط کلاینت برگشت خورده است در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های آپلود شده توسط کلاینت در کارگاه که برگشت خورده اند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده برای کلاینت
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,5 @@ public interface ILeftWorkTempRepository:IRepository<long,LeftWorkTemp>
|
||||
Task<GetStartWorkTempDetails> GetStartAndLeftWorkDetails(long employeeId, long workshopId);
|
||||
void Remove(LeftWorkTemp entity);
|
||||
List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId);
|
||||
Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId);
|
||||
}
|
||||
@@ -15,6 +15,7 @@ using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Drawing.Chart;
|
||||
using System.Collections;
|
||||
|
||||
namespace Company.Domain.RollCallAgg.DomainService;
|
||||
|
||||
@@ -25,7 +26,7 @@ public interface IRollCallDomainService
|
||||
long workshopId);
|
||||
|
||||
TimeOnly GetEmployeeOffSetForRegularSettings(long employeeId, long workshopId);
|
||||
DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId, DateTime rollCallStartDate,DateTime rollCallEndDate);
|
||||
DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId, DateTime rollCallStartDate, DateTime rollCallEndDate);
|
||||
|
||||
void CalculateTimeDifferences(RollCall rollCall);
|
||||
|
||||
@@ -173,16 +174,16 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
}
|
||||
|
||||
public DateTime GetEmployeeShiftDateByRollCallStartDate(long workshopId, long employeeId,
|
||||
DateTime rollCallStartDate,DateTime rollCallEndDate)
|
||||
DateTime rollCallStartDate, DateTime rollCallEndDate)
|
||||
{
|
||||
var shiftDetails = GetEmployeeShiftDetails(employeeId, workshopId);
|
||||
|
||||
|
||||
var offset = GetEmployeeOffSetForRegularSettings(employeeId, workshopId);
|
||||
|
||||
return shiftDetails.shiftType switch
|
||||
{
|
||||
WorkshopShiftStatus.Regular => CalculateRegularShiftDate(rollCallStartDate, offset),
|
||||
WorkshopShiftStatus.Rotating => FindRotatingShift(rollCallEndDate,rollCallEndDate,shiftDetails.rotatingShifts).start.Date,
|
||||
WorkshopShiftStatus.Rotating => FindRotatingShift(rollCallStartDate, rollCallEndDate, shiftDetails.rotatingShifts).start.Date,
|
||||
WorkshopShiftStatus.Irregular => rollCallStartDate.Date,
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
@@ -216,6 +217,7 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
rollCalls.Remove(deletedRollCall);
|
||||
rollCalls.Add(rollCall);
|
||||
|
||||
rollCall.ClearTimeDiff();
|
||||
switch (shiftDetails.shiftType)
|
||||
{
|
||||
case WorkshopShiftStatus.Regular:
|
||||
@@ -255,8 +257,9 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
var earlyEntryRollCall = rollCallsInShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate < employeeShift.start);
|
||||
|
||||
var lateEntryRollCall = rollCallsInShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate > employeeShift.start);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var previousShift = employeeShifts.OrderByDescending(x => x.start)
|
||||
.FirstOrDefault(x => x.end < employeeShift.start);
|
||||
@@ -299,8 +302,6 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
var lateExitRollCall = rollCallsInShift.OrderBy(x => x.EndDate).FirstOrDefault(x => x.EndDate > employeeShift.end);
|
||||
|
||||
|
||||
|
||||
// تعجیل در خروج - زود رفتن
|
||||
var nextShift = employeeShifts.OrderBy(x => x.start)
|
||||
.FirstOrDefault(x => x.start > employeeShift.end);
|
||||
@@ -373,8 +374,8 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
var earlyEntryRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate < shift.start);
|
||||
|
||||
var lateEntryRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.StartDate).FirstOrDefault(x => x.StartDate > shift.start);
|
||||
|
||||
|
||||
earlyEntryRollCallRotating?.ClearTimeDiff();
|
||||
lateEntryRollCallRotating?.ClearTimeDiff();
|
||||
|
||||
if (earlyEntryRollCallRotating != null)
|
||||
{
|
||||
@@ -403,9 +404,10 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
var earlyExitRollCallRotating = rollCallsInRotatingShift.OrderByDescending(x => x.EndDate).FirstOrDefault(x => x.EndDate < shift.end);
|
||||
|
||||
var lateExitRollCallRotating = rollCallsInRotatingShift.OrderBy(x => x.EndDate).FirstOrDefault(x => x.EndDate > shift.end);
|
||||
earlyExitRollCallRotating?.ClearTimeDiff();
|
||||
lateExitRollCallRotating?.ClearTimeDiff();
|
||||
|
||||
|
||||
|
||||
|
||||
if (earlyExitRollCallRotating != null && (rollCallsInRotatingShift.Any(x =>
|
||||
x.StartDate < rotatingShiftEnd && x.StartDate > earlyExitRollCallRotating.EndDate) == false))
|
||||
@@ -453,10 +455,10 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
DateTime startEntryWithDate = startDate.Add(startRollCall.TimeOfDay);
|
||||
DateTime endEntryWithDate = endDate.Add(endRollCall.TimeOfDay);
|
||||
|
||||
DateTime oneHourBeforeStart = startEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterStart = startEntryWithDate.AddHours(1);
|
||||
DateTime oneHourBeforeEnd = endEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterEnd = endEntryWithDate.AddHours(1);
|
||||
DateTime twoHourBeforeStart = startEntryWithDate.AddHours(-2);
|
||||
DateTime twoHourAfterStart = startEntryWithDate.AddHours(2);
|
||||
DateTime twoHourBeforeEnd = endEntryWithDate.AddHours(-2);
|
||||
DateTime twoHourAfterEnd = endEntryWithDate.AddHours(2);
|
||||
|
||||
|
||||
var shiftDateTimes = rotatingShifts.SelectMany(shift =>
|
||||
@@ -477,56 +479,68 @@ public class RollCallDomainService : IRollCallDomainService
|
||||
|
||||
#region مقایسه شروع حضور غیاب با شیفت
|
||||
|
||||
var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeStart <= shift.Start && oneHourAfterStart >= shift.Start) ||
|
||||
(oneHourBeforeStart <= shift.End && oneHourAfterStart >= shift.End)).ToList();
|
||||
//var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeStart <= shift.Start && twoHourAfterStart >= shift.Start) ||
|
||||
// (twoHourBeforeStart <= shift.End && twoHourAfterStart >= shift.End)).ToList();
|
||||
|
||||
if (startFilteredTimes.Count == 0)
|
||||
{
|
||||
startFilteredTimes = shiftDateTimes;
|
||||
}
|
||||
else if (startFilteredTimes.Count == 1)
|
||||
{
|
||||
var startChosenShift = startFilteredTimes.First();
|
||||
//if (startFilteredTimes.Count == 0)
|
||||
//{
|
||||
// startFilteredTimes = shiftDateTimes;
|
||||
//}
|
||||
//else if (startFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var startChosenShift = startFilteredTimes.First();
|
||||
|
||||
if (startChosenShift.End < startChosenShift.Start)
|
||||
startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
// if (startChosenShift.End < startChosenShift.Start)
|
||||
// startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
|
||||
return startChosenShift;
|
||||
}
|
||||
// return startChosenShift;
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
//#endregion
|
||||
|
||||
#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeEnd <= shift.Start && oneHourAfterEnd >= shift.Start) ||
|
||||
(oneHourBeforeEnd <= shift.End && oneHourAfterEnd >= shift.End)).ToList();
|
||||
if (endFilteredTimes.Count == 0)
|
||||
{
|
||||
endFilteredTimes = startFilteredTimes;
|
||||
}
|
||||
else if (endFilteredTimes.Count == 1)
|
||||
{
|
||||
var endChosenShift = endFilteredTimes.First();
|
||||
return endChosenShift;
|
||||
}
|
||||
//#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
//var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeEnd <= shift.Start && twoHourAfterEnd >= shift.Start) ||
|
||||
// (twoHourBeforeEnd <= shift.End && twoHourAfterEnd >= shift.End)).ToList();
|
||||
//if (endFilteredTimes.Count == 0)
|
||||
//{
|
||||
// endFilteredTimes = startFilteredTimes;
|
||||
//}
|
||||
//else if (endFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var endChosenShift = endFilteredTimes.First();
|
||||
// return endChosenShift;
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#region اشتراک حضور غیاب و شیفت
|
||||
|
||||
var overlapShifts = endFilteredTimes.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, oneHourAfterEnd.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, oneHourBeforeStart.Ticks)))
|
||||
});
|
||||
var overlapShifts = shiftDateTimes
|
||||
.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
// زمان حضور فرد در شیفت (مجموع Overlap با شیفت)
|
||||
TotalTimeInShift = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
StartDistance = Math.Abs((shift.Start - startRollCall).Ticks),
|
||||
EndDistance = Math.Abs((shift.End - endRollCall).Ticks),
|
||||
TotalDistance = Math.Abs((shift.Start - startRollCall).Ticks) + Math.Abs((shift.End - endRollCall).Ticks)
|
||||
})
|
||||
.OrderByDescending(s => s.TotalTimeInShift) // 1. بیشترین زمان حضور فرد
|
||||
.ThenByDescending(s => s.Overlap) // 2. بیشترین Overlap
|
||||
.ThenBy(s => s.TotalDistance)
|
||||
.ThenBy(s => s.StartDistance)
|
||||
.ThenBy(x => x.EndDistance); // 3. اگر برابر بود، Start نزدیکتر
|
||||
|
||||
var overlapChosenShift = overlapShifts.MaxBy(s => s.Overlap);
|
||||
var overlapChosenShift = overlapShifts.First();
|
||||
var end = overlapChosenShift.Shift.End;
|
||||
if (overlapChosenShift.Shift.End < overlapChosenShift.Shift.Start)
|
||||
end = overlapChosenShift.Shift.End.AddDays(1);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
@@ -22,4 +23,7 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
|
||||
List<LateToWorkEarlyExistSpannig> LateToWorkEarlyExit(List<GroupedRollCalls> groupedRollCall,
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> shiftSettings, List<LeaveViewModel> leavList);
|
||||
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork);
|
||||
}
|
||||
@@ -87,6 +87,9 @@ namespace Company.Domain.RollCallAgg
|
||||
long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsInShiftDate(DateTime rollCallShiftDate, long employeeId, long workshopId);
|
||||
|
||||
Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds,
|
||||
DateTime fromDate);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace Company.Domain.RollCallAgg
|
||||
return this;
|
||||
}
|
||||
|
||||
private void SetShiftDate(IRollCallDomainService service)
|
||||
public void SetShiftDate(IRollCallDomainService service)
|
||||
{
|
||||
ShiftDate = service.GetEmployeeShiftDateByRollCallStartDate(WorkshopId, EmployeeId, StartDate!.Value,EndDate.Value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
using CompanyManagement.Infrastructure.Excel.EmployeeBankInfo;
|
||||
using OfficeOpenXml.Style;
|
||||
using OfficeOpenXml;
|
||||
using System.Drawing;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Excel.CWS;
|
||||
public class CustomizeWorkshopGroupExcelViewModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ShiftType { get; set; }
|
||||
public string Shifts { get; set; }
|
||||
public string Salary { get; set; }
|
||||
public List<CustomizeWorkshopEmployeeExcelViewModel> EmployeeSettings { get; set; }
|
||||
}
|
||||
|
||||
public class CustomizeWorkshopEmployeeExcelViewModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ShiftType { get; set; }
|
||||
public string Shifts { get; set; }
|
||||
public int LeavePermitted { get; set; }
|
||||
public string Salary { get; set; }
|
||||
}
|
||||
public class CustomizeWorkshopGroupSettingExcelGenerator
|
||||
{
|
||||
public static byte[] Generate(List<CustomizeWorkshopGroupExcelViewModel> groups)
|
||||
{
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
using (var package = new ExcelPackage())
|
||||
{
|
||||
var worksheet = package.Workbook.Worksheets.Add("GroupsAndEmployees");
|
||||
|
||||
// Headers
|
||||
worksheet.Cells[1, 1].Value = "نام گروه";
|
||||
worksheet.Cells[1, 2].Value = "نوع شیفت گروه";
|
||||
worksheet.Cells[1, 3].Value = "شیفت گروه";
|
||||
worksheet.Cells[1, 4].Value = "حقوق گروه";
|
||||
|
||||
worksheet.Cells[1, 5].Value = "نام پرسنل";
|
||||
worksheet.Cells[1, 6].Value = "مجاز مرخصی پرسنل";
|
||||
worksheet.Cells[1, 7].Value = "نوع شیفت پرسنل";
|
||||
worksheet.Cells[1, 8].Value = "شیفت پرسنل";
|
||||
worksheet.Cells[1, 9].Value = "حقوق پرسنل";
|
||||
|
||||
using (var range = worksheet.Cells[1, 1, 1, 9])
|
||||
{
|
||||
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
range.Style.Font.Bold = true;
|
||||
range.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
range.Style.Fill.BackgroundColor.SetColor(Color.LightGray); // رنگ پس زمینه خاکستری
|
||||
|
||||
range.Style.Border.BorderAround(ExcelBorderStyle.Thin);
|
||||
}
|
||||
|
||||
int row = 2;
|
||||
|
||||
foreach (var group in groups)
|
||||
{
|
||||
var employees = group.EmployeeSettings ?? new List<CustomizeWorkshopEmployeeExcelViewModel>();
|
||||
int groupStartRow = row;
|
||||
int groupEndRow = employees.Count > 0 ? (row + employees.Count - 1) : row;
|
||||
|
||||
if (employees.Count == 0)
|
||||
{
|
||||
// گروه بدون پرسنل
|
||||
worksheet.Cells[row, 1].Value = group.Name;
|
||||
worksheet.Cells[row, 2].Value = group.ShiftType;
|
||||
worksheet.Cells[row, 3].Value = group.Shifts;
|
||||
worksheet.Cells[row, 4].Value = Convert.ToInt32(group.Salary);
|
||||
|
||||
ApplyGroupStyle(worksheet, row, row);
|
||||
worksheet.Cells[row, 4].Style.Numberformat.Format = "#,##0";
|
||||
using (var thickBorderRange = worksheet.Cells[groupEndRow, 1, groupEndRow, 9])
|
||||
{
|
||||
thickBorderRange.Style.Border.Bottom.Style = ExcelBorderStyle.Thick;
|
||||
}
|
||||
row++;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var employee in employees)
|
||||
{
|
||||
worksheet.Cells[row, 5].Value = employee.Name;
|
||||
worksheet.Cells[row, 6].Value = employee.LeavePermitted;
|
||||
worksheet.Cells[row, 7].Value = employee.ShiftType;
|
||||
worksheet.Cells[row, 8].Value = employee.Shifts;
|
||||
worksheet.Cells[row, 9].Value = Convert.ToInt32(employee.Salary);
|
||||
|
||||
ApplyEmployeeStyle(worksheet, row);
|
||||
worksheet.Cells[row, 9].Style.Numberformat.Format = "#,##0";
|
||||
row++;
|
||||
}
|
||||
|
||||
// Merge اطلاعات گروه برای تمام پرسنل
|
||||
worksheet.Cells[groupStartRow, 1, groupEndRow, 1].Merge = true;
|
||||
worksheet.Cells[groupStartRow, 1].Value = group.Name;
|
||||
|
||||
worksheet.Cells[groupStartRow, 2, groupEndRow, 2].Merge = true;
|
||||
worksheet.Cells[groupStartRow, 2].Value = group.ShiftType;
|
||||
|
||||
worksheet.Cells[groupStartRow, 3, groupEndRow, 3].Merge = true;
|
||||
worksheet.Cells[groupStartRow, 3].Value = group.Shifts;
|
||||
|
||||
worksheet.Cells[groupStartRow, 4, groupEndRow, 4].Merge = true;
|
||||
worksheet.Cells[groupStartRow, 4].Value = Convert.ToInt32(group.Salary);
|
||||
|
||||
ApplyGroupStyle(worksheet, groupStartRow, groupEndRow);
|
||||
|
||||
worksheet.Cells[groupStartRow, 4, groupEndRow, 4].Style.Numberformat.Format = "#,##0";
|
||||
|
||||
|
||||
worksheet.Cells[groupEndRow, 1, groupEndRow, 9].Style.Border.Bottom.Style = ExcelBorderStyle.Thick;
|
||||
|
||||
}
|
||||
}
|
||||
worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
|
||||
|
||||
for (int i = 2; i <= worksheet.Dimension.Rows; i++)
|
||||
{
|
||||
worksheet.Row(i).Height = 50;
|
||||
}
|
||||
|
||||
int groupShiftCol = 3;
|
||||
int employeeShiftCol = 8;
|
||||
int groupSalary = 4;
|
||||
int employeeSalary = 9;
|
||||
int employeeName =5;
|
||||
worksheet.Columns[groupShiftCol].Width = 15;
|
||||
worksheet.Columns[employeeShiftCol].Width = 15;
|
||||
worksheet.Columns[groupSalary].Width = 16;
|
||||
worksheet.Columns[employeeSalary].Width = 16;
|
||||
worksheet.Columns[employeeName].Width = 24;
|
||||
worksheet.View.RightToLeft = true; // فارسی
|
||||
return package.GetAsByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyEmployeeStyle(ExcelWorksheet worksheet, int row)
|
||||
{
|
||||
using (var range = worksheet.Cells[row, 5, row, 9])
|
||||
{
|
||||
//range.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
//range.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(198, 239, 206)); // سبز خیلی روشن
|
||||
range.Style.Border.BorderAround(ExcelBorderStyle.Thin);
|
||||
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
|
||||
// اضافه کردن بوردر به همهی سلولهای ردیف پرسنل
|
||||
range.Style.Border.Top.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Left.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Right.Style = ExcelBorderStyle.Thin;
|
||||
|
||||
range.Style.WrapText = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyGroupStyle(ExcelWorksheet worksheet, int startRow, int endRow)
|
||||
{
|
||||
using (var range = worksheet.Cells[startRow, 1, endRow, 4])
|
||||
{
|
||||
//range.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
//range.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(255, 255, 204)); // زرد خیلی روشن
|
||||
range.Style.Border.BorderAround(ExcelBorderStyle.Thin);
|
||||
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
|
||||
|
||||
// اضافه کردن بوردر به همهی سلولهای گروه
|
||||
range.Style.Border.Top.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Left.Style = ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Right.Style = ExcelBorderStyle.Thin;
|
||||
|
||||
range.Style.WrapText = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,12 @@ public class ComputingViewModel
|
||||
public string MarriedAllowance { get; set; }
|
||||
public string RotatingShiftValue { get; set; }
|
||||
public List<RotatingShiftViewModel> RotatingResultList { get; set; }
|
||||
public bool HasRollCall { get; set; }
|
||||
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string YearAndMonth { get; set; }
|
||||
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
@@ -9,4 +10,6 @@ public class CustomizeWorkshopSettingsViewModel
|
||||
public string Name { get; set; }
|
||||
public WorkshopShiftStatus WorkshopShiftStatus { get; set; }
|
||||
public List<CustomizeWorkshopGroupSettingsViewModel> GroupSettings { get; set; }
|
||||
public TimeOnly Offset { get; set; }
|
||||
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
|
||||
@@ -34,7 +36,8 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command);
|
||||
|
||||
#region Vafa
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command);
|
||||
OperationResult EditSimpleRollCallEmployeeSetting(EditCustomizeEmployeeSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand);
|
||||
#endregion
|
||||
|
||||
OperationResult RemoveGroupSettings(long employeeSettingsId);
|
||||
@@ -89,4 +92,10 @@ public interface ICustomizeWorkshopSettingsApplication
|
||||
|
||||
|
||||
bool HasAnyEmployeeWithoutGroup(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// این متد چک میکند که آیا شیفت پرسنل تغییر کرده است یا نه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command);
|
||||
}
|
||||
@@ -94,4 +94,14 @@ public class CreateEmployee
|
||||
public long WorkshopId { get; set; }
|
||||
public long? PersonelCode { get; set; }
|
||||
|
||||
public bool IsAuthorized { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
public class EmployeeDataFromApiViewModel
|
||||
{
|
||||
public Gender Gender { get; set; }
|
||||
public string FName { get; set; }
|
||||
public string LName { get; set; }
|
||||
public string FatherName { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// سریال شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSerial { get; set; }
|
||||
/// <summary>
|
||||
/// سری شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employee;
|
||||
|
||||
public class GetEditEmployeeInEmployeeDocumentViewModel
|
||||
{
|
||||
@@ -14,4 +16,5 @@ public class GetEditEmployeeInEmployeeDocumentViewModel
|
||||
public string Nationality { get; set; } = string.Empty;
|
||||
public string Gender { get; set; } = string.Empty;
|
||||
public bool IsAuthorized { get; set; }
|
||||
public MediaViewModel Media { get; set; }
|
||||
}
|
||||
@@ -75,6 +75,8 @@ public interface IEmployeeApplication
|
||||
|
||||
Task<List<EmployeeSelectListViewModel>> WorkedEmployeesInWorkshopSelectList(long workshopId);
|
||||
|
||||
Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
@@ -8,7 +10,19 @@ public interface IEmployeeClientTempApplication
|
||||
OperationResult Create(CreateEmployeeClientTemp command);
|
||||
|
||||
EmployeeClientTempGetDetailsViewModel GetDetails(long employeeId, long workshopId);
|
||||
Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class EmployeeClientTempViewModel
|
||||
{
|
||||
public string EmployeeFullName { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public DateTime StartWorkDate { get; set; }
|
||||
|
||||
public string MaritalStatus { get; set; }
|
||||
}
|
||||
|
||||
public class EmployeeClientTempGetDetailsViewModel
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace CompanyManagment.App.Contracts.EmployeeDocuments
|
||||
public long WorkshopId { get; set; }
|
||||
public IFormFile PictureFile { get; set; }
|
||||
public DocumentItemLabel Label { get; set; }
|
||||
}
|
||||
public bool WithoutPicture { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,77 @@ namespace CompanyManagment.App.Contracts.EmployeeDocuments
|
||||
/// </summary>
|
||||
OperationResult AddRangeEmployeeDocumentItemsByAdmin(long workshopId, long employeeId,
|
||||
List<AddEmployeeDocumentItem> command);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// کارگاهی که افزودن پرسنل کرده اند. بر اساس نقش فیلتر میشوند
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده براساس دسترسی افراد و نقششان. یک مدرک برگشت خورده به تمامی کسانی که به آن کارگاه دسترسی دارند و تمامی کسانی که هم نقش آپلود کننده بوده اند نمایش داده میشود
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId,
|
||||
long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// کارگاه هایی که افزودن پرسنل کرده اند و مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// پرسنلی که افزوده شده اند در کارگاه و آپلود مدارک آنها ناقص است
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارگاه هایی که مدارک آپلود شده توسط کلاینت برگشت خورده است در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshops"></param>
|
||||
/// <param name="roleId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های آپلود شده توسط کلاینت در کارگاه که برگشت خورده اند در کارپوشه ادمین
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId);
|
||||
|
||||
/// <summary>
|
||||
/// مدارک های برگشت خورده برای کلاینت
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId);
|
||||
|
||||
#endregion
|
||||
EmployeeDocumentItemViewModel GetOneDocumentItemDetailsForAdmin(long employeeId, long workshopId,long documentItemId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,15 +32,18 @@ public interface ILeftWorkTempApplication
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> AcceptLeftWork(AcceptLeftWorkTemp command);
|
||||
|
||||
Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId);
|
||||
|
||||
|
||||
List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId);
|
||||
}
|
||||
|
||||
public class LeftWorkTempViewModel
|
||||
{
|
||||
public long LeftWorkId { get; set; }
|
||||
public string StartWork { get; set; }
|
||||
public string LeftWork { get; set; }
|
||||
public string LastDayStanding { get; set; }
|
||||
public DateTime StartWork { get; set; }
|
||||
public DateTime LeftWork { get; set; }
|
||||
public DateTime LastDayStanding { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long JobId { get; set; }
|
||||
|
||||
@@ -42,6 +42,9 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
DateTime end);
|
||||
|
||||
List<RollCallsByDateViewModel> GetUndefinedRollCallWorkFlowsService(long workshopId, DateTime durationStart, DateTime durationEnd);
|
||||
|
||||
|
||||
|
||||
OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa);
|
||||
|
||||
|
||||
@@ -114,5 +117,18 @@ namespace CompanyManagment.App.Contracts.RollCall
|
||||
|
||||
OperationResult SetModifyTypeToEditByEmployerForRollCallsInDate(long workshopId, long employeeId, string absenceDate);
|
||||
List<RollCallViewModel> GetWorkshopEmployeeRollCallsWithUndefinedForDate(long workshopId, long employeeId, string date);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه مجدد مقادیر حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> command);
|
||||
}
|
||||
public class ReCalculateRollCallValues
|
||||
{
|
||||
public long EmployeeId { get; set; }
|
||||
public string FromDate { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
|
||||
@@ -8,4 +9,6 @@ public interface IRollCallMandatoryApplication
|
||||
{
|
||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking);
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork);
|
||||
}
|
||||
@@ -16,5 +16,6 @@ public class RotatingShiftViewModel
|
||||
public bool IsEveningShift { get; set; }
|
||||
public bool IsNightShift { get; set; }
|
||||
public string RotatingDate { get; set; }
|
||||
public int WinRate { get; set; }
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
|
||||
@@ -33,9 +34,10 @@ namespace CompanyManagment.Application
|
||||
private readonly IContractRepository _contractRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
public CustomizeCheckoutApplication(ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository,
|
||||
IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository)
|
||||
IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository)
|
||||
{
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
@@ -46,6 +48,7 @@ namespace CompanyManagment.Application
|
||||
_workshopRepository = workshopRepository;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
}
|
||||
|
||||
public List<CustomizeCheckoutViewModel> Search(SearchCustomizeCheckout searchModel)
|
||||
@@ -270,8 +273,8 @@ namespace CompanyManagment.Application
|
||||
|
||||
var statusesWithActiveLeftWorks = statuses
|
||||
.Where(status => workshopLeftWorksInMonth.Any(leftWork => leftWork.EmployeeId == status.EmployeeId &&
|
||||
leftWork.StartWorkDateGr.Date <= status.StartDateGr.Date &&
|
||||
leftWork.LeftWorkDateGr.Date >= status.EndDateGr.Date)).ToList();
|
||||
leftWork.StartWorkDateGr.Date <= status.EndDateGr.Date &&
|
||||
leftWork.LeftWorkDateGr.Date >= status.StartDateGr.Date)).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -299,8 +302,8 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
List<long> employeesIds = [ 45084, 7980, 5976,45214,45215];
|
||||
foreach (var employeesId in employeesIds)
|
||||
var exceptionEmployeeIds =_customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x=>x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
var status = new RollCallEmployeeStatusViewModel()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
@@ -21,6 +19,7 @@ using Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
|
||||
namespace CompanyManagment.Application
|
||||
{
|
||||
@@ -35,8 +34,10 @@ namespace CompanyManagment.Application
|
||||
private readonly IContractRepository _contractRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
|
||||
public CustomizeCheckoutTempApplication(IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository, IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository)
|
||||
|
||||
public CustomizeCheckoutTempApplication(IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, ILeftWorkRepository leftWorkRepository, IEmployeeRepository employeeRepository, IRollCallMandatoryRepository rollCallMandatoryRepository, IContractRepository contractRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IWorkshopRepository workshopRepository, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository)
|
||||
{
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
@@ -47,6 +48,7 @@ namespace CompanyManagment.Application
|
||||
_workshopRepository = workshopRepository;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
}
|
||||
|
||||
public IEnumerable<CustomizeCheckoutViewModel> Search(SearchCustomizeCheckout searchModel)
|
||||
@@ -247,8 +249,8 @@ namespace CompanyManagment.Application
|
||||
|
||||
if (workshopId == 170)
|
||||
{
|
||||
List<long> employeesIds = [45084, 7980, 5976, 45214,45215];
|
||||
foreach (var employeesId in employeesIds)
|
||||
var exceptionEmployeeIds = _customizeWorkshopGroupSettingsRepository.GetEmployeeSettingsByGroupSettingsId(117).Select(x => x.EmployeeId).ToList();
|
||||
foreach (var employeesId in exceptionEmployeeIds)
|
||||
{
|
||||
|
||||
var status = new RollCallEmployeeStatusViewModel()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -49,7 +50,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly ICustomizeWorkshopSettingsApplication _customizeWorkshopSettingsApplication;
|
||||
private readonly IEmployeeDocumentsApplication _employeeDocumentsApplication;
|
||||
private readonly IEmployeeDocumentsRepository _employeeDocumentsRepository;
|
||||
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
|
||||
private readonly ILeftWorkTempRepository _leftWorkTempRepository;
|
||||
private readonly IUidService _uidService;
|
||||
@@ -58,8 +58,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
|
||||
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) : 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;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
@@ -68,15 +69,14 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_customizeWorkshopSettingsApplication = customizeWorkshopSettingsApplication;
|
||||
_employeeDocumentsApplication = employeeDocumentsApplication;
|
||||
_employeeDocumentsRepository = employeeDocumentsRepository;
|
||||
_employeeBankInformationApplication = employeeBankInformationApplication;
|
||||
_leftWorkTempRepository = leftWorkTempRepository;
|
||||
_uidService = uidService;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_customizeWorkshopGroupSettingsRepository = customizeWorkshopGroupSettingsRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
@@ -201,10 +201,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality, command.IdNumberSerial, command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
@@ -212,7 +212,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
command.InsuranceHistoryByMonth, command.NumberOfChildren, command.OfficePhone, command.MclsUserName, command.MclsPassword, command.EserviceUserName, command.EservicePassword,
|
||||
command.TaxOfficeUserName, command.TaxOfficepassword, command.SanaUserName, command.SanaPassword);
|
||||
|
||||
|
||||
if (command.IsAuthorized)
|
||||
{
|
||||
employeeData.Authorized();
|
||||
}
|
||||
_EmployeeRepository.Create(employeeData);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
@@ -1248,10 +1251,10 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
|
||||
var newEmployee = new Employee(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, apiBirthDate,
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی");
|
||||
dateOfIssue, null, identityInfo.NationalId, idNumber, gender, "ایرانی", identityInfo.ShenasnameSerial, identityInfo.ShenasnameSeri);
|
||||
newEmployee.Authorized();
|
||||
await _EmployeeRepository.CreateAsync(newEmployee);
|
||||
await _context.SaveChangesAsync();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(new EmployeeByNationalCodeInWorkshopViewModel()
|
||||
{
|
||||
@@ -1484,15 +1487,25 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
employee.Edit(command.FName, command.LName, command.FatherName, command.BirthDate.ToGeorgianDateTime(),
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender,
|
||||
command.Nationality,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, employee.MaritalStatus,
|
||||
employee.MilitaryService,
|
||||
command.Nationality, employee.Phone, employee.Address, employee.State, employee.City,
|
||||
command.MaritalStatus, command.MilitaryService,
|
||||
employee.LevelOfEducation, employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch,
|
||||
employee.InsuranceCode, employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth,
|
||||
employee.NumberOfChildren, employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
}
|
||||
else
|
||||
{
|
||||
employee.EditAuthorizeEmployee(employee.DateOfIssue, employee.PlaceOfIssue,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, command.MaritalStatus,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
}
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded();
|
||||
@@ -1503,5 +1516,105 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return await _EmployeeRepository.WorkedEmployeesInWorkshopSelectList(workshopId);
|
||||
}
|
||||
|
||||
public async Task<OperationResult<EmployeeDataFromApiViewModel>> GetEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var op = new OperationResult<EmployeeDataFromApiViewModel>();
|
||||
var birthDateGr = birthDate.ToGeorgianDateTime();
|
||||
|
||||
if (_EmployeeRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employee = _EmployeeRepository.GetByNationalCode(nationalCode);
|
||||
|
||||
if (employee.IsAuthorized == false)
|
||||
{
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
var gender = basicInfo.GenderEnum switch
|
||||
{
|
||||
Gender.Female => "زن",
|
||||
Gender.Male => "مرد",
|
||||
_ => throw new AggregateException()
|
||||
};
|
||||
|
||||
var idNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber;
|
||||
employee.Edit(basicInfo.FirstName, basicInfo.LastName, basicInfo.FatherName, birthDateGr,
|
||||
employee.DateOfIssue, employee.PlaceOfIssue, identityInfo.NationalId, idNumber,
|
||||
gender, "ایرانی", employee.Phone, employee.Address, employee.State, employee.City,
|
||||
employee.MaritalStatus, employee.MilitaryService, employee.LevelOfEducation,
|
||||
employee.FieldOfStudy, employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode, employee.InsuranceHistoryByYear,
|
||||
employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
|
||||
employee.Authorized();
|
||||
await _EmployeeRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
return op.Failed("این پرسنل در بانک اطلاعات موجود میباشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
EmployeeDataFromApiViewModel data;
|
||||
if (_employeeAuthorizeTempRepository.Exists(x => x.NationalCode == nationalCode))
|
||||
{
|
||||
var employeeAuthorizeTemp = await _employeeAuthorizeTempRepository.GetByNationalCode(nationalCode);
|
||||
if (employeeAuthorizeTemp.BirthDate.ToFarsi() != birthDate)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = employeeAuthorizeTemp.BirthDate.ToFarsi(),
|
||||
NationalCode = employeeAuthorizeTemp.NationalCode,
|
||||
IdNumber = employeeAuthorizeTemp.IdNumber,
|
||||
FName = employeeAuthorizeTemp.FName,
|
||||
FatherName = employeeAuthorizeTemp.FatherName,
|
||||
Gender = employeeAuthorizeTemp.Gender,
|
||||
LName = employeeAuthorizeTemp.LName,
|
||||
};
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
var apiResult = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (apiResult.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
}
|
||||
var basicInfo = apiResult.BasicInformation;
|
||||
var identityInfo = apiResult.IdentificationInformation;
|
||||
|
||||
data = new EmployeeDataFromApiViewModel()
|
||||
{
|
||||
BirthDate = identityInfo.BirthDate,
|
||||
NationalCode = identityInfo.NationalId,
|
||||
IdNumber = identityInfo.ShenasnamehNumber == "0" ? identityInfo.NationalId : identityInfo.ShenasnamehNumber,
|
||||
FatherName = basicInfo.FatherName,
|
||||
FName = basicInfo.FirstName,
|
||||
Gender = basicInfo.GenderEnum,
|
||||
LName = basicInfo.LastName,
|
||||
IdNumberSeri = identityInfo.ShenasnameSeri,
|
||||
IdNumberSerial = identityInfo.ShenasnameSerial
|
||||
};
|
||||
|
||||
var newAuthorizeTemp = new EmployeeAuthorizeTemp(data.Gender, data.FName, data.LName, data.FatherName, birthDateGr, data.NationalCode, data.IdNumber, data.IdNumberSerial, data.IdNumberSeri);
|
||||
await _employeeAuthorizeTempRepository.CreateAsync(newAuthorizeTemp);
|
||||
await _employeeAuthorizeTempRepository.SaveChangesAsync();
|
||||
|
||||
return op.Succcedded(data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
|
||||
@@ -29,4 +31,10 @@ public class EmployeeClientTempApplication : IEmployeeClientTempApplication
|
||||
{
|
||||
return _employeeClientTempRepository.GetDetails(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _employeeClientTempRepository.GetByEmployeeId(employeeId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType,roleId);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace CompanyManagment.Application
|
||||
public OperationResult DeleteUnsubmittedItems(long workshopId, long employeeId)
|
||||
{
|
||||
OperationResult op = new();
|
||||
(_, UserType userType) = _authHelper.GetUserTypeWithId();
|
||||
(_, UserType userType,_) = _authHelper.GetUserTypeWithId();
|
||||
var entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopIdWithItems(employeeId, workshopId);
|
||||
var items =
|
||||
entity.EmployeeDocumentItemCollection.Where(x =>
|
||||
@@ -244,7 +244,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
return op.Failed("پرسنل یافت نشد");
|
||||
@@ -289,7 +289,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType, roleId);
|
||||
|
||||
_employeeDocumentItemRepository.Create(newEntity);
|
||||
_employeeDocumentItemRepository.SaveChanges();
|
||||
@@ -311,7 +311,7 @@ namespace CompanyManagment.Application
|
||||
.ToList();
|
||||
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var unsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.Unsubmitted &&
|
||||
x.UploaderType == UserType.Client).ToList();
|
||||
@@ -356,7 +356,7 @@ namespace CompanyManagment.Application
|
||||
if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var unsubmittedDocs = notRejectedDocs.Where(x => x.DocumentStatus == DocumentStatus.Unsubmitted).ToList();
|
||||
|
||||
@@ -386,10 +386,9 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
return op.Failed("پرسنل یافت نشد");
|
||||
|
||||
|
||||
@@ -430,11 +429,12 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByClient);
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, roleId,DocumentStatus.SubmittedByClient);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
var currentItems = entity.EmployeeDocumentItemCollection.GroupBy(x => x.DocumentLabel)
|
||||
.Where(x => command.Any(a => a.Label == x.Key))
|
||||
.Select(x => x.MaxBy(y => y.CreationDate));
|
||||
|
||||
//This can bite!
|
||||
@@ -660,6 +660,12 @@ namespace CompanyManagment.Application
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentForClient(workshopId, accountId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Admin Only Methods
|
||||
@@ -670,7 +676,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
@@ -725,7 +731,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
@@ -778,7 +784,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType, roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
//ToDo: add check for leftwork
|
||||
if (!_employeeRepository.Exists(x => x.id == command.EmployeeId))
|
||||
@@ -834,7 +840,7 @@ namespace CompanyManagment.Application
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType);
|
||||
var newEntity = new EmployeeDocumentItem(command.WorkshopId, command.EmployeeId, mediaOpResult.SendId, entity.id, command.Label, uploaderId, uploaderType, roleId);
|
||||
|
||||
_employeeDocumentItemRepository.Create(newEntity);
|
||||
_employeeDocumentItemRepository.SaveChanges();
|
||||
@@ -856,7 +862,7 @@ namespace CompanyManagment.Application
|
||||
//if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
// return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, operatorType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, operatorType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var adminUnsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.SubmittedByClient ||
|
||||
(x.DocumentStatus == DocumentStatus.Unsubmitted && x.UploaderType == UserType.Admin)).ToList();
|
||||
@@ -895,7 +901,7 @@ namespace CompanyManagment.Application
|
||||
//if (!HasRequiredDocuments(notRejectedDocs, entity.Gender))
|
||||
// return op.Failed("مدارک الزامی بارگذاری نشده اند");
|
||||
|
||||
var (userId, operatorType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, operatorType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
var adminUnsubmittedDocs = currentDocs.Where(x => x.DocumentStatus == DocumentStatus.SubmittedByClient ||
|
||||
(x.DocumentStatus == DocumentStatus.Unsubmitted && x.UploaderType == UserType.Admin)).ToList();
|
||||
@@ -1131,7 +1137,7 @@ namespace CompanyManagment.Application
|
||||
OperationResult op = new();
|
||||
var entity = _employeeDocumentItemRepository.Get(documentItemId);
|
||||
|
||||
(long operatorId, _) = _authHelper.GetUserTypeWithId();
|
||||
(long operatorId, _,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (entity == null)
|
||||
return op.Failed(ApplicationMessages.RecordNotFound);
|
||||
@@ -1165,6 +1171,45 @@ namespace CompanyManagment.Application
|
||||
return await _employeeDocumentsRepository.GetAdminWorkFlowCountForNewEmployees(workshopIds);
|
||||
}
|
||||
|
||||
public async Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentCreatedEmployeeForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetWorkshopDocumentCreatedEmployeeForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public async Task<ICollection<WorkshopWithEmployeeDocumentsViewModel>> GetWorkshopDocumentRejectedForAdmin(List<long> workshops, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetWorkshopDocumentRejectedForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeDocumentsViewModel>> GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(long workshopId, long roleId)
|
||||
{
|
||||
return await _employeeDocumentsRepository.GetRejectedItemsByWorkshopIdAndRoleForAdminWorkFlow(workshopId,
|
||||
roleId);
|
||||
}
|
||||
|
||||
public Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetCreatedEmployeesWorkshopDocumentForAdmin(
|
||||
List<long> workshops, long roleId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetCreatedEmployeesWorkshopDocumentForAdmin(workshops, roleId);
|
||||
}
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetCreatedEmployeesDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetCreatedEmployeesDocumentByWorkshopIdForAdmin(workshopId);
|
||||
}
|
||||
|
||||
public Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(
|
||||
List<long> workshops, long roleId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentWorkshopsForAdmin(workshops,roleId);
|
||||
}
|
||||
|
||||
public Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
return _employeeDocumentsRepository.GetClientRejectedDocumentByWorkshopIdForAdmin(workshopId);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Checker Only Methods
|
||||
@@ -1189,7 +1234,7 @@ namespace CompanyManagment.Application
|
||||
return op.Failed("رکورد مورد نظر یافت نشد");
|
||||
}
|
||||
|
||||
(long operatorId, UserType userType) = _authHelper.GetUserTypeWithId();
|
||||
(long operatorId, UserType userType,long roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if ((item.DocumentStatus is DocumentStatus.SubmittedByAdmin or DocumentStatus.SubmittedByClient) == false)
|
||||
return op.Failed("امکان بررسی رکورد مورد نظر وجود ندارد");
|
||||
@@ -1390,7 +1435,7 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
var (uploaderId, uploaderType) = _authHelper.GetUserTypeWithId();
|
||||
var (uploaderId, uploaderType,roleId) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (!_employeeRepository.Exists(x => x.id == employeeId))
|
||||
|
||||
@@ -1414,27 +1459,42 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
var opCreate = Create(new CreateEmployeeDocuments()
|
||||
{ EmployeeId = employeeId, WorkshopId = workshopId });
|
||||
if (opCreate.IsSuccedded == false) return opCreate;
|
||||
entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopId(employeeId, workshopId);
|
||||
|
||||
if (opCreate.IsSuccedded == false)
|
||||
return opCreate;
|
||||
|
||||
entity = _employeeDocumentsRepository.GetByEmployeeIdWorkshopIdWithItems(employeeId, workshopId);
|
||||
}
|
||||
|
||||
List<EmployeeDocumentItem> newEntities = new();
|
||||
foreach (var item in command)
|
||||
{
|
||||
DeleteMultipleUnsubmittedDocumentsByLabel(entity, item.Label, uploaderType);
|
||||
long mediaId = 0;
|
||||
if (item.WithoutPicture)
|
||||
{
|
||||
var employeeDocumentItem =
|
||||
entity.EmployeeDocumentItemCollection.First(x => x.DocumentLabel == item.Label);
|
||||
mediaId = employeeDocumentItem.MediaId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteMultipleUnsubmittedDocumentsByLabel(entity, item.Label, uploaderType);
|
||||
|
||||
var mediaOpResult = UploadDocumentItemFile(item.PictureFile, item.Label.ToString(),
|
||||
$"temp/{workshopId}/{employeeId}");
|
||||
var mediaOpResult = UploadDocumentItemFile(item.PictureFile, item.Label.ToString(),
|
||||
$"temp/{workshopId}/{employeeId}");
|
||||
|
||||
if (mediaOpResult.IsSuccedded == false)
|
||||
return mediaOpResult;
|
||||
if (mediaOpResult.IsSuccedded == false)
|
||||
return mediaOpResult;
|
||||
|
||||
|
||||
//if the mediaId is already in use in our table return failed
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
//if the mediaId is already in use in our table return failed
|
||||
if (_employeeDocumentItemRepository.Exists(x => x.MediaId == mediaOpResult.SendId))
|
||||
return op.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaOpResult.SendId, entity.id, item.Label, uploaderId, uploaderType, DocumentStatus.SubmittedByAdmin);
|
||||
mediaId = mediaOpResult.SendId;
|
||||
}
|
||||
|
||||
var newEntity = new EmployeeDocumentItem(workshopId, employeeId, mediaId, entity.id, item.Label, uploaderId, uploaderType,roleId ,DocumentStatus.SubmittedByAdmin);
|
||||
newEntities.Add(newEntity);
|
||||
}
|
||||
|
||||
@@ -1459,6 +1519,24 @@ namespace CompanyManagment.Application
|
||||
return op.Succcedded(entity.id);
|
||||
}
|
||||
|
||||
public EmployeeDocumentItemViewModel GetOneDocumentItemDetailsForAdmin(long employeeId, long workshopId,long documentItemId)
|
||||
{
|
||||
var documentItem = _employeeDocumentItemRepository.GetWithEmployeeDocumentsByItemId(documentItemId);
|
||||
var viewModel = new EmployeeDocumentItemViewModel()
|
||||
{
|
||||
CreationDateTime = documentItem.CreationDate,
|
||||
DocumentItemLabel = documentItem.DocumentLabel,
|
||||
EmployeeDocumentsId = documentItem.EmployeeDocumentId,
|
||||
Gender = documentItem.EmployeeDocuments.Gender,
|
||||
Id = documentItem.id,
|
||||
Status = documentItem.DocumentStatus,
|
||||
MediaId = documentItem.MediaId,
|
||||
RejectionMessage = documentItem.RejectionReason,
|
||||
UploaderType = documentItem.UploaderType
|
||||
};
|
||||
return viewModel;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1785,8 +1863,9 @@ namespace CompanyManagment.Application
|
||||
StatusString = item.DocumentStatus.ToString().ToLower(),
|
||||
PicturePath = medias.FirstOrDefault(x => x.Id == item.MediaId)?.Path ?? "",
|
||||
RejectionMessage = item.RejectionReason,
|
||||
UploaderType = item.UploaderType
|
||||
};
|
||||
UploaderType = item.UploaderType,
|
||||
MediaId = medias.FirstOrDefault(x => x.Id == item.MediaId)?.Id ?? 0,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FinancialTransactionApplication : IFinancialTransactionApplication
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var now = DateTime.Now;
|
||||
var check = _financialTransactionRepository.Exists(x => x.CreationDate.Date == now.Date && x.CreationDate.Hour == now.Hour && x.CreationDate.Minute == now.Minute &&
|
||||
var check = _financialTransactionRepository.Exists(x => x.CreationDate.Date == now.Date && x.CreationDate.Hour == now.Hour && x.CreationDate.Minute == now.Minute && x.CreationDate.Second == now.Second &&
|
||||
x.FinancialStatementId == command.FinancialStatementId
|
||||
&& x.Creditor == command.Creditor &&
|
||||
x.Deptor == command.Deptor &&
|
||||
@@ -32,9 +32,14 @@ public class FinancialTransactionApplication : IFinancialTransactionApplication
|
||||
command.TypeOfTransaction, command.DescriptionOption, command.Deptor, command.Creditor, 0);
|
||||
_financialTransactionRepository.Create(transaction);
|
||||
_financialTransactionRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("تکراری است");
|
||||
}
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class FineApplication : IFineApplication
|
||||
#endregion
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
Fine entity = new Fine(employeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
@@ -218,7 +218,7 @@ public class FineApplication : IFineApplication
|
||||
}
|
||||
|
||||
DateTime date = command.FineDate.ToGeorgianDateTime();
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType,_) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
|
||||
entity.Edit(command.EmployeeId, command.WorkshopId, command.Title, command.Amount.MoneyToDouble(), date,
|
||||
|
||||
@@ -89,8 +89,8 @@ public class InsuranceJobApplication: IInsuranceJobApplication
|
||||
if (_insuranceJobRepositpry.Exists(x => x.InsuranceJobTitle == command.InsuranceJobTitle && x.id!=command.Id))
|
||||
return opration.Failed("عنوان صنف و درجه تکراری است");
|
||||
|
||||
if (_insuranceJobRepositpry.Exists(x => x.EconomicCode == command.EconomicCode && x.id != command.Id))
|
||||
return opration.Failed("کد اقتصادی تکراری است");
|
||||
//if (_insuranceJobRepositpry.Exists(x => x.EconomicCode == command.EconomicCode && x.id != command.Id))
|
||||
// return opration.Failed("کد اقتصادی تکراری است");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1633,6 +1633,7 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
dateSaleryviewModel.StartDateGr = startDateGr;
|
||||
dateSaleryviewModel.EndDateGr = endDateGr;
|
||||
var _dateSalary = _dateSalaryRepository.GetDateSalaryViewModel(dateSaleryviewModel);
|
||||
// && _dateSalary.Id >0
|
||||
if (_dateSalary != null)
|
||||
{
|
||||
var dateSaleryItemviewModel = new DateSalaryItemSearchModel();
|
||||
|
||||
@@ -240,6 +240,11 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _leftWorkTempRepository.GetLeftWorkTempsByEmployeeId(employeeId);
|
||||
}
|
||||
|
||||
public List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId)
|
||||
{
|
||||
return _leftWorkTempRepository.GetLeftWorksByWorkshopId(workshopId);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class LoanApplication : ILoanApplication
|
||||
|
||||
#endregion
|
||||
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ public class RewardApplication : IRewardApplication
|
||||
|
||||
|
||||
#endregion
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ public class RewardApplication : IRewardApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است پاداشی دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == command.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= grantDate && x.ContractEnd >= grantDate))
|
||||
|
||||
@@ -8,6 +8,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopSettingsAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
@@ -24,7 +25,6 @@ namespace CompanyManagment.Application;
|
||||
public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeaveRepository _leaveRepository;
|
||||
@@ -33,11 +33,11 @@ public class RollCallApplication : IRollCallApplication
|
||||
private readonly IRollCallDomainService _rollCallDomainService;
|
||||
private readonly ICustomizeWorkshopSettingsRepository _customizeWorkshopSettingsRepository;
|
||||
private readonly ICustomizeWorkshopEmployeeSettingsRepository _customizeWorkshopEmployeeSettingsRepository;
|
||||
private readonly ICustomizeCheckoutTempRepository _customizeCheckoutTempRepository;
|
||||
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository)
|
||||
public RollCallApplication(IRollCallRepository rollCallRepository, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository, ICustomizeCheckoutRepository customizeCheckoutRepository, ICheckoutRepository checkoutRepository, IRollCallDomainService rollCallDomainService, ICustomizeWorkshopSettingsRepository customizeWorkshopSettingsRepository, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository)
|
||||
{
|
||||
_rollCallRepository = rollCallRepository;
|
||||
_employeeApplication = employeeApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_leaveRepository = leaveRepository;
|
||||
@@ -46,7 +46,8 @@ public class RollCallApplication : IRollCallApplication
|
||||
_rollCallDomainService = rollCallDomainService;
|
||||
_customizeWorkshopSettingsRepository = customizeWorkshopSettingsRepository;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
}
|
||||
_customizeCheckoutTempRepository = customizeCheckoutTempRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCall command)
|
||||
{
|
||||
@@ -55,7 +56,7 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
var yearFa = Convert.ToInt32(startDateFa.Substring(0, 4));
|
||||
var monthFa = Convert.ToInt32(startDateFa.Substring(5, 2));
|
||||
var employeeName = _employeeApplication.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var employeeName = _employeeRepository.GetDetails(command.EmployeeId).EmployeeFullName;
|
||||
var create = new RollCall(command.WorkshopId, command.EmployeeId, employeeName, command.StartDate.Value, null,
|
||||
yearFa, monthFa, _rollCallDomainService);
|
||||
_rollCallRepository.Create(create);
|
||||
@@ -503,6 +504,12 @@ public class RollCallApplication : IRollCallApplication
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.ClearTimeDiff();
|
||||
rollCallsAsEntityModel.SetShiftDate(_rollCallDomainService);
|
||||
}
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.Edit(rollCallsAsEntityModel.StartDate.Value, rollCallsAsEntityModel.EndDate.Value, _rollCallDomainService);
|
||||
}
|
||||
@@ -672,6 +679,12 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
_rollCallRepository.AddRange(rollCallsAsEntityModels);
|
||||
_rollCallRepository.SaveChanges();
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
rollCallsAsEntityModel.ClearTimeDiff();
|
||||
rollCallsAsEntityModel.SetShiftDate(_rollCallDomainService);
|
||||
}
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
foreach (var rollCallsAsEntityModel in rollCallsAsEntityModels)
|
||||
{
|
||||
@@ -772,4 +785,56 @@ public class RollCallApplication : IRollCallApplication
|
||||
{
|
||||
return _rollCallRepository.CheckRepeat(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public OperationResult RecalculateValues(long workshopId, List<ReCalculateRollCallValues> commands)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
try
|
||||
{
|
||||
List<DateTime> fromDates = commands.Select(x => x.FromDate.ToGeorgianDateTime()).ToList();
|
||||
var employeeIds = commands.Select(x => x.EmployeeId).ToList();
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش رسمی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی نهایی است");
|
||||
}
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) && fromDates.Any(a => a <= x.ContractStart)))
|
||||
{
|
||||
return operationResult.Failed("پرسنل بعد از تاریخ وارد شده دارای فیش غیررسمی موقت است");
|
||||
}
|
||||
|
||||
var oldestDate = commands.MinBy(x => x.FromDate).FromDate.ToGeorgianDateTime();
|
||||
|
||||
var allRollCalls = _rollCallRepository
|
||||
.GetRollCallsUntilNowWithWorkshopIdEmployeeIds(workshopId, commands.Select(x => x.EmployeeId).ToList(),
|
||||
oldestDate).GetAwaiter().GetResult();
|
||||
|
||||
|
||||
foreach (var command in commands)
|
||||
{
|
||||
var rollCalls = allRollCalls
|
||||
.Where(x => x.EmployeeId == command.EmployeeId && x.ShiftDate >= command.FromDate.ToGeorgianDateTime()).ToList();
|
||||
|
||||
foreach (var rollCall in rollCalls)
|
||||
{
|
||||
rollCall.ClearTimeDiff();
|
||||
_rollCallRepository.SaveChanges();
|
||||
rollCall.SetEndDateTime(rollCall.EndDate!.Value, _rollCallDomainService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return operationResult.Succcedded();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return operationResult.Failed(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -92,12 +92,13 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
//موقت
|
||||
// دادمهرگستر 11 *
|
||||
//585 کاشی گالری سرامیس (بابک ابراهیمی ) *
|
||||
//585 کاشی گالری سرامیس (بابک ابراهیمی )
|
||||
//آموزشگاه ملل 604 *
|
||||
//کاریابی ملل 605 *
|
||||
//368 پیتزا امیر آماده سازی
|
||||
//367 پیتزا امیر رستوران
|
||||
//286 مرکز توان بخشی رسالت *
|
||||
//610 بیمارستان پارس - رازقی طعام
|
||||
DateTime start1404 = new DateTime(2025, 03, 21);
|
||||
bool skipRollCallByWorkshopId = false;
|
||||
if (contractStart < start1404)
|
||||
@@ -106,7 +107,7 @@ namespace CompanyManagment.Application
|
||||
}
|
||||
else
|
||||
{
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367;
|
||||
skipRollCallByWorkshopId = workshopId is 368 or 367 or 585 or 610;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -24,4 +25,10 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
||||
{
|
||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking);
|
||||
}
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
||||
string shiftwork)
|
||||
{
|
||||
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
@@ -122,7 +122,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی موقت صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate,userId,userType);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
@@ -193,7 +193,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
var id = employeeId;
|
||||
|
||||
@@ -23,6 +23,7 @@ using Company.Domain.DateSalaryAgg;
|
||||
using Company.Domain.DateSalaryItemAgg;
|
||||
using Company.Domain.EmployeeAccountAgg;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.EmployeeBankInformationAgg;
|
||||
using Company.Domain.EmployeeChildrenAgg;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
@@ -174,6 +175,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class EmployeeAuthorizeTempMapping:IEntityTypeConfiguration<EmployeeAuthorizeTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<EmployeeAuthorizeTemp> builder)
|
||||
{
|
||||
builder.ToTable("EmployeeAuthorizeTemps");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.NationalCode).HasMaxLength(15);
|
||||
builder.Property(x => x.IdNumber).HasMaxLength(15);
|
||||
builder.Property(x => x.FName).HasMaxLength(100);
|
||||
builder.Property(x => x.LName).HasMaxLength(100);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(100);
|
||||
builder.Property(x => x.Gender).HasConversion<string>().HasMaxLength(15);
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.HasIndex(x => x.NationalCode).IsUnique();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -80,9 +80,17 @@ public class EmployeeMapping : IEntityTypeConfiguration<Employee>
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.HasMany(x => x.EmployeeBankInformationList).WithOne(x => x.Employee)
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
.HasForeignKey(x => x.EmployeeId);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(25);
|
||||
builder.Property(x => x.IdNumberSeri).HasMaxLength(25);
|
||||
|
||||
builder.Ignore(x => x.FullName);
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionCo
|
||||
builder.Property(x => x.Signature).HasMaxLength(1);
|
||||
builder.Property(x => x.OfficialCompany).HasMaxLength(12);
|
||||
builder.Property(x => x.TypeOfContract).HasMaxLength(30);
|
||||
builder.Property(x => x.HasValueAddedTax).HasMaxLength(10);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
|
||||
|
||||
builder.HasMany(x => x.RollCallServicesList)
|
||||
.WithOne(x => x.Workshop)
|
||||
.HasForeignKey(x => x.AccountId);
|
||||
.HasForeignKey(x => x.WorkshopId);
|
||||
|
||||
builder.HasMany(x => x.TaxLeftWorkCategoryList)
|
||||
.WithOne(x => x.Workshop)
|
||||
|
||||
9407
CompanyManagment.EFCore/Migrations/20250426185835_institutioncontractChanges.Designer.cs
generated
Normal file
9407
CompanyManagment.EFCore/Migrations/20250426185835_institutioncontractChanges.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class institutioncontractChanges : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "HasValueAddedTax",
|
||||
table: "InstitutionContracts",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "HasValueAddedTax",
|
||||
table: "InstitutionContracts",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10,
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
9471
CompanyManagment.EFCore/Migrations/20250501111715_add employeeAuthorizeTemp and add serialNumber.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addemployeeAuthorizeTempandaddserialNumber : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees",
|
||||
type: "nvarchar(25)",
|
||||
maxLength: 25,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EmployeeAuthorizeTemps",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Gender = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: false),
|
||||
FName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
FatherName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
BirthDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
NationalCode = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumber = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true),
|
||||
IdNumberSerial = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
IdNumberSeri = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EmployeeAuthorizeTemps", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EmployeeAuthorizeTemps_NationalCode",
|
||||
table: "EmployeeAuthorizeTemps",
|
||||
column: "NationalCode",
|
||||
unique: true,
|
||||
filter: "[NationalCode] IS NOT NULL");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "EmployeeAuthorizeTemps");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employees");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employees");
|
||||
}
|
||||
}
|
||||
}
|
||||
9407
CompanyManagment.EFCore/Migrations/20250503140454_changeRollCallServiceRelation.Designer.cs
generated
Normal file
9407
CompanyManagment.EFCore/Migrations/20250503140454_changeRollCallServiceRelation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class changeRollCallServiceRelation : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_AccountId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_RollCallServices_AccountId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RollCallServices_WorkshopId",
|
||||
table: "RollCallServices",
|
||||
column: "WorkshopId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_WorkshopId",
|
||||
table: "RollCallServices",
|
||||
column: "WorkshopId",
|
||||
principalTable: "Workshops",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_WorkshopId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_RollCallServices_WorkshopId",
|
||||
table: "RollCallServices");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RollCallServices_AccountId",
|
||||
table: "RollCallServices",
|
||||
column: "AccountId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_RollCallServices_Workshops_AccountId",
|
||||
table: "RollCallServices",
|
||||
column: "AccountId",
|
||||
principalTable: "Workshops",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
9474
CompanyManagment.EFCore/Migrations/20250505140611_add uploaderRoleId to EmployeeDocumentItems.Designer.cs
generated
Normal file
9474
CompanyManagment.EFCore/Migrations/20250505140611_add uploaderRoleId to EmployeeDocumentItems.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class adduploaderRoleIdtoEmployeeDocumentItems : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "UploaderRoleId",
|
||||
table: "EmployeeDocumentItems",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UploaderRoleId",
|
||||
table: "EmployeeDocumentItems");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1495,6 +1495,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1591,6 +1599,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1779,6 +1843,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("UploaderId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("UploaderRoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UploaderType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -2797,7 +2864,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("HasValueAddedTax")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<string>("IsActiveString")
|
||||
.HasMaxLength(5)
|
||||
@@ -4636,7 +4704,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
b.HasIndex("WorkshopId");
|
||||
|
||||
b.ToTable("RollCallServices", (string)null);
|
||||
});
|
||||
@@ -8902,7 +8970,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
.WithMany("RollCallServicesList")
|
||||
.HasForeignKey("AccountId")
|
||||
.HasForeignKey("WorkshopId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
|
||||
@@ -28,10 +28,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
private readonly IEmployeeApplication _employeeApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IContractApplication _contractApplication;
|
||||
private readonly IWorkingHoursApplication _workingHoursApplication;
|
||||
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
|
||||
private readonly IAuthHelper _authHelper;
|
||||
@@ -39,14 +36,9 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallRepository _rollCallRepository;
|
||||
|
||||
public CheckoutRepository(IEmployeeApplication employeeApplication, IWorkshopApplication workshopApplication,
|
||||
IContractApplication contractApplication, IWorkingHoursApplication workingHoursApplication,
|
||||
IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository) : base(context)
|
||||
public CheckoutRepository(IAuthHelper authHelper, CompanyContext context, IConfiguration configuration, ILeftWorkRepository leftWorkRepository, IWorkingHoursTempApplication workingHoursTempApplication, IRollCallRepository rollCallRepository) : base(context)
|
||||
{
|
||||
_employeeApplication = employeeApplication;
|
||||
_workshopApplication = workshopApplication;
|
||||
_contractApplication = contractApplication;
|
||||
_workingHoursApplication = workingHoursApplication;
|
||||
|
||||
_authHelper = authHelper;
|
||||
_context = context;
|
||||
_configuration = configuration;
|
||||
@@ -90,7 +82,16 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
TotalDeductions = x.TotalDeductions,
|
||||
TotalPayment = x.TotalPayment,
|
||||
RewardPay = x.RewardPay,
|
||||
})
|
||||
HasRollCall = x.HasRollCall,
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
ContractId = x.ContractId,
|
||||
ContractStartGr = x.ContractStart,
|
||||
ContractEndGr = x.ContractEnd,
|
||||
ContractStart = x.ContractStart.ToFarsi(),
|
||||
ContractEnd = x.ContractEnd.ToFarsi()
|
||||
|
||||
})
|
||||
.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg.Entities;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewModel;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -174,4 +177,65 @@ public class CustomizeWorkshopEmployeeSettingsRepository(CompanyContext companyC
|
||||
if (entity != null)
|
||||
Remove(entity);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
var employeeSettings = _companyContext.CustomizeWorkshopEmployeeSettings.Find(command.Id);
|
||||
if (employeeSettings == null)
|
||||
{
|
||||
throw new InvalidDataException();
|
||||
}
|
||||
|
||||
if (command.WorkshopShiftStatus != employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (employeeSettings.WorkshopShiftStatus)
|
||||
{
|
||||
case WorkshopShiftStatus.Irregular:
|
||||
if (command.IrregularShift != employeeSettings.IrregularShift)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Rotating:
|
||||
var rotatingShift = command.CustomizeRotatingShifts
|
||||
.Select(x => new CustomizeRotatingShift(TimeOnly.Parse(x.StartTime), TimeOnly.Parse(x.EndTime)))
|
||||
.ToList();
|
||||
|
||||
if (!rotatingShift.All(x => employeeSettings.CustomizeRotatingShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case WorkshopShiftStatus.Regular:
|
||||
var employeesShifts =
|
||||
command.ShiftViewModel.Select(x =>
|
||||
{
|
||||
var placement = x.Placement switch
|
||||
{
|
||||
ShiftPlacement.First => "اول",
|
||||
ShiftPlacement.Second => "دوم",
|
||||
ShiftPlacement.Third => "سوم"
|
||||
};
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException($"فرمت شروع نوبت{placement}نادرست است");
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException($"فرمت پایان نوبت{placement}نادرست است");
|
||||
|
||||
|
||||
return new CustomizeWorkshopEmployeeSettingsShift(start, end, x.Placement);
|
||||
|
||||
}).ToList();
|
||||
if (!employeesShifts.All(x => employeeSettings.CustomizeWorkshopEmployeeSettingsShifts.Any(x.Equals)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -123,15 +123,18 @@ public class CustomizeWorkshopGroupSettingsRepository(CompanyContext companyCont
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now.Date;
|
||||
var leftWork = _companyContext.LeftWorkList.Where(x =>
|
||||
x.WorkshopId == workshopId && x.StartWorkDate <= dateNow && x.LeftWorkDate >= dateNow);
|
||||
|
||||
var rollCallEmployeesWithoutCWS = _companyContext.RollCallEmployees
|
||||
var rollCallEmployeesWithoutCWS = _companyContext.RollCallEmployees
|
||||
.Include(x =>
|
||||
x.EmployeesStatus)
|
||||
.Where(
|
||||
x =>
|
||||
x.WorkshopId == workshopId &&
|
||||
x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) &&
|
||||
x.HasUploadedImage == "true")
|
||||
x.HasUploadedImage == "true"&&
|
||||
leftWork.Any(l => l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId))
|
||||
.GroupJoin(_companyContext.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery()
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings)
|
||||
|
||||
@@ -92,6 +92,7 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Offset = entity.EndTimeOffSet,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
@@ -106,7 +107,7 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee.FName} {employee.LName}",
|
||||
Name = $"{employee?.FName} {employee?.LName}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
@@ -115,7 +116,14 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
|
||||
CustomizeRotatingShiftsViewModels = y.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
LeavePermittedDays = y.LeavePermittedDays,
|
||||
IrregularShift = y.IrregularShift,
|
||||
WorkshopShiftStatus = y.WorkshopShiftStatus
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = x.Salary,
|
||||
@@ -127,7 +135,16 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup
|
||||
MainGroup = x.MainGroup,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift
|
||||
|
||||
|
||||
|
||||
}).ToList(),
|
||||
};
|
||||
|
||||
@@ -77,6 +77,7 @@ public class DateSalaryRepository : RepositoryBase<long, DateSalary>, IDateSalar
|
||||
var dateSalary = new DateSalary(command.StartDateFa, command.EndDateFa);
|
||||
Create(dateSalary);
|
||||
SaveChanges();
|
||||
command.DateSalaryItems = command.DateSalaryItems.Where(x => x.Salary > 0).ToList();
|
||||
foreach (var item in command.DateSalaryItems)
|
||||
{
|
||||
|
||||
@@ -104,7 +105,7 @@ public class DateSalaryRepository : RepositoryBase<long, DateSalary>, IDateSalar
|
||||
var dateSalary = Get(command.Id);
|
||||
dateSalary.Edit(command.StartDateFa, command.EndDateFa);
|
||||
SaveChanges();
|
||||
|
||||
command.DateSalaryItems = command.DateSalaryItems.Where(x => x.Salary > 0).ToList();
|
||||
foreach (var item in command.DateSalaryItems)
|
||||
{
|
||||
if (item.Id == 0)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class EmployeeAuthorizeTempRepository:RepositoryBase<long,EmployeeAuthorizeTemp>, IEmployeeAuthorizeTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public EmployeeAuthorizeTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<EmployeeAuthorizeTemp> GetByNationalCode(string nationalCode)
|
||||
{
|
||||
return await _context.EmployeeAuthorizeTemps.FirstOrDefaultAsync(x =>
|
||||
x.NationalCode == nationalCode);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -32,4 +35,18 @@ public class EmployeeClientTempRepository: RepositoryBase<long, EmployeeClientT
|
||||
WorkshopId = x.WorkshopId
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _context.EmployeeClientTemps.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new EmployeeClientTempViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
MaritalStatus = x.MaritalStatus,
|
||||
StartWorkDate = x.StartWorkDate
|
||||
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -450,7 +450,7 @@ public class EmployeeRepository : RepositoryBase<long, Employee>, IEmployeeRepos
|
||||
|
||||
var employeeData = new Employee(command.FName, command.LName, command.FatherName, dateOfBirth,
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,command.IdNumberSerial,command.IdNumberSeri,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
|
||||
@@ -226,7 +226,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
public List<InstitutionContractViewModel> NewSearch(InstitutionContractSearchModel searchModel)
|
||||
{
|
||||
var timer = Stopwatch.StartNew();
|
||||
var query = _context.InstitutionContractSet.Select(x => new InstitutionContractViewModel()
|
||||
var query = _context.InstitutionContractSet.AsSplitQuery()
|
||||
.Select(x => new InstitutionContractViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
@@ -257,7 +258,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
// LeftWorkIds = w.LeftWorks.Where(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate > DateTime.Now).Select(l => l.EmployeeId).ToList(),
|
||||
// InsuranceLeftWorkIds = w.LeftWorkInsurances.Where(l => (l.StartWorkDate <= DateTime.Now && l.LeftWorkDate > DateTime.Now) || (l.StartWorkDate <= DateTime.Now && l.LeftWorkDate == null)).Select(l => l.EmployeeId).ToList(),
|
||||
//}).Where(w=>w.ContractingPartId == x.ContractingPartyId).ToList(),
|
||||
WorkshopIds = _context.Workshops.Include(w => w.WorkshopEmployers).Select(w => new WorkshopViewModel()
|
||||
WorkshopIds = _context.Workshops
|
||||
.Include(w => w.WorkshopEmployers).Select(w => new WorkshopViewModel()
|
||||
{
|
||||
Id = w.id,
|
||||
ContractingPartId = w.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
@@ -270,12 +272,12 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
FullName = e.FName + " " + e.LName,
|
||||
|
||||
}).GroupBy(e => e.Id).Select(e => e.First()).ToList(),
|
||||
EmployerIds = _context.Employers.Where(e => e.ContractingPartyId == x.ContractingPartyId).Select(e => e.id).ToList(),
|
||||
EmployerIds = _context.Employers.AsSplitQuery().Where(e => e.ContractingPartyId == x.ContractingPartyId).Select(e => e.id).ToList(),
|
||||
EmployerNo = "",
|
||||
EmployerName = "",
|
||||
|
||||
IsContractingPartyBlock = _context.PersonalContractingParties.Any(p => p.id == x.ContractingPartyId && p.IsBlock == "true") ? "true" : "false",
|
||||
BlockTimes = _context.PersonalContractingParties.Any(p => p.id == x.ContractingPartyId) ? _context.PersonalContractingParties.FirstOrDefault(p => p.id == x.ContractingPartyId).BlockTimes : 0,
|
||||
IsContractingPartyBlock = _context.PersonalContractingParties.AsSplitQuery().Any(p => p.id == x.ContractingPartyId && p.IsBlock == "true") ? "true" : "false",
|
||||
BlockTimes = _context.PersonalContractingParties.AsSplitQuery().Any(p => p.id == x.ContractingPartyId) ? _context.PersonalContractingParties.FirstOrDefault(p => p.id == x.ContractingPartyId).BlockTimes : 0,
|
||||
|
||||
});
|
||||
|
||||
@@ -407,7 +409,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
BlockTimes = x.BlockTimes,
|
||||
// EmployeeCount = ((x.WorkshopViewModels.Sum(w => w.LeftWorkIds.Count)) + (x.WorkshopViewModels.Sum(w => w.InsuranceLeftWorkIds.Count(c => !w.LeftWorkIds.Contains(c))))).ToString(),
|
||||
// ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
||||
WorkshopViewModels = _context.Workshops.Where(w => x.WorkshopIds.Contains(w.id)).Include(w => w.LeftWorks).Include(w => w.LeftWorkInsurances).Select(w => new WorkshopViewModel()
|
||||
WorkshopViewModels = _context.Workshops.AsSplitQuery().Where(w => x.WorkshopIds.Contains(w.id)).Include(w => w.LeftWorks).Include(w => w.LeftWorkInsurances).Select(w => new WorkshopViewModel()
|
||||
{
|
||||
Id = w.id,
|
||||
WorkshopName = w.WorkshopName,
|
||||
|
||||
@@ -92,12 +92,28 @@ public class LeftWorkTempRepository : RepositoryBase<long, LeftWorkTemp>, ILeftW
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
JobId = x.JobId,
|
||||
LastDayStanding = x.LastDayStanding.ToFarsi(),
|
||||
LeftWork = x.LeftWork.ToFarsi(),
|
||||
LastDayStanding = x.LastDayStanding,
|
||||
LeftWork = x.LeftWork,
|
||||
LeftWorkType = x.LeftWorkType,
|
||||
StartWork = x.StartWork.ToFarsi()
|
||||
StartWork = x.StartWork
|
||||
}).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _companyContext.LeftWorkTemps.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new LeftWorkTempViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
LeftWorkType = x.LeftWorkType,
|
||||
StartWork = x.StartWork,
|
||||
LeftWork = x.LeftWork,
|
||||
JobId = x.JobId,
|
||||
LastDayStanding = x.LastDayStanding,
|
||||
LeftWorkId = x.LeftWorkId
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,146 @@ public class ReportRepository : IReportRepository
|
||||
// };
|
||||
|
||||
//}
|
||||
|
||||
//public async Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
//{
|
||||
// var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
// // Parse the start and end dates for the current and next months
|
||||
// #region FindMonthStartAndEnd
|
||||
|
||||
// string nowFa = $"{(DateTime.Now.ToFarsi()).Substring(0, 8)}01";
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(year) && !string.IsNullOrWhiteSpace(month))
|
||||
// nowFa = $"{year}/{month}/01";
|
||||
|
||||
|
||||
// var currentEndOfMonth = nowFa.FindeEndOfMonth();
|
||||
|
||||
// //شروع ماه جاری
|
||||
// var currentMonthStart = nowFa.ToGeorgianDateTime();
|
||||
// // پایان کاه جاری
|
||||
// var currentMonthEnd = currentEndOfMonth.ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
// int currentYear = Convert.ToInt32(nowFa.Substring(0, 4));
|
||||
// var currentMonth = Convert.ToInt32(nowFa.Substring(5, 2));
|
||||
// var nextMonthStartFa = new PersianDateTime(currentYear, currentMonth, 1).AddMonths(1);
|
||||
|
||||
// //شروع ماه بعد
|
||||
// var nextMonthStart = ($"{nextMonthStartFa}").ToGeorgianDateTime();
|
||||
// //پایان ماه بعد
|
||||
// var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
// #endregion
|
||||
|
||||
// // Preload data to reduce database calls
|
||||
// var accountLeftWorks = await _accountContext.AccountLeftWorks
|
||||
// .Where(x => x.RoleId == 5)
|
||||
// .ToListAsync();
|
||||
|
||||
// var leftWorkList = await _context.LeftWorkList
|
||||
// .Where(x => x.StartWorkDate <= nextMonthEnd && x.LeftWorkDate > currentMonthStart)
|
||||
// .ToListAsync();
|
||||
|
||||
// var institutionContracts = await _context.InstitutionContractSet
|
||||
// .Where(c => c.ContractStartGr <= nextMonthEnd && c.ContractEndGr >= currentMonthStart)
|
||||
// .ToListAsync();
|
||||
|
||||
// var accounts = await _accountContext.Accounts
|
||||
// .Where(x => x.RoleId == 5)
|
||||
// .ToListAsync();
|
||||
|
||||
// // Filter workshops
|
||||
// var activeWorkshops = await _context.WorkshopEmployers
|
||||
// .Include(x => x.Workshop)
|
||||
// .Include(x => x.Employer.ContractingParty)
|
||||
// .Where(x => x.Workshop.IsActiveString == "true" &&
|
||||
// x.Employer.ContractingParty.IsActiveString == "true" &&
|
||||
// x.Employer.ContractingParty.IsBlock != "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// // Group workshops by contract type
|
||||
// var workshopsWithContracts = activeWorkshops
|
||||
// .Where(x => institutionContracts.Any(c => c.ContractingPartyId == x.Employer.ContractingPartyId))
|
||||
// .Select(x => x.WorkshopId)
|
||||
// .Distinct()
|
||||
// .ToList();
|
||||
|
||||
// var workshopsWithoutContracts = activeWorkshops
|
||||
// .Where(x => x.Employer.ContractingPartyId == 30428)
|
||||
// .Select(x => x.WorkshopId)
|
||||
// .Distinct()
|
||||
// .ToList();
|
||||
|
||||
// var allWorkshops = workshopsWithContracts.Concat(workshopsWithoutContracts).Distinct().ToList();
|
||||
|
||||
// // Calculate left works and contracts
|
||||
// var leftWorks = leftWorkList
|
||||
// .Where(x => allWorkshops.Contains(x.WorkshopId))
|
||||
// .ToList();
|
||||
|
||||
// var leftWorkEmployeeIds = leftWorks.Select(x => x.EmployeeId).ToHashSet();
|
||||
|
||||
// var contracts = await _context.Contracts
|
||||
// .Where(x => leftWorkEmployeeIds.Contains(x.EmployeeId) &&
|
||||
// x.ContarctStart.Date <= nextMonthEnd.Date &&
|
||||
// x.ContractEnd.Date > nextMonthStart.Date &&
|
||||
// x.IsActiveString == "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// var signedContracts = contracts.Count(x => x.Signature == "1");
|
||||
|
||||
// // Calculate checkouts
|
||||
// var checkouts = await _context.CheckoutSet
|
||||
// .Where(x => leftWorkEmployeeIds.Contains(x.EmployeeId) &&
|
||||
// x.ContractStart.Date >= currentMonthStart.Date &&
|
||||
// x.ContractEnd.Date <= currentMonthEnd.Date &&
|
||||
// x.IsActiveString == "true")
|
||||
// .ToListAsync();
|
||||
|
||||
// var signedCheckouts = checkouts.Count(x => x.Signature == "1");
|
||||
|
||||
// // Calculate percentages
|
||||
// var contractToBe = leftWorks.Count;
|
||||
// var createdContracts = contracts.Count;
|
||||
// var checkoutToBe = leftWorks.Count;
|
||||
// var createdCheckouts = checkouts.Count;
|
||||
|
||||
// var contractPercent = contractToBe > 0 ? (createdContracts * 100) / contractToBe : 0;
|
||||
// var contractSignaturePercent = createdContracts > 0 ? (signedContracts * 100) / createdContracts : 0;
|
||||
// var checkoutPercent = checkoutToBe > 0 ? (createdCheckouts * 100) / checkoutToBe : 0;
|
||||
// var checkoutSignaturePercent = createdCheckouts > 0 ? (signedCheckouts * 100) / createdCheckouts : 0;
|
||||
|
||||
// // Prepare the final result
|
||||
// var finalResult = new AllReport
|
||||
// {
|
||||
// AllPercent = (contractPercent + contractSignaturePercent + checkoutPercent + checkoutSignaturePercent) / 4,
|
||||
// ContractPercent = contractPercent,
|
||||
// ContractSignaturePercent = contractSignaturePercent,
|
||||
// CheckoutPercent = checkoutPercent,
|
||||
// CheckoutSignaturePercent = checkoutSignaturePercent,
|
||||
// Year = $"{currentMonthStart.Year}",
|
||||
// Month = nowFa.Substring(5, 2),
|
||||
// AllContract = contractToBe,
|
||||
// ContractNotDone = contractToBe - createdContracts,
|
||||
// ContrcatDone = createdContracts,
|
||||
// ContractSignNotDone = createdContracts - signedContracts,
|
||||
// ContractSignDone = signedContracts,
|
||||
// AllCheckout = checkoutToBe,
|
||||
// CheckoutNotDone = checkoutToBe - createdCheckouts,
|
||||
// CheckoutDone = createdCheckouts,
|
||||
// CheckoutSignDone = signedCheckouts,
|
||||
// CheckoutSignNotDone = createdCheckouts - signedCheckouts
|
||||
// };
|
||||
|
||||
// Console.WriteLine("Optimized method execution time: " + watch.Elapsed);
|
||||
// return finalResult;
|
||||
//}
|
||||
|
||||
|
||||
public Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
@@ -1951,16 +2091,24 @@ public class ReportRepository : IReportRepository
|
||||
{
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
int contractSignedPercent = 0;
|
||||
if (contractSigned > 0)
|
||||
{
|
||||
contractSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
contractSignedPercent = 0;
|
||||
}
|
||||
|
||||
var checkoutSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
if (checkoutSignedPercent < 100 && contractCreated > 0)
|
||||
if (contractSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x=>x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
@@ -1968,7 +2116,7 @@ public class ReportRepository : IReportRepository
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractSignPercent = checkoutSignedPercent,
|
||||
ContractSignPercent = contractSignedPercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
? "true"
|
||||
: "false",
|
||||
HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage,
|
||||
CreatedByClient = clientTemp != null || (employee.workshopTemp != null &&employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork)
|
||||
CreatedByClient = clientTemp != null || (employee.workshopTemp != null && employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork)
|
||||
};
|
||||
|
||||
|
||||
@@ -272,8 +272,15 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
var dateNow = DateTime.Now.Date;
|
||||
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus).Where(x => x.WorkshopId == workshopId
|
||||
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow) && x.HasUploadedImage == "true");
|
||||
|
||||
var leftWork = _context.LeftWorkList.Where(x =>
|
||||
x.WorkshopId == workshopId && x.StartWorkDate <= dateNow && x.LeftWorkDate >= dateNow);
|
||||
|
||||
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId
|
||||
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow)
|
||||
&& x.HasUploadedImage == "true" &&leftWork.Any(l=>l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId));
|
||||
|
||||
|
||||
var personnel =
|
||||
_context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId && rollCallEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId))
|
||||
@@ -300,15 +307,15 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
|
||||
{
|
||||
var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId);
|
||||
|
||||
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x=>x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any() && personnelCodes.Any(y=>y.EmployeeId == x.EmployeeId));
|
||||
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
|
||||
.Where(x => x.WorkshopId == workshopId && x.EmployeesStatus.Any() && personnelCodes.Any(y => y.EmployeeId == x.EmployeeId));
|
||||
|
||||
var res = rollCallEmployeesQuery.Select(x => new RollCallEmployeeViewModel
|
||||
{
|
||||
RollCallEmployeeId = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName
|
||||
})
|
||||
{
|
||||
RollCallEmployeeId = x.id,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName
|
||||
})
|
||||
.ToList();
|
||||
|
||||
return res;
|
||||
|
||||
@@ -19,6 +19,7 @@ using System.Linq;
|
||||
using CompanyManagment.App.Contracts.Fine;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Base;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
|
||||
@@ -30,6 +31,7 @@ using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using Company.Domain.RewardAgg;
|
||||
using CompanyManagment.App.Contracts.Reward.Enums;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -460,48 +462,98 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|
||||
string shiftPayValue = "0";
|
||||
List<RotatingShiftViewModel> rotatingResultList = RotatingShiftCheck(groupedRollCall);
|
||||
var moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
var eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
var nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
|
||||
// شبکاری
|
||||
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
|
||||
var RotatingfaName = new List<string>();
|
||||
if (command.ShiftWork != "1" && command.ShiftWork != "2" && command.ShiftWork != "4")//اگر چرخشی بود و منظم نبود
|
||||
{
|
||||
if (moriningCount > 0)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount > 0)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount > 0)
|
||||
RotatingfaName.Add("شب");
|
||||
}
|
||||
else// اگر منظم و شیفتی بود
|
||||
{
|
||||
var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 8) / 28);
|
||||
}
|
||||
//if (command.ShiftWork != "1" && command.ShiftWork != "2" && command.ShiftWork != "4")//اگر چرخشی بود و منظم نبود
|
||||
//{
|
||||
// if (moriningCount > 0)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount > 0)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount > 0)
|
||||
// RotatingfaName.Add("شب");
|
||||
//}
|
||||
//else// اگر منظم و شیفتی بود
|
||||
//{
|
||||
// var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
// int validCount = 0;
|
||||
// if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
// {
|
||||
// validCount = 2;
|
||||
// }
|
||||
// else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
// {
|
||||
// validCount = 8;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
// validCount = (int)((totalDays * 8) / 28);
|
||||
// }
|
||||
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
// if (moriningCount >= validCount)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount >= validCount)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount >= validCount)
|
||||
// RotatingfaName.Add("شب");
|
||||
|
||||
//}
|
||||
|
||||
int moriningCount = 0;
|
||||
int eveningCount = 0;
|
||||
int nightCount = 0;
|
||||
|
||||
int moriningWinRate = rotatingResultList.Where(x => x.IsMorningShift).Sum(x => x.WinRate);
|
||||
int eveningWinRate = rotatingResultList.Where(x => x.IsEveningShift).Sum(x => x.WinRate);
|
||||
int nightWinRate = rotatingResultList.Where(x => x.IsNightShift).Sum(x => x.WinRate);
|
||||
|
||||
|
||||
if (moriningWinRate > eveningWinRate && moriningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (eveningWinRate > moriningWinRate && eveningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (nightWinRate > moriningWinRate && nightWinRate > eveningWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
}
|
||||
|
||||
var totalDays = (int)(command.ContractEndGr - command.ContractStartGr).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 8) / 28);
|
||||
}
|
||||
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
|
||||
{
|
||||
@@ -594,6 +646,142 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId,long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork)
|
||||
{
|
||||
List<RollCallViewModel> rollCallResult =await _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,
|
||||
}).ToListAsync();
|
||||
List<GroupedRollCalls> 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)),
|
||||
|
||||
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
|
||||
|
||||
//****** نوبت کاری و شب کاری ****
|
||||
#region RotatingShiftCheckAndNightWorkOver22
|
||||
|
||||
string shiftPayValue = "0";
|
||||
List<RotatingShiftViewModel> rotatingResultList = RotatingShiftCheck(groupedRollCall);
|
||||
int moriningCount = 0;
|
||||
int eveningCount = 0;
|
||||
int nightCount = 0;
|
||||
|
||||
int moriningWinRate = rotatingResultList.Where(x=>x.IsMorningShift).Sum(x => x.WinRate);
|
||||
int eveningWinRate = rotatingResultList.Where(x => x.IsEveningShift).Sum(x => x.WinRate);
|
||||
int nightWinRate = rotatingResultList.Where(x => x.IsNightShift).Sum(x => x.WinRate);
|
||||
|
||||
|
||||
if (moriningWinRate > eveningWinRate && moriningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (eveningWinRate > moriningWinRate && eveningWinRate > nightWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift && x.WinRate > 55);
|
||||
}
|
||||
|
||||
if (nightWinRate > moriningWinRate && nightWinRate > eveningWinRate)
|
||||
{
|
||||
moriningCount = rotatingResultList.Count(x => x.IsMorningShift && x.WinRate > 55);
|
||||
eveningCount = rotatingResultList.Count(x => x.IsEveningShift && x.WinRate > 55);
|
||||
nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// شبکاری
|
||||
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
|
||||
var RotatingfaName = new List<string>();
|
||||
//if (shiftwork != "1" && shiftwork != "2" && shiftwork != "4")//اگر چرخشی بود و منظم نبود
|
||||
//{
|
||||
// if (moriningCount > 0)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount > 0)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount > 0)
|
||||
// RotatingfaName.Add("شب");
|
||||
//}
|
||||
//else// اگر منظم و شیفتی بود
|
||||
//{
|
||||
|
||||
|
||||
//}
|
||||
var totalDays = (int)(contractEnd - contractStart).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 6) / 28);
|
||||
}
|
||||
|
||||
Console.WriteLine(validCount);
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
|
||||
|
||||
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
|
||||
{
|
||||
|
||||
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 = "نوبت کاری ندارد";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return new ComputingViewModel
|
||||
{
|
||||
RotatingStatus = rotatingFaResult,
|
||||
RotatingResultList = rotatingResultList
|
||||
|
||||
};
|
||||
|
||||
#endregion
|
||||
}
|
||||
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTime.BreakTimeType != BreakTimeType.WithTime)
|
||||
@@ -738,7 +926,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
var nightWorkingTime = new TimeSpan();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
foreach (var shift in item.ShiftList)
|
||||
{
|
||||
#region DatePeriod
|
||||
@@ -913,6 +1101,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
#region Result
|
||||
|
||||
var result = new RotatingShiftViewModel();
|
||||
result.RotatingDate = item.CreationDate.ToFarsi();
|
||||
result.MorningWorkSpan = morningWorkingTime;
|
||||
result.EveningWorkSpan = eveningWorkingTime;
|
||||
result.NightWorkSpan = nightWorkingTime;
|
||||
@@ -954,18 +1143,28 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
if (result.MorningWorkSpan > result.EveningWorkSpan
|
||||
|| result.MorningWorkSpan == result.EveningWorkSpan) // if morning bigerThan evening or equal
|
||||
{
|
||||
|
||||
if (result.MorningWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.EveningWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.MorningWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = true;
|
||||
result.IsNightShift = false;
|
||||
result.IsEveningShift = false;
|
||||
result.RotatingShiftStatus = "صبح";
|
||||
|
||||
}
|
||||
|
||||
if (result.MorningWorkSpan < result.NightWorkSpan
|
||||
|| result.MorningWorkSpan == result.NightWorkSpan) // if night bigerThan morning or equal
|
||||
if (result.NightWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.NightWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.NightWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = false;
|
||||
result.IsNightShift = true;
|
||||
result.IsEveningShift = false;
|
||||
@@ -976,6 +1175,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
if (result.EveningWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.MorningWorkSpan.Add(result.EveningWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.EveningWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsEveningShift = true;
|
||||
result.IsMorningShift = false;
|
||||
result.IsNightShift = false;
|
||||
@@ -986,6 +1189,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|| result.EveningWorkSpan == result.NightWorkSpan) // if night bigerThan evening or equal
|
||||
if (result.NightWorkSpan != nullWorkspan)
|
||||
{
|
||||
var sumSpan = result.EveningWorkSpan.Add(result.NightWorkSpan);
|
||||
var sumSpanDouble = sumSpan.TotalMinutes;
|
||||
var winRate = (result.NightWorkSpan.TotalMinutes * 100) / sumSpanDouble;
|
||||
result.WinRate = Convert.ToInt32(winRate);
|
||||
result.IsMorningShift = false;
|
||||
result.IsEveningShift = false;
|
||||
result.IsNightShift = true;
|
||||
@@ -1677,7 +1884,11 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
var checkoutEnd = contractEnd;
|
||||
var checkoutStart = contractStart;
|
||||
if (employeeId is 45084 or 7980 or 5976 or 45214 or 45215)
|
||||
|
||||
var exceptionEmployees = _context.CustomizeWorkshopGroupSettings.Where(x => x.id == 117)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery().FirstOrDefault()?.CustomizeWorkshopEmployeeSettingsCollection.Select(x => x.EmployeeId).ToList() ?? [];
|
||||
|
||||
if (exceptionEmployees.Contains(employeeId))
|
||||
{
|
||||
return CheckoutWithoutCalculationForKebabMahdi(workshopId, employeeId, contractStart, contractEnd);
|
||||
}
|
||||
@@ -3604,7 +3815,7 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|
||||
|
||||
public static (DateTime start, DateTime end) FindRotatingShift(DateTime startRollCall, DateTime endRollCall,
|
||||
ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
ICollection<CustomizeRotatingShift> rotatingShifts)
|
||||
{
|
||||
DateTime startDate = startRollCall.Date;
|
||||
DateTime endDate = endRollCall.Date;
|
||||
@@ -3614,10 +3825,10 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
DateTime startEntryWithDate = startDate.Add(startRollCall.TimeOfDay);
|
||||
DateTime endEntryWithDate = endDate.Add(endRollCall.TimeOfDay);
|
||||
|
||||
DateTime oneHourBeforeStart = startEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterStart = startEntryWithDate.AddHours(1);
|
||||
DateTime oneHourBeforeEnd = endEntryWithDate.AddHours(-1);
|
||||
DateTime oneHourAfterEnd = endEntryWithDate.AddHours(1);
|
||||
DateTime twoHourBeforeStart = startEntryWithDate.AddHours(-2);
|
||||
DateTime twoHourAfterStart = startEntryWithDate.AddHours(2);
|
||||
DateTime twoHourBeforeEnd = endEntryWithDate.AddHours(-2);
|
||||
DateTime twoHourAfterEnd = endEntryWithDate.AddHours(2);
|
||||
|
||||
|
||||
var shiftDateTimes = rotatingShifts.SelectMany(shift =>
|
||||
@@ -3638,56 +3849,68 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
|
||||
#region مقایسه شروع حضور غیاب با شیفت
|
||||
|
||||
var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeStart <= shift.Start && oneHourAfterStart >= shift.Start) ||
|
||||
(oneHourBeforeStart <= shift.End && oneHourAfterStart >= shift.End)).ToList();
|
||||
//var startFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeStart <= shift.Start && twoHourAfterStart >= shift.Start) ||
|
||||
// (twoHourBeforeStart <= shift.End && twoHourAfterStart >= shift.End)).ToList();
|
||||
|
||||
if (startFilteredTimes.Count == 0)
|
||||
{
|
||||
startFilteredTimes = shiftDateTimes;
|
||||
}
|
||||
else if (startFilteredTimes.Count == 1)
|
||||
{
|
||||
var startChosenShift = startFilteredTimes.First();
|
||||
//if (startFilteredTimes.Count == 0)
|
||||
//{
|
||||
// startFilteredTimes = shiftDateTimes;
|
||||
//}
|
||||
//else if (startFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var startChosenShift = startFilteredTimes.First();
|
||||
|
||||
if (startChosenShift.End < startChosenShift.Start)
|
||||
startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
// if (startChosenShift.End < startChosenShift.Start)
|
||||
// startChosenShift.End = startChosenShift.End.AddDays(1);
|
||||
|
||||
return startChosenShift;
|
||||
}
|
||||
// return startChosenShift;
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
//#endregion
|
||||
|
||||
#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
(oneHourBeforeEnd <= shift.Start && oneHourAfterEnd >= shift.Start) ||
|
||||
(oneHourBeforeEnd <= shift.End && oneHourAfterEnd >= shift.End)).ToList();
|
||||
if (endFilteredTimes.Count == 0)
|
||||
{
|
||||
endFilteredTimes = startFilteredTimes;
|
||||
}
|
||||
else if (endFilteredTimes.Count == 1)
|
||||
{
|
||||
var endChosenShift = endFilteredTimes.First();
|
||||
return endChosenShift;
|
||||
}
|
||||
//#region مقایسه پایان حضورغیاب با شیفت
|
||||
|
||||
//var endFilteredTimes = shiftDateTimes.Where(shift =>
|
||||
// (twoHourBeforeEnd <= shift.Start && twoHourAfterEnd >= shift.Start) ||
|
||||
// (twoHourBeforeEnd <= shift.End && twoHourAfterEnd >= shift.End)).ToList();
|
||||
//if (endFilteredTimes.Count == 0)
|
||||
//{
|
||||
// endFilteredTimes = startFilteredTimes;
|
||||
//}
|
||||
//else if (endFilteredTimes.Count == 1)
|
||||
//{
|
||||
// var endChosenShift = endFilteredTimes.First();
|
||||
// return endChosenShift;
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
#region اشتراک حضور غیاب و شیفت
|
||||
|
||||
var overlapShifts = endFilteredTimes.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, oneHourAfterEnd.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, oneHourBeforeStart.Ticks)))
|
||||
});
|
||||
var overlapShifts = shiftDateTimes
|
||||
.Select(shift => new
|
||||
{
|
||||
Shift = shift,
|
||||
Overlap = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
// زمان حضور فرد در شیفت (مجموع Overlap با شیفت)
|
||||
TotalTimeInShift = new TimeSpan(Math.Max(0,
|
||||
Math.Min(shift.End.Ticks, endRollCall.Ticks) -
|
||||
Math.Max(shift.Start.Ticks, startRollCall.Ticks))),
|
||||
StartDistance = Math.Abs((shift.Start - startRollCall).Ticks),
|
||||
EndDistance = Math.Abs((shift.End - endRollCall).Ticks),
|
||||
TotalDistance = Math.Abs((shift.Start - startRollCall).Ticks) + Math.Abs((shift.End - endRollCall).Ticks)
|
||||
})
|
||||
.OrderByDescending(s => s.TotalTimeInShift) // 1. بیشترین زمان حضور فرد
|
||||
.ThenByDescending(s => s.Overlap) // 2. بیشترین Overlap
|
||||
.ThenBy(s => s.TotalDistance)
|
||||
.ThenBy(s => s.StartDistance)
|
||||
.ThenBy(x => x.EndDistance); // 3. اگر برابر بود، Start نزدیکتر
|
||||
|
||||
var overlapChosenShift = overlapShifts.MaxBy(s => s.Overlap);
|
||||
var overlapChosenShift = overlapShifts.First();
|
||||
var end = overlapChosenShift.Shift.End;
|
||||
if (overlapChosenShift.Shift.End < overlapChosenShift.Shift.Start)
|
||||
end = overlapChosenShift.Shift.End.AddDays(1);
|
||||
|
||||
@@ -2049,5 +2049,12 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public async Task<List<RollCall>> GetRollCallsUntilNowWithWorkshopIdEmployeeIds(long workshopId, List<long> employeeIds, DateTime fromDate)
|
||||
{
|
||||
return await _context.RollCalls.Where(x =>
|
||||
x.ShiftDate >= fromDate && x.WorkshopId == workshopId && employeeIds.Contains(x.EmployeeId) &&
|
||||
x.EndDate != null).ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -791,7 +791,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
string finalResultMoney = string.Empty;
|
||||
double FinalResult = 0;
|
||||
int DayCounter = 0;
|
||||
int Max365 = 365;
|
||||
int Max365 = 366;
|
||||
double Basic = 0;
|
||||
double BaseResult = 0;
|
||||
DateTime periodStarter = new DateTime();
|
||||
@@ -838,6 +838,8 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
//مقدار اولیه مزد روزانه
|
||||
var DayliSalaryStep1Fa = DayliSalaryStep1.ToMoney();
|
||||
double firstDayliSalary = DayliSalaryStep1Fa.MoneyToDouble();
|
||||
|
||||
DateTime baseYearDate = new DateTime();
|
||||
|
||||
for (DateTime LoopDate = getWork; LoopDate <= endDateW; LoopDate = LoopDate.AddDays(1))
|
||||
{
|
||||
@@ -867,6 +869,8 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//اگر تاریخ جاری بزرگتر یت مساوی تاریخ شروع ترک کار و کوچکتر یا مساوی تاریخ پایان ترک کار بود
|
||||
if (LoopDateGr >= startPeriod && LoopDateGr <= endtPeriod)
|
||||
{
|
||||
|
||||
@@ -205,6 +205,7 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -423,6 +424,9 @@ public class PersonalBootstrapper
|
||||
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
@@ -629,10 +629,15 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90114" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <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="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90116" class="check-btn"> <span style="bottom: 2px;position: relative"> وظایف دوره ای </span> </label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@*لیست درخواست ها*@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
@@ -699,9 +704,12 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90315" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90317" class="check-btn"> <span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -633,9 +633,13 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90114" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90115" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children"><input type="checkbox" disabled="disabled" value="90116" class="check-btn"> <span style="bottom: 2px;position: relative"> وظایف دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
@*لیست درخواست ها*@
|
||||
<div class="child-check level3">
|
||||
@@ -703,9 +707,12 @@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90315" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90316" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش عنوان </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="90317" class="check-btn"> <span style="bottom: 2px;position: relative"> دکمه ایجاد وظیفه دوره ای </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1323,6 +1323,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
function rotatingShiftReport(id){
|
||||
|
||||
console.log(Number(id));
|
||||
var checkoutId=Number(id);
|
||||
$.ajax({
|
||||
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "RotatngShiftReport")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "checkoutId": checkoutId},
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteCheckout(element, id) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
|
||||
@@ -10,6 +10,7 @@ using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Job;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
@@ -26,6 +27,7 @@ using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using PersianTools.Core;
|
||||
using ServiceHost.Hubs;
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts;
|
||||
|
||||
@@ -51,9 +53,10 @@ public class IndexModel : PageModel
|
||||
private readonly IWorkingHoursTempApplication _workingHoursTempApplication;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
private readonly IYearlySalaryApplication _yearlySalaryApplication;
|
||||
private readonly IYearlySalaryRepository _yearlySalaryRepository;
|
||||
private readonly IYearlySalaryRepository _yearlySalaryRepository;
|
||||
|
||||
public List<CheckoutViewModel> chekoutlist;
|
||||
|
||||
public List<CheckoutViewModel> chekoutlist;
|
||||
public List<ComputingViewModel> ComputingView;
|
||||
public List<ContractViweModel> Contracts2;
|
||||
public string employeeFullName;
|
||||
@@ -115,7 +118,7 @@ public class IndexModel : PageModel
|
||||
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
|
||||
_rollCallMandatoryApplication = rollCallMandatoryApplication;
|
||||
_rollCallEmployeeStatusApp = rollCallEmployeeStatusApp;
|
||||
}
|
||||
}
|
||||
|
||||
public string Message { get; set; }
|
||||
public bool falseCheck { get; set; }
|
||||
@@ -141,7 +144,97 @@ public class IndexModel : PageModel
|
||||
//chekoutlist = await _checkoutApplication.Search(searchModel);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetSearch(CheckoutSearchModel searchModel)
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
#region RotatngShiftReport
|
||||
|
||||
public async Task<IActionResult> OnGetRotatngShiftReportDesktop(long id)
|
||||
{
|
||||
var result = new ComputingViewModel();
|
||||
var checkout = _checkoutApplication.GetDetails(id);
|
||||
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
|
||||
if (checkout.HasRollCall)
|
||||
{
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId,checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
|
||||
result.HasRollCall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var ConvertYear = checkout.ContractStart.Substring(0, 4);
|
||||
var ConvertMonth = checkout.ContractStart.Substring(5, 2);
|
||||
|
||||
var contract = _contractApplication.GetDetails(checkout.ContractId);
|
||||
var workshop = _workshopApplication.GetDetails(contract.WorkshopIds);
|
||||
var separation = _contractApplication.contractSeparation(ConvertYear, ConvertMonth,
|
||||
contract.ContractStartGr, contract.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
|
||||
workingHours.ContractStartGr = separation.ContractStartGr;
|
||||
workingHours.ContractEndGr = separation.ContractEndGr;
|
||||
workingHours.ContarctStart = separation.ContarctStart;
|
||||
workingHours.ContractEnd = separation.ContractEnd;
|
||||
workingHours.GetWorkDate = contract.GetWorkDate;
|
||||
workingHours.GetWorkDateHide = contract.GetWorkDate;
|
||||
workingHours.WorkshopId = contract.WorkshopIds;
|
||||
workingHours.EmployeeId = contract.EmployeeId;
|
||||
|
||||
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
result.EmployeeFullName = checkout.EmployeeFullName;
|
||||
result.YearAndMonth = $"{checkout.Month} {checkout.Year}";
|
||||
result.HasRotatingShift = result.RotatingStatus == "نوبت کاری ندارد" ? false : true;
|
||||
Console.WriteLine("ok");
|
||||
return Partial("./RotatingShiftReportDesktop", result);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetRotatngShiftReportMobile(long id)
|
||||
{
|
||||
var result = new ComputingViewModel();
|
||||
var checkout = _checkoutApplication.GetDetails(id);
|
||||
var workingHours = _workingHoursTempApplication.GetByContractIdConvertToShiftwork4(checkout.ContractId);
|
||||
if (checkout.HasRollCall)
|
||||
{
|
||||
result = await _rollCallMandatoryApplication.RotatingShiftReport(checkout.WorkshopId, checkout.EmployeeId, checkout.ContractStartGr, checkout.ContractEndGr, workingHours.ShiftWork);
|
||||
result.HasRollCall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
var ConvertYear = checkout.ContractStart.Substring(0, 4);
|
||||
var ConvertMonth = checkout.ContractStart.Substring(5, 2);
|
||||
|
||||
var contract = _contractApplication.GetDetails(checkout.ContractId);
|
||||
var workshop = _workshopApplication.GetDetails(contract.WorkshopIds);
|
||||
var separation = _contractApplication.contractSeparation(ConvertYear, ConvertMonth,
|
||||
contract.ContractStartGr, contract.ContractEndGr, contract.EmployeeId, contract.WorkshopIds);
|
||||
workingHours.ContractStartGr = separation.ContractStartGr;
|
||||
workingHours.ContractEndGr = separation.ContractEndGr;
|
||||
workingHours.ContarctStart = separation.ContarctStart;
|
||||
workingHours.ContractEnd = separation.ContractEnd;
|
||||
workingHours.GetWorkDate = contract.GetWorkDate;
|
||||
workingHours.GetWorkDateHide = contract.GetWorkDate;
|
||||
workingHours.WorkshopId = contract.WorkshopIds;
|
||||
workingHours.EmployeeId = contract.EmployeeId;
|
||||
|
||||
result = MandatoryHours(workingHours, workshop.WorkshopHolidayWorking, 0);
|
||||
|
||||
|
||||
|
||||
}
|
||||
result.EmployeeFullName = checkout.EmployeeFullName;
|
||||
result.YearAndMonth = $"{checkout.Month} {checkout.Year}";
|
||||
Console.WriteLine("ok");
|
||||
return Partial("./RotatingShiftReportMobile", result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public async Task<IActionResult> OnGetSearch(CheckoutSearchModel searchModel)
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
|
||||
@@ -6694,14 +6787,30 @@ public class IndexModel : PageModel
|
||||
var AllDaysCount = (conEnd - conStart).TotalDays + 1;
|
||||
var endContract = command.ContractEnd.ToGeorgianDateTime();
|
||||
var AllmandatoryDays = 0;
|
||||
for (var gDate = conStart; gDate <= endContract; gDate = gDate.AddDays(1))
|
||||
if (gDate.DayOfWeek != DayOfWeek.Friday)
|
||||
AllmandatoryDays += 1;
|
||||
int fridayCount = 0;
|
||||
int officialHolidayCount = 0;
|
||||
for (var gDate = conStart; gDate <= endContract; gDate = gDate.AddDays(1))
|
||||
{
|
||||
if (gDate.DayOfWeek != DayOfWeek.Friday)
|
||||
AllmandatoryDays += 1;
|
||||
if (gDate.DayOfWeek == DayOfWeek.Friday)
|
||||
fridayCount += 1;
|
||||
bool officialHoliday = _holidayItemRepository.GetHoliday(gDate);
|
||||
if (officialHoliday)
|
||||
officialHolidayCount += 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var mandatoryFixComplex = new TimeSpan(7, 20, 0).Multiply(AllmandatoryDays);
|
||||
var mandatoryFixShifts = new TimeSpan(7, 20, 0).Multiply(notHolidaysCount);
|
||||
|
||||
var allDays = (endContract - conStart).TotalDays + 1;
|
||||
var allDays = (int)(endContract - conStart).TotalDays + 1;
|
||||
int mondatoryDaysInMonth = allDays - (fridayCount + officialHolidayCount);
|
||||
var mandatoryFixShifts = new TimeSpan(7, 20, 0).Multiply(mondatoryDaysInMonth);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var jomeh2 = new TimeSpan();
|
||||
@@ -7315,13 +7424,30 @@ public class IndexModel : PageModel
|
||||
var nightCount = rotatingResultList.Count(x => x.IsNightShift);
|
||||
|
||||
var RotatingfaName = new List<string>();
|
||||
if (moriningCount > 0)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount > 0)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount > 0)
|
||||
RotatingfaName.Add("شب");
|
||||
var rotatingFaResult = "";
|
||||
var totalDays = Convert.ToInt32(AllDaysCount);
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
{
|
||||
validCount = 2;
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 6) / 28);
|
||||
}
|
||||
|
||||
Console.WriteLine(validCount);
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)
|
||||
{
|
||||
shiftOver22Hours = "0";
|
||||
|
||||
@@ -212,9 +212,12 @@
|
||||
</svg>
|
||||
</a>
|
||||
|
||||
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")"
|
||||
@* <a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")"
|
||||
href="#showmodal=@Url.Page("./Index", "CustomSet", new { item.Id })">
|
||||
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
|
||||
</a> *@
|
||||
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" href="#showmodal=@Url.Page("./Index", "RotatngShiftReportDesktop",new { @item.Id })">
|
||||
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flexible-div op-td mobile-view" style="justify-content: flex-end;">
|
||||
@@ -231,8 +234,7 @@
|
||||
<i class="fa faSize fa-print"></i>
|
||||
</a>
|
||||
|
||||
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")"
|
||||
href="#showmodal=@Url.Page("./Index", "CustomSet", new { item.Id })">
|
||||
<a permission="20218" class="btn btn-inverse pull-left customSet @(item.IsBlockCantracingParty == "true" ? "disabled" : "")" href="#showmodal=@Url.Page("./Index", "RotatngShiftReportMobile",new { @item.Id })">
|
||||
<i class="md-attach-money" style="font-size: 22px; top: 2px; position: relative;"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
@model CompanyManagment.App.Contracts.Contract.ComputingViewModel
|
||||
@{
|
||||
<style>
|
||||
.modal .modal-dialog .modal-content{
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-color: #DDDDDD;
|
||||
padding: 0px 30px;
|
||||
border-radius: 10px;
|
||||
background-color: #ededed;
|
||||
border: none;
|
||||
}
|
||||
.modal2-btns {
|
||||
float: left;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.modal2-btn {
|
||||
border-radius: 16px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.modal-body2 {
|
||||
background-color: #f2fbfb;
|
||||
width: 100%;
|
||||
height: 674px;
|
||||
border-radius: 25px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.rotateHead {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
height: 20px;
|
||||
background-color: #eb950a;
|
||||
box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.rotateItems {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
height: 17px;
|
||||
box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.rotateParntModal {
|
||||
height: 600px !important;
|
||||
}
|
||||
.noRotating{
|
||||
background-color: #fe8470;
|
||||
}
|
||||
.hasRotating{
|
||||
background-color: #1bff01;
|
||||
}
|
||||
|
||||
</style>
|
||||
string noRotating = "noRotating";
|
||||
string hasRotating = "hasRotating";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div class="modal-body2" dir="rtl">
|
||||
|
||||
<div class="row container" style="background-color: #a3e2ef;
|
||||
border-radius: 25px 25px 0px 0px;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
width: 100%;
|
||||
margin-bottom: 25px;">
|
||||
<div class="col-xs-6" style="text-align:center">
|
||||
|
||||
<h5> @Model.YearAndMonth</h5>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-6" style="text-align:center">
|
||||
<h5>@Model.EmployeeFullName</h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row container" style="margin-top: 38px;
|
||||
position: absolute;
|
||||
background-color: antiquewhite;
|
||||
width: 100%;
|
||||
right: 10px;">
|
||||
<div class="col-xs-3" style="text-align:right">
|
||||
@if (Model.HasRollCall)
|
||||
{
|
||||
<h5> حضور غیاب</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5> استاتیک</h5>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-3" style="text-align:left"> <h5>نوع ساعت کاری :</h5> </div>
|
||||
|
||||
|
||||
<div class="col-xs-3 @(!Model.HasRotatingShift? @noRotating :@hasRotating )" style="text-align:right ">
|
||||
|
||||
<h5>@Model.RotatingStatus</h5>
|
||||
</div>
|
||||
<div class="col-xs-3" style="text-align:left">
|
||||
<h5>وضعیت نوبت کاری : </h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container" style="height: 550px;margin-top: 67px">
|
||||
<div class="rotateHead">
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;">تاریخ</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> کارکرد صبح </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> کارکرد عصر </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> کارکرد شب </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> نوبت صبح </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> نوبت عصر </span>
|
||||
<span style="padding: 0px 10px;"> نوبت شب </span>
|
||||
</div>
|
||||
<div id="rotatingList">
|
||||
|
||||
|
||||
@foreach (var item in @Model.RotatingResultList)
|
||||
{
|
||||
|
||||
<div class="rotateItems">
|
||||
<span style="border-left: 1px solid;padding: 0px 15px;width : 15.3%;display:inline-block;font-family: 'IranText' !important;font-size: 10px;">@item.RotatingDate</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 22px;width: 14%;display: inline-block;">@item.MorningString</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 20px;display: inline-block;width: 13.1%;">@item.EveningString </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 22px;display: inline-block;width: 13.2%;">@item.NightString</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;display: inline-block;width: 13%;">
|
||||
@if (item.IsMorningShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;display: inline-block;width: 12.7%;">
|
||||
@if (item.IsEveningShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
<span style="padding: 0px 30px;display: inline-block;width: 12.7%;">
|
||||
@if (item.IsNightShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-9"></div>
|
||||
<div class="modal2-btns col-md-3">
|
||||
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,166 @@
|
||||
@model CompanyManagment.App.Contracts.Contract.ComputingViewModel
|
||||
@{
|
||||
<style>
|
||||
.modal .modal-dialog .modal-content{
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-color: #DDDDDD;
|
||||
padding: 0px 30px;
|
||||
border-radius: 10px;
|
||||
background-color: #ededed;
|
||||
border: none;
|
||||
}
|
||||
.modal2-btns {
|
||||
float: left;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.modal2-btn {
|
||||
border-radius: 16px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.modal-body2 {
|
||||
background-color: #f2fbfb;
|
||||
width: 95%;
|
||||
height: 703px;
|
||||
border-radius: 25px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.rotateHead {
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
height: 20px;
|
||||
background-color: #eb950a;
|
||||
box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.rotateItems {
|
||||
width: 100%;
|
||||
margin-top: 3px;
|
||||
height: 17px;
|
||||
box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.rotateParntModal {
|
||||
height: 600px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div class="modal-body2" dir="rtl">
|
||||
<div class="row container">
|
||||
<div class="col-xs-6" style="text-align:center">
|
||||
|
||||
<h5> @Model.YearAndMonth</h5>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-6" style="text-align:center">
|
||||
<h5>@Model.EmployeeFullName</h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row container m-t-5" >
|
||||
<div class="col-xs-6" style="text-align: center;background-color: #dcf5f9;border-radius: 15px;box-shadow: -5px 0px 12px 1px rgb(0 0 0 / 19%);">
|
||||
<span>نوع ساعت کاری </span>
|
||||
<br />
|
||||
@if (Model.HasRollCall)
|
||||
{
|
||||
<span> حضور غیاب</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span> استاتیک</span>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="col-xs-6" style="text-align: center;background-color: #dcf5f9;border-radius: 15px;box-shadow: 4px -1px 12px 1px rgb(0 0 0 / 19%);">
|
||||
<span>وضعیت نوبت کاری </span>
|
||||
<br/>
|
||||
<span>@Model.RotatingStatus</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container" style="height: 550px">
|
||||
<div class="rotateHead">
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;">تاریخ</span>
|
||||
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> نوبت صبح </span>
|
||||
<span style="border-left: 1px solid;padding: 0px 10px;"> نوبت عصر </span>
|
||||
<span style="padding: 0px 10px;"> نوبت شب </span>
|
||||
</div>
|
||||
<div id="rotatingList">
|
||||
@{
|
||||
if (@Model.RotatingStatus == "نوبت کاری ندارد")
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-xs-2"></div>
|
||||
<div class="col-xs-6">
|
||||
<h4>نوبت کاری ندارد</h4>
|
||||
</div>
|
||||
<div class="col-xs-2"></div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in @Model.RotatingResultList)
|
||||
{
|
||||
|
||||
<div class="rotateItems">
|
||||
<span style="border-left: 1px solid;padding: 0px 15px;width : 27.3%;display:inline-block;font-family: 'IranText' !important;font-size: 10px;">@item.RotatingDate</span>
|
||||
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;display: inline-block;width: 24%;">
|
||||
@if (item.IsMorningShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
<span style="border-left: 1px solid;padding: 0px 30px;display: inline-block;width: 22.7%;">
|
||||
@if (item.IsEveningShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
<span style="padding: 0px 30px;display: inline-block;width: 20.7%;">
|
||||
@if (item.IsNightShift == true) {
|
||||
<i class="ion-checkmark-circled" style="color: #1bff01;"></i>
|
||||
}else{
|
||||
<i class="ion-checkmark-circled" style="color: #f2fbfb;"></i>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-9"></div>
|
||||
<div class="modal2-btns col-md-3">
|
||||
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,8 @@
|
||||
</style>
|
||||
}
|
||||
|
||||
<link href="@Href("~/Admintheme/css/personelCreate.css")" rel="stylesheet"/>
|
||||
@* <link href="@Href("~/Admintheme/css/personelCreate.css")" rel="stylesheet"/> *@
|
||||
<link href="@Href("~/Admintheme/css/personelEdit.css")" rel="stylesheet"/>
|
||||
|
||||
<fieldset class="content-fieldset">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
@@ -565,12 +566,26 @@
|
||||
$(".listNext").click(function() {
|
||||
if ($("#divGender").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
|
||||
$("#divGender").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divGender").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#divMarried").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
// $("#divMarried").addClass('errored');
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
|
||||
$("#divMarried").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divMarried").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
const option1 = document.getElementById("city").options.selectedIndex;
|
||||
|
||||
@@ -6,11 +6,14 @@ using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeChildren;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Job;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.LeftWorkInsurance;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -42,7 +45,9 @@ public class IndexModel : PageModel
|
||||
private readonly IPersonnelCodeApplication _personnelCodeApplication;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWorkshopApplication _workShopApplication;
|
||||
public List<CreateEmployeChildren> ChildrenList;
|
||||
private readonly ILeftWorkTempApplication _leftWorkTempApplication;
|
||||
private readonly IEmployeeClientTempApplication _employeeClientTempApplication;
|
||||
public List<CreateEmployeChildren> ChildrenList;
|
||||
public string employeeFullName;
|
||||
public List<EmployeeViewModel> Employees;
|
||||
public string EmployerFullName;
|
||||
@@ -57,7 +62,7 @@ public class IndexModel : PageModel
|
||||
ICheckoutApplication checkoutApplication, ICheckoutRepository checkoutRepository,
|
||||
IWebHostEnvironment webHostEnvironment, ILeftWorkInsuranceApplication leftWorkInsuranceApplication,
|
||||
ILeftWorkApplication leftWorkApplication, IPersonnelCodeApplication personnelCodeApplication,
|
||||
IJobApplication jobApplication, IEmployerApplication employerApplication)
|
||||
IJobApplication jobApplication, IEmployerApplication employerApplication, ILeftWorkTempApplication leftWorkTempApplication, IEmployeeClientTempApplication employeeClientTempApplication)
|
||||
{
|
||||
_employeeApplication = employeeApplication;
|
||||
_employeeChildrenApplication = employeeChildrenApplication;
|
||||
@@ -72,7 +77,9 @@ public class IndexModel : PageModel
|
||||
_personnelCodeApplication = personnelCodeApplication;
|
||||
_jobApplication = jobApplication;
|
||||
_employerApplication = employerApplication;
|
||||
_authHelper = authHelper;
|
||||
_leftWorkTempApplication = leftWorkTempApplication;
|
||||
_employeeClientTempApplication = employeeClientTempApplication;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
[TempData] public string Message { get; set; }
|
||||
@@ -1466,7 +1473,27 @@ public class IndexModel : PageModel
|
||||
PermissionIds = permissionIds
|
||||
};
|
||||
|
||||
return Partial("./LeftWork", command);
|
||||
var leftWorks = _leftWorkTempApplication.GetLeftWorkTempsByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.LeftWork))
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "این پرسنل دارای یک درخواست ترک کار میباشد لطفا اول آن را در کارپوشه خود تعیین تکلیف نمایید",
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "این پرسنل دارای یک درخواست شروع به کار میباشد لطفا اول آن را در کارپوشه خود تعیین تکلیف نمایید",
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
return Partial("./LeftWork", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateLeftWork(LeftWorkDividedList command)
|
||||
@@ -1564,5 +1591,15 @@ public class IndexModel : PageModel
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
public async Task<IActionResult> OnPostEmployeeDataFromApi(string nationalCode, string birthDate)
|
||||
{
|
||||
var result = await _employeeApplication.GetEmployeeDataFromApi(nationalCode, birthDate);
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
data = result.Data
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
@model CompanyManagment.App.Contracts.Error.ErrorViewModel
|
||||
|
||||
@{
|
||||
<style>
|
||||
.disable {
|
||||
pointer-events: none;
|
||||
filter: grayscale(100%);
|
||||
opacity: 0.6;
|
||||
}
|
||||
.modal-content {
|
||||
padding: 2px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div class="modal-header" style="border-bottom: unset">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h5 class="text-center" id="startBuyLabel">خطا</h5>
|
||||
</div>
|
||||
|
||||
<div class="modal-body clearfix">
|
||||
<section class="container-fluid d-flex justify-content-center align-items-center" style="height: 220px">
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-12 mt-2 text-center">
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 124px;">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 12.5C4 7.80558 7.80558 4 12.5 4C17.1944 4 21 7.80558 21 12.5C21 17.1944 17.1944 21 12.5 21C7.80558 21 4 17.1944 4 12.5ZM13 14.5V16H12V14.5H13ZM12 9V13H13V9H12Z" fill="#bdbdbd"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<p class="m-0 p-2">@Model.WorkshopFullName</p>
|
||||
<p>@Model.Message</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.CreateInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
width: 94% !important;
|
||||
}*/
|
||||
@@ -398,714 +398,13 @@
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
//$(document).ready(function() {
|
||||
// $('#amount').on('input', function() {
|
||||
// var amount = $(this).val();
|
||||
// var totalAmount = amount * 10;
|
||||
// $('#totalAmount').val(totalAmount);
|
||||
// });
|
||||
//});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#city2').on('change',
|
||||
function() {
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
$('#hidencity').val(selectedcity);
|
||||
|
||||
});
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
|
||||
var ajaxLoadContractingPrties = '@Url.Page("/Company/InstitutionContracts/Index", "ContractingParties")';
|
||||
var ajaxLoadContractingPrtiesInfo = '@Url.Page("/Company/InstitutionContracts/Index", "WorkshopCountAndEmployeeCount")';
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
async function loadContractingPrties() {
|
||||
/* loadPersonnel();*/
|
||||
const nameId = document.getElementById("getContractingPrties").value;
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Create.js?ver=@adminVersion"></script>
|
||||
|
||||
|
||||
$('#getContracingPartiesInfo').empty().append('<option selected="selected" value="0" >انتخاب طرف حساب</option>');
|
||||
|
||||
|
||||
if (nameId != "noId") {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "ContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": nameId },
|
||||
|
||||
success: function(response) {
|
||||
//var items2 = [];
|
||||
|
||||
//$.each(response,
|
||||
// function (key, val) {
|
||||
// items2.push({ id: key, vall: val });
|
||||
|
||||
// });
|
||||
|
||||
|
||||
$.each(response.mylist,
|
||||
function(i, item) {
|
||||
$('#getContracingPartiesInfo').append($('<option>',
|
||||
{
|
||||
value: item.id,
|
||||
text: item.fullName,
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
async function loadContracingPartiesInfo() {
|
||||
const id = document.getElementById("getContracingPartiesInfo").value;
|
||||
const workshopId = document.getElementById("getContractingPrties").value;
|
||||
|
||||
if (workshopId == "noId") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا معرف را انتخاب نمایید");
|
||||
}
|
||||
|
||||
if (id > 0 && workshopId != "noId") {
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "WorkshopCountAndEmployeeCount")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": id },
|
||||
|
||||
success: function(response) {
|
||||
var items2 = [];
|
||||
$.each(response,
|
||||
function(key, val) {
|
||||
items2.push({ id: key, vall: val });
|
||||
|
||||
});
|
||||
//if (items2[8].vall == "")
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
|
||||
document.getElementById("WCounter").value = items2[1].vall;
|
||||
document.getElementById("ECounter").value = items2[2].vall;
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,5 +1,6 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.EditInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
@@ -522,619 +523,10 @@
|
||||
<script language="javascript" src="~/AdminTheme/js/city2.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
$(".date").mask("0000/00/00");
|
||||
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
|
||||
$('#copyCity').val(selectedcity);
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(@Model.HasValueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
var valueAddedTax = '@Model.HasValueAddedTax';
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Edit.js?ver=@adminVersion"></script>
|
||||
@@ -1,5 +1,8 @@
|
||||
@model CompanyManagment.App.Contracts.FinancilTransaction.EditFinancialTransaction
|
||||
@Html.AntiForgeryToken()
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
<span style="font-size: 24px">×</span>
|
||||
@@ -62,260 +65,6 @@
|
||||
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
const taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
const debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
const creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
const typeOfTransAction = $('#EditTransactionBody .options-select').val();
|
||||
const defaultSelect = $('#decriptioOption').val();
|
||||
if (typeOfTransAction == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function() {
|
||||
$('#todayFa').val($('#hiddenToday').val());
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.EditTransactionForm .form-control').keypress(function(event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
$("#EditTransactionBody .options-select").change(function() {
|
||||
const selectedOption = $(this).val();
|
||||
$("#EditTransactionBody .options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").val("").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//غیرفعال کردن datepicker پس از بستن مودال
|
||||
$("#close , .close").on('click',
|
||||
function() {
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".datepicker-container").hide();
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#EditTransactionBody #debtInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#EditTransactionBody #creditInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($("#EditTransactionBody .persianDateInput").val().length < 10) {
|
||||
$("#EditTransactionBody .persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .persianDateInput").removeClass("errored");
|
||||
}
|
||||
const selectedOption = $("#EditTransactionBody .options-select").val();
|
||||
const selectedOption2 = $("#EditTransactionBody .options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$("#EditTransactionBody .options-select").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$("#EditTransactionBody .options-select2").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $("#EditTransactionBody .debtor").val() == "") {
|
||||
$("#EditTransactionBody .debtor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $("#EditTransactionBody .creditor").val() == "" && $("#EditTransactionBody .creditor").prop("disabled") == false) {
|
||||
$("#EditTransactionBody .creditor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('#EditTransactionBody .errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./FinancialStatments", "Edit")',
|
||||
data: {
|
||||
"id": $('#transactionId').val(),
|
||||
"tDateFa": $("#EditTransactionBody .persianDateInput").val(),
|
||||
"typeOfTransaction": $("#EditTransactionBody .options-select").val(),
|
||||
"descriptionOption": $("#EditTransactionBody .options-select2").val(),
|
||||
"description": $('#desc').val(),
|
||||
"deptorString": $("#EditTransactionBody .debtor").val(),
|
||||
"creditorString": $("#EditTransactionBody .creditor").val()
|
||||
|
||||
},
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
} //endOfFunction
|
||||
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$("#EditTransactionBody .persianDateInput").on('keyup',
|
||||
function() {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on('blur',
|
||||
function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
var ajaxEditSave = '@Url.Page("./FinancialStatments", "Edit")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/EditTransaction.js?ver=@adminVersion"></script>
|
||||
@@ -1,5 +1,6 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.CreateInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
@@ -506,639 +507,10 @@
|
||||
<script language="javascript" src="~/AdminTheme/js/city2.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" asp-for="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" asp-for="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).closest('div.row').remove();
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
console.log($('#officialStatus').val());
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".date").mask("0000/00/00");
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
//var y = document.getElementById('city2');
|
||||
//var city1 = y.options[y.selectedIndex].text;
|
||||
|
||||
//if (city1 == "ویرایش نام شهر" || city1 == "شهرستان") {
|
||||
|
||||
// document.getElementById('hidencity').value = " ";
|
||||
|
||||
//} else {
|
||||
// document.getElementById('hidencity').value = city1;
|
||||
//}
|
||||
|
||||
|
||||
//var x = document.getElementById('state');
|
||||
//var state1 = x.options[x.selectedIndex].text;
|
||||
//var state2 = x.options[x.selectedIndex].value;
|
||||
//if (state1 == "ویرایش نام استان") {
|
||||
// document.getElementById('hide1').value = state2;
|
||||
//} else {
|
||||
// document.getElementById('hide1').value = state1;
|
||||
//}
|
||||
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
//if (selectedcity == "ویرایش نام شهر" || selectedcity == "شهرستان") {
|
||||
|
||||
// $('#copyCity').val("");
|
||||
|
||||
//} else {
|
||||
$('#copyCity').val(selectedcity);
|
||||
//}
|
||||
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(@Model.HasValueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
var valueAddedTax = '@Model.HasValueAddedTax';
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Extention.js?ver=@adminVersion"></script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.InstitutionContracts.FinancialStatmentsModel
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
var Green = "green-row";
|
||||
<style>
|
||||
.blocked {
|
||||
@@ -277,504 +278,14 @@
|
||||
|
||||
@section Script {
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".creditor").prop("disabled", true);
|
||||
});
|
||||
|
||||
//رنگ بندی ستون های جمع مبلغ
|
||||
let cols = $(".totalBalance").val();
|
||||
if (cols > 0) {
|
||||
$(".totalBalanceTd").css("color", "#9f210c");
|
||||
} else {
|
||||
$(".totalBalanceTd").css("color", "#2b8f1b");
|
||||
}
|
||||
$('.main-table').find(".balance").each(function() {
|
||||
const balance = $(this).closest(".remainder-td");
|
||||
const value = $(this).val();
|
||||
if (value > 0) {
|
||||
balance.css("color", "#9f210c");
|
||||
} else {
|
||||
balance.css("color", "#2b8f1b");
|
||||
}
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.panelRequiredFields .form-control').keypress(function(event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//بدست آوردن تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function() {
|
||||
console.log("clicked");
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: '@Url.Page("./FinancialStatments", "DateOfToday")',
|
||||
type: "Get",
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#today').val(response.datOfToday);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
});
|
||||
//صفحه بندی
|
||||
|
||||
//صفحه اول
|
||||
$('.first-page-number').on("click",
|
||||
function() {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه اول
|
||||
$('.first-page-text').on("click",
|
||||
function() {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه قبل
|
||||
$('.prev-page').on("click",
|
||||
function() {
|
||||
const firstPageNumber = $("input[name=firtPageNumber]").val();
|
||||
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber -= 1;
|
||||
if (currentPageNumber >= firstPageNumber) {
|
||||
$('.table-container').remove();
|
||||
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// اینتر بر روی عدد
|
||||
$("input[name=currentPageNumber]").on('keyup keypress',
|
||||
function(e) {
|
||||
const keyCode = e.keyCode || e.which;
|
||||
if (keyCode === 13) {
|
||||
e.preventDefault();
|
||||
const firstPageNumber = Number($("input[name=firtPageNumber]").val());
|
||||
const goToCurrentNumber = $(this).val();
|
||||
const lastPageNumber = Number($("input[name=lastPageNumber]").val());
|
||||
if (goToCurrentNumber >= firstPageNumber && goToCurrentNumber <= lastPageNumber) {
|
||||
pagination(goToCurrentNumber);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//صفحه بعد
|
||||
$('.next-page').on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber += 1;
|
||||
console.log(`cuntentPlusOne ${currentPageNumber}`);
|
||||
if (currentPageNumber <= lastPageNumber) {
|
||||
$('.table-container').remove();
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
}
|
||||
});
|
||||
|
||||
//صفحه آخر
|
||||
$(".last-page-text").on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
|
||||
});
|
||||
//صفحه آخر
|
||||
$(".last-page-number").on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
});
|
||||
|
||||
//Ajax Pagination
|
||||
function pagination(currentPageNumber) {
|
||||
const contractingPartyId = $('#contractingPartyId').val();
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: '@Url.Page("./FinancialStatments", "Pagination")',
|
||||
data: {
|
||||
"id": contractingPartyId,
|
||||
"pageNumber": currentPageNumber
|
||||
},
|
||||
type: "Get",
|
||||
dataType: 'html',
|
||||
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('.table-panel').html(response);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
$(".options-select").change(function() {
|
||||
const selectedOption = $(this).val();
|
||||
$(".options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$(".options-select2").append(debtorOptions);
|
||||
$(".debtor").prop("disabled", false);
|
||||
$(".creditor").prop("disabled", true);
|
||||
$(".creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$(".options-select2").append(creditorOptions);
|
||||
$(".creditor").prop("disabled", false);
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$(".creditor").val("").prop("disabled", true);
|
||||
$(".debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#debtInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#creditInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
//لرزیدن دکمه ها
|
||||
$(".op-container a").on("mouseenter",
|
||||
function() {
|
||||
vibratingAnimation(this);
|
||||
});
|
||||
|
||||
function vibratingAnimation(element) {
|
||||
$(element).animate({ left: "-2px" }, 50)
|
||||
.animate({ left: "2px" }, 50)
|
||||
.animate({ left: "0px" }, 50);
|
||||
}
|
||||
|
||||
|
||||
//حذف
|
||||
function removeTransaction(Id) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام سند مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "RemoveTransaction")',
|
||||
data: { "id": Id },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($(".persianDateInput").val().length < 10) {
|
||||
$(".persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$(".persianDateInput").removeClass("errored");
|
||||
}
|
||||
var selectedOption = $(".options-select").val();
|
||||
var selectedOption2 = $(".options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$(".options-select").addClass("errored");
|
||||
} else {
|
||||
$(".options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$(".options-select2").addClass("errored");
|
||||
} else {
|
||||
$(".options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $(".debtor").val() == "") {
|
||||
$(".debtor").addClass("errored");
|
||||
} else {
|
||||
$(".debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $(".creditor").val() == "" && $(".creditor").prop("disabled") == false) {
|
||||
$(".creditor").addClass("errored");
|
||||
} else {
|
||||
$(".creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('.errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.Notification.autoHideNotify('success', 'top right', 'پیام سیستم ', "ثبت با موفقیت انجام شد.");
|
||||
var command = {};
|
||||
command.ContractingPartyId = $('#contractingPartyId').val();
|
||||
command.ContractingPartyName = $('#contractingPartyName').val();
|
||||
command.TdateFa = $(".persianDateInput").val();
|
||||
command.Description = $('#description').val();
|
||||
command.TypeOfTransaction = selectedOption;
|
||||
command.DeptorString = $(".debtor").val();
|
||||
command.Deptor = 0;
|
||||
command.Creditor = 0;
|
||||
command.CreditorString = $(".creditor").val();
|
||||
command.DescriptionOption = selectedOption2;
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "Create")',
|
||||
data: command,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
console.log("success");
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
}
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$(".persianDateInput").on('keyup',
|
||||
function() {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
if ($(window).width() < 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 229); // Adjusted for mobile
|
||||
const isSlash = (keyCode === 191); // Adjusted for mobile
|
||||
const isBackspace = (keyCode === 8); // Adjusted for mobile
|
||||
|
||||
if (!(isDigit || isControlKey || isSlash || isBackspace)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(".persianDateInput").on('blur',
|
||||
function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(window).on('resize',
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function() {
|
||||
console.log(1);
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function removeBlocked(trId) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام رنگ طوسی آیتم نظر حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "RemoveBlocked")',
|
||||
data: { "id": Number(trId) },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.isSuccedded) {
|
||||
$(`#${trId}`).removeClass("blocked");
|
||||
$(`#closeBtn-${trId}`).remove();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var ajaxCurrentDay ='@Url.Page("./FinancialStatments", "DateOfToday")';
|
||||
var ajaxPagination ='@Url.Page("./FinancialStatments", "Pagination")';
|
||||
var ajaxRemoveTransaction = '@Url.Page("./FinancialStatments", "RemoveTransaction")';
|
||||
var ajaxCreate ='@Url.Page("./FinancialStatments", "Create")';
|
||||
var ajaxRemoveBlocked = '@Url.Page("./FinancialStatments", "RemoveBlocked")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/FinancialStatment.js?ver=@adminVersion"></script>
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.InstitutionContracts.IndexModel
|
||||
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
var i = 1;
|
||||
|
||||
var myclass = "noworkshop";
|
||||
@@ -317,6 +318,24 @@
|
||||
background-color:#b5b5b5 !important;
|
||||
color: #646464;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.eye {
|
||||
z-index: 1;
|
||||
position: relative !important;
|
||||
top: 63px !important;
|
||||
display: inline-block !important;
|
||||
color: #363636 !important;
|
||||
float: left !important;
|
||||
direction: ltr !important;
|
||||
font-size: 14px !important;
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
|
||||
@@media screen and (max-width: 1920px) {
|
||||
.fulltext {
|
||||
font-family: 'IranSans' !important;
|
||||
@@ -483,6 +502,19 @@
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 600px) {
|
||||
.eye{
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display:block;
|
||||
}
|
||||
.desktopVeiw{
|
||||
display: none;
|
||||
}
|
||||
.form-group{
|
||||
margin-bottom: 3px !important;
|
||||
}
|
||||
@@ -598,11 +630,37 @@
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 412px) {
|
||||
.eye {
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display: block;
|
||||
}
|
||||
.desktopVeiw {
|
||||
display: none;
|
||||
}
|
||||
.table > tbody > tr > td{
|
||||
padding: 5px 4px;
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 400px) {
|
||||
.eye {
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left : 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView{
|
||||
display : block;
|
||||
}
|
||||
.desktopVeiw {
|
||||
display: none;
|
||||
}
|
||||
.name-td {
|
||||
max-width: 60px;
|
||||
}
|
||||
@@ -644,16 +702,8 @@
|
||||
|
||||
|
||||
}
|
||||
.eye{ z-index: 1;
|
||||
position: relative !important;
|
||||
top: 63px !important;
|
||||
display: inline-block !important;
|
||||
color: #363636 !important;
|
||||
float: left !important;
|
||||
direction: ltr !important;
|
||||
font-size: 14px !important;
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@media screen and (max-width: 400px) {
|
||||
.SumOfAmounts {
|
||||
@@ -662,14 +712,20 @@
|
||||
}
|
||||
|
||||
.eye{
|
||||
float: right !important;
|
||||
top: 20px !important; margin-right: 5px !important;
|
||||
z-index : 1;
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 500px) {
|
||||
.SumOfAmounts {
|
||||
float: right!important;
|
||||
.mobileView
|
||||
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -881,15 +937,44 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" style="background-color: #2f6002 !important ">
|
||||
<h3 class="panel-title" style="display: inline-block"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست قرارداد های موسسه</h3>
|
||||
<div class="desktopVeiw">
|
||||
<h3 class="TotalBalance">
|
||||
<span span class="panelTopText">بدهی کل</span><span> </span> <span class="amount">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
<h3 class="SumOfAmounts">
|
||||
<span class="amount">@Model.SumOfAmounts</span> <span> </span> <span class="panelTopText">مبلغ قراردادها</span>
|
||||
</h3>
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
</div>
|
||||
|
||||
<h3 class="TotalBalance">
|
||||
<span span class="panelTopText">بدهی کل</span><span> </span> <span class="amount">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
<h3 class="SumOfAmounts">
|
||||
<span class="amount">@Model.SumOfAmounts</span> <span> </span> <span class="panelTopText">مبلغ قراردادها</span>
|
||||
</h3>
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
@* <h3 class="countPersonel"><span>تعداد پرسنل:</span> <span>@Model.InstitutionContracts.Sum(x=>Convert.ToInt32(x.EmployeeCount))</span></h3> *@
|
||||
<div class="mobileView">
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
<h3 class="TotalBalance" style="width: 100%;height: 50px;">
|
||||
<span>بدهی کل</span>
|
||||
<br/>
|
||||
<span class="amount" style="font-size: 16px; position: relative;right: 10px;bottom: 5px;">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
|
||||
|
||||
<h3 class="SumOfAmounts" style="width: 100%;height: 50px;">
|
||||
<span >مبلغ قراردادها</span>
|
||||
<br/>
|
||||
<span class="amount" style="font-size: 16px; position: relative;right: 10px;bottom: 5px;">@Model.SumOfAmounts</span>
|
||||
</h3>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1269,654 +1354,17 @@
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.myLinkSign').click(function(event) {
|
||||
signAjax(event, this);
|
||||
});
|
||||
});
|
||||
|
||||
function signAjax(event, element) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
if ($(element).find('input[name="unsigned"]').length > 0) { // اگر بایگانی نبود بود به ابایگانی اضافه شود
|
||||
swal({
|
||||
title: "آیا نسخه قرارداد منتخب را به بایگانی اضافه می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
const signId = Number($(element).find('input[name="unsigned"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${signId}']`);
|
||||
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "Sign")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "Id": signId },
|
||||
success: function(response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasSignature"> موجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="unsigned"]').attr('name', 'signed');
|
||||
$(contractNoTd).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
} else if ($(element).find('input[name="signed"]').length > 0) { //اگر بایگانی شده بود از بایگانی حذف شود
|
||||
swal({
|
||||
title: "آیا قرارداد منتخب را از بایگانی حذف می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
const unsignId = Number($(element).find('input[name="signed"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${unsignId}']`);
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "UnSign")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "Id": unsignId },
|
||||
success: function(response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasNoSignature"> ناموجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="signed"]').attr('name', 'unsigned');
|
||||
$(contractNoTd).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//function hasContract(element) {
|
||||
// if ($(element).hasClass("hasSignature")){
|
||||
// $(element).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
// $(element).text("ناموجود");
|
||||
// $(element).parent().next().addClass("hasNoSignature");
|
||||
// }else{
|
||||
// $(element).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
// $(element).text("موجود");
|
||||
// $(element).parent().next().removeClass("hasNoSignature");
|
||||
// }
|
||||
|
||||
//}
|
||||
$(".activateContract-td span").on('click',
|
||||
function() {
|
||||
hasContract($(this));
|
||||
});
|
||||
$('.activer').on('change',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
$('.search').click();
|
||||
|
||||
});
|
||||
$('#datatable').find("tbody tr").each(function() {
|
||||
const cols = $(this).find(".BalanceDouble").val();
|
||||
if (cols > 0) {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "red");
|
||||
} else {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "#009300");
|
||||
}
|
||||
});
|
||||
|
||||
//var a = window.location.href;
|
||||
//var res = a.split("#")[1];
|
||||
//if (res == "false") {
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " ابتدا یکی از فیلد های کارگاه، کارفرما، پرسنل را انتخاب نموده و سپس جستجو را بزنید ");
|
||||
//}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
|
||||
//if (document.getElementById("activing").selectedIndex == 1) {
|
||||
// $('.deact').remove();
|
||||
// $('.act').append(
|
||||
// ' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
|
||||
// );
|
||||
//}
|
||||
//if (document.getElementById("activing").selectedIndex == 2) {
|
||||
// $('.deact').remove();
|
||||
|
||||
|
||||
//}
|
||||
$('.persianDateInputa').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
initialValue: false,
|
||||
/* 'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$('.persianDateInputb').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
|
||||
initialValue: false,
|
||||
/*'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(".datepicker-container").hide();
|
||||
$(document).ready(function() {
|
||||
$('#datatable').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||||
});
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
@*function copyLink() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
|
||||
|
||||
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "true") {
|
||||
checkboxes = document.getElementsByName('foo');
|
||||
var url3 = '';
|
||||
for (var i = 0, n = checkboxes.length; i < n; i++) {
|
||||
if (checkboxes[i].checked == true) {
|
||||
var u = '&ids=' + checkboxes[i].value;
|
||||
url3 = url3 + u;
|
||||
}
|
||||
}
|
||||
var url1 = '#showmodal=';
|
||||
var url2 = '@Url.Page("/Company/Checkouts/Index", "PrintAll")';
|
||||
|
||||
window.location.href = url1 + url2 + url3;
|
||||
} else if (document.getElementById("sercheCheck").value == "false") {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}*@
|
||||
|
||||
@*function deactiveAll() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ تصفیه حسابی انتخاب نشده است ");
|
||||
|
||||
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام تمامی تصفیه حساب های انتخاب شده بطور کامل از بانک اطلاعات حذف می شوند",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
var url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
var u2 = '&ids=' + checkboxes2[i2].value;
|
||||
url3b = url3b + u2;
|
||||
}
|
||||
}
|
||||
/* var url1 = '#showmodal=';*/
|
||||
var url2b = '@Url.Page("/Company/Checkouts/Index", "MultiRemoveCheckout")';
|
||||
/* var url3 = document.getElementById('yearSend').value;*/
|
||||
window.location.href = url2b + url3b;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "false") {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}*@
|
||||
|
||||
function removeOneCheckout(aTag) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
/* $("a.dell").click();*/
|
||||
const inputTag = aTag.querySelector('input[name="checkoutId"]');
|
||||
const chekoutId = inputTag.value;
|
||||
let url3b = '';
|
||||
const u2 = `&id=${chekoutId}`;
|
||||
url3b = url3b + u2;
|
||||
const url2b = '@Url.Page("/Company/InstitutionContracts/Index", "RemoveOne")';
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deactiveOneCheckout(Id, Balance) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر غیر فعال می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false,
|
||||
customClass: "disableSwall"
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
let url3b = '';
|
||||
const u2 = `&id=${Id}`;
|
||||
const u3 = `&balance=${Balance}`;
|
||||
url3b = url3b + u2 + u3;
|
||||
const url2b = '@Url.Page("/Company/InstitutionContracts/Index", "DeActive")';
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
@*function print() {
|
||||
/* $("a.dell").click();*/
|
||||
var url2b = '@Url.Page("/Company/InstitutionContracts/Index", "Print")';
|
||||
window.location.href = url2b;
|
||||
}*@
|
||||
</script>
|
||||
<script>
|
||||
function reActiveAll() {
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "false") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
let url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
const u2 = `&ids=${checkboxes2[i2].value}`;
|
||||
url3b = url3b + u2;
|
||||
}
|
||||
}
|
||||
const url2b = '@Url.Page("/Company/Checkouts/Index", "GroupReActive")';
|
||||
window.location.href = url2b + url3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(window).on('resize',
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#LeftWorkInsuranceForm") && !target.is("#LeftWorkInsuranceForm *") && !target.is("#LeftWorkForm") && !target.is("#LeftWorkForm *") && !target.is("#LeftWorkInsuranceForm #closing") && !target.is("#LeftWorkForm #close") && !target.is("#LeftWorkInsuranceForm .close") && !target.is("#LeftWorkForm .close") && !target.is("#LeftWorkInsuranceForm #btnSaveData") && !target.is("#LeftWorkForm #btnSaveData")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainer() {
|
||||
const beforePosition = $(".screen-view .employee-operations").position();
|
||||
const containerWidth = $('.screen-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.screen-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".screen-view .employee-operations").outerWidth() + 20;
|
||||
const containerTop = beforePosition.top + ($(".screen-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.screen-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function showAmount(element) {
|
||||
|
||||
if ($(element).hasClass("fa-eye-slash")) {
|
||||
$(element).removeClass("fa-eye-slash");
|
||||
$(element).addClass("fa-eye");
|
||||
$('.amount').css("visibility", "hidden");
|
||||
} else if ($(element).hasClass("fa-eye")) {
|
||||
$(element).removeClass("fa-eye");
|
||||
$(element).addClass("fa-eye-slash");
|
||||
$('.amount').css("visibility", "visible");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showTooltip(id) {
|
||||
|
||||
|
||||
// var id= $(this).attr("id").replace("p_","");
|
||||
|
||||
|
||||
console.log($(`tooltip_${id}`).hasClass('show'));
|
||||
|
||||
|
||||
if ($(`tooltip_${id}`).hasClass('show')) {
|
||||
$(`tooltip_${id}`).removeClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'hidden' });
|
||||
} else {
|
||||
$(`tooltip_${id}`).addClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'visible' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function block(id) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
swal({
|
||||
title: "آیا از مسدود کردن این طرف حساب مطمئن هستید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "BlockPersonalContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "id": id },
|
||||
success: function(response) {
|
||||
// console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
bloked(id, response.blockTimes);
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function bloked(id, blocktime) {
|
||||
const blocked = `<a onclick="disableBlock(${id},${blocktime})" class="btn btn-inverse unblock pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${blocktime}</span>
|
||||
<i class="fa fa-minus-circle"></i><span>آنبلاک</span></a>`;
|
||||
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(blocked);
|
||||
$(`.blockingTr${id}`).addClass("blockTr");
|
||||
$(`.blockingTr${id}`).addClass("progress-bar-striped");
|
||||
$(`.extention${id}`).addClass("disabled");
|
||||
$(`.deactive${id}`).addClass("disabled");
|
||||
$(`.edit${id}`).addClass("disabled");
|
||||
$(`.delete${id}`).addClass("disabled");
|
||||
|
||||
}
|
||||
|
||||
function disableBlock(id, blocktime) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
|
||||
|
||||
swal({
|
||||
title: "آیا میخواهید این طرف حساب را از حالت مسدود خارج نمایید؟ ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "DisableBlockPersonalContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "id": id },
|
||||
success: function(response) {
|
||||
//console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
$(`.blockingTr${id}`).removeClass("blockTr");
|
||||
$(`.blockingTr${id}`).removeClass("progress-bar-striped");
|
||||
$(`.extention${id}`).removeClass("disabled");
|
||||
$(`.deactive${id}`).removeClass("disabled");
|
||||
$(`.edit${id}`).removeClass("disabled");
|
||||
$(`.delete${id}`).removeClass("disabled");
|
||||
if (response.blockTimes == 1) {
|
||||
const orange = `<a onclick="block(${id})" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(orange);
|
||||
|
||||
|
||||
} else if (response.blockTimes >= 2) {
|
||||
const red = `<a onclick="block(${id})" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(red);
|
||||
|
||||
|
||||
}
|
||||
swal({
|
||||
title: response.message,
|
||||
text: "",
|
||||
type: "success",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بستن",
|
||||
//cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
customClass: "successSwall"
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$("#btnSearch").click();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
// text: "برای حذف قرارداد، ابتدا تیک مربوط به امضای قرارداد را حذف نمایید.",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var signAjaxUrl = '@Url.Page("./Index", "Sign")';
|
||||
var unSignAjax ='@Url.Page("./Index", "UnSign")';
|
||||
var removeOneCheckoutUrl = '@Url.Page("/Company/InstitutionContracts/Index", "RemoveOne")';
|
||||
var deactiveOneCheckoutUrl = '@Url.Page("/Company/InstitutionContracts/Index", "DeActive")';
|
||||
|
||||
var reActiveAllUrl = '@Url.Page("/Company/Checkouts/Index", "GroupReActive")';
|
||||
var blockAjax = '@Url.Page("./Index", "BlockPersonalContractingParties")';
|
||||
var disableBlockAjax = '@Url.Page("./Index", "DisableBlockPersonalContractingParties")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Index.js?ver=@adminVersion"></script>
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user