SOLVED! The problem of calculation and ranking for plan and provider.