From 64a4a7830826401284d5ccedc1ba4eec5be39f31 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 10 Jun 2024 17:09:25 +0200 Subject: [PATCH] feat(salix): refs #6321 updates --- db/routines/vn/procedures/item_getSimilar.sql | 9 ++++++++- modules/item/back/methods/item/getSimilar.js | 8 ++++---- modules/ticket/back/methods/ticket/itemLackDetail.js | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index 762c25342..63d2c05d9 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -66,7 +66,14 @@ BEGIN ELSE 1 END AS minQuantity, iss.visible located, - b.price2 + b.price, + b.price1, + b.price2, + b.price3, + a.price, + a.price1, + a.price2, + a.price3, FROM vn.item i JOIN cache.available a ON a.item_id = i.id AND a.calc_id = vCalcFk diff --git a/modules/item/back/methods/item/getSimilar.js b/modules/item/back/methods/item/getSimilar.js index 84bb351af..f8115fb5e 100644 --- a/modules/item/back/methods/item/getSimilar.js +++ b/modules/item/back/methods/item/getSimilar.js @@ -25,9 +25,9 @@ module.exports = Self => { if (typeof options == 'object') Object.assign(myOptions, options); - // const where = filter.where; - // const query = [where.itemFk, where.warehouseFk, where.date ?? Date.now(), where.showType ?? true] ; - // const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?)',, myOptions); + const where = filter.where; + const query = [where.itemFk, where.warehouseFk, where.date ?? Date.now(), where.showType ?? true]; + const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?)', query, myOptions); return [ { @@ -51,7 +51,7 @@ module.exports = Self => { 'counter': 0, 'minQuantity': 1, 'visible': null, - 'price2': null + 'price2': 1 } ]; diff --git a/modules/ticket/back/methods/ticket/itemLackDetail.js b/modules/ticket/back/methods/ticket/itemLackDetail.js index f18d5d34e..9c9ffd010 100644 --- a/modules/ticket/back/methods/ticket/itemLackDetail.js +++ b/modules/ticket/back/methods/ticket/itemLackDetail.js @@ -45,6 +45,7 @@ module.exports = Self => { st.name stateName, st.id stateId, s.itemFk itemFk, + s.price price, al.code alertLevelCode, z.name zoneName, z.hour theoreticalhour,