Merge branch 'dev' into 7683-productionControlDeadlock
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2024-07-18 10:08:15 +00:00
commit ff8820f18d
1 changed files with 12 additions and 3 deletions

View File

@ -53,13 +53,22 @@ module.exports = Self => {
const stmts = []; const stmts = [];
const stmt = new ParameterizedSQL( const stmt = new ParameterizedSQL(
`SELECT t.id AS ticketFk, c.id AS clientFk, c.name AS clientName, tw.weekDay, `SELECT t.id AS ticketFk,
wh.name AS warehouseName, u.id AS workerFk, u.name AS userName, u.nickName, tw.agencyModeFk c.id AS clientFk,
c.name AS clientName,
tw.weekDay,
wh.name AS warehouseName,
u.id AS workerFk,
u.name AS userName,
u.nickName,
tw.agencyModeFk,
am.name agencyModeName
FROM ticketWeekly tw FROM ticketWeekly tw
JOIN ticket t ON t.id = tw.ticketFk JOIN ticket t ON t.id = tw.ticketFk
JOIN client c ON c.id = t.clientFk JOIN client c ON c.id = t.clientFk
JOIN account.user u ON u.id = c.salesPersonFk JOIN account.user u ON u.id = c.salesPersonFk
JOIN warehouse wh ON wh.id = t.warehouseFk` JOIN warehouse wh ON wh.id = t.warehouseFk
LEFT JOIN agencyMode am ON am.id = tw.agencyModeFk`
); );
stmt.merge(conn.makeSuffix(filter)); stmt.merge(conn.makeSuffix(filter));