If any person accused of a public offense is taken before a judge in chambers for the purpose of entering a plea of guilty and receives a state incarceration sentence, the county where the alleged offense was committed shall reimburse the sheriff pursuant to §§ 7-12-21 and 7-12-22.
If a state incarceration sentence is not imposed, the county where the alleged offense was committed shall reimburse the sheriff for the actual expenses for conveying the person to and from the judge by the nearest traveled route.
SDCL 7-12-23