Merge pull request 'feat: refs #7568 Added freelancer exception' (!2571) from 7568-ticket_doCmr into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2571 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
deff65918d
|
@ -18,7 +18,7 @@ BEGIN
|
||||||
com.id companyFk,
|
com.id companyFk,
|
||||||
a.id addressFk,
|
a.id addressFk,
|
||||||
c2.defaultAddressFk,
|
c2.defaultAddressFk,
|
||||||
su.id supplierFk,
|
IFNULL(sat.supplierFk, su.id) supplierFk,
|
||||||
t.landed
|
t.landed
|
||||||
FROM ticket t
|
FROM ticket t
|
||||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||||
|
@ -28,7 +28,6 @@ BEGIN
|
||||||
JOIN `address` a ON a.id = t.addressFk
|
JOIN `address` a ON a.id = t.addressFk
|
||||||
JOIN province p ON p.id = a.provinceFk
|
JOIN province p ON p.id = a.provinceFk
|
||||||
JOIN country co ON co.id = p.countryFk
|
JOIN country co ON co.id = p.countryFk
|
||||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
|
||||||
JOIN warehouse w ON w.id = t.warehouseFk
|
JOIN warehouse w ON w.id = t.warehouseFk
|
||||||
JOIN company com ON com.id = t.companyFk
|
JOIN company com ON com.id = t.companyFk
|
||||||
JOIN client c2 ON c2.id = com.clientFk
|
JOIN client c2 ON c2.id = com.clientFk
|
||||||
|
@ -37,6 +36,10 @@ BEGIN
|
||||||
LEFT JOIN route r ON r.id = t.routeFk
|
LEFT JOIN route r ON r.id = t.routeFk
|
||||||
LEFT JOIN worker wo ON wo.id = r.workerFk
|
LEFT JOIN worker wo ON wo.id = r.workerFk
|
||||||
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
LEFT JOIN vehicle v ON v.id = r.vehicleFk
|
||||||
|
LEFT JOIN agencyMode am ON am.id = r.agencyModeFk
|
||||||
|
LEFT JOIN agency ag ON ag.id = am.agencyFk
|
||||||
|
LEFT JOIN supplierAgencyTerm sat ON sat.agencyFk = ag.id
|
||||||
|
AND wo.isFreelance
|
||||||
WHERE al.code IN ('PACKED', 'DELIVERED')
|
WHERE al.code IN ('PACKED', 'DELIVERED')
|
||||||
AND co.code <> 'ES'
|
AND co.code <> 'ES'
|
||||||
AND am.name <> 'ABONO'
|
AND am.name <> 'ABONO'
|
||||||
|
|
Loading…
Reference in New Issue