diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js
index 9038b0886..79006e77d 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -107,7 +107,12 @@ module.exports = Self => {
arg: 'alertLevel',
type: 'number',
description: `The alert level of the tickets`
- }
+ },
+ {
+ arg: 'collectionFk',
+ type: 'number',
+ description: `The collection id filter`
+ },
],
returns: {
type: ['object'],
@@ -269,6 +274,15 @@ module.exports = Self => {
});
}
+ if (args.collectionFk) {
+ stmt.merge({
+ sql: `
+ JOIN collection cll ON cll.id = ?
+ JOIN ticketCollection tc ON tc.collectionFk = cll.id AND tc.ticketFk = t.id`,
+ params: [args.collectionFk]
+ });
+ }
+
stmt.merge(conn.makeWhere(filter.where));
stmts.push(stmt);
diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html
index d0b77b9de..79dfabb58 100644
--- a/modules/ticket/front/search-panel/index.html
+++ b/modules/ticket/front/search-panel/index.html
@@ -110,6 +110,11 @@
ng-model="filter.provinceFk"
url="Provinces">
+
+