Merge pull request #50404 from khushi8112/company-details-popup-trigger

fix: show company-details popup only for the targeted print format/le…
This commit is contained in:
Khushi Rawat
2025-11-17 11:15:59 +05:30
committed by GitHub

View File

@@ -1,6 +1,16 @@
let beforePrintHandled = false;
frappe.realtime.on("sales_invoice_before_print", (data) => {
let print_format = $('input[data-fieldname="print_format"]').val();
let letterhead = $('input[data-fieldname="letterhead"]').val();
let allowed_print_formats = ["Sales Invoice Standard", "Sales Invoice with Item Image"];
let allowed_letterheads = ["Company Letterhead", "Company Letterhead - Grey"];
if (!allowed_print_formats.includes(print_format) && !allowed_letterheads.includes(letterhead)) {
return;
}
const route = frappe.get_route();
if (!beforePrintHandled && route[0] === "print" && route[1] === "Sales Invoice") {