From d6683918bb8126887e29b5ae905966fb663fc03d Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 4 Mar 2019 16:06:41 +0100 Subject: [PATCH] =?UTF-8?q?#1165=20A=C3=B1adir=20al=20buscador=20avanzado?= =?UTF-8?q?=20de=20order=20la=20b=C3=BAsqueda=20por=20ticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/order/back/methods/order/filter.js | 12 ++++++++++++ modules/order/front/search-panel/index.html | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/modules/order/back/methods/order/filter.js b/modules/order/back/methods/order/filter.js index 00b4eec96..628b85343 100644 --- a/modules/order/back/methods/order/filter.js +++ b/modules/order/back/methods/order/filter.js @@ -35,6 +35,10 @@ module.exports = Self => { arg: 'clientFk', type: 'Integer', description: `The client id` + }, { + arg: 'ticketFk', + type: 'Integer', + description: `The ticket id` }, { arg: 'agencyModeFk', type: 'Integer', @@ -78,6 +82,8 @@ module.exports = Self => { return {'o.agency_id': value}; case 'sourceApp': return {'o.source_app': value}; + case 'ticketFk': + return {'ort.ticketFk': value}; case 'isConfirmed': return {'o.confirmed': value ? 1 : 0}; case 'id': @@ -118,6 +124,12 @@ module.exports = Self => { LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN account.user u ON u.id = wk.userFk LEFT JOIN company co ON co.id = o.company_id`); + + if (ctx.args && ctx.args.ticketFk) { + stmt.merge({ + sql: `LEFT JOIN orderTicket ort ON ort.orderFk = o.id` + }); + } stmt.merge(conn.makeSuffix(filter)); stmts.push(stmt); diff --git a/modules/order/front/search-panel/index.html b/modules/order/front/search-panel/index.html index 8f692a0fa..0af885a53 100644 --- a/modules/order/front/search-panel/index.html +++ b/modules/order/front/search-panel/index.html @@ -50,6 +50,13 @@ model="filter.to"> + + + +