Rename method sum_by_roles to sum_by_entity.