Where a mortgage is given to secure the payment of money by installments, each installment, either for principal or interest, or both, as is due at any time, may be taken and deemed to be a separate and independent mortgage, and such mortgage for each such installment may be foreclosed by advertisement or by action, in the same manner and with like effect as if a separate mortgage were given for each of such installments, and such foreclosure may be made and sale had subject to the installments yet to become due upon the mortgage; and a redemption from any such sale shall have the like effect as if the sale for such installment had been made upon an independent subsequent mortgage; provided in such cases the attorney's fee on the foreclosure so made shall not exceed the amount permitted by law in case of a mortgage securing the amount of the debt then due on such foreclosure. The proceeds of the sale shall be applied first in payment of the costs of the foreclosure sale, and of the installment due, with interest thereon, taxes and insurance premiums paid, if any, and then towards the payment of the residue of the sum secured by such mortgage, and not due and payable at the time of such sale; and, if such residue does not bear interest, such application shall be made with rebate of the legal interest for the time during which the residue shall not be due and payable; and the surplus, if any, shall be paid to the subsequent lienors, if any, in the order of their priority, and then to the owner of the equity of redemption, the owner's legal representatives or assigns. In case of redemption from any sale herein authorized, at the option of the redemptioner, the whole amount remaining unpaid on the mortgage, with interest and other items, if any, which have become part of the amount secured by the lien of the mortgage, may be included in the amount paid on redemption and, in such event, the redemption so made shall have like effect as if the foreclosure sale had been made for the entire amount secured by the mortgage, including such additional items.
Before any sale herein authorized, the holder of the mortgage shall file with the sheriff a verified itemized statement in writing showing the entire amount remaining unpaid on the mortgage, including taxes and insurance premiums paid and other items which have become part of the amount secured, and the rate of interest to accrue on same, which statement shall be subject to public inspection and shall be read by the sheriff at the sale, immediately after reading the notice of sale. The certificate of sale shall set forth correctly, in addition to the amount of sale, the remaining amount still unpaid on and secured by the mortgage, subject to which the sale is made, and the rate of interest to accrue on same. If, during the time to redeem from the sale, any additional or other item, other than interest at the rate so stated in the certificate, shall attach to such amount subject to which the sale was made, or any change shall occur in such amount or the rate of interest thereon, the facts with respect thereto shall be set forth by affidavit, made and recorded, and a copy furnished the sheriff, in accordance with the provisions of section 582.03, and the provisions of that section shall apply thereto.