Skip to content

Commit

Permalink
fix: bold in group by and options mapping (backport #1564) (#1580)
Browse files Browse the repository at this point in the history
* fix: bold in group by and options mapping

* fix: bold in group by and options mapping

(cherry picked from commit f1c3de2)

Co-authored-by: Nihantra C. Patel <[email protected]>
  • Loading branch information
mergify[bot] and Nihantra-Patel authored Mar 26, 2024
1 parent 03995bf commit 5f917ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ frappe.query_reports["Monthly Attendance Sheet"] = {
const summarized_view = frappe.query_report.get_filter_value('summarized_view');
const group_by = frappe.query_report.get_filter_value('group_by');

if (group_by && column.colIndex === 1) {
value = "<strong>" + value + "</strong>";
}

if (!summarized_view) {
if ((group_by && column.colIndex > 3) || (!group_by && column.colIndex > 2)) {
if (value == 'P' || value == 'WFH')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,19 @@ def get_columns(filters: Filters) -> List[Dict]:
columns = []

if filters.group_by:
options_mapping = {
"Branch": "Branch",
"Grade": "Employee Grade",
"Department": "Department",
"Designation": "Designation",
}
options = options_mapping.get(filters.group_by)
columns.append(
{
"label": _(filters.group_by),
"fieldname": frappe.scrub(filters.group_by),
"fieldtype": "Link",
"options": "Branch",
"options": options,
"width": 120,
}
)
Expand Down Expand Up @@ -191,7 +198,7 @@ def get_data(filters: Filters, attendance_map: Dict) -> List[Dict]:
records = get_rows(employee_details[value], filters, holiday_map, attendance_map)

if records:
data.append({group_by_column: frappe.bold(value)})
data.append({group_by_column: value})
data.extend(records)
else:
data = get_rows(employee_details, filters, holiday_map, attendance_map)
Expand Down

0 comments on commit 5f917ce

Please sign in to comment.