fix: refs #7611 & ticket195937 incoterms #2613
|
@ -2,11 +2,6 @@ WITH tickets AS(
|
||||||
SELECT id, packages, addressFk, weight
|
SELECT id, packages, addressFk, weight
|
||||||
FROM ticket
|
FROM ticket
|
||||||
WHERE refFk= ?
|
WHERE refFk= ?
|
||||||
robert marked this conversation as resolved
Outdated
|
|||||||
) , weight AS(
|
|
||||||
SELECT weight
|
|
||||||
FROM tickets
|
|
||||||
WHERE weight
|
|
||||||
LIMIT 1
|
|
||||||
), volume AS(
|
), volume AS(
|
||||||
SELECT SUM(volume) volume
|
SELECT SUM(volume) volume
|
||||||
FROM tickets t
|
FROM tickets t
|
||||||
|
@ -20,7 +15,7 @@ SELECT GROUP_CONCAT(DISTINCT ir.description ORDER BY ir.description SEPARATOR '
|
||||||
)SELECT SUM(t.packages),
|
)SELECT SUM(t.packages),
|
||||||
a.incotermsFk,
|
a.incotermsFk,
|
||||||
ic.name incotermsName,
|
ic.name incotermsName,
|
||||||
w.weight,
|
MAX(t.weight) weight,
|
||||||
ca.fiscalName customsAgentName,
|
ca.fiscalName customsAgentName,
|
||||||
ca.street customsAgentStreet,
|
ca.street customsAgentStreet,
|
||||||
ca.nif customsAgentNif,
|
ca.nif customsAgentNif,
|
||||||
|
@ -34,4 +29,3 @@ SELECT GROUP_CONCAT(DISTINCT ir.description ORDER BY ir.description SEPARATOR '
|
||||||
LEFT JOIN vn.customsAgent ca ON ca.id = a.customsAgentFk
|
LEFT JOIN vn.customsAgent ca ON ca.id = a.customsAgentFk
|
||||||
JOIN volume v
|
JOIN volume v
|
||||||
JOIN intrastat i
|
JOIN intrastat i
|
||||||
LEFT JOIN weight w ON TRUE
|
|
||||||
|
|
Loading…
Reference in New Issue
refFk a pel??