While testing for ticket 1303, I found this problem voiding+posting invoice 1560 in the 1.4 demo system.
'2F005:ERROR: control reached end of function without RETURN
CONTEXT: PL/pgSQL function cogsreverse_ar(integer,numeric)
PL/pgSQL function cogsadd_for_ar_line(integer) line 30 at assignment
SQL statement "SELECT cogs__add_for_ar_line(id) FROM invoice
WHERE trans_id = in_id"
PL/pgSQL function draft_approve(integer) line 8 at PERFORM at LedgerSMB.pm line 782.
'
dbversion: 1.4.11, company: demo14
Moved to github for retriage https://github.com/ledgersmb/LedgerSMB/issues/990