const vnReport = require('../../../core/mixins/vn-report.js'); const app = require('vn-loopback/server/server'); module.exports = { name: 'balance-compensation', mixins: [vnReport], async serverPrefetch() { this.receipt = await app.models.Receipt.findOne({ fields: ['amountPaid', 'payed', 'clientFk', 'companyFk', 'description'], include: [ { relation: 'client', scope: { fields: ['name', 'street', 'fi', 'city'], } }, { relation: 'supplier', scope: { fields: ['name', 'street', 'nif', 'city'], } } ], where: {id: this.id} }); this.checkMainEntity(this.receipt); }, props: { id: { type: Number, required: true, description: 'The receipt id' } } };