
37 Cal.2d 609 (1951)
ALEX KESSLOFF, Appellant,
v.
EDWARD F. PEARSON et al., Respondents.
L. A. No. 21918. 
Supreme Court of California. In Bank.  
July 27, 1951.
 Aaron Sapiro and Hyman O. Danoff for Appellant.
 Louis Licht, Mitchell, Silberberg & Knupp and Arthur Groman for Respondents.
 SHENK, J.
 Upon the termination of a written contract of employment the plaintiff commenced an action for declaratory relief and an accounting. After issue joined the trial court sustained an objection to the introduction of evidence on the ground that the complaint did not state a cause of action for declaratory relief. The plaintiff appealed from a judgment dismissing the action.
 The complaint discloses the following:
 The defendants were engaged in the manufacture and sale of candy under the name of Pearson Candy Company. On July 1, 1944, the plaintiff and Edward F. Pearson, herein designated as the defendant, entered into a written contract whereby the plaintiff was employed to make candy and advance the interests of the company for which he was to receive his regular weekly salary, to be agreed upon orally, and 10 per cent of the "net profits earned by the Pearson Candy Co." The agreement specified that the plaintiff was to have nothing to do with the management of the business or of the employees, but that his duties were to be confined to candy making and its supervision. Profits were to be determined at the end of one year from the date of the contract and each year of renewal, and the plaintiff's share was to be paid to him by the company. The agreement was renewable by mutual consent each year for three years at progressively higher percentages of the profits--15 per cent for the second year, 20 per cent for the third year, and 25 per cent for the fourth year. The plaintiff continued in employment under the contract until July 1, 1948, and thereafter under different terms and conditions until February *611 26, 1949, when his employment terminated. At the close of the first and each succeeding year under the contract the plaintiff received from the defendant a sum represented to be his share of the profits. He was told that he was not entitled to an explanation as to how the sum was computed but was obligated to accept what the defendant in his own judgment determined was the proper amount. The plaintiff specifies large sums of money paid to various persons including Fannie Pearson, the defendant's mother who was not employed, in excess of $10,000 per year; G. Florence Permar in addition to regular salary in excess of $5,000 per year; Dan Pearson, a brother who was not employed except for a limited period, in excess of $40,000 in the aggregate; and the expenditure of large sums for automobiles and other articles for the defendant and the members of his family which had no connection with the business, all of which were improperly charged as expenses of the business before the computation of net earnings in arriving at the annual amounts due to the plaintiff under the contract. The plaintiff has been denied access to and has been unable to examine the books of the company. On termination of the employment he attempted to obtain a correct statement of the earnings and expenditures during the period of the contract but the defendant refused to furnish any statement, account or explanation of the alleged excess payments. The plaintiff alleged the existence of an actual dispute and controversy as to the proper computation of net profits in determining the amounts due to him. He asked for a declaration of the parties' rights and duties under the contract; for a full and complete accounting of the gross earnings and business expenditures of the company; for a determination of the net earnings and the amounts due to him; for judgment therefor, and any other relief to which he might be entitled.
 The defendants filed an amended answer. They admitted the contract, joined issue as to the matters of accounting and method of computation of net profits, and set up certain defenses. They alleged that the candy company was a copartnership consisting of Edward F. Pearson, Dan Pearson, Fannie Pearson, and G. Florence Permar; admitted that the copartners withdrew various amounts representing their shares of the profits; alleged the propriety of deductions therefor and of profits from jobbing operations, and denied that there were improper deductions from gross earnings before the computation of the plaintiff's share of net profits. The defendants alleged *612 other defenses including insufficiency of the complaint to state a cause of action; illegality of the agreement as in violation of the Stabilization Act of 1942; estoppel, ratification and waiver; account stated; unclean hands because of the alleged violation of the Stabilization Act; and laches. The defendants sought a declaration that the contract was illegal and void and that the plaintiff had received all sums due to him thereunder. The defendants also filed a cross-complaint for reformation of the contract alleging that by mutual mistake it did not express the true intention of the parties as to how the percentage compensation to the plaintiff was to be computed; that it did not truly identify the parties to the writing; that the parties intended that there should be deducted from operating profits a reasonable compensation for the services and capital contributed by the partners and the individual income taxes paid by them; and that the intention was that the plaintiff should not participate in the jobbing business and profits as distinguished from the candy making business. The plaintiff filed an answer to the cross-complaint.
 At the commencement of the trial the court overruled an objection to the introduction of evidence. Evidence was received. Thereupon the court revived the objection and sustained it on the ground that the complaint did not state a cause of action for declaratory relief. In its own language the court conceded the existence of an actual controversy but concluded that since ultimately the only judgment which could be rendered was one for a sum of money, declaratory relief was not the proper "form of action."
 In 1921 sections 1060-1062 were added to the Code of Civil Procedure whereby either alone or with other relief, in cases where an actual controversy existed, a declaration of the mutual rights and obligations of persons under a written instrument or a contract might be given and might be had in advance of a breach ( 1060). The court could refuse to exercise the power in cases where it was unnecessary or improper at the time under all the circumstances ( 1061). The remedy was cumulative and did not preclude a party from obtaining additional relief based upon the same facts ( 1062). In 1927 section 1062a was added to provide that the trial of actions for declaratory relief should take precedence over actions as to which precedence was not provided.
 In sustaining the objection to the introduction of evidence the court assumed to exercise the power to refuse declaratory relief pursuant to section 1061 and followed the exercise of *613 that power by a judgment of dismissal. The question is whether the court's action was proper.
 [1] The discretion to be exercised pursuant to section 1061 is not unlimited. It is a legal or judicial discretion subject to appellate review, and declaratory relief must be granted when the facts justifying that course are sufficiently alleged. (Columbia Pictures Corp. v. DeToth, 26 Cal.2d 753, 762 [161 P.2d 217, 162 A.L.R. 747].) [2] Refusal is limited to cases where a declaration of rights and obligations would be unnecessary or improper at the time under all the circumstances. The determination rests on the facts in each case.
 The pleadings presented, and the trial court was of the view that there existed, an actual controversy as to the terms and construction of the alleged contract. But the court concluded that since the contract had terminated the plaintiff could not sue for the declaratory relief and thus procure a trial on the preferential calendar because he could obtain all essential relief in an action for an accounting and money judgment.
 [3] The code sections provide for declaratory relief in advance of breach. This salutary relief is procurable so that parties may know their rights and obligations where a controversy arises before a breach or violation occurs. (For such cases see Henderson v. Oroville-Wyandotte Irr. Dist., 207 Cal. 215 [277 P. 487]; Maguire v. Hibernia S. & L. Soc., 23 Cal.2d 719, 733-734 [146 P.2d 673, 151 A.L.R. 1062]; California Physicians' Service v. Garrison, 28 Cal.2d 790 [172 P.2d 4, 167 A.L.R. 306].) [4a] It is true that under the circumstances here disclosed a breach of the alleged contract has occurred and the plaintiff may be entitled to an accounting and to a money judgment. The judgment which he may recover could therefore be afforded in an action for an accounting where questions as to the terms and construction of the contract would become triable issues. (Nelson v. Abraham, 29 Cal.2d 745 [177 P.2d 931].) Therefore it may be said that the trial court was correct in concluding that all the relief sought could be had in an action for an accounting. But the court was in error in dismissing the action on the general ground of insufficiency of the complaint. This is so for the reason that the complaint in any event states a cause of action against the defendants for an accounting pursuant to the alleged contract and for a money judgment. [5] In this latter connection if it appears that the plaintiff has mistitled the action as in declaratory relief for the sole purpose of obtaining a *614 preference on the calendar, the court has the power to prevent the accomplishment of that purpose by appropriate order or procedure.
 [4b] In Columbia Pictures Corp. v. DeToth, supra (26 Cal.2d 753, at 761), it was recognized that the plaintiff's right to proceed was not foreclosed by the fact that the contract had been breached and that other remedies were available. It was not suggested that if the alternative relief was sought and was procurable in the action before it the court could entirely refuse to entertain the cause. In reversing a judgment of dismissal on sustaining the demurrer in Lord v. Garland, 27 Cal.2d 840, 852-853 [168 P.2d 5], we said that a general demurrer should be overruled if, upon any theory, the complaint stated a cause of action. (See, also, Johnson v. Clark, 7 Cal.2d 529, 536 [61 P.2d 767].)
 The foregoing sufficiently demonstrates, without extending the review or multiplying citations, that the plaintiff was and is entitled to a trial and a judgment on the issues framed by the pleadings.
 The judgment is reversed.
 Gibson, C.J., Edmonds, J., Carter, J., Traynor, J., and Schauer, J., concurred.
