fix: POS print receipt (#24924)
* fix: POS print receipt * fix: print recepit dialog
This commit is contained in:
parent
dd39a6b47c
commit
8a87ffc8f6
@ -64,10 +64,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
{fieldname: 'print', fieldtype: 'Data', label: 'Print Preview'}
|
{fieldname: 'print', fieldtype: 'Data', label: 'Print Preview'}
|
||||||
],
|
],
|
||||||
primary_action: () => {
|
primary_action: () => {
|
||||||
const frm = this.events.get_frm();
|
this.print_receipt();
|
||||||
frm.doc = this.doc;
|
|
||||||
frm.print_preview.lang_code = frm.doc.language;
|
|
||||||
frm.print_preview.printit(true);
|
|
||||||
},
|
},
|
||||||
primary_action_label: __('Print'),
|
primary_action_label: __('Print'),
|
||||||
});
|
});
|
||||||
@ -192,13 +189,21 @@ erpnext.PointOfSale.PastOrderSummary = class {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.$summary_container.on('click', '.print-btn', () => {
|
this.$summary_container.on('click', '.print-btn', () => {
|
||||||
const frm = this.events.get_frm();
|
this.print_receipt();
|
||||||
frm.doc = this.doc;
|
|
||||||
frm.print_preview.lang_code = frm.doc.language;
|
|
||||||
frm.print_preview.printit(true);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {
|
attach_shortcuts() {
|
||||||
const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
|
const ctrl_label = frappe.utils.is_mac() ? '⌘' : 'Ctrl';
|
||||||
this.$summary_container.find('.print-btn').attr("title", `${ctrl_label}+P`);
|
this.$summary_container.find('.print-btn').attr("title", `${ctrl_label}+P`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user