When you want to get a job,diploma is more important.Because you are totally a stranger for the boss.You need to show your ability through your diploma.
When you want to get a promotion in the company,ability is more important.Because the boss know you well now.He can judge your qualification through your ability.