From 2eeee7d020da7b66d90b79c0a19919e41adb7f43 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 8 Apr 2019 14:26:19 +0530 Subject: [PATCH] fix(Query Report): Show totals row in Print (#7206) --- frappe/public/js/frappe/views/reports/query_report.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/views/reports/query_report.js b/frappe/public/js/frappe/views/reports/query_report.js index aa284f6aa1..596a6501ad 100644 --- a/frappe/public/js/frappe/views/reports/query_report.js +++ b/frappe/public/js/frappe/views/reports/query_report.js @@ -902,7 +902,13 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList { get_data_for_print() { const indices = this.datatable.datamanager.getFilteredRowIndices(); - return indices.map(i => this.data[i]); + let rows = indices.map(i => this.data[i]); + let totalRow = this.datatable.bodyRenderer.getTotalRow().reduce((row, cell) => { + row[cell.column.id] = cell.content; + return row; + }, {}); + rows.push(totalRow); + return rows; } get_columns_for_print() {