[FIX] LEAVE: Fixed forcasted leave issue
This commit is contained in:
@@ -297,12 +297,13 @@ class LeaveRequestCreationForm(ModelForm):
|
||||
if f"{today.month}-{today.year}" in unique_dates:
|
||||
unique_dates.remove(f"{today.strftime('%m')}-{today.year}")
|
||||
forcasted_leaves = available_leave.forcasted_leaves()
|
||||
if f"{today.year}-{today.strftime('%m')}" not in unique_dates:
|
||||
for item in unique_dates:
|
||||
total_leave_days += forcasted_leaves[item]
|
||||
if leave_type_id.reset_based == "monthly":
|
||||
if f"{today.year}-{today.strftime('%m')}" not in unique_dates:
|
||||
for item in unique_dates:
|
||||
total_leave_days += forcasted_leaves[item]
|
||||
if not effective_requested_days <= total_leave_days:
|
||||
raise forms.ValidationError(_("Employee doesn't have enough leave days.."))
|
||||
|
||||
|
||||
return cleaned_data
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user