If the debt for which the mortgage, lien, or encumbrance is held is not all due, as soon as sufficient of the property has been sold to pay the amount due, with costs, the sale must cease; and afterward, as often as more becomes due, for principal or interest, the court may, on motion, order more to be sold. But if the property cannot be sold in portions without injury to the parties, the whole may be ordered to be sold in the first instance and the entire debt and costs paid, there being a rebate of interest where such rebate is proper.
§ 71-1-226, MCA