[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) {
|
||||
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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user