From 00568ad943361c8acb40ae15acda30b40f13c700 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Tue, 10 Dec 2024 13:33:14 +0700 Subject: [PATCH] =?UTF-8?q?fix=20issue=20:=20=E0=B8=A3=E0=B8=B0=E0=B8=9A?= =?UTF-8?q?=E0=B8=9A=E0=B8=A5=E0=B8=B2(=E0=B8=82=E0=B8=A3=E0=B8=81.)=20>>?= =?UTF-8?q?=20=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=B8=E0=B8=9B=E0=B8=AA?= =?UTF-8?q?=E0=B8=A1=E0=B8=9A=E0=B8=97=E0=B8=AB=E0=B8=A3=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=81=E0=B8=AD=E0=B8=9A=E0=B8=9E=E0=B8=B4=E0=B8=98?= =?UTF-8?q?=E0=B8=B5=E0=B8=AE=E0=B8=B1=E0=B8=88=E0=B8=A2=E0=B9=8C=E0=B8=AF?= =?UTF-8?q?(=E0=B8=81=E0=B8=A3=E0=B8=93=E0=B8=B5=E0=B8=A3=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=99=E0=B9=89=E0=B8=AD=E0=B8=A2=E0=B8=81=E0=B8=A7=E0=B9=88?= =?UTF-8?q?=E0=B8=B2=201=20=E0=B8=9B=E0=B8=B5)=20#840?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LeaveRequestController.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs index 17b8858f..ac1c4793 100644 --- a/BMA.EHR.Leave/Controllers/LeaveRequestController.cs +++ b/BMA.EHR.Leave/Controllers/LeaveRequestController.cs @@ -842,13 +842,19 @@ namespace BMA.EHR.Leave.Service.Controllers isLeave = false; break; case "LV-006": - // fix issue : ระบบลา (ขรก.) >> ลาอุปสมบทหรือการลาประกอบพิธีฮัจย์ฯ (ยื่นขอลาได้มากกว่า 1 ครั้ง) #841 - var prevLeave = _context.Set().Where(x => x.LeaveTypeCode == "LV-006").Where(x => x.LeaveStatus == "APPROVE").Count(); - - if (prevLeave > 0) + // fix issue : ระบบลา(ขรก.) >> ลาอุปสมบทหรือการลาประกอบพิธีฮัจย์ฯ(กรณีรับราชการน้อยกว่า 1 ปี) #840 + if (govAge < 365) isLeave = false; else - isLeave = totalDay <= 120; + { + // fix issue : ระบบลา (ขรก.) >> ลาอุปสมบทหรือการลาประกอบพิธีฮัจย์ฯ (ยื่นขอลาได้มากกว่า 1 ครั้ง) #841 + var prevLeave = _context.Set().Where(x => x.LeaveTypeCode == "LV-006").Where(x => x.LeaveStatus == "APPROVE").Count(); + + if (prevLeave > 0) + isLeave = false; + else + isLeave = totalDay <= 120; + } break; case "LV-008": case "LV-009":