Any salaried county or precinct officer, who fails to pay to the county treasury all sums that have come into the officer's hands for fees and charges for the county, or by virtue of the officer's office, whether under the laws of this state or of the United States, is guilty of a class C felony, and upon conviction thereof shall be punished by imprisonment in a state correctional facility not less than one year nor more than three years: PROVIDED, That upon conviction, his or her office shall be declared to be vacant by the court pronouncing sentence.