From 909fef5e86c4373aa80d338c8647f5bebbb9c4e1 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Thu, 28 Nov 2019 08:30:36 +0100 Subject: [PATCH] =?UTF-8?q?#1903=20informe=20consumo=20campa=C3=B1a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../campaign-metrics/campaign-metrics.js | 20 +------------------ .../campaign-metrics/campaign-metrics.html | 10 +++++----- .../campaign-metrics/campaign-metrics.js | 17 ++++++---------- .../reports/campaign-metrics/locale/es.yml | 4 +--- 4 files changed, 13 insertions(+), 38 deletions(-) diff --git a/print/templates/email/campaign-metrics/campaign-metrics.js b/print/templates/email/campaign-metrics/campaign-metrics.js index f2104d825..cb01ca09e 100755 --- a/print/templates/email/campaign-metrics/campaign-metrics.js +++ b/print/templates/email/campaign-metrics/campaign-metrics.js @@ -4,25 +4,7 @@ const emailFooter = new Component('email-footer'); module.exports = { name: 'campaign-metrics', - async serverPrefetch() { - this.client = await this.fetchClient(this.clientId); - }, - methods: { - // fetchClient(clientId) { - // return db.findOne(` - // SELECT - // c.id, - // u.name AS userName, - // CONCAT(w.lastName, ' ', w.firstName) salesPersonName, - // w.phone AS salesPersonPhone, - // CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail - // FROM client c - // JOIN account.user u ON u.id = c.id - // LEFT JOIN worker w ON w.id = c.salesPersonFk - // LEFT JOIN account.user wu ON wu.id = w.userFk - // WHERE c.id = ?`, [clientId]); - // }, - }, + components: { 'email-header': emailHeader.build(), 'email-footer': emailFooter.build() diff --git a/print/templates/reports/campaign-metrics/campaign-metrics.html b/print/templates/reports/campaign-metrics/campaign-metrics.html index 5ab7c894b..5e4bc7d08 100644 --- a/print/templates/reports/campaign-metrics/campaign-metrics.html +++ b/print/templates/reports/campaign-metrics/campaign-metrics.html @@ -16,20 +16,20 @@
-
-

{{$t('title')}}

+

{{$t('title')}}

+
- + - + - + diff --git a/print/templates/reports/campaign-metrics/campaign-metrics.js b/print/templates/reports/campaign-metrics/campaign-metrics.js index d4d613a61..f72069260 100755 --- a/print/templates/reports/campaign-metrics/campaign-metrics.js +++ b/print/templates/reports/campaign-metrics/campaign-metrics.js @@ -6,15 +6,8 @@ const reportFooter = new Component('report-footer'); module.exports = { name: 'campaign-metrics', async serverPrefetch() { - // // te delete once form inputs get date ranges - this.from = new Date(); - this.from.setMonth(0); - this.from.setDate(1); - this.to = new Date(); - this.to.setMonth(11); - this.to.setDate(31); - // this.clientId = 101; - // // end of delete + this.to = new Date(this.to); + this.from = new Date(this.from); this.client = await this.fetchClient(this.clientId); @@ -74,10 +67,12 @@ module.exports = { required: true }, from: { - required: true + required: true, + type: Date }, to: { - required: true + required: true, + type: Date } } }; diff --git a/print/templates/reports/campaign-metrics/locale/es.yml b/print/templates/reports/campaign-metrics/locale/es.yml index 67f65a652..df0c91971 100644 --- a/print/templates/reports/campaign-metrics/locale/es.yml +++ b/print/templates/reports/campaign-metrics/locale/es.yml @@ -4,10 +4,8 @@ clientData: Datos del cliente dated: Fecha From: Desde To: Hasta -concept: Concepto client: Cliente {0} Code: Código Quantity: Cantidad Stems: Tallos -Concept: Concepto -Tags: Etiquetas \ No newline at end of file +Concept: Concepto \ No newline at end of file
{{$t('Client')}}{{$t('Client')}} {{client.id}}
{{$t('From')}}{{$t('From')}} {{from | date('%d-%m-%Y')}}
{{$t('To')}}{{$t('To')}} {{to | date('%d-%m-%Y')}}