#6321 - Negative tickets #1945

Open
jsegarra wants to merge 93 commits from 6321_negative_tickets into dev
2 changed files with 8 additions and 9 deletions
Showing only changes of commit 2cbd610bc2 - Show all commits

View File

@ -66,14 +66,7 @@ BEGIN
ELSE 1
END AS minQuantity,
iss.visible located,
b.price,
b.price1,
b.price2,
b.price3,
a.price,
a.price1,
a.price2,
a.price3,
b.price2
FROM vn.item i
JOIN cache.available a ON a.item_id = i.id
AND a.calc_id = vCalcFk
@ -87,6 +80,7 @@ BEGIN
LEFT JOIN vn.buy b ON b.id = lb.buy_id
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
AND iss.warehouseFk = vWarehouseFk
LEFT JOIN vn.ink ink ON ink.id = i.tag5
JOIN itemTags its
WHERE a.available > 0
AND (i.typeFk = its.typeFk OR NOT vShowType)
@ -95,6 +89,7 @@ BEGIN
(t.name = its.name) DESC,
(it.value = its.value) DESC,
(i.tag5 = its.tag5) DESC,
(ink.`showOrder`) DESC,
match5 DESC,
(i.tag6 = its.tag6) DESC,
match6 DESC,

View File

@ -26,7 +26,11 @@ module.exports = Self => {
Object.assign(myOptions, options);
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);
return [