mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
Merge pull request #32426 from AnandBaburajan/fix_mark_attendance_joining_date_and_future
fix: mark attendance issue with joining and relieving date, and fix future attendance marking
This commit is contained in:
@@ -253,10 +253,12 @@ def get_unmarked_days(employee, month, exclude_holidays=0):
|
|||||||
start_day = 1
|
start_day = 1
|
||||||
end_day = calendar.monthrange(today.year, month_map[month])[1] + 1
|
end_day = calendar.monthrange(today.year, month_map[month])[1] + 1
|
||||||
|
|
||||||
if joining_date and joining_date.month == month_map[month]:
|
if joining_date and joining_date.year == today.year and joining_date.month == month_map[month]:
|
||||||
start_day = joining_date.day
|
start_day = joining_date.day
|
||||||
|
|
||||||
if relieving_date and relieving_date.month == month_map[month]:
|
if (
|
||||||
|
relieving_date and relieving_date.year == today.year and relieving_date.month == month_map[month]
|
||||||
|
):
|
||||||
end_day = relieving_date.day + 1
|
end_day = relieving_date.day + 1
|
||||||
|
|
||||||
dates_of_month = [
|
dates_of_month = [
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ frappe.listview_settings['Attendance'] = {
|
|||||||
onload: function(list_view) {
|
onload: function(list_view) {
|
||||||
let me = this;
|
let me = this;
|
||||||
const months = moment.months();
|
const months = moment.months();
|
||||||
|
const curMonth = moment().format("MMMM");
|
||||||
|
months.splice(months.indexOf(curMonth) + 1);
|
||||||
list_view.page.add_inner_button(__("Mark Attendance"), function() {
|
list_view.page.add_inner_button(__("Mark Attendance"), function() {
|
||||||
let dialog = new frappe.ui.Dialog({
|
let dialog = new frappe.ui.Dialog({
|
||||||
title: __("Mark Attendance"),
|
title: __("Mark Attendance"),
|
||||||
|
|||||||
Reference in New Issue
Block a user