fix: pos payment mode selection issue (#27409)

This commit is contained in:
Subin Tom 2021-09-09 19:33:34 +05:30 committed by GitHub
parent 7edac5a5d7
commit 8b4c57ee09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -297,6 +297,7 @@ erpnext.PointOfSale.Payment = class {
this.render_payment_mode_dom(); this.render_payment_mode_dom();
this.make_invoice_fields_control(); this.make_invoice_fields_control();
this.update_totals_section(); this.update_totals_section();
this.focus_on_default_mop();
} }
edit_cart() { edit_cart() {
@ -378,17 +379,24 @@ erpnext.PointOfSale.Payment = class {
}); });
this[`${mode}_control`].toggle_label(false); this[`${mode}_control`].toggle_label(false);
this[`${mode}_control`].set_value(p.amount); this[`${mode}_control`].set_value(p.amount);
});
this.render_loyalty_points_payment_mode();
this.attach_cash_shortcuts(doc);
}
focus_on_default_mop() {
const doc = this.events.get_frm().doc;
const payments = doc.payments;
payments.forEach(p => {
const mode = p.mode_of_payment.replace(/ +/g, "_").toLowerCase();
if (p.default) { if (p.default) {
setTimeout(() => { setTimeout(() => {
this.$payment_modes.find(`.${mode}.mode-of-payment-control`).parent().click(); this.$payment_modes.find(`.${mode}.mode-of-payment-control`).parent().click();
}, 500); }, 500);
} }
}); });
this.render_loyalty_points_payment_mode();
this.attach_cash_shortcuts(doc);
} }
attach_cash_shortcuts(doc) { attach_cash_shortcuts(doc) {