From 697739dd6473ad5b91d941ba408ad6ca36276146 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Fri, 11 Dec 2015 09:45:35 +0100 Subject: [PATCH] [FIX] point_of_sale: make tendered amount adhere to currency formatting Part of the number formatting overhaul done in 5c9b4556e35c420985696b0c958ca492030efa4a, 4b003afd0ab125b0296de8939626ae889ccdab47, 261ccf7c56062930b1d712ae860fe01dd8718968 and 6e945de681452d6753f58a749352bfbe099bac1d. The only place left where we didn't correctly format the numbers was in the tendered column on the payment screen. This fixes that by not directly displaying the inputbuffer anymore. Instead we pass the payment line amount through format_currency_no_symbol() and display that instead. We also give a default amount of 0 to parse_value so it doesn't return false for an empty string. --- addons/point_of_sale/static/src/js/screens.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 4f74859b97c..68ce5aa9180 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1530,7 +1530,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ // if (order.selected_paymentline) { var amount; try{ - amount = instance.web.parse_value(this.inputbuffer, {type: "float"}); + amount = instance.web.parse_value(this.inputbuffer, {type: "float"}, 0); } catch(e){ amount = 0; @@ -1538,7 +1538,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ // order.selected_paymentline.set_amount(amount); this.order_changes(); this.render_paymentlines(); - this.$('.paymentline.selected .edit').text(this.inputbuffer); + this.$('.paymentline.selected .edit').text(this.format_currency_no_symbol(amount)); } } },