The former boss of HIV Scotland, who embezzled £5,000 from the charity, has been ordered to repay the money to a similar organisation.
Nathan Sparling, 35, was also sentenced to 100 hours of unpaid work for his deceit.
Sparling's illicit behaviour took place between April 2019 and March 2021 in Edinburgh while he was chief executive of the charity.
HIV Scotland has since closed.
Sparling, a former adviser to an SNP MP, pleaded guilty last month and returned to Edinburgh Sheriff Court on Wednesday for sentencing.
The court earlier heard how he spent £2,000 on Ubers and £3,000 on Amazon packages that were delivered to his home, including groceries and technical goods.
Sparling was suspended from his role amid a probe and later replaced.
Sheriff John Cook was told he had accepted responsibility for his actions and intended to repay the money in full.
Given HIV Scotland is no longer in operation, Waverley Care, which supports people living with HIV, was suggested as an alternative charity to receive the money, which the sheriff accepted.
Sparling, who attended court wearing a grey blazer, gave no comment as he left the building.
Read more from Sky News:
Scottish parliament removes gender search function from website
'Serious concerns' raised by MPs after rape allegations on MAFS
The Crown Office and Procurator Fiscal Service (COPFS) emphasised the seriousness of Sparling's offending.
Faith Currie, procurator fiscal for Edinburgh, Lothian and Borders, said: "Nathan Sparling committed an egregious breach of trust.
"He flagrantly took advantage of his position as a senior figure at HIV Scotland to embezzle public money from his employers.
"He showed no regard for the impact his crimes would have on those trying to run an important charity, as well as those who depend upon its work.
"This case demonstrates that those who seek to exploit public funds for their own personal gain will be held fully to account for their crimes.
"Embezzlement is not a victimless crime.
"As prosecutors, we are fully committed to tackling financial crime of this kind when it is in the public interest and where there is evidence to do so."
(c) Sky News 2026: Ex-chief executive of HIV Scotland ordered to repay embezzled £5,000 to similar charity


Three women who died off the coast of Brighton named
UK weather: Heatwave forecast and health alerts issued as temperatures set to hit 30C
'Best friend' of murdered Kayden Moy tells court how he 'witnessed fatal stabbing'
'Serious concerns' raised by MPs after rape allegations on Married At First Sight UK
Girl begged for help at window as officials drove away from 'beastie house', paedophile ring report says

