From ea626821fc410e29ae5aac56ffb416c4613308e6 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 11 Jul 2024 06:17:19 +0200 Subject: [PATCH] feat(ssalix): refs #7671 #7671 checkDates --- modules/item/back/methods/fixed-price/filter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/item/back/methods/fixed-price/filter.js b/modules/item/back/methods/fixed-price/filter.js index 9c91886c1..5580dfecf 100644 --- a/modules/item/back/methods/fixed-price/filter.js +++ b/modules/item/back/methods/fixed-price/filter.js @@ -137,6 +137,7 @@ module.exports = Self => { SELECT fp.id, fp.itemFk, fp.warehouseFk, + w.name as warehouseName, fp.rate2, fp.rate3, fp.started, @@ -160,6 +161,7 @@ module.exports = Self => { FROM priceFixed fp JOIN item i ON i.id = fp.itemFk JOIN itemType it ON it.id = i.typeFk + JOIN warehouse w ON fp.warehouseFk = w.id `); if (ctx.args.tags) { @@ -183,6 +185,11 @@ module.exports = Self => { } } } + if (ctx.req.query.showBadDates === 'true') { + stmt.merge({ + sql: `WHERE + fp.started< fp.ended `}); + } stmt.merge(conn.makeSuffix(filter));