refs #4547 cambios sql
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alexandre Riera 2022-11-03 08:08:24 +01:00
parent 908908a643
commit 84eb87e02a
3 changed files with 12 additions and 11 deletions

View File

@ -6,14 +6,14 @@ module.exports = {
name: 'balance-compensation', name: 'balance-compensation',
async serverPrefetch() { async serverPrefetch() {
this.client = await this.fetchClient(this.id); this.client = await this.fetchClient(this.id);
this.company = await this.fetchCompany(); this.company = await this.fetchCompany(this.id);
}, },
methods: { methods: {
fetchClient(id) { fetchClient(id) {
return this.findOneFromDef('client', [id]); return this.findOneFromDef('client', [id]);
}, },
fetchCompany() { fetchCompany(id) {
return this.findOneFromDef('company'); return this.findOneFromDef('company', [id]);
}, },
currentDate() { currentDate() {

View File

@ -6,7 +6,7 @@ SELECT
c.city, c.city,
r.amountPaid, r.amountPaid,
r.payed r.payed
FROM client c FROM client c
JOIN receipt r ON r.clientFk = c.id JOIN receipt r ON r.clientFk = c.id
JOIN supplier s ON c.fi = s.nif JOIN supplier s ON c.fi = s.nif
WHERE r.id = ?; WHERE r.id = ?

View File

@ -1,7 +1,8 @@
SELECT SELECT
s.name, s.name,
s.nif, s.nif,
s.street, s.street,
s.city s.city
FROM supplier s FROM supplier s
WHERE s.id = 442; JOIN receipt r ON r.companyFk = s.id
WHERE r.id = ?;