update GetLastEffectRound method to accept effectiveDate parameter and adjust usage in LeaveReportController
This commit is contained in:
parent
a540912202
commit
99accd44e3
2 changed files with 5 additions and 4 deletions
|
|
@ -101,12 +101,12 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
|
|||
return data;
|
||||
}
|
||||
|
||||
public async Task<UserDutyTime?> GetLastEffectRound(Guid profileId)
|
||||
public async Task<UserDutyTime?> GetLastEffectRound(Guid profileId, DateTime? effectiveDate = null)
|
||||
{
|
||||
effectiveDate ??= DateTime.Now;
|
||||
var data = await _dbContext.Set<UserDutyTime>()
|
||||
.Where(x => x.ProfileId == profileId)
|
||||
.Where(x => x.IsProcess)
|
||||
.Where(x => x.EffectiveDate.Value.Date <= DateTime.Now.Date)
|
||||
.Where(x => x.EffectiveDate.Value.Date <= effectiveDate.Value.Date)
|
||||
.OrderByDescending(x => x.EffectiveDate)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue