[UPDT] ATTENDANCE: Updated hour account and late come ealry out records export method

This commit is contained in:
Horilla
2024-08-21 10:15:36 +05:30
parent 9f646cadf5
commit 826a505a83
7 changed files with 532 additions and 526 deletions

View File

@@ -853,3 +853,16 @@ def get_working_days(start_date, end_date):
# All the company/holiday leave dates between the range
"company_leave_dates": company_leave_dates,
}
def get_next_month_same_date(date_obj):
date_copy = date_obj
month = date_obj.month + 1
year = date_obj.year
if month > 12:
month = 1
year = year + 1
day = date_copy.day
total_days_in_month = calendar.monthrange(year, month)[1]
day = min(day, total_days_in_month)
return date(day=day, month=month, year=year)