then the municipality and such person, firm or corporation or utility district shall attempt to reach agreement in writing for allocation and conveyance to the municipality of any or all public utility functions, including, but not limited to, those set out in § 7-82-302, excepting the furnishing of natural or artificial gas or telephone service, and of all rights, duties, property, assets and liabilities of such person, firm or corporation or utility district so affected that justice and reason may require. If, within a reasonable time, the parties cannot agree in writing on allocation and conveyance, then either party may petition the circuit court of the district in which such area is located for a determination of value and damages suffered by such person, firm or corporation or utility district as a result of such municipal choice. If the court finds that it would be in the best interests of both the municipality and the person, firm or corporation or utility district furnishing utility services in the area in question, the court may, in its discretion, order the transfer to the municipality of the entire utility system, upon compensation being paid such person, firm or corporation or utility district in such amount and in such manner as may be determined by the court. Before any such municipality may initiate any negotiation or proceedings under this subsection (d) for the allocation and conveyance to the municipality of any or all public utility functions, such action shall first have been approved by a majority of the qualified voters of such municipality voting in a referendum on the question of such municipality acquiring and exercising such public utility functions. Such referendum shall be called by resolution or ordinance duly adopted by a majority of the governing body of such municipality, and shall be held by the county election commission upon request of such governing body not less than forty-five (45) days after the adoption of such resolution or ordinance and publication in a newspaper of general circulation in such municipality once a week for a period of three (3) weeks preceding such referendum. The votes cast in such election shall be counted and the results certified as provided by law for municipal elections generally and the qualification of voters in such referendum shall be the same as those required for voting in municipal elections generally. The municipality shall pay the costs of holding such referendum.