"then how can it have had any impact on Telefonica's earnings already?"
I haven't bothered to check, but usually businesses making a divestment report the numbers for a business they plan to sell as "discontinued operations" until the deal closes. When discussing performance, and quoting their financials (and indeed awarding themselves bonuses), all the commentary and metrics will focus on continuing operations.