#1903 informe consumo campaña
gitea/salix/1772-campaign_metrics This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-11-28 08:30:36 +01:00
parent f4e0d04b64
commit 909fef5e86
4 changed files with 13 additions and 38 deletions

View File

@ -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()

View File

@ -16,20 +16,20 @@
<div class="grid-block">
<div class="columns">
<div class="size50">
<div class="size100">
<h1 class="title uppercase">{{$t('title')}}</h1>
<h1 class="title uppercase">{{$t('title')}}</h1>
<div class="size75">
<table class="row-oriented">
<tbody>
<tr>
<td class="font gray uppercase">{{$t('Client')}}</td>
<td class="font gray">{{$t('Client')}}</td>
<th>{{client.id}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('From')}}</td>
<td class="font gray">{{$t('From')}}</td>
<th>{{from | date('%d-%m-%Y')}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('To')}}</td>
<td class="font gray">{{$t('To')}}</td>
<th>{{to | date('%d-%m-%Y')}}</th>
</tr>
</tbody>

View File

@ -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
}
}
};

View File

@ -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
Concept: Concepto