diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 0b93324b19d..30790f0a987 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -286,7 +286,7 @@ erpnext.pos.PointOfSale = class PointOfSale { if (in_list(['serial_no', 'batch_no'], field)) { args[field] = value; } - + // add to cur_frm const item = this.frm.add_child('items', args); frappe.flags.hide_serial_batch_dialog = true; @@ -436,7 +436,7 @@ erpnext.pos.PointOfSale = class PointOfSale { set_primary_action_in_modal() { if (!this.frm.msgbox) { this.frm.msgbox = frappe.msgprint( - ` + ` ${__('Print')} ${__('New')}` @@ -445,7 +445,15 @@ erpnext.pos.PointOfSale = class PointOfSale { $(this.frm.msgbox.body).find('.btn-default').on('click', () => { this.frm.msgbox.hide(); this.make_new_invoice(); - }) + }); + + $(this.frm.msgbox.body).find('.btn-primary').on('click', () => { + this.frm.msgbox.hide(); + const frm = this.events.get_frm(); + frm.doc = this.doc; + frm.print_preview.lang_code = frm.doc.language; + frm.print_preview.printit(true); + }); } } @@ -680,7 +688,10 @@ erpnext.pos.PointOfSale = class PointOfSale { if(this.frm.doc.docstatus != 1 ){ await this.frm.save(); } - this.frm.print_preview.printit(true); + const frm = this.events.get_frm(); + frm.doc = this.doc; + frm.print_preview.lang_code = frm.doc.language; + frm.print_preview.printit(true); }); } if(this.frm.doc.items.length == 0){