checkout MainList bug fixed

This commit is contained in:
SamSys
2025-07-23 19:16:47 +04:00
parent 7541abb92c
commit b0c1f216a1

View File

@@ -2229,40 +2229,41 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
if (!hasSearch && !hasEmployeeOrWorkshpSearch)
{
return checkouts.Select(x => new CheckoutViewModel()
{
{
Id = x.ch.id,
EmployeeFullName = x.ch.EmployeeFullName,
ContractStart = x.ch.ContractStart.ToFarsi(),
ContractEnd = x.ch.ContractEnd.ToFarsi(),
ContractStartGr = x.ch.ContractStart,
ContractEndGr = x.ch.ContractEnd,
PersonnelCode = x.ch.PersonnelCode,
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
ArchiveCode = x.workshop.ArchiveCode,
SumOfWorkingDays = x.ch.SumOfWorkingDays,
WorkshopName = x.workshop.WorkshopName,
Month = x.ch.Month,
Year = x.ch.Year,
ContractNo = x.ch.ContractNo,
ContractId = x.ch.ContractId,
WorkshopId = x.ch.WorkshopId,
EmployeeId = x.ch.EmployeeId,
EmployerId = x.workshopEmployer.EmployerId,
IsActiveString = x.ch.IsActiveString,
Signature = x.ch.Signature,
CreationDate = x.ch.CreationDate,
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
IsBlockCantracingParty = x.contractingParty.IsBlock,
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
Id = x.ch.id,
EmployeeFullName = x.ch.EmployeeFullName,
ContractStart = x.ch.ContractStart.ToFarsi(),
ContractEnd = x.ch.ContractEnd.ToFarsi(),
ContractStartGr = x.ch.ContractStart,
ContractEndGr = x.ch.ContractEnd,
PersonnelCode = x.ch.PersonnelCode,
PersonnelCodeInt = Convert.ToInt32(x.ch.PersonnelCode),
ArchiveCode = x.workshop.ArchiveCode,
SumOfWorkingDays = x.ch.SumOfWorkingDays,
WorkshopName = x.workshop.WorkshopName,
Month = x.ch.Month,
Year = x.ch.Year,
ContractNo = x.ch.ContractNo,
ContractId = x.ch.ContractId,
WorkshopId = x.ch.WorkshopId,
EmployeeId = x.ch.EmployeeId,
EmployerId = x.workshopEmployer.EmployerId,
IsActiveString = x.ch.IsActiveString,
Signature = x.ch.Signature,
CreationDate = x.ch.CreationDate,
EmployerName = $"{x.workshopEmployer.Employer.FName} {x.workshopEmployer.Employer.LName}",
IsBlockCantracingParty = x.contractingParty.IsBlock,
HasSignCheckout = x.option != null ? x.option.SignCheckout : x.workshop.SignCheckout
}).OrderByDescending(x => x.Id).ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).Take(200)
.GroupBy(x => x.Id)
.Select(x => x.First()).ToList()
.OrderByDescending(x => x.Id).ThenByDescending(x => x.Year).ThenBy(x => x.PersonnelCodeInt).Take(50).ToList();
}).OrderByDescending(x=>x.Id).Take(3000).ToList().DistinctBy(x => x.Id)
.OrderByDescending(x => x.Id).ThenByDescending(x => x.Year)
.ThenBy(x => x.PersonnelCodeInt)
.Take(50).ToList();
}
else if (hasSearch && !hasEmployeeOrWorkshpSearch)
{