update mail_salesinvoice plpgsql to use updated view field