Marge from Master

This commit is contained in:
SamSys
2025-03-16 21:06:48 +03:30
46 changed files with 11126 additions and 1203 deletions

View File

@@ -42,8 +42,39 @@ public class PersonalContractingParty : EntityBase
public string IsActiveString { get; private set; }
public string IsBlock { get; private set; }
public int BlockTimes {get; private set; }
#region NewProps
/// <summary>
/// سری شناسنامه
/// </summary>
public string IdNumberSeri { get; private set; }
/// <summary>
/// سریال شناسنامه
/// </summary>
public string IdNumberSerial { get; private set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; private set; }
/// <summary>
/// تاریخ تولد
/// </summary>
public DateTime? DateOfBirth { get; private set; }
/// <summary>
/// آیا از طریق ای پی ای احراز هویت شده است
/// </summary>
public bool IsAuthenticated { get; private set; }
#endregion
public List<Employer> Employers { get; private set; }
public Representative Representative { get; set; }
@@ -159,5 +190,8 @@ public class PersonalContractingParty : EntityBase
this.IsActiveString = "false";
}
public void Authenticated()
{
IsAuthenticated = true;
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.LeftWork;
@@ -41,5 +42,7 @@ public interface ILeftWorkRepository : IRepository<long, LeftWork>
bool IsEmployeeWorkingInDates(long employeeId, long workshopId, List<(DateTime, DateTime)> dates);
List<LeftWorkViewModel> GetByWorkshopIdInDates(long workshopId, DateTime startDateGr, DateTime endDateGr);
LeftWorkViewModel GetByWorkshopIdEmployeeIdInDates(long workshopId, long employeeId, DateTime start, DateTime end);
#endregion
#endregion
Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId);
}

View File

@@ -9,20 +9,24 @@ namespace Company.Domain.ReportAgg
{
public interface IReportRepository
{
AllReport GetAllActiveWorkshopsNew(string year, string month);
Task<AllReport> GetAllActiveWorkshopsNew(string year, string month);
AllReport GetAllActiveWorkshops(string year, string month);
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId);
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId);
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId);
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId);
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList);
List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List<long> workshopList);
}

View File

@@ -481,21 +481,25 @@ namespace Company.Domain.RollCallAgg
internal void SetEarlyEnter(TimeSpan earlyEntryDuration)
{
EarlyEntryDuration = earlyEntryDuration;
LateEntryDuration = TimeSpan.Zero;
}
internal void SetLateEnter(TimeSpan lateEntryDuration)
{
LateEntryDuration = lateEntryDuration;
EarlyEntryDuration = TimeSpan.Zero;
}
internal void SetEarlyExit(TimeSpan earlyExit)
{
EarlyExitDuration = earlyExit;
LateExitDuration = TimeSpan.Zero;
}
internal void SetLateExit(TimeSpan lateExitDuration)
{
LateExitDuration = lateExitDuration;
EarlyExitDuration = TimeSpan.Zero;
}
public void setStartAndEnd(DateTime start, DateTime end, IRollCallDomainService service)

View File

@@ -0,0 +1,96 @@
using System;
using _0_Framework.Application;
using _0_Framework.Domain;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public class ContractingPartyTemp : EntityBase
{
public ContractingPartyTemp(string fName, string lName, string nationalCode, string idNumber, string phone, string fatherName, string state, string city, string address, string idNumberSeri, string idNumberSerial, Gender gender, DateTime dateOfBirth)
{
FName = fName;
LName = lName;
NationalCode = nationalCode;
IdNumber = idNumber;
Phone = phone;
FatherName = fatherName;
State = state;
City = city;
Address = address;
IdNumberSeri = idNumberSeri;
IdNumberSerial = idNumberSerial;
Gender = gender;
DateOfBirth = dateOfBirth;
}
/// <summary>
/// نام
/// </summary>
public string FName { get; private set; }
/// <summary>
/// نام خانوادگی
/// </summary>
public string LName { get; private set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; private set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; private set; }
/// <summary>
/// کد ملی
/// </summary>
public string NationalCode { get; private set; }
/// <summary>
///تاریخ تولد
/// </summary>
public DateTime DateOfBirth { get; private set; }
/// <summary>
/// سری شناسنامه
/// </summary>
public string IdNumberSeri { get; private set; }
/// <summary>
/// سریال شناسنامه
/// </summary>
public string IdNumberSerial { get; private set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; private set; }
/// <summary>
/// شماره همراه
/// </summary>
public string Phone { get; private set; }
/// <summary>
/// استان
/// </summary>
public string State { get; private set; }
/// <summary>
/// شهر
/// </summary>
public string City { get; private set; }
/// <summary>
/// نشانی
/// </summary>
public string Address { get; private set; }
}

View File

@@ -0,0 +1,8 @@
using _0_Framework.Domain;
namespace Company.Domain.TemporaryClientRegistrationAgg;
public interface IContractingPartyTempRepository :IRepository<long, ContractingPartyTemp>
{
(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode);
}

View File

@@ -44,6 +44,7 @@ public class PersonalContractingPartyViewModel
public string IsActiveString { get; set; }
public string IsBlock { get; set; }
public int BlockTimes { get; set; }
public bool IsAuthenticated { get; set; }
public List<EmployerViewModel> EmployerList { get; set; }
}

View File

@@ -7,6 +7,8 @@ public class AccountResults
public long AccountId { get; set; }
public string AccountFullName { get; set; }
public List<long> WorkshopList { get; set; }
//public int ContractToBe { get; set; }
//public int CheckoutoBe { get; set; }

View File

@@ -8,19 +8,23 @@ namespace CompanyManagment.App.Contracts.Report
{
public interface IReportApplication
{
AllReport GetAllActiveWorkshops(string year, string month);
AllReport GetAllReports(string year, string month);
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId);
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId);
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId);
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId);
Task<AllReport> GetAllActiveWorkshops(string year, string month);
Task<AllReport> GetAllReports(string year, string month);
WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList);
WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList);
List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId);
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
List<long> workshopList);
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List<long> workshopList);
}
}

View File

@@ -15,8 +15,7 @@ public class RollCallEmployeeViewModel : EditRollCallEmployee
public string PersonName { get; set; }
public bool ContractPerson { get; set; }
public bool InsurancePerson { get; set; }
public long WorkshopId { get; set; }
public long EmployeeId { get; set; }
public bool ContractLeft { get; set; }
public bool InsurancetLeft { get; set; }
public bool Black { get; set; }

View File

@@ -0,0 +1,6 @@
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
public class ContractingPartyTempViewModel : CreateContractingPartyTemp
{
public long Id { get; set; }
}

View File

@@ -0,0 +1,78 @@
using _0_Framework.Application;
using System;
using System.Drawing.Interop;
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
public class CreateContractingPartyTemp
{
/// <summary>
/// نام
/// </summary>
public string FName { get; set; }
/// <summary>
/// نام خانوادگی
/// </summary>
public string LName { get; set; }
/// <summary>
/// نام پدر
/// </summary>
public string FatherName { get; set; }
/// <summary>
/// جنسیت
/// </summary>
public Gender Gender { get; set; }
/// <summary>
/// کد ملی
/// </summary>
public string NationalCode { get; set; }
/// <summary>
///تاریخ تولد
/// </summary>
public DateTime DateOfBirth { get; set; }
/// <summary>
/// سری شناسنامه
/// </summary>
public string IdNumberSeri { get; set; }
/// <summary>
/// سریال شناسنامه
/// </summary>
public string IdNumberSerial { get; set; }
/// <summary>
/// شماره شناسنامه
/// </summary>
public string IdNumber { get; set; }
/// <summary>
/// شماره همراه
/// </summary>
public string Phone { get; set; }
/// <summary>
/// استان
/// </summary>
public string State { get; set; }
/// <summary>
/// شهر
/// </summary>
public string City { get; set; }
/// <summary>
/// نشانی
/// </summary>
public string Address { get; set; }
}

View File

@@ -0,0 +1,8 @@
using _0_Framework.Application;
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
public interface ITemporaryClientRegistrationApplication
{
OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command);
}

View File

@@ -439,6 +439,11 @@ public class InsuranceListApplication: IInsuranceListApplication
//محاسبه مزایای ماهانه
var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId,employee.IncludeStatus);
//if (employee.EmployeeId is 7999)// سید عباس خوشکلام سلیمان
// monthlyBenefits = 80869389;
//if (employee.EmployeeId is 43787)// شهرام براهیمی سیقلان
// monthlyBenefits = 54748472;
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,

View File

@@ -18,35 +18,35 @@ public class ReportApplication : IReportApplication
_reportRepository = reportRepository;
}
public AllReport GetAllActiveWorkshops(string year, string month)
public async Task<AllReport> GetAllActiveWorkshops(string year, string month)
{
return _reportRepository.GetAllActiveWorkshops(year, month);
return await _reportRepository.GetAllActiveWorkshopsNew(year, month);
}
public AllReport GetAllReports(string year, string month)
public async Task<AllReport> GetAllReports(string year, string month)
{
return _reportRepository.GetAllActiveWorkshops(year, month);
return await _reportRepository.GetAllActiveWorkshopsNew(year, month);
}
public WorkshopResult GetWorkshopContractDone(string year, string month, long accountId)
public WorkshopResult GetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList)
{
return _reportRepository.GetWorkshopContractDone(year, month, accountId);
return _reportRepository.GetWorkshopContractDone(year, month, accountId, workshopList);
}
public WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId)
public WorkshopResult GetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList)
{
return _reportRepository.GetWorkshopContractSignDone(year, month, accountId);
return _reportRepository.GetWorkshopContractSignDone(year, month, accountId, workshopList);
}
public WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId)
public WorkshopResult GetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList)
{
return _reportRepository.GetWorkshopCheckoutDone(year, month, accountId);
return _reportRepository.GetWorkshopCheckoutDone(year, month, accountId, workshopList);
}
public WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId)
public WorkshopResult GetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList)
{
return _reportRepository.GetWorkshopCheckoutSignDone(year, month, accountId);
return _reportRepository.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList);
}
public List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId)
@@ -71,21 +71,25 @@ public class ReportApplication : IReportApplication
#region Print
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId)
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
List<long> workshopList)
{
return _reportRepository.GetPrintAllContractDone(year, month, accountId);
return _reportRepository.GetPrintAllContractDone(year, month, accountId, workshopList);
}
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId)
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
List<long> workshopList)
{
return _reportRepository.GetPrintAllContractSignDone(year, month, accountId);
return _reportRepository.GetPrintAllContractSignDone(year, month, accountId, workshopList);
}
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId)
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
List<long> workshopList)
{
return _reportRepository.GetPrintAllCheckoutDone(year, month, accountId);
return _reportRepository.GetPrintAllCheckoutDone(year, month, accountId, workshopList);
}
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId)
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
List<long> workshopList)
{
return _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId);
return _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId, workshopList);
}
#endregion

View File

@@ -44,10 +44,7 @@ namespace CompanyManagment.Application
if (!_leftWorkRepository.Exists(x =>
x.EmployeeId == rollCallEmployee.EmployeeId && x.WorkshopId == rollCallEmployee.WorkshopId &&
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now) &&
!_leftWorkInsuranceRepository.Exists(x =>
x.EmployeeId == rollCallEmployee.EmployeeId && x.WorkshopId == rollCallEmployee.WorkshopId &&
x.StartWorkDate <= DateTime.Now && (x.LeftWorkDate > DateTime.Now || x.LeftWorkDate == null)) &&
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now) &&
!_leftWorkTempRepository.Exists(x =>
x.EmployeeId == rollCallEmployee.EmployeeId && x.WorkshopId == rollCallEmployee.WorkshopId &&
x.LeftWorkType == LeftWorkTempType.StartWork))
@@ -67,7 +64,21 @@ namespace CompanyManagment.Application
}
else
{
RollCallEmployeeStatus newRecord = new(rollCallEmployee.id, DateTime.Now.Date);
var pc = new PersianCalendar();
var startStatus = DateTime.Today;
LeftWork leftWork =
_leftWorkRepository.GetLastLeftWork(rollCallEmployee.EmployeeId, rollCallEmployee.WorkshopId).GetAwaiter().GetResult();
if (leftWork.StartWorkDate > DateTime.Today)
startStatus = leftWork.StartWorkDate;
//else if(pc.GetMonth(DateTime.Today) == pc.GetMonth(leftWork.StartWorkDate))
//{
// startStatus = new DateTime(pc.GetYear(leftWork.StartWorkDate), pc.GetMonth(leftWork.StartWorkDate),
// 1, pc);
//}
RollCallEmployeeStatus newRecord = new(rollCallEmployee.id, startStatus);
_employeeRollCallStatusRepository.Create(newRecord);
}
@@ -86,12 +97,18 @@ namespace CompanyManagment.Application
//368 پیتزا امیر آماده سازی
//367 پیتزا امیر رستوران
//286 مرکز توان بخشی رسالت
bool skipRollCall = workshopId is 11 or 585 or 604 or 605 or 368 or 367 or 286;
bool skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367 or 286;
#if DEBUG
skipRollCall = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
#endif
if (skipRollCall)
//#if DEBUG
// skipRollCallByWorkshopId = workshopId is 11 or 585 or 604 or 605 or 368 or 367;
//#endif
if (skipRollCallByWorkshopId)
return false;
// 42550 مصطفی مقدس نژاد فومنی
bool skipRollCallByEmployeeId = employeeId is 42550;
if (skipRollCallByEmployeeId)
return false;

View File

@@ -0,0 +1,24 @@
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.TemporaryClientRegistrationAgg;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
namespace CompanyManagment.Application;
public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrationApplication
{
private readonly IContractingPartyTempRepository _contractingPartyTempRepository;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
public TemporaryClientRegistrationApplication(IContractingPartyTempRepository contractingPartyTempRepository, IPersonalContractingPartyRepository personalContractingPartyRepository)
{
_contractingPartyTempRepository = contractingPartyTempRepository;
_personalContractingPartyRepository = personalContractingPartyRepository;
}
public OperationResult CreateContractingPartyTemp(CreateContractingPartyTemp command)
{
throw new System.NotImplementedException();
}
}

View File

@@ -0,0 +1,32 @@
using System;
using _0_Framework.Application;
using Company.Domain.TemporaryClientRegistrationAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ContractingPartyTempMapping : IEntityTypeConfiguration<ContractingPartyTemp>
{
public void Configure(EntityTypeBuilder<ContractingPartyTemp> builder)
{
builder.ToTable("ContractingPartyTemp");
builder.HasKey(x => x.id);
builder.Property(x => x.FName).HasMaxLength(25).IsRequired();
builder.Property(x => x.LName).HasMaxLength(25).IsRequired();
builder.Property(x => x.NationalCode).HasMaxLength(10).IsRequired();
builder.Property(x => x.IdNumber).HasMaxLength(10).IsRequired(false);
builder.Property(x => x.Phone).HasMaxLength(12);
builder.Property(x => x.FatherName).HasMaxLength(25);
builder.Property(x => x.State).HasMaxLength(35);
builder.Property(x => x.City).HasMaxLength(35);
builder.Property(x => x.Address).HasMaxLength(500);
builder.Property(x => x.IdNumberSeri).HasMaxLength(5);
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
builder.Property(x => x.Gender).HasConversion(
v => v.ToString(),
v => (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
builder.Property(x => x.DateOfBirth);
}
}

View File

@@ -31,6 +31,16 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
builder.Property(x => x.IsBlock).HasMaxLength(5);
builder.Property(x => x.BlockTimes);
#region NewProp
builder.Property(x => x.IdNumberSeri).HasMaxLength(5);
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
builder.Property(x => x.FatherName).HasMaxLength(20);
builder.Property(x => x.DateOfBirth).IsRequired(false);
#endregion

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addNewPropToContractingParty : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "DateOfBirth",
table: "PersonalContractingParties",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FatherName",
table: "PersonalContractingParties",
type: "nvarchar(20)",
maxLength: 20,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IdNumberSeri",
table: "PersonalContractingParties",
type: "nvarchar(5)",
maxLength: 5,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "IdNumberSerial",
table: "PersonalContractingParties",
type: "nvarchar(15)",
maxLength: 15,
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsAuthenticated",
table: "PersonalContractingParties",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DateOfBirth",
table: "PersonalContractingParties");
migrationBuilder.DropColumn(
name: "FatherName",
table: "PersonalContractingParties");
migrationBuilder.DropColumn(
name: "IdNumberSeri",
table: "PersonalContractingParties");
migrationBuilder.DropColumn(
name: "IdNumberSerial",
table: "PersonalContractingParties");
migrationBuilder.DropColumn(
name: "IsAuthenticated",
table: "PersonalContractingParties");
}
}
}

View File

@@ -558,19 +558,37 @@ namespace CompanyManagment.EFCore.Migrations
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateOfBirth")
.HasColumnType("datetime2");
b.Property<string>("FName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("FatherName")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("IdNumber")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("IdNumberSeri")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<string>("IdNumberSerial")
.HasMaxLength(15)
.HasColumnType("nvarchar(15)");
b.Property<string>("IsActiveString")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b.Property<bool>("IsAuthenticated")
.HasColumnType("bit");
b.Property<string>("IsBlock")
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");

View File

@@ -0,0 +1,35 @@
using System.Linq;
using _0_Framework.InfraStructure;
using Company.Domain.TemporaryClientRegistrationAgg;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class ContractingPartyTempRepository : RepositoryBase<long, ContractingPartyTemp>, IContractingPartyTempRepository
{
private readonly CompanyContext _context;
public ContractingPartyTempRepository(CompanyContext context) : base(context)
{
_context = context;
}
//(long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
//{
// //return _context.PersonalContractingParties.Select(x=>new PersonalContractingPartyViewModel
// //{
// // id = x.id,
// // IsAuthenticated = x.IsAuthenticated,
// // Nationalcode = x.Nationalcode,
// // IdNumber = x.IdNumber,
// //}).FirstOrDefault(x => x.Nationalcode == nationalcode);
// return new();
//}
public (long id, bool IsAuthenticated) CheckExistOrAuthenticated(string nationalCode)
{
throw new System.NotImplementedException();
}
}

View File

@@ -308,7 +308,8 @@ namespace CompanyManagment.EFCore.Repository
SalaryAidDateTimeGe = s.SalaryAidDateTime
}).ToList(),
LateToWorkValue = x.LateToWorkValue == TimeSpan.Zero ? "-" : $"{(int)x.LateToWorkValue.TotalHours}:{x.LateToWorkValue.Minutes:D2}"
//LateToWorkValue = x.LateToWorkValue == TimeSpan.Zero ? "-" : $"{(int)x.LateToWorkValue.TotalHours}:{x.LateToWorkValue.Minutes:D2}"
LateToWorkValue = x.LateToWorkValue == TimeSpan.Zero ? "-" : $"{Convert.ToInt32(x.LateToWorkValue.TotalHours)}:{Convert.ToInt32(x.LateToWorkValue.TotalMinutes % 60):00}"
}).ToList();
List<WorkshopViewModel> workshopsList = workshopsQuery.Select(x => new WorkshopViewModel

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.LeftWorkAgg;
@@ -162,15 +163,17 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
if (item != null)
{
_context.LeftWorkList.Remove(item);
_context.SaveChanges();
if (!_context.LeftWorkList.Any(x => x.WorkshopId == item.WorkshopId && x.EmployeeId == item.EmployeeId && item.id != x.id) && HasActiveRollCallStatus(item.WorkshopId, item.EmployeeId))
{
RemoveEmployeeRollCallStatus(item.WorkshopId,item.EmployeeId);
RemoveEmployeeRollCallStatus(item.WorkshopId, item.EmployeeId);
}
_context.LeftWorkList.Remove(item);
}
_context.SaveChanges();
return op.Succcedded();
}
@@ -240,8 +243,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
}
if (HasActiveRollCallStatus(workshopId, employeeId))
RemoveEmployeeRollCallStatus(workshopId, employeeId);
var list = _context.LeftWorkList.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).ToList();
@@ -257,7 +259,12 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
}
_context.SaveChanges();
transaction.Commit();
if (HasActiveRollCallStatus(workshopId, employeeId))
RemoveEmployeeRollCallStatus(workshopId, employeeId);
if (hasLeftWorkInsurance)
return
op.Succcedded(1, "حذف با موفقیت انجام شد."); //+ "<br/>" + "<span class='text-danger'>" + "کد پرسنلی این شخص به دلیل استفاده در ترک کار بیمه قابل حذف نمی باشد. " + "</span>");
@@ -638,19 +645,49 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
private bool HasActiveRollCallStatus(long workshopId, long employeeId)
{
var now = DateTime.Today;
var isDateUndefined = new DateTime(2121, 03, 21);
return
_context.RollCallEmployees.Include(x => x.EmployeesStatus).Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId &&
x.EmployeesStatus.Any(y => y.EndDate.Date > now && y.StartDate <= now));
x.EmployeesStatus.Any(y => (y.EndDate.Date > now && y.StartDate <= now) || (y.EndDate.Date == isDateUndefined)));
}
private void RemoveEmployeeRollCallStatus(long workshopId, long employeeId)
{
var entity = _context.RollCallEmployees.FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
var entity = _context.RollCallEmployees.Include(x=>x.EmployeesStatus).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
if (entity == null)
return;
_context.RollCallEmployees.Remove(entity);
_context.SaveChanges();
var hasLeftWork = _context.LeftWorkList.Any(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
//اگر هیچ شرع بکار ترک کاری نداشت
if (!hasLeftWork)
{
var now = DateTime.Today;
entity.DeActive();
var rollCallEmployeeStatus =
entity.EmployeesStatus.FirstOrDefault(x => x.EndDate.Date.IsDateUndefined() || x.EndDate.Date > now && x.StartDate <= now);
if (rollCallEmployeeStatus != null)
{
var end = rollCallEmployeeStatus.StartDate.Date > DateTime.Now.Date
? rollCallEmployeeStatus.StartDate.Date
: DateTime.Now.Date;
rollCallEmployeeStatus.Deactivate(end);
}
_context.SaveChanges();
}
//_context.RollCallEmployees.Remove(entity);
}
#endregion
public async Task<LeftWork> GetLastLeftWork(long employeeId, long workshopId)
{
var leftWork = await _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
.OrderByDescending(x => x.StartWorkDate).FirstOrDefaultAsync();
return leftWork;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -49,12 +49,11 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
public EditRollCallEmployee GetDetails(long id)
{
return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel()
return _context.RollCallEmployees.Select(x => new EditRollCallEmployee()
{
Id = x.id,
WorkshopId = x.WorkshopId,
EmployeeFName = x.FName,
EmployeeLName = x.LName,
EmployeeId = x.EmployeeId,
EmployeeFullName = x.EmployeeFullName,
IsActiveString = x.IsActiveString,
HasUploadedImage = x.HasUploadedImage
@@ -104,7 +103,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
(x, temp) => new { x.employee, temp })
.Where(x => (x.employee.LeftWorks.Any(y =>
y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
y.LeftWorkDate > dateNow) ||
y.LeftWorkDate > dateNow || (y.WorkshopId == command.WorkshopId && y.StartWorkDate > dateNow)) ||
x.employee.LeftWorkInsurances.Any(y =>
y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow &&
(y.LeftWorkDate > dateNow || y.LeftWorkDate == null))) || x.temp != null).OrderByDescending(x => x.employee.id)

View File

@@ -37,7 +37,7 @@ namespace Query.AdminReports.Handlers
var allWorkshops = _companyContext.Workshops.AsSplitQuery().Select(x => new { x.id, x.WorkshopFullName });
if (parameters.WorkshopId != 0)
allWorkshops = allWorkshops.Where(x => x.id == parameters.WorkshopId);
allWorkshops = allWorkshops.Where(x => x.id == parameters.WorkshopId);
if (!string.IsNullOrWhiteSpace(parameters.WorkshopName))
allWorkshops = allWorkshops.Where(x => x.WorkshopFullName.Contains(parameters.WorkshopName));
@@ -45,10 +45,10 @@ namespace Query.AdminReports.Handlers
if (!string.IsNullOrWhiteSpace(parameters.RollCallServiceType))
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.ServiceType == parameters.RollCallServiceType);
if (parameters.FilterMode == FilterMode.Active)
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.StartService.Date <= now && x.EndService.Date >= now);
else if(parameters.FilterMode == FilterMode.DeActive)
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.EndService.Date < now || x.StartService.Date > now);
if (parameters.FilterMode == FilterMode.Active)
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.StartService.Date <= now && x.EndService.Date >= now);
else if (parameters.FilterMode == FilterMode.DeActive)
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.EndService.Date < now || x.StartService.Date > now);
var workshopsWithService = rollCallServiceQuery.Join(allWorkshops, x => x.WorkshopId, y => y.id, (rcs, workshop) =>
new WorkshopWithRollCallServiceQueryModel()
@@ -60,7 +60,7 @@ namespace Query.AdminReports.Handlers
IsActive = rcs.StartService <= DateTime.Now && rcs.EndService >= DateTime.Now,
ServiceStart = rcs.StartService,
ServiceEnd = rcs.EndService
});
});
//workshop population
@@ -73,12 +73,15 @@ namespace Query.AdminReports.Handlers
}).ToList();
var workshopsWorkingEmployeesList = workshopLeftWorks
.Select(x => new { x.WorkshopId, TotalWorkingEmployeesCount = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct().Count() }).ToList();
.Select(x => new { x.WorkshopId, TotalWorkingEmployeesCount = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct().Count(), EmployeeIds = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct() }).ToList();
var activeEmployees = _companyContext.RollCallEmployees.AsSplitQuery().Include(x => x.EmployeesStatus).Where(x => x.EmployeesStatus.Any(y =>
y.EndDate.Date >= now) && workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId)).Select(x => new { x.WorkshopId, x.EmployeeId });
var activeEmployees = _companyContext.RollCallEmployees.AsSplitQuery()
.Include(x => x.EmployeesStatus)
.Where(x => x.EmployeesStatus.Any(y => y.EndDate.Date >= now) &&
workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId))
.Select(x => new { x.WorkshopId, x.EmployeeId });
var lastWeekRollCalls = _companyContext.RollCalls.AsSplitQuery().Where(x => x.StartDate.HasValue && x.StartDate.Value >= lastWeek
&& workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId)).GroupBy(x => x.EmployeeId).Select(x => x.Key);
@@ -88,27 +91,27 @@ namespace Query.AdminReports.Handlers
&& workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId)).Select(x => x.EmployeeId);
var activeEmployeesList = activeEmployees.ToList();
var activeEmployeesList = activeEmployees.ToList().Where(x => workshopsWorkingEmployeesList.Any(w => w.WorkshopId == x.WorkshopId && w.EmployeeIds.Contains(x.EmployeeId)));
var lastWeekRollCallsList = lastWeekRollCalls.ToList();
var leavesList = leaves.ToList();
var workshopsWithServiceList = workshopsWithService.ToList();
return workshopsWithServiceList.GroupBy(x=>x.WorkshopId)
.Select(x=>x.OrderByDescending(y=>y.ServiceStartFa).First())
.Select(x => new WorkshopWithRollCallServiceQueryModel()
{
IsActive = x.IsActive,
ServiceStartFa = x.ServiceStart.ToFarsi(),
ServiceEndFa = x.ServiceEnd.ToFarsi(),
WorkshopId = x.WorkshopId,
RollCallServiceType = x.RollCallServiceType,
MaxPersonValid = x.MaxPersonValid,
WorkshopName = x.WorkshopName,
ActiveEmployeesCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId),
ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId &&
lastWeekRollCallsList.Contains(y.EmployeeId) && !leavesList.Contains(y.EmployeeId)),
TotalEmployeesCount = workshopsWorkingEmployeesList.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.TotalWorkingEmployeesCount ?? 0,
//UndoneWorkFlowsCount = workFlowApplication.GetAllWorkFlowCount(x.WorkshopId).Result
}).OrderByDescending(x=>x.IsActive).ToList();
return workshopsWithServiceList.GroupBy(x => x.WorkshopId)
.Select(x => x.OrderByDescending(y => y.ServiceStartFa).First())
.Select(x => new WorkshopWithRollCallServiceQueryModel()
{
IsActive = x.IsActive,
ServiceStartFa = x.ServiceStart.ToFarsi(),
ServiceEndFa = x.ServiceEnd.ToFarsi(),
WorkshopId = x.WorkshopId,
RollCallServiceType = x.RollCallServiceType,
MaxPersonValid = x.MaxPersonValid,
WorkshopName = x.WorkshopName,
ActiveEmployeesCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId),
ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId &&
lastWeekRollCallsList.Contains(y.EmployeeId) && !leavesList.Contains(y.EmployeeId)),
TotalEmployeesCount = workshopsWorkingEmployeesList.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.TotalWorkingEmployeesCount ?? 0,
//UndoneWorkFlowsCount = workFlowApplication.GetAllWorkFlowCount(x.WorkshopId).Result
}).OrderByDescending(x => x.IsActive).ToList();
}
}

View File

@@ -384,14 +384,16 @@
{
if (firstItem1)
{
<script>
$(document).ready(function() {
ajaxContractDone(@personnel.AccountId, '@personnel.AccountFullName');
var workshopList = @Html.Raw(Json.Serialize(personnel.WorkshopList));
ajaxContractDone(@personnel.AccountId, '@personnel.AccountFullName', workshopList);
});
</script>
}
<div id="ContractDonePercentDiv" class="d-flex align-items-center m-1 select @(firstItem1 ? "active" : "") ContractDonePercent activeBtn" onclick="ajaxContractDone(@personnel.AccountId, '@personnel.AccountFullName')">
<div id="ContractDonePercentDiv" class="d-flex align-items-center m-1 select @(firstItem1 ? "active" : "") ContractDonePercent activeBtn" onclick="ajaxContractDone(@personnel.AccountId, '@personnel.AccountFullName', @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<div class="col-xs-4">
<div class="title-name">
<div class="scrolltext text-container">
@@ -410,7 +412,7 @@
<span class="title">@personnel.ContractDonePercent%</span>
</div>
<div class="col-xs-2 text-left">
<button class="btn-print @(personnel.ContractDonePercent >= 100 ? "disable" : "")" onclick="printAllContractDone(@personnel.AccountId)">
<button class="btn-print @(personnel.ContractDonePercent >= 100 ? "disable" : "")" onclick="printAllContractDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
@@ -426,9 +428,9 @@
}
var firstItem2 = true;
foreach (var personnel in Model.PersonnelContract.OrderBy(x => x.ContractSignPercent))
foreach (var personnel in Model.PersonnelContract.OrderBy(x => x.ContractSignPercent))
{
<div style="display: none" id="ContractSignPercentDiv" class="d-flex align-items-center m-1 select @(firstItem2 ? "active" : "") ContractSignPercent activeBtn" onclick="ajaxContractSignDone(@personnel.AccountId, '@personnel.AccountFullName')">
<div style="display: none" id="ContractSignPercentDiv" class="d-flex align-items-center m-1 select @(firstItem2 ? "active" : "") ContractSignPercent activeBtn" onclick="ajaxContractSignDone(@personnel.AccountId, '@personnel.AccountFullName', @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<div class="col-xs-4">
<div class="scrolltext text-container">
<span>@personnel.AccountFullName</span>
@@ -445,7 +447,7 @@
<span class="title">@personnel.ContractSignPercent%</span>
</div>
<div class="col-xs-2 text-left">
<button class="btn-print @(personnel.ContractSignPercent >= 100 ? "disable" : "")" onclick="PrintAllContractSignDone(@personnel.AccountId)">
<button class="btn-print @(personnel.ContractSignPercent >= 100 ? "disable" : "")" onclick="PrintAllContractSignDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
@@ -461,9 +463,9 @@
}
var firstItem3 = true;
foreach (var personnel in Model.PersonnelCheckout.OrderBy(x => x.CheckoutDonePercent))
foreach (var personnel in Model.PersonnelCheckout.OrderBy(x => x.CheckoutDonePercent))
{
<div id="CheckoutDonePercentDiv" style="display: none" class="d-flex align-items-center m-1 select @(firstItem3 ? "active" : "") CheckoutDonePercent activeBtn" onclick="ajaxWorkshopCheckoutDone(@personnel.AccountId, '@personnel.AccountFullName')">
<div id="CheckoutDonePercentDiv" style="display: none" class="d-flex align-items-center m-1 select @(firstItem3 ? "active" : "") CheckoutDonePercent activeBtn" onclick="ajaxWorkshopCheckoutDone(@personnel.AccountId, '@personnel.AccountFullName', @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<div class="col-xs-4">
<div class="scrolltext text-container">
<span>@personnel.AccountFullName</span>
@@ -480,7 +482,7 @@
<span class="title">@personnel.CheckoutDonePercent%</span>
</div>
<div class="col-xs-2 text-left">
<button class="btn-print @(personnel.CheckoutDonePercent >= 100 ? "disable" : "")" onclick="printAllCheckoutDone(@personnel.AccountId)">
<button class="btn-print @(personnel.CheckoutDonePercent >= 100 ? "disable" : "")" onclick="printAllCheckoutDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
@@ -498,7 +500,7 @@
var firstItem4 = true;
foreach (var personnel in Model.PersonnelCheckout.OrderBy(x => x.CheckoutSignPercent))
{
<div id="CheckoutSignPercentDiv" style="display: none" class="d-flex align-items-center m-1 select @(firstItem4 ? "active" : "") CheckoutSignPercent activeBtn" onclick="ajaxWorkshopCheckoutSignDone(@personnel.AccountId, '@personnel.AccountFullName')">
<div id="CheckoutSignPercentDiv" style="display: none" class="d-flex align-items-center m-1 select @(firstItem4 ? "active" : "") CheckoutSignPercent activeBtn" onclick="ajaxWorkshopCheckoutSignDone(@personnel.AccountId, '@personnel.AccountFullName', @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<div class="col-xs-4">
<div class="scrolltext text-container">
<span>@personnel.AccountFullName</span>
@@ -515,7 +517,7 @@
<span class="title">@personnel.CheckoutSignPercent%</span>
</div>
<div class="col-xs-2 text-left">
<button class="btn-print @(personnel.CheckoutSignPercent >= 100 ? "disable" : "")" onclick="printAllCheckoutSignDone(@personnel.AccountId)">
<button class="btn-print @(personnel.CheckoutSignPercent >= 100 ? "disable" : "")" onclick="printAllCheckoutSignDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
@@ -940,7 +942,7 @@
});
// workshopFirstLoad
function ajaxContractDone(accountId, accountFullName) {
function ajaxContractDone(accountId, accountFullName, workshopList) {
$('#workshopListMobileSection').html('');
$('#appendTableWorkshop').html('');
$('#loading').show();
@@ -950,7 +952,8 @@
dataType: 'json',
url: '@Url.Page("/Company/Reports/Index", "WorkshopContractDone")',
type: 'GET',
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId) },
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId), "workshopList" : workshopList},
traditional: true,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.success) {
@@ -1048,7 +1051,7 @@
});
}
function ajaxContractSignDone(accountId, accountFullName) {
function ajaxContractSignDone(accountId, accountFullName, workshopList) {
$('#workshopListMobileSection').html('');
$('#appendTableWorkshop').html('');
$('#loading').show();
@@ -1058,7 +1061,8 @@
dataType: 'json',
url: '@Url.Page("/Company/Reports/Index", "WorkshopContractSignDone")',
type: 'GET',
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId) },
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId), "workshopList" : workshopList},
traditional: true,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.success) {
@@ -1155,7 +1159,7 @@
});
}
function ajaxWorkshopCheckoutDone(accountId, accountFullName) {
function ajaxWorkshopCheckoutDone(accountId, accountFullName, workshopList) {
$('#workshopListMobileSection').html('');
$('#appendTableWorkshop').html('');
$('#loading').show();
@@ -1165,7 +1169,8 @@
dataType: 'json',
url: '@Url.Page("/Company/Reports/Index", "WorkshopCheckoutDone")',
type: 'GET',
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId) },
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId), "workshopList" : workshopList},
traditional: true,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.success) {
@@ -1262,7 +1267,7 @@
});
}
function ajaxWorkshopCheckoutSignDone(accountId, accountFullName) {
function ajaxWorkshopCheckoutSignDone(accountId, accountFullName, workshopList) {
$('#workshopListMobileSection').html('');
$('#appendTableWorkshop').html('');
$('#loading').show();
@@ -1272,7 +1277,8 @@
dataType: 'json',
url: '@Url.Page("/Company/Reports/Index", "WorkshopCheckoutSignDone")',
type: 'GET',
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId) },
data: { "year": $('#selectYear').val(), "month": $('#selectMonth').val(), "accountId": Number(accountId), "workshopList" : workshopList },
traditional: true,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.success) {
@@ -1369,7 +1375,7 @@
});
}
// EmployeeNotDone
//EmployeeNotDone
function ajaxEmployeeContract(workshopId) {
$(`#employeeList_${workshopId}`).html('');
$('#personnelSection').html('');
@@ -1881,29 +1887,38 @@
}
}
function printAllAction(id, handler) {
//===============PrintAll by account and workshoplist==============
function printAllAction(id, workshopList, handler) {
const year = $('#selectYear').val();
const month = $('#selectMonth').val();
const accoundId = Number(id);
const url = `#showmodal=/Admin/Company/Reports/Index?year=${year}&month=${month}&accountId=${accoundId}&handler=${handler}`;
const url = `#showmodal=/Admin/Company/Reports/Index?year=${year}&month=${month}&accountId=${accoundId}&workshopList=${workshopList}&handler=${handler}`;
window.location.href = url;
}
function printAllContractDone(id) {
printAllAction(id, 'PrintAllContractDone');
function printAllContractDone(id, workshopList) {
printAllAction(id, JSON.stringify(workshopList), 'PrintAllContractDone');
}
function PrintAllContractSignDone(id) {
printAllAction(id, 'PrintAllContractSignDone');
function PrintAllContractSignDone(id, workshopList) {
printAllAction(id, JSON.stringify(workshopList), 'PrintAllContractSignDone');
}
function printAllCheckoutDone(id) {
printAllAction(id, 'PrintAllCheckoutDone');
function printAllCheckoutDone(id, workshopList) {
printAllAction(id, JSON.stringify(workshopList), 'PrintAllCheckoutDone');
}
function printAllCheckoutSignDone(id) {
printAllAction(id, 'PrintAllCheckoutSignDone');
function printAllCheckoutSignDone(id, workshopList) {
printAllAction(id, JSON.stringify(workshopList), 'PrintAllCheckoutSignDone');
}
//================================================================
function printAllEmployeeAction(id, accountFullName, handler) {
const year = $('#selectYear').val();

View File

@@ -50,10 +50,10 @@ public class IndexModel : PageModel
public int CheckoutSignNotDone { get; set; }
public int CheckoutSignDone { get; set; }
public void OnGet(string year, string month)
public async Task OnGet(string year, string month)
{
YearlyList = _yearlySalaryApplication.GetYears();
var allReports = _reportApplication.GetAllReports(year, month);
var allReports = await _reportApplication.GetAllReports(year, month);
AllPercent = allReports.AllPercent;
ContractPercent = allReports.ContractPercent;
ContractSignaturePercent = allReports.ContractSignaturePercent;
@@ -78,13 +78,14 @@ public class IndexModel : PageModel
CheckoutDone = allReports.CheckoutDone;
CheckoutSignNotDone = allReports.CheckoutSignNotDone;
CheckoutSignDone = allReports.CheckoutSignDone;
}
}
#region workshopFirstLoad
public IActionResult OnGetWorkshopContractDone(string year, string month, long accountId)
public IActionResult OnGetWorkshopContractDone(string year, string month, long accountId, List<long> workshopList)
{
var res = _reportApplication.GetWorkshopContractDone(year, month, accountId);
var res = _reportApplication.GetWorkshopContractDone(year, month, accountId, workshopList);
return new JsonResult(new
{
success = true,
@@ -93,9 +94,9 @@ public class IndexModel : PageModel
});
}
public IActionResult OnGetWorkshopContractSignDone(string year, string month, long accountId)
public IActionResult OnGetWorkshopContractSignDone(string year, string month, long accountId, List<long> workshopList)
{
var res = _reportApplication.GetWorkshopContractSignDone(year, month, accountId);
var res = _reportApplication.GetWorkshopContractSignDone(year, month, accountId, workshopList);
return new JsonResult(new
{
success = true,
@@ -104,9 +105,9 @@ public class IndexModel : PageModel
});
}
public IActionResult OnGetWorkshopCheckoutDone(string year, string month, long accountId)
public IActionResult OnGetWorkshopCheckoutDone(string year, string month, long accountId, List<long> workshopList)
{
var res = _reportApplication.GetWorkshopCheckoutDone(year, month, accountId);
var res = _reportApplication.GetWorkshopCheckoutDone(year, month, accountId, workshopList);
return new JsonResult(new
{
success = true,
@@ -115,9 +116,9 @@ public class IndexModel : PageModel
});
}
public IActionResult OnGetWorkshopCheckoutSignDone(string year, string month, long accountId)
public IActionResult OnGetWorkshopCheckoutSignDone(string year, string month, long accountId, List<long> workshopList)
{
var res = _reportApplication.GetWorkshopCheckoutSignDone(year, month, accountId);
var res = _reportApplication.GetWorkshopCheckoutSignDone(year, month, accountId, workshopList);
return new JsonResult(new
{
success = true,
@@ -170,32 +171,38 @@ public class IndexModel : PageModel
});
}
#endregion
#endregion
#region Print
#region Print
//================Done
public IActionResult OnGetPrintAllContractDone(string year, string month, long accountId)
{
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId);
//================PrintAll by account and workshoplist
public IActionResult OnGetPrintAllContractDone(string year, string month, long accountId,string workshopList)
{
var workshopIds = Tools.ExtractNumbers(workshopList);
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId, workshopIds);
return Partial("PrintAll", res);
}
public IActionResult OnGetPrintAllContractSignDone(string year, string month, long accountId)
public IActionResult OnGetPrintAllContractSignDone(string year, string month, long accountId, string workshopList)
{
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId);
var workshopIds = Tools.ExtractNumbers(workshopList);
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId, workshopIds);
return Partial("PrintAll", res);
}
public IActionResult OnGetPrintAllCheckoutDone(string year, string month, long accountId)
public IActionResult OnGetPrintAllCheckoutDone(string year, string month, long accountId, string workshopList)
{
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId);
var workshopIds = Tools.ExtractNumbers(workshopList);
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId, workshopIds);
return Partial("PrintAll", res);
}
public IActionResult OnGetPrintAllCheckoutSignDone(string year, string month, long accountId)
public IActionResult OnGetPrintAllCheckoutSignDone(string year, string month, long accountId, string workshopList)
{
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId);
var workshopIds = Tools.ExtractNumbers(workshopList);
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId, workshopIds);
return Partial("PrintAll", res);
}
//================Employee

View File

@@ -198,7 +198,7 @@
</div>
<div class="card p-0">
<div class="card-section-btn">
<a class="btn loadingButton @(authHelper.GetPermissions().Any(x => x == 2) ? "" : "disable")" asp-area="AdminNew" asp-page="/Company/FileBackup/Index">
<a class="btn loadingButton @(authHelper.GetPermissions().Any(x => x == 2) || authHelper.CurrentAccountId() == 322 ? "" : "disable")" asp-area="AdminNew" asp-page="/Company/FileBackup/Index">
<svg width="50" height="50" viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M42.75 7.875H11.25C10.0125 7.875 9 8.8875 9 10.125V16.875C9 18.1125 10.0125 19.125 11.25 19.125H42.75C43.9875 19.125 45 18.1125 45 16.875V10.125C45 8.8875 43.9875 7.875 42.75 7.875ZM42.75 21.375H11.25C10.0125 21.375 9 22.3875 9 23.625V30.375C9 31.6125 10.0125 32.625 11.25 32.625H42.75C43.9875 32.625 45 31.6125 45 30.375V23.625C45 22.3875 43.9875 21.375 42.75 21.375ZM42.75 34.875H11.25C10.0125 34.875 9 35.8875 9 37.125V43.875C9 45.1125 10.0125 46.125 11.25 46.125H42.75C43.9875 46.125 45 45.1125 45 43.875V37.125C45 35.8875 43.9875 34.875 42.75 34.875Z" fill="#C4E8E8"/>
<path d="M34.875 33.7492L42.75 40.0492V27.4492L34.875 33.7492Z" fill="#23A8A8"/>

View File

@@ -84,9 +84,9 @@ namespace ServiceHost.Areas.Admin.Pages
//}
}
public IActionResult OnGetReportDataAjax()
public async Task<IActionResult> OnGetReportDataAjax()
{
var allReports = _reportApplication.GetAllReports(null, null);
var allReports = await _reportApplication.GetAllReports(null, null);
var now = new PersianDateTime(Convert.ToInt32(allReports.Year), Convert.ToInt32(allReports.Month), 1);
var before = now.AddMonths(1);

View File

@@ -158,7 +158,7 @@
<div><input type="text" name="employeeName" class="form-control employeeName" placeholder="نام پرسنل"></div>
</div>
<div class="col-12">
<div class="btn-clear-filter py-2 text-center d-block w-100 mt-2">
<div class="btn-clear-filter py-2 text-center d-block w-100 disable mt-2">
<span class="w-100">حذف جستجو</span>
</div>
</div>
@@ -174,7 +174,7 @@
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
</div>
<div class="col-6 text-start">
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
</div>
</div>
</div>

View File

@@ -18,69 +18,73 @@
@section Styles {
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/dropdown.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AssetsClient/css/dropdown.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet"/>
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
<link href="~/assetsclient/pages/customizecheckout/css/CheckoutTemporary.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/pages/customizecheckout/css/CheckoutTemporary.css?ver=@clientVersion" rel="stylesheet"/>
<style>
.sweet-alert {
font-family: 'IranSans' !important
}
<style>
.sweet-alert {
font-family: 'IranSans' !important
}
button.btn-delete {
border-radius: 8px;
}
button.btn-delete {
border-radius: 8px;
}
button.btn-print {
width: 30px;
height: 30px;
border-radius: 8px;
}
button.btn-print {
width: 30px;
height: 30px;
border-radius: 8px;
}
.btn-excel {
border-radius: 7px;
padding: 3px 7px;
color: #000000;
background-color: #afffcc
}
.textRed {
color: red !important;
}
.btn-excel span {
color: #1E293B;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 24px;
}
.btn-excel {
border-radius: 7px;
padding: 3px 7px;
color: #000000;
background-color: #afffcc
}
.btn-excel:hover {
background-color: #a8ebc1;
}
.btn-excel span {
color: #1E293B;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 24px;
}
@@media(max-width: 767px) {
.table-contracts .Rtable .Rtable-row .Rtable-contract .Rtable-cell--heading button.btn-print {
width: 30px;
height: 30px;
border-radius: 8px;
}
.btn-excel:hover {
background-color: #a8ebc1;
}
.btn-excel, .btn-print-all {
width: 35px;
height: 35px;
}
@@media (max-width: 767px) {
.table-contracts .Rtable .Rtable-row .Rtable-contract .Rtable-cell--heading button.btn-print {
width: 30px;
height: 30px;
border-radius: 8px;
}
.btn-excel span, .btn-print-all span {
display: none;
}
}
</style>
.btn-excel, .btn-print-all {
width: 35px;
height: 35px;
}
.btn-excel span, .btn-print-all span {
display: none;
}
}
</style>
}
@@ -352,11 +356,13 @@
<div class="Rtable-cell column-heading width2">شماره پرسنلی</div>
<div class="Rtable-cell column-heading width3">سال</div>
<div class="Rtable-cell column-heading width4">ماه</div>
<div class="Rtable-cell column-heading width5">شماره قرارداد</div>
<div class="Rtable-cell column-heading width5 d-xxl-block d-none">شماره قرارداد</div>
<div class="Rtable-cell column-heading width6">نام پرسنل</div>
<div class="Rtable-cell column-heading width7">آغاز قرارداد</div>
<div class="Rtable-cell column-heading width8">پایان قرارداد</div>
<div class="Rtable-cell column-heading width9">روزهای کارکرد</div>
<div class="Rtable-cell column-heading width9">تاخیر در ورود</div>
<div class="Rtable-cell column-heading width9">غیبت</div>
<div class="Rtable-cell column-heading width9">مبلغ قابل پرداخت</div>
<div class="Rtable-cell column-heading width10 text-end">عملیات</div>
</div>
@@ -390,7 +396,7 @@
<div class="Rtable-cell--heading">ماه</div>
<div class="Rtable-cell--content">@item.Month</div>
</div>
<div class="Rtable-cell d-md-block d-none width5">
<div class="Rtable-cell d-xxl-block d-none width5">
<div class="Rtable-cell--heading">شماره قرارداد</div>
<div class="Rtable-cell--content">@item.ContractNo</div>
</div>
@@ -410,6 +416,14 @@
<div class="Rtable-cell--heading">روزهای کارکرد</div>
<div class="Rtable-cell--content ">@item.SumOfWorkingDays</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="Rtable-cell--heading">تاخیر در ورود</div>
<div class="Rtable-cell--content @(item.TotalLateToWorkDeduction == "0" ? "" : "textRed")">@item.TotalLateToWorkDeduction</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="Rtable-cell--heading">غیبت</div>
<div class="Rtable-cell--content @(item.AbsenceDeduction == "0" ? "" : "textRed")">@item.AbsenceDeduction</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="@(item.TotalPaymentD < 0 ? "bgColorMonthlySalaryMinus" : "bgColorMonthlySalaryPlus")">
<div class="Rtable-cell--heading">مبلغ قابل پرداخت</div>

View File

@@ -38,6 +38,10 @@
border-radius: 8px;
}
.textRed {
color: red !important;
}
.btn-excel {
border-radius: 7px;
padding: 3px 7px;
@@ -352,11 +356,13 @@
<div class="Rtable-cell column-heading width2">شماره پرسنلی</div>
<div class="Rtable-cell column-heading width3">سال</div>
<div class="Rtable-cell column-heading width4">ماه</div>
<div class="Rtable-cell column-heading width5">شماره قرارداد</div>
<div class="Rtable-cell column-heading width5 d-xxl-block d-none">شماره قرارداد</div>
<div class="Rtable-cell column-heading width6">نام پرسنل</div>
<div class="Rtable-cell column-heading width7">آغاز قرارداد</div>
<div class="Rtable-cell column-heading width8">پایان قرارداد</div>
<div class="Rtable-cell column-heading width9">روزهای کارکرد</div>
<div class="Rtable-cell column-heading width9">تاخیر در ورود</div>
<div class="Rtable-cell column-heading width9">غیبت</div>
<div class="Rtable-cell column-heading width9">مبلغ قابل پرداخت</div>
<div class="Rtable-cell column-heading width10 text-end">عملیات</div>
</div>
@@ -390,7 +396,7 @@
<div class="Rtable-cell--heading">ماه</div>
<div class="Rtable-cell--content">@item.Month</div>
</div>
<div class="Rtable-cell d-md-block d-none width5">
<div class="Rtable-cell d-xxl-block d-none width5">
<div class="Rtable-cell--heading">شماره قرارداد</div>
<div class="Rtable-cell--content">@item.ContractNo</div>
</div>
@@ -412,6 +418,14 @@
@item.SumOfWorkingDays
</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="Rtable-cell--heading">تاخیر در ورود</div>
<div class="Rtable-cell--content @(item.TotalLateToWorkDeduction == "0" ? "" : "textRed")">@item.TotalLateToWorkDeduction</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="Rtable-cell--heading">غیبت</div>
<div class="Rtable-cell--content @(item.AbsenceDeduction == "0" ? "" : "textRed")">@item.AbsenceDeduction</div>
</div>
<div class="Rtable-cell d-md-flex d-none width9">
<div class="@(item.TotalPaymentD < 0 ? "bgColorMonthlySalaryMinus" : "bgColorMonthlySalaryPlus" )">
<div class="Rtable-cell--heading">مبلغ قابل پرداخت</div>

View File

@@ -23,7 +23,7 @@
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col d-flex align-items-center justify-content-start">
<img src="~/AssetsClient/images/icons/list-info-personnel.png" alt="" class="img-fluid me-2" style="width: 45px;" />
<img src="~/AssetsClient/images/icons/documents-upload.png" alt="" class="img-fluid me-2" style="width: 45px;" />
<div>
<h4 class="title d-flex align-items-center">اطلاعات مدارک پرسنل</h4>
<div>@Model.WorkshopFullName</div>
@@ -40,7 +40,7 @@
<div class="container-fluid">
<div class="row p-2">
<div class="row py-2">
<div class="align-items-center d-flex">
<button data-mode="active" class="btnTabPD active">پرسنل های فعال</button>
<button data-mode="deactive" class="btnTabPD">پرسنل های غیر فعال</button>
@@ -158,7 +158,7 @@
<div><input type="text" name="employeeName" class="form-control employeeName" placeholder="نام پرسنل"></div>
</div>
<div class="col-12">
<div class="btn-clear-filter py-2 text-center d-block w-100 mt-2">
<div class="btn-clear-filter py-2 text-center disable d-block w-100 mt-2">
<span class="w-100">حذف جستجو</span>
</div>
</div>
@@ -174,7 +174,7 @@
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
</div>
<div class="col-6 text-start">
<button type="submit" class="btn-search btn-search-click w-100">جستجو</button>
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
</div>
</div>
</div>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -72,7 +72,7 @@ namespace ServiceHost.Pages
// _reportRepository.GetAllActiveWorkshopsNew("1403", "12");
//var test = _uidService.GetPersonalInfo("2669318622", "1363/02/25");
HasApkToDownload = _androidApkVersionApplication.HasAndroidApkToDownload();
if (User.Identity is { IsAuthenticated: true })
{

View File

@@ -12,7 +12,7 @@
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
//server
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;"
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;"
//local
//"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",

View File

@@ -1,5 +1,5 @@
var pageIndexJs = 0;
var pageIndex = 0;
var indexPage = 0;
var mode = 'active';
var searchName = '';
@@ -12,7 +12,8 @@ $(document).ready(function () {
$(this).addClass('active');
$('.btn-clear-filter').addClass('disable');
pageIndexJs = 0;
pageIndex = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.employeeName').val('');
loadPersonnelDocuments(mode, searchName = '');
@@ -35,6 +36,8 @@ $(document).on('click', '.btn-uploadingPD, .btn-uploadingPD-mobile', function ()
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
pageIndexJs = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.btn-clear-filter').removeClass('disable');
searchName = $('.employeeName').val().trim();
@@ -46,6 +49,8 @@ $(document).on('click', '.btn-search-click, .btn-search-click-mobile', function
});
$(document).on('click', '.btn-clear-filter', function () {
pageIndexJs = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.btn-clear-filter').addClass('disable');
$('.employeeName').val('');
@@ -95,14 +100,15 @@ function loadPersonnelDocuments(mode, searchName) {
dataType: 'json',
type: 'GET',
url: employeeDocumentsAjaxLoadData,
data: { workshopId: workshopId, searchMode: mode, employeeName: searchName, 'pageIndex': pageIndex },
data: { workshopId: workshopId, searchMode: mode, employeeName: searchName, 'pageIndex': pageIndexJs },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
var personnelDocumentsData = response.data;
if (response.isSuccedded) {
personnelDocumentsData.forEach(function (item) {
var n = pageIndexJs + 1;
var n = indexPage + 1;
indexPage++;
html += `<div></div>
<div class="Rtable-row align-items-center openAction ${item.isBlack === "true"
? `withdraw`
@@ -338,13 +344,9 @@ function loadPersonnelDocuments(mode, searchName) {
</div>
</div>
</div>`;
pageIndexJs++;
});
pageIndexJs = pageIndex + response.pageIndex;
pageIndex = pageIndexJs;
pageIndexJs += response.pageIndex;
$('#personnelDocumentsAjax').append(html);
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">

View File

@@ -1608,6 +1608,35 @@ function showExcelAllModal() {
function downloadExcelAll() {
var idlist = "";
var year = $('#Year').val();
var month = $('#Month').val();
if (year === '0' || month === '0') {
$('#dropdown-year').addClass("errored");
$('#dropdown-month').addClass("errored");
$('.alert-msg').show();
$('.alert-msg p').text('لطفا سال و ماه را انتخاب نموده و جستجو نمایید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('#dropdown-year').removeClass("errored");
$('#dropdown-month').removeClass("errored");
}, 3500);
return
}
if (!($('input:checkbox').is(":checked"))) {
$('.alert-msg').show();
$('.alert-msg p').text('هیچ موردی انتخاب نشده است.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return
}
$('.foo').each(function () {
if ($(this).is(":checked")) {

View File

@@ -1607,8 +1607,36 @@ function showExcelAllModal() {
window.location.href = showCheckoutExcelModalUrl;
}
function downloadExcelAll() {
function excelDownloadAll() {
var idlist = "";
var year = $('#Year').val();
var month = $('#Month').val();
if (year === '0' || month === '0') {
$('#dropdown-year').addClass("errored");
$('#dropdown-month').addClass("errored");
$('.alert-msg').show();
$('.alert-msg p').text('لطفا سال و ماه را انتخاب نموده و جستجو نمایید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('#dropdown-year').removeClass("errored");
$('#dropdown-month').removeClass("errored");
}, 3500);
return
}
if (!($('input:checkbox').is(":checked"))) {
$('.alert-msg').show();
$('.alert-msg p').text('هیچ موردی انتخاب نشده است.');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
return
}
$('.foo').each(function () {
if ($(this).is(":checked")) {
@@ -1619,22 +1647,47 @@ function downloadExcelAll() {
}
});
var filterArray = [];
$("input[name='filter[]']:checked").each(function () {
filterArray.push($(this).val());
});
if (idlist !== "") {
//var url = CheckoutExcelAllUrl + "&idList=" + idlist;
var url = CheckoutExcelAllUrl + "&idList=" + encodeURIComponent(idlist);
filterArray.forEach(function (filter) {
url += "&filter=" + encodeURIComponent(filter);
});
var yearFa = '&yearFa=' + year;
var monthFa = '&monthFa=' + month;
var url = CheckoutExcelAllUrl + '&idlist=' + idlist;
//console.log(url + '?checkoutId=' + idlist + yearFa + monthFa);
window.open(url, "_blank");
}
}
//function downloadExcelAll() {
// var idlist = "";
// $('.foo').each(function () {
// if ($(this).is(":checked")) {
// var a = $(this).val();
// var b = a + "+";
// idlist += b;
// }
// });
// var filterArray = [];
// $("input[name='filter[]']:checked").each(function () {
// filterArray.push($(this).val());
// });
// if (idlist !== "") {
// //var url = CheckoutExcelAllUrl + "&idList=" + idlist;
// var url = CheckoutExcelAllUrl + "&idList=" + encodeURIComponent(idlist);
// filterArray.forEach(function (filter) {
// url += "&filter=" + encodeURIComponent(filter);
// });
// window.open(url, "_blank");
// }
//}
function printAllMobile() {
var idlist = "";

View File

@@ -1,5 +1,5 @@
var pageIndexJs = 0;
var pageIndex = 0;
var indexPage = 0;
var mode = 'active';
var searchName = '';
@@ -12,7 +12,8 @@ $(document).ready(function () {
$(this).addClass('active');
$('.btn-clear-filter').addClass('disable');
pageIndexJs = 0;
pageIndex = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.employeeName').val('');
loadPersonnelDocuments(mode, searchName = '');
@@ -42,10 +43,12 @@ $(document).on('click', '.btn-uploadingPD, .btn-uploadingPD-mobile', function ()
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
pageIndexJs = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.btn-clear-filter').removeClass('disable');
searchName = $('.employeeName').val().trim();
if (searchName == "") {
if (searchName === "") {
$('.btn-clear-filter').addClass('disable');
}
$('#searchModal').modal('hide');
@@ -53,6 +56,8 @@ $(document).on('click', '.btn-search-click, .btn-search-click-mobile', function
});
$(document).on('click', '.btn-clear-filter', function () {
pageIndexJs = 0;
indexPage = 0;
n = 1;
$('#personnelDocumentsAjax').html('');
$('.btn-clear-filter').addClass('disable');
$('.employeeName').val('');
@@ -102,14 +107,15 @@ function loadPersonnelDocuments(mode, searchName) {
dataType: 'json',
type: 'GET',
url: employeeDocumentsAjaxLoadData,
data: { searchMode: mode, employeeName: searchName, 'pageIndex': pageIndex },
data: { searchMode: mode, employeeName: searchName, 'pageIndex': pageIndexJs },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
var personnelDocumentsData = response.data;
if (response.isSuccedded) {
personnelDocumentsData.forEach(function (item) {
var n = pageIndexJs + 1;
var n = indexPage + 1;
indexPage++;
html += `<div></div>
<div class="Rtable-row align-items-center openAction ${item.isBlack === "true"
? `withdraw`
@@ -117,7 +123,7 @@ function loadPersonnelDocuments(mode, searchName) {
<div class="Rtable-cell width1" style="margin-left:3px; ">
<div class="Rtable-cell--content">
<span class="d-flex justify-content-center">
${n}
${n++}
<div class="d-none idPersonnel">${item.employeeId}</div>
</span>
</div>
@@ -344,11 +350,9 @@ function loadPersonnelDocuments(mode, searchName) {
</div>
</div>
</div>`;
pageIndexJs++;
});
pageIndexJs = pageIndex + response.pageIndex;
pageIndex = pageIndexJs;
pageIndexJs += response.pageIndex;
$('#personnelDocumentsAjax').append(html);
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">