Skip to content

Commit

Permalink
fix: total row in report print template
Browse files Browse the repository at this point in the history
  • Loading branch information
prssanna committed Sep 8, 2020
1 parent 898098d commit 662ccbb
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions frappe/public/js/frappe/views/reports/print_grid.html
Expand Up @@ -37,16 +37,20 @@ <h2>{{ __(title) }}</h2>

<td {% if row.bold == 1 %} style="font-weight: bold" {% endif %}>
<span {% if col._index == 0 %} style="padding-left: {%= cint(row.indent) * 2 %}em" {% endif %}>
{% format_data = row.is_total_row ? data[0] : row %}
{{
col.formatter
? col.formatter(row._index, col._index, value, col, format_data, true)
: col.format
? col.format(value, row, col, format_data)
: col.docfield
? frappe.format(value, col.docfield)
: value
}}
{% format_data = row.is_total_row && ["Currency", "Float"].includes(col.fieldtype) ? data[0] : row %}
{% if (row.is_total_row && col._index == 0) { %}
{{ __("Total") }}
{% } else { %}
{{
col.formatter
? col.formatter(row._index, col._index, value, col, format_data, true)
: col.format
? col.format(value, row, col, format_data)
: col.docfield
? frappe.format(value, col.docfield)
: value
}}
{% } %}
</span>
</td>
{% endif %}
Expand All @@ -55,4 +59,3 @@ <h2>{{ __(title) }}</h2>
{% endfor %}
</tbody>
</table>

0 comments on commit 662ccbb

Please sign in to comment.