Merge pull request #23378 from rohitwaghchaure/online-pos-print-not-working-pre

fix: online pos print not working
This commit is contained in:
rohitwaghchaure
2020-09-22 10:30:53 +05:30
committed by GitHub

View File

@@ -449,8 +449,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
$(this.frm.msgbox.body).find('.btn-primary').on('click', () => {
this.frm.msgbox.hide();
const frm = this.events.get_frm();
frm.doc = this.doc;
const frm = this.frm;
frm.print_preview.lang_code = frm.doc.language;
frm.print_preview.printit(true);
});
@@ -688,8 +687,8 @@ erpnext.pos.PointOfSale = class PointOfSale {
if(this.frm.doc.docstatus != 1 ){
await this.frm.save();
}
const frm = this.events.get_frm();
frm.doc = this.doc;
const frm = this.frm;
frm.print_preview.lang_code = frm.doc.language;
frm.print_preview.printit(true);
});
@@ -948,8 +947,12 @@ class POSCart {
}
},
onchange: () => {
this.events.on_customer_change(this.customer_field.get_value());
this.events.get_loyalty_details();
let customer = this.customer_field.get_value();
frappe.db.get_value("Customer", customer, "language", (r) => {
this.frm.doc.language = r ? r.language : "en-US";
this.events.on_customer_change(customer);
this.events.get_loyalty_details();
});
}
},
parent: this.wrapper.find('.customer-field'),