feat: refs #6845 userInterface #3161
|
@ -30,7 +30,9 @@ BEGIN
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
w.id salesPersonFk,
|
w.id salesPersonFk,
|
||||||
IFNULL(ob.description,'') observaciones,
|
IFNULL(ob.description,'') observaciones,
|
||||||
cc.rgb
|
cc.rgb,
|
||||||
|
p.code parkingCode,
|
||||||
|
IF (ps.ticketFk, TRUE, FALSE) isAdvanced
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
LEFT JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
||||||
|
@ -42,7 +44,10 @@ BEGIN
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||||
|
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
||||||
|
LEFT JOIN vn.parking p ON tp.parkingFk = p.id
|
||||||
|
LEFT JOIN vn.packingSiteAdvanced ps ON ps.ticketFk = t.id
|
||||||
WHERE t.id = vParamFk
|
WHERE t.id = vParamFk
|
||||||
AND t.shipped >= vYesterday
|
AND t.shipped >= vYesterday
|
||||||
UNION
|
UNION
|
||||||
|
@ -52,7 +57,9 @@ BEGIN
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
w.id salesPersonFk,
|
w.id salesPersonFk,
|
||||||
ob.description,
|
ob.description,
|
||||||
IF(NOT (vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb`
|
IF(NOT (vItemPackingTypeFk <=> 'V'), cc.rgb, NULL) `rgb`,
|
||||||
|
p.code parkingCode,
|
||||||
|
IF (ps.ticketFk, TRUE, FALSE) isAdvanced
|
||||||
FROM vn.ticket t
|
FROM vn.ticket t
|
||||||
JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
JOIN vn.ticketCollection tc ON t.id = tc.ticketFk
|
||||||
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
LEFT JOIN vn.collection c2 ON c2.id = tc.collectionFk
|
||||||
|
@ -64,7 +71,10 @@ BEGIN
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||||
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
LEFT JOIN vn.worker w ON w.id = c.salesPersonFk
|
||||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||||
|
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
||||||
|
LEFT JOIN vn.parking p ON tp.parkingFk = p.id
|
||||||
|
LEFT JOIN vn.packingSiteAdvanced ps ON ps.ticketFk = t.id
|
||||||
WHERE tc.collectionFk = vParamFk
|
WHERE tc.collectionFk = vParamFk
|
||||||
UNION
|
UNION
|
||||||
SELECT sg.ticketFk,
|
SELECT sg.ticketFk,
|
||||||
|
@ -73,7 +83,9 @@ BEGIN
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
c.salesPersonFk,
|
c.salesPersonFk,
|
||||||
ob.description,
|
ob.description,
|
||||||
NULL `rgb`
|
NULL `rgb`,
|
||||||
|
p.code parkingCode,
|
||||||
|
IF (ps.ticketFk, TRUE, FALSE) isAdvanced
|
||||||
FROM vn.sectorCollection sc
|
FROM vn.sectorCollection sc
|
||||||
JOIN vn.sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
|
JOIN vn.sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
|
||||||
JOIN vn.saleGroup sg ON sg.id = ss.saleGroupFk
|
JOIN vn.saleGroup sg ON sg.id = ss.saleGroupFk
|
||||||
|
@ -81,7 +93,10 @@ BEGIN
|
||||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||||
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
LEFT JOIN vn.agencyMode am ON am.id = z.agencyModeFk
|
||||||
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
LEFT JOIN observation ob ON ob.ticketFk = t.id
|
||||||
LEFT JOIN vn.client c ON c.id = t.clientFk
|
LEFT JOIN vn.client c ON c.id = t.clientFk
|
||||||
|
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
||||||
|
LEFT JOIN vn.parking p ON tp.parkingFk = p.id
|
||||||
|
LEFT JOIN vn.packingSiteAdvanced ps ON ps.ticketFk = t.id
|
||||||
WHERE sc.id = vParamFk
|
WHERE sc.id = vParamFk
|
||||||
AND t.shipped >= vYesterday
|
AND t.shipped >= vYesterday
|
||||||
GROUP BY ticketFk;
|
GROUP BY ticketFk;
|
||||||
|
|
Loading…
Reference in New Issue