From ada3330403696b452a48785abdef183defa42b11 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Sat, 29 Jun 2019 21:18:53 +0530 Subject: [PATCH] fix(pos): changing loyalty points not updating payment amounts --- .../selling/page/point_of_sale/point_of_sale.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index ac1a9fa6fc7..4b34cb01a28 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -1838,13 +1838,14 @@ class Payment { }); } - update_loyalty_points() { - if (this.dialog.get_value("redeem_loyalty_points")) { - this.dialog.set_value("loyalty_points", this.frm.doc.loyalty_points); - this.dialog.set_value("loyalty_amount", this.frm.doc.loyalty_amount); - this.update_payment_amount(); - this.show_paid_amount(); - } + async update_loyalty_points() { + const { loyalty_points, loyalty_amount } = this.frm.doc; + await Promise.all([ + this.dialog.set_value("loyalty_points", loyalty_points), + this.dialog.set_value("loyalty_amount", loyalty_amount) + ]); + this.update_payment_amount(); + this.show_paid_amount(); } }