diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index b6d4eff59..4f8cbd36e 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -75,7 +75,8 @@ module.exports = Self => { t.name type, u.id userId, intr.description AS intrastat, i.stems, ori.code AS origin, t.name AS type, - ic.name AS category, i.density, tc.description AS taxClass + ic.name AS category, i.density, tc.description AS taxClass, + b.grouping, b.packing FROM item i JOIN itemType t ON t.id = i.typeFk LEFT JOIN itemCategory ic ON ic.id = t.categoryFk @@ -84,7 +85,9 @@ module.exports = Self => { LEFT JOIN intrastat intr ON intr.id = i.intrastatFk LEFT JOIN producer pr ON pr.id = i.producerFk LEFT JOIN origin ori ON ori.id = i.originFk - LEFT JOIN taxClass tc ON tc.id = i.taxClassFk` + LEFT JOIN taxClass tc ON tc.id = i.taxClassFk + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk + LEFT JOIN vn.buy b ON b.id = lb.buy_id` ); if (ctx.args.tags) {