From 687cd63c47cbdd9a40d4d96901005261390ea17e Mon Sep 17 00:00:00 2001 From: VPA Date: Tue, 12 Nov 2024 17:13:52 +0100 Subject: [PATCH] FIX corrected the refund process when pressed the Do full refund button if the quantity is lesser than 1 --- pos_full_refund/static/src/js/pos_full_refund.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pos_full_refund/static/src/js/pos_full_refund.js b/pos_full_refund/static/src/js/pos_full_refund.js index 5de59c2fd4..d0a773392f 100644 --- a/pos_full_refund/static/src/js/pos_full_refund.js +++ b/pos_full_refund/static/src/js/pos_full_refund.js @@ -8,12 +8,14 @@ patch(TicketScreen.prototype, { onDoFullRefund() { var selected_order = this.getSelectedOrder(); for (const line of selected_order.orderlines) { - this.onClickOrderline(line); - for (const char of line.quantity.toString()) { - this._onUpdateSelectedOrderline({key: char, buffer: char}); + const toRefundDetails = line + .getAllLinesInCombo() + .map((line) => this._getToRefundDetail(line)); + for (const toRefundDetail of toRefundDetails) { + toRefundDetail.qty = line.quantity; } } var pay_button = document.querySelector(".pay"); pay_button.click(); }, -}); +}); \ No newline at end of file