Compare commits

...

2 Commits

Author SHA1 Message Date
Carlos Satorres c44a65abb9 fix filter sql 2024-06-12 14:01:38 +02:00
Carlos Satorres 0839cd1c7c fix filter 2024-06-11 16:05:38 +02:00
1 changed files with 7 additions and 1 deletions

View File

@ -71,11 +71,17 @@ module.exports = Self => {
d.defaulterSinced,
cn.name country,
c.countryFk,
pm.name payMethod
pm.name payMethod,
dp.name departmentName,
dp.id departmentFk,
c.businessTypeFk = 'worker' isWorker
FROM vn.defaulter d
JOIN vn.client c ON c.id = d.clientFk
JOIN vn.country cn ON cn.id = c.countryFk
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
JOIN vn.worker w ON c.salesPersonFk = w.id
JOIN vn.workerDepartment wd ON w.id = wd.workerFk
JOIN vn.department dp ON wd.departmentFk = dp.id
LEFT JOIN vn.clientObservation co ON co.clientFk = c.id
LEFT JOIN account.user u ON u.id = c.salesPersonFk
LEFT JOIN account.user uw ON uw.id = co.workerFk