This commit is contained in:
parent
908908a643
commit
84eb87e02a
|
@ -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() {
|
||||||
|
|
|
@ -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 = ?
|
|
@ -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 = ?;
|
Loading…
Reference in New Issue