#6321 - Negative tickets #1945
|
@ -66,14 +66,7 @@ BEGIN
|
||||||
ELSE 1
|
ELSE 1
|
||||||
END AS minQuantity,
|
END AS minQuantity,
|
||||||
iss.visible located,
|
iss.visible located,
|
||||||
b.price,
|
b.price2
|
||||||
b.price1,
|
|
||||||
b.price2,
|
|
||||||
b.price3,
|
|
||||||
a.price,
|
|
||||||
a.price1,
|
|
||||||
a.price2,
|
|
||||||
a.price3,
|
|
||||||
FROM vn.item i
|
FROM vn.item i
|
||||||
JOIN cache.available a ON a.item_id = i.id
|
JOIN cache.available a ON a.item_id = i.id
|
||||||
AND a.calc_id = vCalcFk
|
AND a.calc_id = vCalcFk
|
||||||
|
@ -87,6 +80,7 @@ BEGIN
|
||||||
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
LEFT JOIN vn.buy b ON b.id = lb.buy_id
|
||||||
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
|
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
|
||||||
AND iss.warehouseFk = vWarehouseFk
|
AND iss.warehouseFk = vWarehouseFk
|
||||||
|
LEFT JOIN vn.ink ink ON ink.id = i.tag5
|
||||||
JOIN itemTags its
|
JOIN itemTags its
|
||||||
WHERE a.available > 0
|
WHERE a.available > 0
|
||||||
AND (i.typeFk = its.typeFk OR NOT vShowType)
|
AND (i.typeFk = its.typeFk OR NOT vShowType)
|
||||||
|
@ -95,6 +89,7 @@ BEGIN
|
||||||
(t.name = its.name) DESC,
|
(t.name = its.name) DESC,
|
||||||
(it.value = its.value) DESC,
|
(it.value = its.value) DESC,
|
||||||
(i.tag5 = its.tag5) DESC,
|
(i.tag5 = its.tag5) DESC,
|
||||||
|
(ink.`showOrder`) DESC,
|
||||||
match5 DESC,
|
match5 DESC,
|
||||||
(i.tag6 = its.tag6) DESC,
|
(i.tag6 = its.tag6) DESC,
|
||||||
match6 DESC,
|
match6 DESC,
|
||||||
|
|
|
@ -26,7 +26,11 @@ module.exports = Self => {
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const where = filter.where;
|
const where = filter.where;
|
||||||
const query = [where.itemFk, where.warehouseFk, where.date ?? Date.now(), where.showType ?? true];
|
const today =
|
||||||
|
new Date().toLocaleDateString('es-ES', {year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit'});
|
||||||
|
const query = [where.itemFk, where.warehouseFk, where.date ?? today, where.showType ?? true];
|
||||||
const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?)', query, myOptions);
|
const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?)', query, myOptions);
|
||||||
|
|
||||||
jsegarra marked this conversation as resolved
Outdated
|
|||||||
return [
|
return [
|
||||||
|
|
Loading…
Reference in New Issue
asegurate que esto es necesario y solo el Date.vnNew() no funciona