If such consent be not given, filed and entered as provided in the last section, at or before a judgment of sale is rendered, the court must ascertain and determine what proportion of the proceeds of the sale, after deducting expenses, will be a just and reasonable sum to be allowed on account of such estate, and must order the same to be paid to such party, or deposited in court for him, as the case may require.
Idaho Code § 6-528