Skip to content
Permalink
Browse files

[FIX] pos: encode negative payment for refund

currently, if the user wants to refund amount to the customer
and enter negative payment form keyboard its throws an error. that will fixed.

Task: #1935602

closes #31061
  • Loading branch information...
mgh-odoo committed Feb 20, 2019
1 parent 09bf391 commit 66392a9fff6ea110c90a8df7370d766772e6c689
Showing with 4 additions and 2 deletions.
  1. +4 −2 addons/point_of_sale/static/src/js/gui.js
@@ -437,7 +437,7 @@ var Gui = core.Class.extend({
numpad_input: function(buffer, input, options) {
var newbuf = buffer.slice(0);
options = options || {};
var newbuf_float = field_utils.parse.float(newbuf);
var newbuf_float = newbuf === '-' ? newbuf : field_utils.parse.float(newbuf);
var decimal_point = _t.database.parameters.decimal_point;

if (input === decimal_point) {
@@ -457,7 +457,9 @@ var Gui = core.Class.extend({
newbuf = newbuf.substring(1,newbuf.length);
}
} else if (input === '-') {
if ( newbuf[0] === '-' ) {
if (options.firstinput) {
newbuf = '-';
} else if ( newbuf[0] === '-' ) {
newbuf = newbuf.substring(1,newbuf.length);
} else {
newbuf = '-' + newbuf;

0 comments on commit 66392a9

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.