salix/print/templates/reports/campaign-metrics/campaign-metrics.js

25 lines
620 B
JavaScript
Raw Normal View History

2023-01-23 12:15:30 +00:00
const vnReport = require('../../../core/mixins/vn-report.js');
2019-11-27 15:00:42 +00:00
module.exports = {
name: 'campaign-metrics',
2023-01-23 12:15:30 +00:00
mixins: [vnReport],
2019-11-27 15:00:42 +00:00
async serverPrefetch() {
2023-01-23 12:15:30 +00:00
this.client = await this.findOneFromDef('client', [this.id]);
this.checkMainEntity(this.client);
this.sales = await this.rawSqlFromDef('sales', [this.id, this.from, this.to]);
2019-11-27 15:00:42 +00:00
},
props: {
2022-09-22 06:48:29 +00:00
id: {
2022-10-28 13:53:57 +00:00
type: Number,
2022-09-26 11:33:27 +00:00
required: true,
description: 'The client id'
2019-11-27 15:00:42 +00:00
},
from: {
2020-06-12 07:18:19 +00:00
required: true
2019-11-27 15:00:42 +00:00
},
to: {
2020-06-12 07:18:19 +00:00
required: true
2019-11-27 15:00:42 +00:00
}
}
};