From f9a3c8c3180f0b49b2b67cfde7737d4cb5a569cb Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Mon, 24 Jun 2024 12:26:02 +0700 Subject: [PATCH] fix: change all code for fix profile salary --- BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs index dc303db3..43e4342a 100644 --- a/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave.Service/Controllers/LeaveRequestController.cs @@ -1416,7 +1416,7 @@ namespace BMA.EHR.Leave.Service.Controllers var userCalendar = await _userCalendarRepository.GetExist(profile.Id); var category = userCalendar == null ? "NORMAL" : userCalendar.Calendar; - var lastSalary = profile.Salaries.OrderByDescending(x => x.Order).FirstOrDefault(); + var lastSalary = profile.ProfileSalary; var lastSalaryAmount = lastSalary == null ? 0 : lastSalary.Amount ?? 0; var lastLeaveRequest =