fix: #6742 calcula hasIncoterm a partir de la serie
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
371cc1e0a9
commit
540c76005e
|
@ -15,7 +15,7 @@ SELECT pack.packages,
|
||||||
LEFT JOIN vn.province p ON p.id = c.provinceFk
|
LEFT JOIN vn.province p ON p.id = c.provinceFk
|
||||||
JOIN vn.ticket t ON t.refFk = io.ref
|
JOIN vn.ticket t ON t.refFk = io.ref
|
||||||
JOIN vn.address a ON a.id = t.addressFk
|
JOIN vn.address a ON a.id = t.addressFk
|
||||||
LEFT JOIN vn.incoterms ic ON ic.code = a.incotermsFk
|
JOIN vn.incoterms ic ON ic.code = a.incotermsFk
|
||||||
LEFT JOIN vn.customsAgent ca ON ca.id = a.customsAgentFk
|
LEFT JOIN vn.customsAgent ca ON ca.id = a.customsAgentFk
|
||||||
JOIN vn.sale s ON s.ticketFk = t.id
|
JOIN vn.sale s ON s.ticketFk = t.id
|
||||||
JOIN (
|
JOIN (
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
SELECT IF(incotermsFk IS NULL, FALSE, TRUE) AS hasIncoterms
|
SELECT COUNT(*) AS hasIncoterms
|
||||||
FROM ticket t
|
FROM invoiceOut io
|
||||||
JOIN invoiceOut io ON io.ref = t.refFk
|
JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
|
||||||
JOIN client c ON c.id = t.clientFk
|
AND ios.taxAreaFk = 'WORLD'
|
||||||
JOIN address a ON a.id = t.addressFk
|
WHERE io.ref = ?
|
||||||
WHERE t.refFk = ?
|
|
||||||
AND IF(c.hasToinvoiceByAddress = FALSE, c.defaultAddressFk, TRUE)
|
|
||||||
LIMIT 1
|
|
||||||
|
|
Loading…
Reference in New Issue