From f2a89924101ccfb1d6bc446220fcdbef402fb9e1 Mon Sep 17 00:00:00 2001
From: joan <joan@verdnatura.es>
Date: Tue, 14 Dec 2021 09:17:00 +0100
Subject: [PATCH] fix(ticketIndex): excluded collectionFk property from date
 ranges Refs: 3431

---
 modules/ticket/back/methods/ticket/filter.js | 7 ++++---
 modules/ticket/front/main/index.js           | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js
index a015d2165e..44ef7c4860 100644
--- a/modules/ticket/back/methods/ticket/filter.js
+++ b/modules/ticket/back/methods/ticket/filter.js
@@ -177,6 +177,8 @@ module.exports = Self => {
                 return {'a.provinceFk': value};
             case 'stateFk':
                 return {'ts.stateFk': value};
+            case 'collectionFk':
+                return {'cll.id': value};
             case 'mine':
             case 'myTeam':
                 if (value)
@@ -276,9 +278,8 @@ 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]
+                    JOIN collection cll
+                    JOIN ticketCollection tc ON tc.collectionFk = cll.id AND tc.ticketFk = t.id`
             });
         }
 
diff --git a/modules/ticket/front/main/index.js b/modules/ticket/front/main/index.js
index 35a955e553..1b807216b7 100644
--- a/modules/ticket/front/main/index.js
+++ b/modules/ticket/front/main/index.js
@@ -8,6 +8,7 @@ export default class Ticket extends ModuleMain {
             'to',
             'search',
             'clientFk',
+            'collectionFk',
             'orderFk',
             'refFk',
             'scopeDays'