Juventus have agreed to sell Hernanes to Hebei Fortune for an initial fee of €8 million, rising to €10m including bonuses.