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