From 86f331bec546e1cbb851be3368ec6f325b16abd4 Mon Sep 17 00:00:00 2001 From: Invitu Date: Fri, 9 Feb 2018 07:26:50 -1000 Subject: [PATCH] fixes currencies with decimals <>2 --- pos_payment_terminal/static/src/js/pos_payment_terminal.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pos_payment_terminal/static/src/js/pos_payment_terminal.js b/pos_payment_terminal/static/src/js/pos_payment_terminal.js index 984d09b3..ba99956a 100755 --- a/pos_payment_terminal/static/src/js/pos_payment_terminal.js +++ b/pos_payment_terminal/static/src/js/pos_payment_terminal.js @@ -20,7 +20,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { models.load_fields('account.journal', ['payment_mode']); devices.ProxyDevice.include({ - payment_terminal_transaction_start: function(line_cid, currency_iso){ + payment_terminal_transaction_start: function(line_cid, currency_iso, currency_decimals){ var line; var lines = this.pos.get_order().get_paymentlines(); for ( var i = 0; i < lines.length; i++ ) { @@ -31,6 +31,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { var data = {'amount' : line.get_amount(), 'currency_iso' : currency_iso, + 'currency_decimals' : currency_decimals, 'payment_mode' : line.cashregister.journal.payment_mode}; //console.log(JSON.stringify(data)); this.message('payment_terminal_transaction_start', {'payment_info' : JSON.stringify(data)}); @@ -45,7 +46,7 @@ odoo.define('pos_payment_terminal.pos_payment_terminal', function (require) { this.$('.paymentlines-container').unbind('click').on('click', '.payment-terminal-transaction-start', function(event){ // Why this "on" thing links severaltime the button to the action if I don't use "unlink" to reset the button links before ? //console.log(event.target); - self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name); + self.pos.proxy.payment_terminal_transaction_start($(this).data('cid'), self.pos.currency.name, self.pos.currency.decimals); }); }, });