The court may endeavor to secure employment for unemployed prisoners under this section. If a prisoner is employed for wages or salary, the court may collect the same, or require the prisoner to turn over his wages or salary in full when received, and the court shall keep a ledger showing the status of the account of each prisoner. Except when the prisoner returns to the employment he held at the time of his arrest, such employment shall not result in the displacement of employed workers, or be applied in skills, crafts, or trades in which there is a surplus of available gainful labor in the locality, or impair existing contracts for services, and the rates of pay and other conditions of employment shall not be less than for work of similar nature in the locality in which the work is to be performed.