fix: show letterhead footer in report print preview
This commit is contained in:
parent
b0995bd4a0
commit
819dba8038
2 changed files with 27 additions and 13 deletions
|
|
@ -14,19 +14,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="print-format-gutter">
|
||||
{% if print_settings.repeat_header_footer %}
|
||||
<div id="footer-html" class="visible-pdf">
|
||||
{% if print_settings.letter_head && print_settings.letter_head.footer %}
|
||||
<div class="letter-head-footer">
|
||||
{{ print_settings.letter_head.footer }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="text-center small page-number visible-pdf">
|
||||
{{ __("Page {0} of {1}", [`<span class="page"></span>`, `<span class="topage"></span>`]) }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="print-format {% if landscape %}landscape{% endif %}"
|
||||
{% if columns.length > 20 %}
|
||||
{% if can_use_smaller_font %}
|
||||
|
|
@ -40,6 +27,18 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{{ content }}
|
||||
{% if print_settings.repeat_header_footer %}
|
||||
<div id="footer-html" class="visible-pdf">
|
||||
{% if print_settings.letter_head && print_settings.letter_head.footer %}
|
||||
<div class="letter-head-footer">
|
||||
{{ print_settings.letter_head.footer }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="text-center small page-number visible-pdf">
|
||||
{{ __("Page {0} of {1}", [`<span class="page"></span>`, `<span class="topage"></span>`]) }}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -163,6 +163,21 @@ frappe.render_template = function (name, data) {
|
|||
}
|
||||
|
||||
w.document.write(html);
|
||||
|
||||
// show footer on print
|
||||
const footer = w.document.getElementById("footer-html");
|
||||
if (footer) {
|
||||
footer.classList.remove("visible-pdf");
|
||||
footer.style.marginTop = "auto";
|
||||
|
||||
const print_format = w.document.querySelector(".print-format");
|
||||
if (print_format) {
|
||||
print_format.style.display = "flex";
|
||||
print_format.style.flexDirection = "column";
|
||||
print_format.style.minHeight = "100vh";
|
||||
}
|
||||
}
|
||||
|
||||
w.document.close();
|
||||
}),
|
||||
(frappe.render_tree = function (opts) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue