If the mortgage is given to secure a debt due by installments and is foreclosed before any one of the installments falls due and there is a surplus of funds as provided in Code Section 44-14-190, the court may retain the funds or order them to be invested to meet the unpaid installments.
OCGA § 44-14-191