From 80f651f37d0757551a7db7f8ca664d16f39f4dee Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 22 Nov 2021 12:34:20 +0100 Subject: [PATCH] add entries less than a year ago --- modules/entry/back/methods/entry/latestBuysFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index c877612e1..0c8ce3f99 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -180,7 +180,7 @@ module.exports = Self => { LEFT JOIN itemType t ON t.id = i.typeFk LEFT JOIN intrastat intr ON intr.id = i.intrastatFk LEFT JOIN origin ori ON ori.id = i.originFk - LEFT JOIN entry e ON e.id = b.entryFk + LEFT JOIN entry e ON e.id = b.entryFk AND e.created >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR) LEFT JOIN supplier s ON s.id = e.supplierFk` );