SELECT CONCAT_WS('/', c.pdfs_dir, invoice_get_path (#invoice)) FROM config c JOIN invoice_view i WHERE i.invoice_id = #invoice