When inmates employed on public works or improvements or in public workhouses shall have paid the full amount of their fines and costs by their labor, then the county court shall issue a warrant in favor of each officer to whom costs may be due, for the amount of his or her costs, on the county treasurer, and it shall be paid if there are sufficient funds in the county treasury.