
55 Wis.2d 642 (1972)
201 N.W.2d 66
CITY OF KENOSHA, Appellant,
v.
UNIFIED SCHOOL DISTRICT No. 1, CITY OF KENOSHA and TOWNS OF PLEASANT PRAIRIE and SOMERS, KENOSHA COUNTY, Respondent.
No. 170.
Supreme Court of Wisconsin.
Argued September 6, 1972.
Decided October 3, 1972.
*644 For the appellant there was a brief by Michael S. Fisher, city attorney, and Terry L. Constant of Kenosha, and oral argument by Mr. Fisher.
For the respondent there was a brief and oral argument by Paul F. Wokwicz of Kenosha.
HALLOWS, C. J.
The sole issue is the meaning of the phrase "at a price equal to the principal amount of the then outstanding obligations of such city issued for such school purposes" appearing in sec. 40.807 (4a) (b), Stats. 1965,[1] which statute the parties stipulated to be applicable to the facts.
*645 Prior to July 1, 1965, Kenosha operated a city school district. Between that date and April, 1967, the towns of Pleasant Prairie and Somers were joined to the city school district. On April 5, 1967, the electors of the three municipalities created the respondent Unified School District No. 1 which is composed of the city of Kenosha, the towns of Pleasant Prairie and Somers. Upon the creation of the respondent school district, sec. 40.807 (4a) (b), Stats. 1965, became operative. Under this section all school property when operating under the Kenosha school plan was required to be sold by Kenosha to the school district at a price equal to the principal amount of the then outstanding obligations of Kenosha issued for such school purposes. On October *646 2, 1967, Kenosha and the school district entered into an agreement wherein Kenosha agreed to transfer the school property in exchange for the school district's promissory note in the amount of $12,392,946.81, which the school district claimed to be the amount owing. The agreement left open for determination the question of whether the principal amount of the outstanding obligations, as claimed by Kenosha, was owing and this suit was brought to determine that question.
On December 31, 1967, Kenosha had outstanding bonds relating to school purposes, of which two specific schoolpurpose bond issues were issued prior to 1955, and nine corporate multipurpose bond issues were issued after July 1, 1955, and prior to April, 1967. Of these multiple-purpose bonds totaling $36,336,000, $14,720,000 was for school purposes. The maturity of these bonds was paid off over the years by means of an irrepealable tax levy sufficient to cover the annual interest and the maturing maturities. In the accounting practice used by Kenosha prior to 1967, the payments of the principal maturities of these multipurpose bonds were not apportioned to the various purposes in proportion to the amount borrowed for such purpose, but rather the payments on the early maturities were apportioned to such purposes as to construction of sewers and other capital improvements. The result of such apportionment was to leave proportionately a larger book debt owing for school purposes than for the other purposes included in the bonds.
It is the contention of Kenosha that the amount of outstanding bonds for school purposes is to be determined by its method of accounting and as shown on its books; while it is the contention of the school district that the outstanding bonds for school purposes in the multipurpose bonds should be the amount determined by apportioning to the respective purposes of the bonds the *647 annual payments and interest in the proportion those purposes bear to the total amount of the particular bond issue. It was this view the trial court took and we think correctly so.
The language of the statute was drawn contemplating specific school bonds and not multipurpose bonds, and if the procedure used by Kenosha prior to 1955 of issuing separate bonds for school purposes had been continued there would be no difficulty in determining the principal amount outstanding of such bonds. The problem arises because multipurpose bonds were used and because Kenosha in retiring the bonds did not prorate the payments on its books to all the purposes.
The legislative history of this statute sheds no light upon its meaning.[2] The statute is ambiguous as applied to the facts and must be construed to work a reasonable and just result in its application rather than an unreasonable one.[3] We think a reasonable interpretation of the language of the statute means it is the principal amount of the obligations which are outstanding in fact or should be shown to be outstanding on its books for school purposes. What amount in fact is outstanding is not necessarily determined by a method of bookkeeping or accounting used by a city. A city should not be allowed to gain an advantage for school purposes by the use of multipurpose bonds; nor should a school district *648 on the other hand gain an advantage when a city apportions payments on early retirements to school purposes. Kenosha contends: (1) If its records and method of determining outstanding obligations for various purposes is not accepted, the taxpayers of the city of Kenosha will be injured, and (2) their budgetary procedure was lawful for other purposes and therefore should be accepted for the purposes of this section.
We find no merit in the claim the taxpayers of the city of Kenosha will be injured if its accounting method is not recognized. The taxpayers will pay no more for school purposes and the retirement of bonds than the bond agreements require. The irrevocable levy for the purpose of retiring the multipurpose bonds provided in sec. 67.05 (10), Stats. 1965, requires the same amount of tax regardless of how the city apportions the amount of that tax for budget purposes. The budgetary procedure required by secs. 40.813 (2) and 65.90, Stats. 1965, is not necessarily applicable to the construction of sec. 40.807 (4a) (b), Stats. 1965. The budgetary procedure does not call for retirements but merely for the listing of indebtedness generally and such budget did not fix the outstanding obligations for the purpose contemplated by this section and should not be controlling.
The irrevocable assessment law required an assessment to retire the multipurpose bonds and it should naturally follow that the retirements should be prorated among all purposes of each bond issue in the proportion which each purpose bears to the total purposes, unless language in the bonds or other agreement relating thereto provides the retirements are to be allocated differently. We do not think a city official, such as a director of finance, has the power to bind the city or third parties by his allocation of maturities where there is no basis in a contract, in a prior ordinance or otherwise for such *649 procedure. Neither he nor a city can determine the meaning of a statute by adopting an accounting procedure.
By analogy this court has held that "book value" is not necessarily the value which is entered by an accounting method on the books of a corporation but rather is the in-fact value predicated on the market value of the assets of the corporation. Whitman v. Whitman (1967), 34 Wis. 2d 341, 149 N. W. 2d 529. Likewise, in McDonald v. McDonald (1972), 53 Wis. 2d 371, 192 N. W. 2d 903, this court said agreements cannot be changed by accounting methods and the accounting records were not necessarily determinative of legal rights. So in this case we cannot read the language of sec. 40.807 (4a) (b), Stats. 1965, to mean that the principal amount of the outstanding obligations of a city issued for school purposes is necessarily the amount the city has on its municipal books for that purpose. In most cases the amount may be what the city's books show, but the statute does not make the city's books exclusive. The language of the statute means the principal amount in substance which, in justice and in fact, is outstanding for school purposes, not the amount determined in form by an accounting method.
We point out again[4] that in a suit for declaratory judgment a complaint should not be dismissed because the declaration of rights is adverse to the plaintiff. When the judgment in a declaratory judgment action declares the rights on the complaint, the complaint should not be dismissed. The complaint in a suit should not *650 be dismissed if the merits are decided. Dismissal is proper when for a valid reason the merits are not reached and the suit should not be entertained. The lower court's judgment should be modified to eliminate the dismissal of the complaint.
By the Court.The judgment appealed from is modified to eliminate the dismissal of the complaint and, as modified, is affirmed.
NOTES
[1]  "40.807 Reorganized city school district. . . .

"(4a) (a) When a unified school district is created, . . .
"(b) All school property other than vocational school property of a city or city school district then operating under the city school plan and situated in the unified school district at the time of its creation; and all school property of any city or city school district which shall hereafter abandon the city school plan in favor of a common or unified school district; and all school property of any city or city school district which has heretofore abandoned the city school plan in favor of a common or unified school district; shall be sold by such city or city school district to the unified or common school district which thereafter shall assume the operation of the city schools at a price equal to the principal amount of the then outstanding obligations of such city issued for such school purposes. The unified school district or common school district may issue its bonds or promissory notes pursuant to ch. 67 to pay the cost of purchasing such school property. The city shall deposit the proceeds of the sale of the school property in the sinking fund or funds created for the payment of its obligations issued for school purposes, and the indebtedness of the city shall, for purposes of computing its legal debt limit, be deemed to be reduced by the amount of such deposit. The municipal treasurer shall invest these sinking fund moneys in the name of the city in compliance with s. 66.04 (2). Bonds and notes issued by school districts for the purposes provided in this subsection shall not be subject to referendum. The purchase agreement shall include an irrevocable clause providing that the school district shall pay annually to the city a sum of money equal to the amount in which the interest received by the city on account of the investment herein required is less than the amount of interest paid by the city on the bonds of the city for school purposes other than vocational schools." (This section is now sec. 120.58, Stats., which was re-enacted in substantially the same form.)
[2]  The legislative reference library file on this section indicates that earlier drafts of the bill read: "Any outstanding indebtedness for school purposes of a city abandoning the city school plan . . . shall be an indebtedness of the . . . unified school district thereby created." Substitute Amendment No. 1, A., to Bill 449, A (1959). While the change to the language used in the statute may indicate the legislature did not intend the unified school district was to step in the shoes of the city school district, it in no way illuminates the legislative intent with reference to corporate-purpose bond indebtedness.
[3]  See State ex rel. McGrael v. Phelps (1910), 144 Wis. 1, 128 N. W. 1041.
[4]  City of Milwaukee v. Milwaukee County (1965), 27 Wis. 2d 53, 133 N. W. 2d 393; Odelberg v. Kenosha (1963), 20 Wis. 2d 346, 122 N. W. 2d 435; Liddicoat v. Kenosha City Board of Education (1962), 17 Wis. 2d 400, 117 N. W. 2d 369; David A. Ulrich, Inc. v. Saukville (1959), 7 Wis. 2d 173, 96 N. W. 2d 612; Denning v. Green Bay (1955), 271 Wis. 230, 72 N. W. 2d 730.
