salix/print/templates/reports/invoice/sql/hasIncoterms.sql

6 lines
176 B
SQL

SELECT COUNT(*) AS hasIncoterms
FROM invoiceOut io
JOIN vn.invoiceOutSerial ios ON ios.code = io.serial
AND ios.taxAreaFk = 'WORLD'
WHERE io.ref = ?