fix ajax search for external modules

This commit is contained in:
Christophe Battarel
2024-01-04 17:52:05 +01:00
committed by Laurent Destailleur
parent 425f10d71e
commit b64ecef81d

View File

@@ -286,7 +286,7 @@ if ($action == 'getProducts') {
$sql .= " AND archive = 0"; $sql .= " AND archive = 0";
}*/ }*/
if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) { if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1) {
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_stock as ps'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps';
$sql .= ' ON (p.rowid = ps.fk_product'; $sql .= ' ON (p.rowid = ps.fk_product';
if (getDolGlobalString('CASHDESK_ID_WAREHOUSE'.$_SESSION['takeposterminal'])) { if (getDolGlobalString('CASHDESK_ID_WAREHOUSE'.$_SESSION['takeposterminal'])) {
$sql .= " AND ps.fk_entrepot = ".((int) getDolGlobalInt("CASHDESK_ID_WAREHOUSE".$_SESSION['takeposterminal'])); $sql .= " AND ps.fk_entrepot = ".((int) getDolGlobalInt("CASHDESK_ID_WAREHOUSE".$_SESSION['takeposterminal']));
@@ -381,6 +381,7 @@ if ($action == 'getProducts') {
} else { } else {
$row = array(); $row = array();
} }
$rows[] = $row;
} else { } else {
// add // add
if (count($hookmanager->resArray)) { if (count($hookmanager->resArray)) {