fixed sepa core mandate by supplier id
gitea/salix/master This commit looks good
Details
gitea/salix/master This commit looks good
Details
This commit is contained in:
parent
f5a95d3190
commit
51cf09da2d
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
if (!params.companyFk)
|
||||
throw new UserException('No company id specified');
|
||||
|
||||
return this.methods.fetchClient(params.clientFk)
|
||||
return this.methods.fetchClient(params.clientFk, params.companyFk)
|
||||
.then(([[client]]) => {
|
||||
if (!client)
|
||||
throw new UserException('No client data found');
|
||||
|
@ -24,7 +24,7 @@ module.exports = {
|
|||
this.$i18n.locale = this.locale;
|
||||
},
|
||||
methods: {
|
||||
fetchClient(clientFk) {
|
||||
fetchClient(clientFk, companyFk) {
|
||||
return database.pool.query(
|
||||
`SELECT
|
||||
c.id clientId,
|
||||
|
@ -46,12 +46,12 @@ module.exports = {
|
|||
FROM client c
|
||||
JOIN account.user u ON u.id = c.id
|
||||
JOIN country ct ON ct.id = c.countryFk
|
||||
JOIN mandate m ON m.clientFk = c.id AND m.finished IS NULL
|
||||
JOIN supplier s ON s.id = m.companyFk
|
||||
JOIN country sc ON sc.id = s.countryFk
|
||||
JOIN province sp ON sp.id = s.provinceFk
|
||||
LEFT JOIN province p ON p.id = c.provinceFk
|
||||
LEFT JOIN mandate m ON m.clientFk = c.id AND m.finished IS NULL
|
||||
LEFT JOIN supplier s ON s.id = m.companyFk
|
||||
LEFT JOIN country sc ON sc.id = s.countryFk
|
||||
LEFT JOIN province sp ON sp.id = s.provinceFk
|
||||
WHERE c.id = ?`, [clientFk]);
|
||||
WHERE m.companyFk = ? AND c.id = ?`, [companyFk, clientFk]);
|
||||
},
|
||||
dated: () => {
|
||||
return strftime('%d-%m-%Y', new Date());
|
||||
|
|
Loading…
Reference in New Issue