select trim(to_char(date_trunc('month', i.invoice_date), 'Month')) || to_char(date_trunc('month', i.invoice_date), ' YYYY') AS "Month"
    , it.code AS "Invoice type code"
    , it.description AS "Invoice type description"
    , trim(to_char(sum(i.amount_without_tax), '9999999990.00')) AS "Amount without tax"
    , trim(to_char(sum(i.amount_with_tax), '9999999990.00')) AS "Amount with tax"  
from billing_invoice i 
    INNER JOIN billing_invoice_type it  on it.id = i.invoice_type_id 
where i.invoice_date > (date_trunc('month', CURRENT_DATE) - CAST(:MONTH_INTERVAL || ' month' AS INTERVAL))  
group by date_trunc('month', i.invoice_date)
    , it.code
    , it.description order by date_trunc('month', i.invoice_date) DESC
    , it.code DESC