A former taxman exploited his knowledge of lax system checks to con HMRC into paying him £22,000 to cover his gambling debts.
Crooked accountant Derek Foster duped the inland revenue into paying him regular rebates which he was blowing on online betting site Bet365.
Foster was unemployed and had less than £10 in his bank account but he convinced HMRC he was earning more than £200,000 a year working for corporate giants Shell, the Wood Group and Hat-trick Bruce.
A court was told Foster carried out the con for 20 months and was given rebates of up to £9,000 at a time without any checks being carried out by inspectors.
Foster, who also previously worked for BA at Gatwick Airport and for Perth and Kinross Council, was only caught when he ramped up the money he was claiming and sparked an investigation.
The 46-year-old, of Rae Place, Perth, admitted forming a fraudulent scheme to obtain £22,000 of income tax repayments between January 2013 and September 2014.
He admitted setting up online self-assessments in which he claimed to be working as a book-keeper for himself and for a number of companies.
He filed false statements for the 2011-12, 2012-13, and 2013-14 tax years.
Perth Sheriff Court heard Foster had initially been charged with almost £50,000 worth of frauds and attempted frauds but the Crown accepted his guilty plea to the reduced figure.
Depute fiscal Matthew Kerr told the court: “He said he was entitled to repayments of income tax.
“HMRC accepted him at face value and made payments to his bank account without confirming he had worked for these companies.
“It was only as he began to submit them with increased frequency and for higher amounts that it eventually prompted an investigation.”
Counsel for the accused, Iain Smith, said: “Clearly he has a BA in accountancy and I dare say that will have equipped him with certain knowledge as to how this offence could be committed.”
Sheriff Lindsay Foulis said: “It seems to me there is a reasonable inference to be drawn that he is very familiar with how the system operates.”
Noting Foster has previous fraud, embezzlement and shoplifting convictions, the sheriff said: “There is an element of Walter Mitty about him.”
He ordered Foster to carry out 300 hours unpaid work and placed him under social work supervision for two years.