Impermissibility of the agent taking any amount of the price without the owner's permission
Your friend who took the money is considered an agent for the person who gave him this money.
An agent should be honest and never take any of the money without the permission of the one who authorized him. If he agrees to it, there is no harm in it; otherwise, he should return the remaining money to him. May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.