Fix internal server error when creating invoices for accounts with data CDRs