A shamed finance officer stole more than £240,000 to fund his gambling habit.
John Reid, 39, overpaid companies linked to First People Solutions Ltd where he worked in Glasgow between March 2014 and July 2017.
He then got his hands on the cash by asking the firms to send the surplus back into his own bank account.
Glasgow Sheriff Court heard Reid carried out 155 transactions and pocketed a total of £244,950.
He confessed to his manager when caught and stated he had a “gambling addiction”.
Reid, of East Kilbride, South Lanarkshire, pled guilty on Friday to embezzlement.
The first offender was granted bail and will be sentenced next month.
The court heard Reid joined the recruitment company as a finance officer in March 2014.
Reid was responsible for the payroll, arranging payments and collections of overpayments from “umbrella companies”.
He resigned after the company was unable to match the salary of a job he was offered elsewhere.
However, an audit in August 2017 uncovered “discrepancies within the payroll”.
Prosecutor Sarah Latta said: “Reid was in control of the company accounts and was making payments to various payroll firms that his employer dealt with.
“He made legitimate payments to these companies, in various amounts, to payroll firms.
“Reid deliberately overpaid the companies between several hundred and thousands of pounds.
“He then contacted them by email or telephone to state there was an error and that he had overpaid.
“Reid asked them to refund the amount back into the company account which was, in fact, his own personal account.”
The director of First People Solutions traced Reid to his new employment at another payroll firm, SD Worx.
Ms Latta said: “He freely stated that he had a gambling addiction and that he had embezzled the money to fund this.
“Reid printed out his last three years banking statement and there were 155 transactions totalling £244,950.”
There was no initial police involvement as Reid made attempts to contact his father to help repay the debt.
No arrangement could be met and Reid was arrested.
Gerard Brown, defending, said: “This came from a gambling addiction and he did not benefit at all from this addiction.
“In terms of repayment, the company is insured and all the money has been paid except from £10,000.
“Mr Reid pays back the insurance company on a monthly basis.”
Sheriff Paul Crozier adjourned the case for reports.