The plaintiffs were copartners doing business under the firm name of Heegaard & Co. It is alleged they sold and delivered to the defendant, at its special instance and -request, merchandise valued at $400, and that there is a balance due them on said sale, which the defendant has refused to pay. The original answer admits that the plaintiffs were copartners and doing business under the name of Heegaard & Co., but deny they are owing them any balance. Upon the trial of the issues' thus made, after the plaintiffs had introduced all of their evidence in support of the complaint, and the defendant had submitted all of its evidence in bar of the action, the defendant introduced a witness whose testimony tended to show that the plaintiffs had failed to file in the office of the clerk of the circuit court of Coding-' ton county a certificate in relation to the partnership of Heegaard & Co., as required by sections 4066,4068, Comp. Laws, stating the names in full of the persons composing such partnership, and their place of residence. This evidence was admitted at the time it was offered, without objection. The defendant then rested its case, and asked the court-to direct a verdict upon all the issues, in favor of the defendant. This motion was overruled. The plaintiffs then moved to strike out all the testimony in relation to the nonfiling of any certificate by the plaintiffs in the office of the clerk of the circuit court (1) because, under the pleadings in the action, the answer of the defendant admits the copartnership of the plaintiffs, and that no pleading involved in the action justifies the introduction of that evidence; (2) because, in order to render the evidence competent, the matter stated in the sections of the Compiled Laws above referred to must be specifically pleaded. This motion of the plaintiffs was overruled. The defendant then asked leave to amend the answer so as to conform to the proof *572as introduced on this point. This motion was granted. Before this amended answer was filed, the defendant asked the court to direct a verdict in its favor. Before a decision on the motion was rendered by the court, the amended answer was filed. The plaintiffs then moved to have it stricken from the files — First, because it is too late, after evidence has been introduced, to file an amended answer which in its nature is a plea in abatement; second, because the defendant has shown no cause or sufficient excuse for the delay in filing its amended answer or plea in abatement until after the issues had been tried upon the original pleadings. The motion to direct a verdict, and the motion to strike out the testimony in relation to filing the certificate, were overruled. The plaintiffs then interposed a demurrer to the amended answer. This was also overruled. The court then, upon its own motion, dismissed the action upon the alleged facts as shown under the amended answer. From this judgment of dismissal this appeal is taken.
The first question presented on the appeal is whether there is a final judgment in the cause from which an appeal will lie. The entry in the record is as follows: “By the Court: The judgment is that the action be, and is hereby, dismissed.” It is true that this is not as formal as it might be, but by this order of the court the cause was entirely ended, and out of court. It was dismissed against the will or wish of the plaintiffs, and was a finality, as far as they were concerned. To hold that this is not a final judgment would be looking more to form than substance. The abstract states “the action is hereby dismissed,” and we are not to presume that the dismissal was not effectual and final. In this view we are sustained by several eminent-authorities. Judge Elliott, in his valuable work on Appellate Jurisdiction, (page 75,) says: “Form is not a matter of much importance in determining whether a judgment is or is not final. If the controversy Is ended between the parties so far as the court can end it, then the judgment is final, regardless of mere matter of form. This must necessarily be true, since the order terminates the litigation in the court where it is pending. Nothing more can be done, except, perhaps, prepare for an appeal. It is obvious that under this *573rule an order dismissing a case over the objection of the plaintiff may constitute a final judgment.” In the case of Koons v. Williamson, 90 Ind. 599, where an appeal was taken from an order dismissing a cause of action, the court say: “The appellants contend that there was no such judgment in the case as can be appealed from. We think otherwise. The judgment of the court, as stated in the record, is in these words: 'The cause of action is dismissed, at the cost of the plaintiffs.’ The entry of judgment is not as formal as it might be, but the form of the entry expresses in the fewest words just what the court adjudged and did. The judgment of dismissal, as expressed in the record, is sufficient and valid, and the judgment for costs is in the usual form.” See. also, Bowie v. Kansas City, 51 Mo. 459; Scriven v. Hursh, 39 Mich. 98; Lines v. Brenner, 52 Ind. 195; Stoppenbach v. Zohrlaut, 21 Wis. 385; Rogers v. Russell, 11 Neb. 361, 9 N. W. Rep. 547; Murdock v. Martin, 132 Pa. St. 86, 18 Atl. Rep. 1114; Insurance Co. v. Green, 52 Miss. 332. Our own judgment, aided by the light of the above authorities, leads us to say that this objection of the defendant is not well taken. The judgment, as shown by this record, is sufficient upon which to base an appeal.
The assignment of errors presents but one other question for determination, viz.: “Should a trial court allow a defendant to amend his answer during the trial of a cause, to make it conform to the evidence offered, when such amended answer entirely changes the issues as raised in the original pleadings? and, if such an amendment is allowed, is it an abuse of discretion on the part of the court, entitling the defendant to a reversal?” Under our Code of Civil Procedure the most ample provisions exist for the correction of errors and mistakes in pleadings. One of the general provisions is: “The court may, before and after judgment, in furtherance of justice, and on such terms as may be proper, amend any pleading, process, or proceeding by adding or striking out the name of the party, or by correcting a mistake in the name of a party, or a mistake in any other respect, or by inserting other allegations material to the case; or when the amendment does not change substantially the claim or defense by conforming the pleading or proceeding to the facts proved.” Comp. Laws, § 4938. *574This provision is fonnd to be substantially the same in the Codes of New York, California, Ohio, Colorado, Kansas, Oregon, Nebraska, Minnesota, and Wisconsin. It is also further provided that the court must in every stage of an action disregard any error or defect in a pleading or proceeding which does not affect the substantial rights of the adverse party. Comp. Laws, § 4941. The discretion of the court in relation to amendments or in disregarding any error or defect in the pleading will not be reviewed unless the amendment allowed changes substantially the claim or defense, or when the error or defect in the pleading affects a substantial right. When it is apparent upon the face of the record that the parties have had a fair trial, that neither party has been prejudiced by reason of the amendment to a pleading or by reason of a defect or error, and that substantial justice has been done, a judgment should not be reversed; but, on the contrary, when the amendment changes the entire issues so that plaintiff has either been wronged or deprived of a substantial right, it is beyond the discretion of the court to allow the amendment to be made, unless the adverse party is- given time to meet the new allegation, and given such terms as will in part compensate him for the negligence or delay -of the other party. While the allowance of amendments to pleadings is a matter largely within the discretion of the court, yet .such discretion should not be- so liberally used as to result in injustice or hardship to litigants. Amendments to pleadings are only allowable in furtherance of justice; never for the purpose of defeating it. In the case at bar the amended answer set up .new matter, which, in its effect, if true, would work a dismissal ,of the cause of action. This was allowed after the issues as formerly pleaded had been tried, and, so far as the record discloses, it contained matter which was known to the defendant at the time the original answer was filed, and, if the defendant desired to take advantage of it, it should have been pleaded at first; if not, the plaintiffs could with good reason consider it as waived, unless the fact was unknown to the defendant, — which does not so appear in this record. The statute of California in relation to the filing of a certificate setting forth the names of persons composing fictitious firms is identical with our own, with the excep*575tion that it does not contain a proviso like onrs. The manner in which advantage shall be taken of the failure of a partnership to comply with its requirements is well settled by the supreme court of that state. In the case of Phillips v. Goldtree, (Cal.) 13 Pac. Rep. 314, the court say: “This objection must be taken by demurrer, if the ground for it appears in the complaint, or by answer if it does not] otherwise it is waived.” In the same case, Judge Thornton, specially concurring.'says:' “The failure to file the certificate required by section 2466 of the Civil Code was not set up by the answer. Such a defense must be specially pleaded when, as in this case, there is no averment in the complaint in relation to the filing of the certificate.” In the case of Sweeney v. Stanford, (Cal.) 8 Pac. Rep. 444, the court say: “Failure of partners to comply with this law in regard to fictitious names must be pleaded in order that the defendant may take advantage of the defect. If the complaint does not contain allegations showing that this law has been complied with in this respect, the defect, to avail the defendant, must be set up by him as a defense to the action. In either case the action abates only, and is not a bar to another action properly brought.” Without further citation of authorities, we can say the only penalty attached by the Code for a failure to comply with this statute is a legal incapacity to maintain an action upon “any contract or transaction” had in the partnership named. There is no disability to make contracts or to have transactions. The objection is to the legal capacity to sue. The proviso attached to our statute removes-this incapacity as soon as the firm at any time has complied with its terms, and this compliance relates back to cover any contract or transaction entered into prior or subsequent to the compliance. In the case at bar the wrong and injustice in allowing the answer to be amended in this particular is apparent upon the face of the record. Had the fact of noncompliance with the statute been pleaded in the original answer, as the supreme court of California says it must, and that fact had been dominantly brought to the attention of the plaintiffs, the cause could have been abated, the requirements of the statute have, been fulfilled .by the plaintiffs, and a new suit instituted. The expense of proceeding fúr*576ther in the canse, or preparing for trial, or procuring witnesses, or time spent in the trial, could have been saved. But the defendent withheld these facts, tacitly giving the plaintiffs the assurance that they were waived, pleaded in bar upon the merits, and, after the evidence had been submitted on both sides upon the merits, this new matter was interpolated into the case, and defendant asked the court to allow its answer to be amended to conform to this proof, which was done. It is a well-settled principle of practice, both at common law and under the Code, that amendments will not be allowed that, in effect, substitute new causes of action. Another principle equally well established is that amendments are only allowed in furtherance of justice; never to defeat it. In the case of Cooke v. Spears, 2 Cal. 409, the court, in considering the question of an amendment in relation to pleading the statute of limitation, say: “When the plea of the' statute of limitation is claimed as a mere legal right, it must be pleaded in the first instance, and has no days of grace thereafter.” In discussing this question the court, in its opinion says: “The object of the statute in reference to amendments is unquestionably in furtherance of justice. So far as that goes, courts ought to be disposed to treat such applications favorably. In most instances it is a matter of course that they should be granted; but courts hare not been inclined to look kindly upon statutes of limitation, except when they are used as instruments of justice, and not strategy. * * * The record does not disclose that any attempt was made by the defendant by affidavits or otherwise, to show that it was necessary to permit the amendment in order to obtain justice. It is claimed solely as a legal advantage, to which at one time he would have been entitled, but it is a wise conservatism that it should have but its day in pleading, and no days of grace of right beyond the extent of justice. If it existed in this case it was not shown.” The pleading of'*the statute of limitation after a plea in bar was not allowed. The above reasons and principles apply with great force to the case at bar. There is no showing made by the defendant in this case of any diligence or that the facts set up in the amended answer were not known to the defendant at the time the original answer was filed. *577There is no explanation why it was delayed, or why these new facts were, not incorporated into the original answer. The supreme court of Illinois, in the case of Fielding v. Fitzgerald, 130 Ill. 437, 22 N. E. Rep. 592, upon the question of allowing amendments, says: “It would, to say the least, he but trifling with courts to allow a party, as here, after proceeding to the trial of the issue presented by his answer, and, being defeated thereon, upon his own request, unsupported by any evidence of mistake in his former answer, to take the admissions, and present a new issue. * * * Such a practice would lead to oppression, and it is clearly beyond any discretion vested in the court.” The order of the court in dismissing the action in the case under consideration was based upon the facts set up in the amended answer. The answer was allowed to be filed after the plea in bar had befen tried, and related to entirely new matter, which was not meritorious, and without any reason given why it had not been pleaded before. The facts are very similar to the case above cited, and its results were oppressive. The action of the court, both in allowing the amended answer to be filed and in the dismissal of the case, was error, and went beyond the reasonable discretion of the court, and worked an injustice for which the judgment should be reversed, and the case remanded for a new trial; and it is so ordered.
All the judges concur.