Skip to content

Commit

Permalink
fix: use smaller font only if the report doesnt have a standard print…
Browse files Browse the repository at this point in the history
… format (#20878)
  • Loading branch information
phot0n committed May 9, 2023
1 parent 5f623c9 commit 66716fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frappe/public/html/print_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
</div>
{% endif %}

<div class="print-format {% if landscape %} landscape {% endif %}"
<div class="print-format {% if landscape %}landscape{% endif %}"
{% if columns.length > 20 %}
style="font-size: 4.0pt"
{% if can_use_smaller_font %}
style="font-size: 4.0pt"
{% endif %}
{% endif %}
>
{% if print_settings.letter_head %}
Expand Down
2 changes: 2 additions & 0 deletions frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
columns: this.get_columns_for_print(print_settings, custom_format),
original_data: this.data,
report: this,
can_use_smaller_font: this.report_doc.is_standard === "Yes" && custom_format ? 0 : 1,
});
}

Expand Down Expand Up @@ -1407,6 +1408,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
columns: columns,
lang: frappe.boot.lang,
layout_direction: frappe.utils.is_rtl() ? "rtl" : "ltr",
can_use_smaller_font: this.report_doc.is_standard === "Yes" && custom_format ? 0 : 1,
});

let filter_values = [],
Expand Down
1 change: 1 addition & 0 deletions frappe/public/js/frappe/views/reports/report_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
print_settings: print_settings,
columns: this.columns,
data: rows_in_order,
can_use_smaller_font: 1,
});
});
},
Expand Down

0 comments on commit 66716fb

Please sign in to comment.