diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index 6f275de86..b0f3ca40e 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -21,9 +21,6 @@ BEGIN CALL cache.available_refresh(vCalcFk, FALSE, vWarehouseFk, vDated); - -- AƱadido temporalmente para ver si ya no sucede el cuelgue de db - SET vShowType = TRUE; - WITH itemTags AS ( SELECT i.id, typeFk, @@ -82,7 +79,7 @@ BEGIN AND iss.warehouseFk = vWarehouseFk JOIN itemTags its WHERE a.available > 0 - AND IF(vShowType, i.typeFk = its.typeFk, TRUE) + AND (i.typeFk = its.typeFk OR NOT vShowType) AND i.id <> vSelf ORDER BY `counter` DESC, (t.name = its.name) DESC,