fix: online pos print not working

This commit is contained in:
Rohit Waghchaure
2020-09-21 18:26:52 +05:30
parent a621c52ebb
commit 088e1e66ac

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'),