Answer:
Praise be to Allah, the Lord of the World; and blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
We do not know this story and could not find it in the authentic books of Shariah.
However, the life of the companions proves the essence of the above story. The essence is that the companions of the Prophet Muhammad (Peace and blessing be upon him) used to stay away from every extravagance and they used to feel complete responsibility for every coin if it were not spent for the Sake of Allah. At the same time they did not care if their entire wealth was spent to please Allah; or even their souls if sacrificed in obedience to Allah.
Allah knows best.