[FIX] point_of_sale: use correct decimal separator for payment amounts

In some places '.' was hardcoded as a decimal separator. Because now
payment amounts now get passed through web.parse_value() this causes
issues when the the decimal separator is not '.'.

opw-660024
This commit is contained in:
Joren Van Onder
2015-12-17 15:13:36 +01:00
parent b6fa479000
commit da9275abde
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -314,14 +314,15 @@ openerp.point_of_sale.load_gui = function load_gui(instance, module) {
numpad_input: function(buffer, input, options) {
var options = options || {};
var newbuf = buffer.slice(0);
var decimal_point = instance.web._t.database.parameters.decimal_point;
if (input === '.') {
if (input === decimal_point) {
if (options.firstinput) {
newbuf = "0.";
}else if (!newbuf.length || newbuf === '-') {
newbuf += "0.";
} else if (newbuf.indexOf('.') < 0){
newbuf = newbuf + '.';
} else if (newbuf.indexOf(decimal_point) < 0){
newbuf = newbuf + decimal_point;
}
} else if (input === 'CLEAR') {
newbuf = "";
@@ -1482,7 +1482,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ //
} else if ( event.keyCode === 190 || // Dot
event.keyCode === 110 || // Decimal point (numpad)
event.keyCode === 188 ) { // Comma
key = '.';
key = self.decimal_point;
} else if ( event.keyCode === 46 ) { // Delete
key = 'CLEAR';
} else if ( event.keyCode === 8 ) { // Backspace
+1 -1
View File
@@ -544,7 +544,7 @@
<br />
<button class="input-button numpad-char" data-action='CLEAR' >C</button>
<button class="input-button number-char" data-action='0'>0</button>
<button class="input-button number-char" data-action='.'>.</button>
<button class="input-button number-char" t-att-data-action='widget.decimal_point'><t t-esc='widget.decimal_point'/></button>
<button class="input-button numpad-backspace" data-action='BACKSPACE' >
<img src="/point_of_sale/static/src/img/backspace.png" width="24" height="21" />
</button>