From c8c179a32e48dc3a8eb1a0e6bc14c74d77c47fec Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 3 Dec 2021 15:29:00 +0000 Subject: [PATCH] Bug 27801: Fix javascript price calculations This patch ensures we're formatting the price values consistently for the table total and the amount to pay input field. Test plan 1) Add an item to charge at 0.10. 2) Add this same item 8 or 9 times (Do not use the 'quantity') 3) Note that the table total and the 'Amount paid' values do not match 4) Apply the patch and repeat the above steps.. the values should now match. Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Sally Signed-off-by: Tomas Cohen Arazi Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall (cherry picked from commit 7e72a7dde5a73ed6177b321d29fca0df13f08f2c) Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit 9e16f33b37aaf107ff3293df0cd3da5f94563c81) Signed-off-by: Victor Grousset/tuxayo --- koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt index c7856979cc..7e7493e48f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -331,7 +331,8 @@ { iTotalPrice += aData[i][3]*1; } - nFoot.getElementsByTagName('td')[1].innerHTML = iTotalPrice.format_price(); + iTotalPrice = iTotalPrice.format_price(); + nFoot.getElementsByTagName('td')[1].innerHTML = iTotalPrice; $('#paid').val(iTotalPrice); $('#paid').trigger('change'); }, -- 2.39.5