Merge pull request #8651 from rohitwaghchaure/pos_default_customer_issue

[fix] Default pos profile's customer not working for the POS
This commit is contained in:
rohitwaghchaure 2017-05-02 13:18:40 +05:30 committed by GitHub
commit 8811cc6b5b

View File

@ -327,6 +327,7 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.name = null;
this.load_data(true);
this.setup();
this.set_default_customer()
},
load_data: function (load_doc) {
@ -360,6 +361,16 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
}
},
set_default_customer: function() {
if (this.default_customer && !this.frm.doc.customer) {
this.party_field.$input.val(this.default_customer);
this.frm.doc.customer = this.default_customer;
this.numeric_keypad.show();
this.toggle_list_customer(false)
this.toggle_item_cart(true)
}
},
set_transaction_defaults: function (party) {
var me = this;
this.party = party;
@ -675,11 +686,6 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
me.toggle_delete_button();
}
if (this.default_customer && !this.frm.doc.customer) {
this.party_field.$input.val(this.default_customer);
this.frm.doc.customer = this.default_customer;
}
this.party_field.awesomeplete =
new Awesomplete(this.party_field.$input.get(0), {
minChars: 0,