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'} {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'),
}); });
@@ -200,6 +197,11 @@ erpnext.PointOfSale.PastOrderSummary = class {
}); });
this.$summary_container.on('click', '.print-btn', () => { this.$summary_container.on('click', '.print-btn', () => {
this.print_receipt();
});
}
print_receipt() {
const frm = this.events.get_frm(); const frm = this.events.get_frm();
frappe.utils.print( frappe.utils.print(
frm.doctype, frm.doctype,
@@ -207,8 +209,7 @@ erpnext.PointOfSale.PastOrderSummary = class {
frm.pos_print_format, frm.pos_print_format,
frm.doc.letter_head, frm.doc.letter_head,
frm.doc.language || frappe.boot.lang frm.doc.language || frappe.boot.lang
) );
});
} }
attach_shortcuts() { attach_shortcuts() {