Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show attendance w.r.t years instead of academic year #217

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ frappe.query_reports["Student Monthly Attendance Sheet"] = {
{
"fieldname": "year",
"label": __("Year"),
"fieldtype": "Link",
"options":"Academic Year",
"fieldtype": "Select",
"options":"",
"reqd": 1
},
{
Expand All @@ -27,4 +27,17 @@ frappe.query_reports["Student Monthly Attendance Sheet"] = {
"reqd": 1
}
],
onload: function() {
return frappe.call({
// method: "hrms.hr.report.monthly_attendance_sheet.monthly_attendance_sheet.get_attendance_years",
method: "education.education.report.student_monthly_attendance_sheet.student_monthly_attendance_sheet.get_year_list",
callback: function(r) {
let year_filter = frappe.query_report.get_filter('year');
year_filter.df.options = r.message;
year_filter.df.default = r.message.join("\n");
year_filter.refresh();
year_filter.set_input(year_filter.df.default);
}
});
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,13 @@ def mark_holidays(att_map, from_date, to_date, students_list):
att_map.setdefault(student, frappe._dict()).setdefault(dt, "Holiday")

return att_map

@frappe.whitelist()
def get_year_list():
all_academic_years = frappe.db.get_list("Academic Year", pluck="year_start_date")

year_list = [date.year for date in all_academic_years]
year_list = list(set(year_list))
year_list.sort()

return year_list
4 changes: 1 addition & 3 deletions education/hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from frappe import _

from . import __version__ as app_version

app_name = "education"
Expand Down Expand Up @@ -44,7 +42,7 @@
]

standard_portal_menu_items = [
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role": "Student"},
{"title": "Fees", "route": "/fees", "reference_doctype": "Fees", "role": "Student"},
{
"title": _("Admission"),
"route": "/admissions",
Expand Down