From 819dba80388d135f40b56b3b578eec07e9e5ba8f Mon Sep 17 00:00:00 2001 From: gajjug004 Date: Wed, 18 Mar 2026 17:31:04 +0530 Subject: [PATCH] fix: show letterhead footer in report print preview --- frappe/public/html/print_template.html | 25 ++++++++++++------------ frappe/public/js/frappe/microtemplate.js | 15 ++++++++++++++ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/frappe/public/html/print_template.html b/frappe/public/html/print_template.html index 80069f4bf3..03dc439b61 100644 --- a/frappe/public/html/print_template.html +++ b/frappe/public/html/print_template.html @@ -14,19 +14,6 @@ diff --git a/frappe/public/js/frappe/microtemplate.js b/frappe/public/js/frappe/microtemplate.js index f3041c677a..3f5a4665c4 100644 --- a/frappe/public/js/frappe/microtemplate.js +++ b/frappe/public/js/frappe/microtemplate.js @@ -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) {