If the amount of any assessment for a local improvement with interest, penalty, costs, and charges accrued thereon is paid to the treasurer before sale of the property in foreclosure of the lien thereon, the city or town treasurer shall mark it paid upon the assessment roll with the date of payment thereof.