fix: skip approver check if no commander is assigned; update leave data retrieval logic
Some checks failed
release-dev / release-dev (push) Failing after 13s
Some checks failed
release-dev / release-dev (push) Failing after 13s
This commit is contained in:
parent
2981f865b3
commit
6b9767449c
2 changed files with 15 additions and 5 deletions
|
|
@ -1103,9 +1103,17 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests
|
|||
throw new Exception(GlobalMessages.DataNotFound);
|
||||
}
|
||||
|
||||
if (rawData.ApproveStep != "st3")
|
||||
// ถ้าไม่มี commander ข้ามไปเช็ค approver ได้เลย
|
||||
var commanders = rawData.Approvers
|
||||
.Where(x => x.ApproveType!.ToUpper() == "COMMANDER")
|
||||
.OrderBy(x => x.Seq)
|
||||
.ToList();
|
||||
if(commanders.Count > 0 || commanders != null)
|
||||
{
|
||||
throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
|
||||
if (rawData.ApproveStep != "st3")
|
||||
{
|
||||
throw new Exception("คำขอนี้ยังไม่ได้อยู่ในขั้นตอนที่สามารถอนุมัติได้ ไม่สามารถทำรายการได้");
|
||||
}
|
||||
}
|
||||
|
||||
// check commander approve
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue