last steps to preview credit request #692
|
@ -176,6 +176,13 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Footer block -->
|
||||
<report-footer
|
||||
id="pageFooter"
|
||||
v-bind:left-text="$t('client', [client.id])"
|
||||
v-bind:center-text="client.socialName"
|
||||
v-bind="$props">
|
||||
</report-footer>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
const Component = require(`${appPath}/core/component`);
|
||||
const reportHeader = new Component('report-header');
|
||||
const reportFooter = new Component('report-footer');
|
||||
|
||||
const rptCreditRequest = {
|
||||
name: 'credit-request',
|
||||
async serverPrefetch() {
|
||||
this.client = await this.fetchClient(this.recipientId);
|
||||
|
||||
if (!this.client)
|
||||
throw new Error('Something went wrong');
|
||||
},
|
||||
methods: {
|
||||
fetchClient(clientId) {
|
||||
return this.findOneFromDef('client', [clientId]);
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'report-header': reportHeader.build()
|
||||
'report-header': reportHeader.build(),
|
||||
'report-footer': reportFooter.build()
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
SELECT
|
||||
c.id,
|
||||
c.socialName,
|
||||
c.street,
|
||||
c.postcode,
|
||||
c.city,
|
||||
c.fi,
|
||||
p.name AS province,
|
||||
ct.country
|
||||
FROM client c
|
||||
JOIN country ct ON ct.id = c.countryFk
|
||||
LEFT JOIN province p ON p.id = c.provinceFk
|
||||
WHERE c.id = ?
|
Loading…
Reference in New Issue