Merge pull request #29597 from nextchamp-saqib/fix-pos-checkout
fix(pos): pricing rule on transactions doesn't work
This commit is contained in:
commit
f696eddceb
@ -248,7 +248,7 @@ erpnext.PointOfSale.Controller = class {
|
||||
|
||||
numpad_event: (value, action) => this.update_item_field(value, action),
|
||||
|
||||
checkout: () => this.payment.checkout(),
|
||||
checkout: () => this.save_and_checkout(),
|
||||
|
||||
edit_cart: () => this.payment.edit_cart(),
|
||||
|
||||
@ -713,4 +713,9 @@ erpnext.PointOfSale.Controller = class {
|
||||
})
|
||||
.catch(e => console.log(e));
|
||||
}
|
||||
|
||||
async save_and_checkout() {
|
||||
this.frm.is_dirty() && await this.frm.save();
|
||||
this.payment.checkout();
|
||||
}
|
||||
};
|
||||
|
@ -191,10 +191,10 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
this.numpad_value = '';
|
||||
});
|
||||
|
||||
this.$component.on('click', '.checkout-btn', function() {
|
||||
this.$component.on('click', '.checkout-btn', async function() {
|
||||
if ($(this).attr('style').indexOf('--blue-500') == -1) return;
|
||||
|
||||
me.events.checkout();
|
||||
await me.events.checkout();
|
||||
me.toggle_checkout_btn(false);
|
||||
|
||||
me.allow_discount_change && me.$add_discount_elem.removeClass("d-none");
|
||||
@ -985,6 +985,7 @@ erpnext.PointOfSale.ItemCart = class {
|
||||
$(frm.wrapper).off('refresh-fields');
|
||||
$(frm.wrapper).on('refresh-fields', () => {
|
||||
if (frm.doc.items.length) {
|
||||
this.$cart_items_wrapper.html('');
|
||||
frm.doc.items.forEach(item => {
|
||||
this.update_item_html(item);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user