diff --git a/Core/Base/AjaxForms/SalesModalHTML.php b/Core/Base/AjaxForms/SalesModalHTML.php
index 35da7255c..d09a00fc1 100644
--- a/Core/Base/AjaxForms/SalesModalHTML.php
+++ b/Core/Base/AjaxForms/SalesModalHTML.php
@@ -233,13 +233,14 @@ protected static function getProducts(): array
if (count($words) === 1) {
$sql .= " AND (LOWER(v.codbarras) = " . $dataBase->var2str(self::$query)
. " OR LOWER(v.referencia) LIKE '%" . self::$query . "%'"
- . " OR LOWER(p.descripcion) LIKE '%" . self::$query . "%')";
+ . " OR LOWER(p.descripcion) LIKE '%" . self::$query . "%'"
+ . " OR LOWER(v.descripcion_alt) LIKE '%" . self::$query . "%')";
} elseif (count($words) > 1) {
$sql .= " AND (LOWER(v.referencia) LIKE '%" . self::$query . "%' OR (";
foreach ($words as $wc => $word) {
$sql .= $wc > 0 ?
- " AND LOWER(p.descripcion) LIKE '%" . $word . "%'" :
- "LOWER(p.descripcion) LIKE '%" . $word . "%'";
+ " AND (LOWER(p.descripcion) LIKE '%" . $word . "%' OR LOWER(v.descripcion_alt) LIKE '%" . $word . "%')" :
+ "(LOWER(p.descripcion) LIKE '%" . $word . "%' OR LOWER(v.descripcion_alt) LIKE '%" . $word . "%')";
}
$sql .= "))";
}
@@ -261,6 +262,9 @@ protected static function getProducts(): array
case 'stock_desc':
$sql .= " ORDER BY 8 DESC";
break;
+ default:
+ $sql .= " ORDER BY 8 DESC";
+ break;
}
$results = $dataBase->selectLimit($sql);
diff --git a/Core/Lib/AjaxForms/SalesModalHTML.php b/Core/Lib/AjaxForms/SalesModalHTML.php
index 6efcd87c0..34605d2ab 100644
--- a/Core/Lib/AjaxForms/SalesModalHTML.php
+++ b/Core/Lib/AjaxForms/SalesModalHTML.php
@@ -229,13 +229,14 @@ protected static function getProducts(): array
if (count($words) === 1) {
$sql .= " AND (LOWER(v.codbarras) = " . $dataBase->var2str(self::$query)
. " OR LOWER(v.referencia) LIKE '%" . self::$query . "%'"
- . " OR LOWER(p.descripcion) LIKE '%" . self::$query . "%')";
+ . " OR LOWER(p.descripcion) LIKE '%" . self::$query . "%'"
+ . " OR LOWER(v.descripcion_alt) LIKE '%" . self::$query . "%')";
} elseif (count($words) > 1) {
$sql .= " AND (LOWER(v.referencia) LIKE '%" . self::$query . "%' OR (";
foreach ($words as $wc => $word) {
$sql .= $wc > 0 ?
- " AND LOWER(p.descripcion) LIKE '%" . $word . "%'" :
- "LOWER(p.descripcion) LIKE '%" . $word . "%'";
+ " AND (LOWER(p.descripcion) LIKE '%" . $word . "%' OR LOWER(v.descripcion_alt) LIKE '%" . $word . "%')" :
+ "(LOWER(p.descripcion) LIKE '%" . $word . "%' OR LOWER(v.descripcion_alt) LIKE '%" . $word . "%')";
}
$sql .= "))";
}
@@ -257,6 +258,9 @@ protected static function getProducts(): array
case 'stock_desc':
$sql .= " ORDER BY 8 DESC";
break;
+ default:
+ $sql .= " ORDER BY 8 DESC";
+ break;
}
$results = $dataBase->selectLimit($sql);