+ qq| e.name AS employee, | .
+ qq| v.vendornumber, v.country, v.ustid, | .
+ qq| tz.description AS taxzone, | .
+ qq| pt.description AS payment_terms, | .
+ qq{ ( SELECT ch.accno || ' -- ' || ch.description
+ FROM acc_trans at
+ LEFT JOIN chart ch ON ch.id = at.chart_id
+ WHERE ch.link ~ 'AP[[:>:]]'
+ AND at.trans_id = a.id
+ LIMIT 1
+ ) AS charts } .