แก้คิวรี่ report 46 error

This commit is contained in:
Kittapath 2023-09-19 10:48:44 +07:00
parent 3328bdf726
commit 52223304c6

View file

@ -883,16 +883,16 @@ namespace BMA.EHR.Application.Repositories.Reports
var data = (from r in await _dbContext.Set<ProfileSalary>()
.Include(x => x.Profile)
.ToListAsync()
join p in positions on r.PositionId equals p.Id into pGroup
join p in positions on r?.PositionId equals p.Id into pGroup
from p in pGroup.DefaultIfEmpty()
join o in organizations on r.OcId equals o.Id into oGroup
join o in organizations on r?.OcId equals o.Id into oGroup
from o in oGroup.DefaultIfEmpty()
where r.Profile == profile
select new
{
DateTh = r.Date == null ? "-" : r.Date.Value.ToThaiShortDate().ToString().ToThaiNumber(),
Position = p.Name,
OCName = o.Parent == null ? "-" : (o.Parent.OrganizationOrganization == null ? "-" : o.Parent.OrganizationOrganization.Name),
Position = p == null ? "-" : p.Name,
OCName = o == null || o.Parent == null ? "-" : (o.Parent.OrganizationOrganization == null ? "-" : o.Parent.OrganizationOrganization.Name),
Age = r.Date == null ? "-" : r.Date.Value.CalculateBetweenDateV2(DateTime.Now).ToThaiNumber(),
Amount = r.Amount == null ? null : r.Amount.Value.ToNumericText().ToThaiNumber(),
Date = r.Date,