“In all controversies at law respecting property the ancient mode of trial by jury is one of the best securities of the rights of the people, and ought to remain sacred and inviolable.” Const, of N. 0., Art. I, sec. 19.
“In all issues of fact, joined in any court, the parties may waive the right-to have the same determined by a jury, in which case the finding of a judge upon the facts shall have the force and effect of a verdict by a jury.” Const, of N. 0., Art. IY, sec. 13.
“Trial by jury may be waived by the several parties to an issue of fact in actions on contract, and with the assent of the court in other *535actions, (1) by failing to appear at trial, (2) by written consent, in 'person or by attorney, filed with, the clerk, or (3) by oral consent entered in the minutes.” C. S., 568.
“Any or all of the issues in an action, whether of fact or law, may he referred, upon the written consent of the parties, except in actions to annul a marriage or for divorce and separation.” 0. S., 572.
“Where the parties do not consent, the court may upon the application of either, or of its own motion, direct a reference, where the trial of an issue of fact requires the examination of a long account on either side. The compulsory reference under this section does not deprive either party of his constitutional right to a trial by jury of the issues of fact arising on the pleadings, but such trial shall be only upon the written evidence taken before the referee.” C. S., 573.
This action in which an issue of fact arises upon the pleadings has been referred to a referee, under C. S., 573, with direction that he take testimony and pass upon and find the facts as to all matters of account or accounting raised by the pleadings and report the same, with his conclusions of law arising upon the facts so found to the next term of the Superior Court of Columbus County. Defendant in apt time objected to the order of .reference and is therefore not deprived of his right to trial by jury of the issue of facts which he has joined with the plaintiff.
Having duly excepted to the order, and upon appeal assigned same as error, defendant presents to this Court, for review, the decision of the court below as a matter of law, contending that it was error to order a compulsory reference, for that the answer contains a general denial and sets up a plea in bar of plaintiff’s right to recover in this action. Defendant having objected to the reference, and excepted to the order signed by the judge, had the option to appeal at once, if he was so minded, or to await final judgment, having preserved his objection by exceptions noted in apt time. Pritchett v. Supply Co., 153 N. C., 344; Baker v. Edwards, 176 N. C., 229.
It appears from the pleadings in this action that on or about 1 June, 1923, plaintiff and defendant entered into a contract by which plaintiff agreed to advance to defendant the sum of $10,000, to enable defendant to pay off and discharge a chattel mortgage then outstanding upon his property and to carry on his business as a manufacturer of lumber; defendant executed his note to plaintiff for the amount advanced, due 1 June, 1924, and secured payment of same by a chattel mortgage on his sawmill outfit and personal property; defendant agreed to manufacture and ship to plaintiff lumber, in accordance with orders and specifications to be given by plaintiff; plaintiff agreed to sell said lumber, and after deducting commissions as agreed upon, and applying *536a portion of tbe proceeds to be determined as provided in tbe contract, to payment of defendant’s indebtedness to plaintiff, to pay tbe surplus, if any, to defendant.
Pursuant to said contract, defendant has manufactured and shipped to plaintiff a large quantity of lumber, and plaintiff .lias sold same. There is a controversy between tbe parties as to a settlement of tbe account growing out of these dealings, plaintiff contending that there is a balance due it, exceeding tbe amount of tbe note, defendant contending that tbe amounts received by plaintiff from sale of lumber shipped under tbe contract are sufficient to more than pay defendant’s indebtedness to plaintiff to which said amounts should be applied.
Defendant further alleges facts upon which he contends he is entitled to recover a large sum of money from plaintiff and prays for affirmative relief on account of plaintiff’s liability to him growing out of these facts.
Defendant having admitted the execution of the note sued on, the first issue of fact arising upon the pleadings is whether said note has been paid; the trial of this issue will necessarily require the examination of a long account of the dealings between the parties growing out of the contract, and extending over a year. The statement of account, attached to plaintiff’s reply as Exhibit A, shows that defendant shipped plaintiff 171 cars of lumber; that after deducting freight, discounts and commissions and after making adjustments, growing out of claims from purchasers for damages, shortage, etc., plaintiff received for said lumber $62,337.95; the debit items in said account, for checks and drafts number 51, and aggregate $72,423.11, leaving a balance due, according to plaintiff’s contention of $10,085.16.
It is true that defendant pleads in his answer that the note has been paid, and that the chattel mortgage is therefore null and void; but it clearly appears from his further defense that said plea is dependent upon and involves an accounting between plaintiff and defendant.
Defendant contends that the order of reference was erroneous because of his plea in bar. This Court has held, uniformly and consistently that when a good plea in bar is set up in the pleadings, until such plea is in some way disposed of, an order of reference, on objection made in apt time is erroneous and an immediate appeal will lie. Riley v. Sears, 151 N. C., 187.
It is held in Oldham v. Rieger, 145 N. C., 254, that a plea of the statute of limitations is a good plea in bar and should be disposed of before an order for accounting can be made.
An account stated is held to be a good plea in bar and that a compulsory reference should not be ordered until such plea is determined. Kerr v. Hicks, 129 N. C., 141; Jones v. Wooten, 137 N. C., 421. A *537plea tbat plaintiff has not complied with terms and provisions of a contract which are conditions precedent to liability of defendant must be submitted to a jury or otherwise disposed of before a compulsory reference for an accounting can be ordered. Bank v. Fidelity Co., 126 N. C., 320. A plea of sole seizin by reason of 20 years adverse possession by one alleged to be a tenant in common with plaintiff is a .good plea in bar, but a plea of sole seizin which by its very terms involves an accounting is not a good plea in bar. Duckworth v. Duckworth, 144 N. C., 620.
The “entire cause of action,” or the “whole action” between plaintiff .and defendant, as constituted by the pleadings in this action is not dependent on the issue as to whether the note secured by the chattel mortgage has been paid or not. Defendant alleges a cause of action .against plaintiff in his “further answer” and asks for affirmative relief, and plaintiff, in its reply denies the facts alleged as constituting this eause of action. The issues thus raised will clearly require the examination of a long account, involving many items and transactions, which will necessarily be the subject of controversy between the parties.
In Alley v. Rogers, 170 N. C., 538, Brown, J., writing for the Court, .says: “In those cases where this Court has held that a reference should not be made when there is a plea in bar, the plea constituting the bar has extended to the whole action, and the Court seems to have been particular to use the term “whole action” or “entire cause of action.” He cites many cases to support this statement.
It is clear that the note and chattel mortgage set up in the complaint, .and the contract alleged in the answer and reply, were parts of one transaction. It is equally clear that it was contemplated by the parties to this transaction that the note should be paid out of the .proceeds ■of the sale of lumber to be manufactured and shipped under the contract. There seems to be a controversy between the parties as to whether under the contract the balance arising from the sale of the lumber, after ■deducting commissions should be applied to any indebtedness due by ■defendant to plaintiff, or whether such balances should be applied only to payment of advancement, evidenced by note.and secured by chattel mortgage. An inspection of the written contract will probably determine this controversy.
The order of reference was not erroneous. The exception thereto is not sustained. The objection and exception, however, preserve defendant’s right to trial by jury after the report of the referee has been filed, provided he preserves this right in accordance with the practice approved by this Court in Baker v. Edwards, 176 N. C., 229, and cases cited therein by Justice Walker.
Affirmed.