
129 N.W.2d 532 (1964)
CHICAGO AND NORTH WESTERN RAILWAY COMPANY, a Corporation, Plaintiff and Appellant,
v.
Bruce GILLIS, as Director of Taxation of South Dakota, et al., Defendants and Respondents.
No. 10113.
Supreme Court of South Dakota.
July 6, 1964.
*533 Woods, Fuller, Shultz & Smith, Sioux Falls, for plaintiff and appellant.
Frank L. Farrar, Atty. Gen., John P. Dewell, Asst. Atty. Gen., Pierre, for defendants and respondents.
ROBERTS, Judge.
This action for declaratory judgment was brought in the Circuit Court of Lincoln County by the Chicago and North Western Railway Company against the Commissioner of Revenue, the members of the State Board of Equalization, and the counties of Lincoln, Turner and McCook and their auditors and treasurers as representatives of all the counties in which the plaintiff had operating property during the year 1962. The action is grounded on the claim that the assessment of plaintiff's property for that year was in excess of its actual value and that the taxable value upon which levies were made and applied was discriminatory because the resulting tax was proportionately and relatively greater than that of owners of other property. The prayer in the complaint was that defendants be mandatorily directed to apply levies for property taxation for the year 1962 against 60 percent of the actual value of the plaintiff's property as finally ascertained and in the same manner as the property of other taxpayers. The answer of the defendants to the complaint, so far as necessary to consider, was that by reason of a prior action and the adjudication therein the rights of the parties to the present action were finally and conclusively determined and that plaintiff is barred from maintaining the herein action. The motion to dismiss the complaint was granted, the court being of the opinion that the prior adjudication was res judicata and a bar to the prosecution of the present action.
The question presented is whether the decision of this court in Chicago and North Western Railway Co. v. Gillis, S.D., 118 N.W.2d 316, is res judicata since it involved the evaluation of the entire operating property of the plaintiff for the year 1962 by the defendants, the Commissioner of Revenue and the State Board of Equalization. In a companion case, Chicago, Milwaukee, St. Paul & Pacific R. Co. v. Gillis, S.D., 118 N.W.2d 313, we held that under the provisions of the statute (SDC 1960 Supp. 57.0334) providing that "All property shall be assessed at its true and full value in money but only sixty per cent of such assessed value shall be taken and considered as the taxable value" the 60 percent factor is applicable to railway operating properties. In the prior decision between the parties in the pending action, this court while it recognized the applicability of the 60 percent factor held that plaintiff railroad was not entitled to relief since there was no evidence showing that its operating property was assigned a taxable value in excess of 60 percent of its true and full value.
The Commissioner of Revenue is required in July of each year to assess the operating property of each railroad in the state at its true and full value. The Commissioner in the valuation of the property of a railroad must first determine the value of the entire system and in so doing take into consideration the market price of its stocks and bonds and the net operating income of the system during the five calendar years preceding the assessment and other material information. The Commissioner must then decide the portion of the operating property that should be allocated to this state in arriving at the equalized assessment. SDC 57.1305. The statute does not prescribe a definite formula or rule for ascertaining the value of the operating property of a railroad. If evaluation includes consideration of elements specifically required *534 by statute, the Commissioner of Revenue may follow any method by which a fair and just determination of values may be reached. Bailey v. Megan, 8 Cir., 102 F.2d 651.
The parties in the original proceeding in this court entered into a stipulation as to the facts of the assessment and equalization and the method employed by respondents. It was stipulated that the 1962 system value of the operating property of the appellant in this state in the amount of $12,010,546 was arrived at "in the following manner and on the basis of the following figures which were furnished to the State of South Dakota by the Petitioner and which figures are hereby stipulated to be correct:


   Percentage of the entire system assigned to the State of South
   Dakota = 3.68 percent
   Total system stock and bonds                                        $171,202,000
   System net revenue, capitalized at 7 percent (which was multiplied
   by 3.68, the percentage in South Dakota to the system)                61,074,000
   Total stock and bonds allocated to the State of South Dakota
   (3.68%)                                                                6,300,234
   Net revenue capitalized at 7 percent allocated to the State of
   South Dakota                                                           2,247,523
                                                                        ___________
   (Which two figures were added together) TOTAL                        $ 8,547,757
   Divided by two giving a figure of                                      4,273,879
   (For the average of the total of stock and debt, and capitalized
   net revenue)
   To this figure was added 331/3 percent of the Public Utilities
   Commission depreciated cost of
   * $23,210,000 or                                                       7,736,667
                                                                      ______________
   Resulting in what was called the tentative value in the
   amount of                                                           $ 12,010,546
   (* Developed by the Public Utilities Commission)"

The so-called "tentative" or system value of appellant's property in this state for purposes of taxation was ascertained in the same manner as it had been in the past ten years. As was pointed out in the companion case, Chicago, Milwaukee, St. Paul & Pacific R. Co., the system value of $12,010,546 must be accepted as the true and full value of the operating property of the appellant for 1962. The statutory factor of 60 percent was not specifically applied to such amount. It appears from the stipulated facts that $6,579,984 was taken as the taxable value which is approximately 54 percent of the assessed value. The record did not sustain appellant's claim that the method adopted by respondents resulted in a taxable value in excess of the 60 percent of the true and full value and application for writ of mandamus was accordingly denied. In the Chicago, Milwaukee, St. Paul & Pacific R. Co. case, it appears from the stipulated facts that the operating property of the railroad in this state had been assigned a taxable value in excess of 60 percent of the true and full value and judgment was rendered giving effect to the statutory factor.
It is well established that a final judgment on the merits is a bar to any future action between the same parties or their privies upon the same cause of action settling not only every issue actually presented to sustain or to defeat the right asserted, but every issue that might have been raised *535 in the first action. Howard v. City of Huron, 6 S.D. 180, 60 N.W. 803; Keith v. Willers Truck Service, 64 S.D. 274, 266 N.W. 256, 104 A.L.R. 1471; Ramsey Twp., McCook County v. Lake County, 68 S.D. 67, 298 N.W. 356; Hartman v. Home Owners' Loan Corp., 69 S.D. 160, 7 N.W.2d 720; Carr v. Preslar, 73 S.D. 610, 47 N.W.2d 497; Sodak Distributing Company v. Wayne, 77 S.D. 496, 93 N.W.2d 791. A judgment on the merits is one which is based on legal rights as distinguished from mere matters of practice, procedure and jurisdiction. 30A Am.Jur., Judgments, § 348. The policy upon which the doctrine of res judicata is founded applies with equal force to tax cases. As said in Fairmont Aluminum Co. v. Commissioner of Int. Rev., 4 Cir., 222 F.2d 622: "When taxpayer has invoked the judgment of the court with respect to his claim, he is bound by an adverse judgment, whether this has resulted from the fact that the law is against him, from failure to produce sufficient proof or from failure to include sufficient facts in a stipulation."
The issue presented for decision in the original proceeding in this court was whether the Commissioner of Revenue properly determined the taxable value of appellant's property by application of the statutory 60 percent factor. This in turn depended upon a determination of the true and full value of the property. The statute (SDC 1960 Supp. 57.0334) as we have indicated provides that all property shall be assessed at its "true and full value", but only 60 percent thereof shall be taken and considered as the "taxable value". Concerning the same stipulated facts with exception of amounts in the Chicago, Milwaukee, St. Paul & Pacific R. Co. case, this court as foundation for issuance of its writ of mandate to reduce the taxable value of the property of the railroad company held that the true and full value thereof was no different then the stipulated "tentative" or system value determined by consideration of the market price of stocks and bonds, capitalized net operating revenue and cost of operating property less depreciation.
Plaintiff in the former proceeding in this court is the party plaintiff in the present action and defendants occupy the same relation and defend in the same capacity in both suits. It is the same assessment and equalization of property that plaintiff is again seeking to question. We have pointed out that prior to argument and submission in the original proceeding a stipulation and agreement as to certain facts was made and entered into for the purposes of the proceeding. The assumption of original jurisdiction in a mandamus proceeding rests largely in the discretion of this court. Everitt v. Board of Com'rs of Hughes County, 1 S.D. 365, 47 N.W. 296; Annotation, 165 A.L.R. 1431. The parties may have pursued the course indicated in the belief that if issues of fact were involved this court would refuse to assume original jurisdiction. Plaintiff having joined in the stipulation is in no position to recede from its effect. The decision in the former proceeding was rendered on the merits and is distinguishable from situations where a judgment is rendered in favor of defendants because plaintiff sought a form of remedy not available to him or where the court refuses a preliminary writ or injunction in the exercise of a judicial discretion. The doctrine of res judicata as above stated does not only extend to matters which were determined, but also to any other matter properly involved which might have been raised and determined. In Cromwell v. County of Sac, 94 U.S. 351, 24 L.Ed. 195, frequently cited in support of the rule, the court said: "In the former case, the judgment, if rendered upon the merits, constitutes an absolute bar to a subsequent action. It is a finality as to the claim or demand in controversy, concluding parties and those in privity with them, not only as to every matter which was offered and received to *536 sustain or defeat the claim or demand, but as to any other admissible matter which might have been offered for that purpose. Thus, for example, a judgment rendered upon a promissory note is conclusive as to the validity of the instrument and the amount due upon it, although it be subsequently alleged that perfect defences actually existed, of which no proof was offered, such as forgery, want of consideration, or payment. If such defences were not presented in the action, and established by competent evidence, the subsequent allegation of their existence is of no legal consequence. The judgment is as conclusive, so far as future proceedings at law are concerned, as though the defences never existed. The language, therefore, which is so often used, that a judgment estops not only as to every ground of recovery or defence actually presented in the action, but also as to every ground which might have been presented, is strictly accurate, when applied to the demand or claim in controversy. Such demand or claim, having passed into judgment, cannot again be brought into litigation between the parties in proceedings at law upon any ground whatever." The present action comes within the rule. Plaintiff was not privileged to try the matter of the validity of its assessment and equalization piecemeal. If it be assumed that this court would have declined jurisdiction of a mandamus proceeding if the litigation had involved disputed and conflicting questions of fact in all substantial respects identical with those now urged, complete relief could have been first sought in the circuit court being constituted as the trial court in our judicial system, vested with original jurisdiction in all actions and causes in which jurisdiction shall not have been exclusively vested by law in some other court. The trial court ruled correctly.
The order appealed from is affirmed.
All the Judges concur.
