I need to count all amount of invoices for last year. I do it using helper method but, as far as I know, there is better way using only one query to database with SQL functi