[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:
@@ -314,14 +314,15 @@ openerp.point_of_sale.load_gui = function load_gui(instance, module) {
|
|||||||
numpad_input: function(buffer, input, options) {
|
numpad_input: function(buffer, input, options) {
|
||||||
var options = options || {};
|
var options = options || {};
|
||||||
var newbuf = buffer.slice(0);
|
var newbuf = buffer.slice(0);
|
||||||
|
var decimal_point = instance.web._t.database.parameters.decimal_point;
|
||||||
|
|
||||||
if (input === '.') {
|
if (input === decimal_point) {
|
||||||
if (options.firstinput) {
|
if (options.firstinput) {
|
||||||
newbuf = "0.";
|
newbuf = "0.";
|
||||||
}else if (!newbuf.length || newbuf === '-') {
|
}else if (!newbuf.length || newbuf === '-') {
|
||||||
newbuf += "0.";
|
newbuf += "0.";
|
||||||
} else if (newbuf.indexOf('.') < 0){
|
} else if (newbuf.indexOf(decimal_point) < 0){
|
||||||
newbuf = newbuf + '.';
|
newbuf = newbuf + decimal_point;
|
||||||
}
|
}
|
||||||
} else if (input === 'CLEAR') {
|
} else if (input === 'CLEAR') {
|
||||||
newbuf = "";
|
newbuf = "";
|
||||||
|
|||||||
@@ -1482,7 +1482,7 @@ openerp.point_of_sale.load_screens = function load_screens(instance, module){ //
|
|||||||
} else if ( event.keyCode === 190 || // Dot
|
} else if ( event.keyCode === 190 || // Dot
|
||||||
event.keyCode === 110 || // Decimal point (numpad)
|
event.keyCode === 110 || // Decimal point (numpad)
|
||||||
event.keyCode === 188 ) { // Comma
|
event.keyCode === 188 ) { // Comma
|
||||||
key = '.';
|
key = self.decimal_point;
|
||||||
} else if ( event.keyCode === 46 ) { // Delete
|
} else if ( event.keyCode === 46 ) { // Delete
|
||||||
key = 'CLEAR';
|
key = 'CLEAR';
|
||||||
} else if ( event.keyCode === 8 ) { // Backspace
|
} else if ( event.keyCode === 8 ) { // Backspace
|
||||||
|
|||||||
@@ -544,7 +544,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<button class="input-button numpad-char" data-action='CLEAR' >C</button>
|
<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='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' >
|
<button class="input-button numpad-backspace" data-action='BACKSPACE' >
|
||||||
<img src="/point_of_sale/static/src/img/backspace.png" width="24" height="21" />
|
<img src="/point_of_sale/static/src/img/backspace.png" width="24" height="21" />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user