Hi, i replaced gui.js in pos module and using the default js that i modify a littlebit. and i got this error while i want to use my shortcut that i've already created.
Cannot read property 'slice' of undefined
http://localhost:4227/web/content/1149-878d886/point_of_sale.assets.js:368
Traceback:
TypeError: Cannot read property 'slice' of undefined
at Class.numpad_input (http://localhost:4227/web/content/1149-878d886/point_of_sale.assets.js:368:350)
and my numpad_input class is:
numpad_input: function(buffer, input, options) {
var newbuf = buffer.slice(0);
options = options || {};
var newbuf_float = newbuf === '-' ? newbuf : field_utils.parse.float(newbuf);
var decimal_point = _t.database.parameters.decimal_point;
if (input === decimal_point) {
if (options.firstinput) {
newbuf = "0.";
}else if (!newbuf.length || newbuf === '-') {
newbuf += "0.";
} else if (newbuf.indexOf(decimal_point) < 0){
newbuf = newbuf + decimal_point;
}
} else if (input === 'CLEAR') {
newbuf = "";
} else if (input === 'BACKSPACE') {
newbuf = newbuf.substring(0,newbuf.length - 1);
} else if (input === '+') {
if ( newbuf[0] === '-' ) {
newbuf = newbuf.substring(1,newbuf.length);
}
} else if (input === '-') {
if (options.firstinput) {
newbuf = '-0';
} else if ( newbuf[0] === '-' ) {
newbuf = newbuf.substring(1,newbuf.length);
} else {
newbuf = '-' + newbuf;
}
} else if (input[0] === '+' && !isNaN(parseFloat(input))) {
newbuf = this.chrome.format_currency_no_symbol(newbuf_float + parseFloat(input));
} else if (!isNaN(parseInt(input))) {
if (options.firstinput) {
newbuf = '' + input;
} else {
newbuf += input;
}
}
if (newbuf === "-") {
newbuf = "";
}
// End of input buffer at 12 characters.
if (newbuf.length > buffer.length && newbuf.length > 16) {
this.play_sound('bell');
return buffer.slice(0);
}
return newbuf;
},
any idea why i got this error?