Merge pull request #13320 from OPEN-DSI/new-takepos-search-on-keycode
New takepos search on keycode
This commit is contained in:
commit
40973cfca9
@ -452,7 +452,14 @@ function New() {
|
|||||||
*/
|
*/
|
||||||
function Search2(keyCodeForEnter) {
|
function Search2(keyCodeForEnter) {
|
||||||
console.log("Search2 Call ajax search to replace products");
|
console.log("Search2 Call ajax search to replace products");
|
||||||
if(window.event.keyCode == keyCodeForEnter) var key=13;
|
|
||||||
|
var search = false;
|
||||||
|
var eventKeyCode = window.event.keyCode;
|
||||||
|
if (typeof keyCodeForEnter === 'undefined' || eventKeyCode == keyCodeForEnter) {
|
||||||
|
search = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (search === true) {
|
||||||
pageproducts = 0;
|
pageproducts = 0;
|
||||||
jQuery(".wrapper2 .catwatermark").hide();
|
jQuery(".wrapper2 .catwatermark").hide();
|
||||||
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term=' + $('#search').val(), function (data) {
|
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term=' + $('#search').val(), function (data) {
|
||||||
@ -472,9 +479,10 @@ function Search2(keyCodeForEnter) {
|
|||||||
$("#prodiv" + i).data("iscat", 0);
|
$("#prodiv" + i).data("iscat", 0);
|
||||||
}
|
}
|
||||||
}).always(function (data) {
|
}).always(function (data) {
|
||||||
if(key==13 && data.length==1) ClickProduct(0);
|
if ($('#search').val().length > 0 && data.length == 1) ClickProduct(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Edit(number) {
|
function Edit(number) {
|
||||||
|
|
||||||
@ -661,7 +669,7 @@ $( document ).ready(function() {
|
|||||||
<body class="bodytakepos" style="overflow: hidden;">
|
<body class="bodytakepos" style="overflow: hidden;">
|
||||||
<?php
|
<?php
|
||||||
print '<div class="hidden" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
|
print '<div class="hidden" id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
|
||||||
$keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : 13;
|
$keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : '';
|
||||||
?>
|
?>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user