add absence reason (leave_type) column to Monthly Absence Report

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ali 2026-03-25 17:59:17 +04:00
parent e883f8816f
commit a1d4d7ab51
1 changed files with 9 additions and 2 deletions

View File

@ -43,7 +43,13 @@ def get_columns():
"fieldtype": "Data", "fieldtype": "Data",
"width": 130 "width": 130
}, },
{ {
"label": _("Davamsızlığın səbəbi"),
"fieldname": "leave_type",
"fieldtype": "Data",
"width": 180
},
{
"label": _("İşçinin işləmədiyi iş günlərinin sayı"), "label": _("İşçinin işləmədiyi iş günlərinin sayı"),
"fieldname": "days_absent", "fieldname": "days_absent",
"fieldtype": "Int", "fieldtype": "Int",
@ -63,6 +69,7 @@ def get_data(filters):
e.father_name, e.father_name,
e.identification_number AS fin, e.identification_number AS fin,
e.ssn, e.ssn,
a.leave_type,
COUNT(*) AS days_absent COUNT(*) AS days_absent
FROM `tabAttendance` a FROM `tabAttendance` a
LEFT JOIN `tabEmployee` e ON e.name = a.employee LEFT JOIN `tabEmployee` e ON e.name = a.employee
@ -72,6 +79,6 @@ def get_data(filters):
AND a.company = %(company)s AND a.company = %(company)s
AND a.attendance_date >= %(from_date)s AND a.attendance_date >= %(from_date)s
AND a.attendance_date <= %(to_date)s AND a.attendance_date <= %(to_date)s
GROUP BY a.employee GROUP BY a.employee, a.leave_type
ORDER BY e.last_name ASC, e.first_name ASC ORDER BY e.last_name ASC, e.first_name ASC
""", filters, as_dict=1) """, filters, as_dict=1)