7199-devToTest_2316 #2287
|
@ -32,7 +32,7 @@ BEGIN
|
||||||
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
|
LEFT JOIN vn.expedition e ON e.ticketFk = t.id
|
||||||
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
|
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.freightItemFk
|
||||||
JOIN vn.zone z ON t.zoneFk = z.id
|
JOIN vn.zone z ON t.zoneFk = z.id
|
||||||
JOIN vn.companyFk cp ON cp.id = t.companyFk
|
JOIN vn.company cp ON cp.id = t.companyFk
|
||||||
WHERE t.shipped BETWEEN vDateStarted AND vDateEnded
|
WHERE t.shipped BETWEEN vDateStarted AND vDateEnded
|
||||||
AND c.isRelevant
|
AND c.isRelevant
|
||||||
AND cp.code IN ('VNL', 'VNH')
|
AND cp.code IN ('VNL', 'VNH')
|
||||||
|
@ -60,7 +60,7 @@ BEGIN
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT dp.ticketFk, SUM(s.quantity * sc.value) valor
|
SELECT dp.ticketFk, SUM(s.quantity * sc.value) valor
|
||||||
FROM tmp.dp
|
FROM tmp.dp
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN vn.sale s ON s.ticketFk = dp.ticketFk
|
||||||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||||
JOIN vn.component c ON c.id = sc.componentFk
|
JOIN vn.component c ON c.id = sc.componentFk
|
||||||
WHERE c.code = 'delivery'
|
WHERE c.code = 'delivery'
|
||||||
|
|
Loading…
Reference in New Issue