fix(Query Report): Show totals row in Print (#7206)

This commit is contained in:
Faris Ansari 2019-04-08 14:26:19 +05:30 committed by GitHub
parent 9f64ff1ed9
commit 2eeee7d020
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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() {