fix: print recepit dialog

This commit is contained in:
prssanna 2021-03-18 17:02:19 +05:30
parent b6ce868199
commit b5843dbdcd

View File

@ -64,10 +64,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
{fieldname: 'print', fieldtype: 'Data', label: 'Print Preview'}
],
primary_action: () => {
const frm = this.events.get_frm();
frm.doc = this.doc;
frm.print_preview.lang_code = frm.doc.language;
frm.print_preview.printit(true);
this.print_receipt();
},
primary_action_label: __('Print'),
});
@ -200,17 +197,21 @@ erpnext.PointOfSale.PastOrderSummary = class {
});
this.$summary_container.on('click', '.print-btn', () => {
const frm = this.events.get_frm();
frappe.utils.print(
frm.doctype,
frm.docname,
frm.pos_print_format,
frm.doc.letter_head,
frm.doc.language || frappe.boot.lang
)
this.print_receipt();
});
}
print_receipt() {
const frm = this.events.get_frm();
frappe.utils.print(
frm.doctype,
frm.docname,
frm.pos_print_format,
frm.doc.letter_head,
frm.doc.language || frappe.boot.lang
);
}
attach_shortcuts() {
const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
this.$summary_container.find('.print-btn').attr("title", `${ctrl_label}+P`);