1 -- @tag: fix_datepaid_for_sepa_transfers
 
   2 -- @description: Feld »datepaid« bei via SEPA durchgeführten Transfers richtig setzen
 
   3 -- @depends: release_3_0_0
 
   6   SELECT MAX(acc.transdate)
 
   8   LEFT JOIN chart c ON (c.id = acc.chart_id)
 
   9   WHERE (acc.trans_id = ar.id)
 
  10     AND (c.link LIKE '%paid%')
 
  12 WHERE (ar.amount != 0)
 
  16     FROM sepa_export_items sei
 
  17     WHERE (sei.ar_id IS NOT NULL)