The collector must, on or before July 1 in each year, make a final settlement, under oath, with the county treasurer and school treasurer or, if there is no county treasurer or school treasurer in the county, with the custodian of the funds of the county for all the county taxes which have been assessed and levied for the use of the county and all taxes levied for the use of the schools and then pay over to the county treasurer and school treasurer or, if there is no county treasurer in the county, to the custodian of the funds of the county the balance of the county tax due from him as such tax collector and not paid over prior to that date, and shall make final settlement with the treasurer of school funds of all school taxes which have been assessed and levied and pay over to the treasurer of school funds the balance of school taxes due from him as such tax collector and not paid over prior to that date.