fix: use smaller font only if the report doesnt have a standard print format (#20878)

This commit is contained in:
Ritwik Puri 2023-05-09 19:34:50 +05:30 committed by GitHub
parent 5f623c9148
commit 66716fbe12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -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 %}

View file

@ -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,
});
}
@ -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 = [],

View file

@ -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,
});
});
},