WIP: feat: refs #6583 add new opt in where builder #3162

Draft
jorgep wants to merge 9 commits from 6583-addOnlyDestination into dev
1 changed files with 5 additions and 2 deletions
Showing only changes of commit 611cd12392 - Show all commits

View File

@ -52,7 +52,8 @@ BEGIN
IFNULL(dest.nickname, origin.nickname) nickname,
dest.landed,
dest.preparation,
origin.departmentFk
origin.departmentFk,
origin.saleClonedFk
FROM (
SELECT s.ticketFk,
c.salesPersonFk workerFk,
@ -73,11 +74,13 @@ BEGIN
t.warehouseFk,
t.companyFk,
t.agencyModeFk,
wd.departmentFk
wd.departmentFk,
sc.saleClonedFk
FROM ticket t
JOIN client c ON c.id = t.clientFk
JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
JOIN sale s ON s.ticketFk = t.id
LEFT JOIN saleCloned sc ON sc.saleClonedFk = s.id
JOIN saleVolume sv ON sv.saleFk = s.id
JOIN item i ON i.id = s.itemFk
JOIN ticketState ts ON ts.ticketFk = t.id