Aсtion to foreclose mechanic’s lien and to recover money judgment. Under written agreement plaintiff agreed to build and construct a building or night club for defendants, which building was comрleted. He filed a complaint in four counts.- Count 1 was for the fair and reasonable value of his services performed and for the material bought for defendants; Counts 2 and 3 are аlternative statements of his claim for his own services and an alternative statement for material bought for defendant; Count 4 is an alternative statement of his claim for the total amount in which he pleads the written contract between the parties which specifically sets forth the nature of the" contract and the duties and liabilities of the parties.
The contract provides, in substance, that in consideration of 10 per cent of the total cost of the buildings and operations plaintiff would build the building, prepare preliminary sketches, detailed drawings and specifications, and give general supervision of all building operations; that plaintiff would segregate the various items of labor and material going into the building аnd award them as individual contracts according to his own judgment. It provides then for an audit, twice a month, of all labor, material paid or payable, subcontracts performеd, and that defendants then would pay plaintiff that amount and plaintiff would then pay all bills to date. The method of paying plaintiff’s compensation was under a graduated scale. The 10 per cent basic fee included all architectural services and is computed on the total cost of construction. In case defendants discontinued the work plaintiff was to recover 10 per cent of the estimated cost of the completed building, and should the building not be completed, then defendants were to pay plaintiff for the balance, four per cent of that total estimated cost. It then provided that it was agreed and understood that plaintiff was not a registered architect. Plaintiff seeks a judgment for $7,959.43, and foreclosure of his lien.
*235 Defendants answered the complaint, denied all allegations bnt admitted the due execution of the written instrument; alleged that plaintiff, at no time mentioned in his сomplaint, was a duly licensed contractor; and that the building was completed on February 21, 1946. By way of cross-complaint defendants alleged that they paid plaintiff $42,307.10, at which time he was not a licensed contractor, and they ask judgment against him in that amount.
In answer to the cross-complaint plaintiff alleges that the money was paid to him by defendants, not as аn independent contractor, but as defendants’ employee and that at all times defendants well knew that plaintiff was not a licensed contractor nor a licensed arсhitect.
A jury was empaneled to try the issues thus presented. Counsel for plaintiff made an opening statement to the jury, in substance as follows: He told them that his statement was not evidence “but simply to outline to you in a general way what the parties expect to prove”; “. . . Now I think the evidence will show . . . that Mr. Cash . . . has had considerable skill and experience in the preparations of plans and specifications for the building of structures. However, he is not a contractor and does not have a license as such, and neither is he what we would call a licensed architect. . . . He is what we might call an unlicensed architect”; that in 1940, defendants started using Mr. Cash’s advice and supervision in the remodeling of various places for them; that he believed the evidence would show that one contractor who started on the matter, sort of a general contractor, was not able to go through with it and another one was engaged; and “I believe the man who did most of the work, the general contractor on the place, will be shown to be a man by the name of Hutchinson, wh'o was a licensed contractor”; that Mr. Cash’s duties were confined to those of preparing plans and specifications and supervising the work and finding materials; that as the work prоgressed Cash would present bills from material people, presented his plans, and was paid, from time to time by defendants ; that defendants are defending themselves by saying that plaintiff did not have a license; and that “those are the issues.”
Defendants’ counsel then moved for a nonsuit under section 581, Code of Civil Procedure, and then argued that the pleadings, contrаct, and statement of counsel conclusively showed that plaintiff violated sections 5536 and 5537, and sections 7026-28-30-31 of the Business and Professions Code, *236 and by reason thereof was barred from a recovery. The motion was granted and judgment of nonsuit followed.
Plaintiff states in his brief that the sole issue or question of law presented is that since the complaint states four separate counts and that it is only in the fourth count that the contract is referred to, the court erred in granting the nonsuit upon the ground that plaintiff had no contractor’s license or сertificate to practice architecture, because, under his statement of the evidence sought to be proved and the pleadings, he may be able to establish that plaintiff was entitled to recover under some one or more particular counts if not under the count setting forth the contract or agreement; that even though the written agreement may be illegal or unenforceable he may enforce his demand or some portion of it without resorting to the contract, the bad being severable from the good. (Citing
Wayman Investment Co.
v.
Wessinger & Wagner,
Frоm a -reading of the written agreement and from counsel’s own statement to the jury as to the transaction here involved, it affirmatively appears that plaintiff’s right of recovery uрon any count must be based upon the written agreement pleaded. There is no other agreement suggested or referred to in the pleadings or statement to the jury. Therefore, the trial court was called upon to construe the written agreement according to its terms. Such is our duty too. The pleadings, the contract and statement of facts which cоunsel could rightfully prove affirmatively show that all the acts for which compensation is sought were performed pursuant to that agreement and by the terms of it plaintiff was to receive costs plus 10 per cent.
Counsel’s argument that he might establish by the evidence that plaintiff was not in fact the principal contractor is dispelled by the holding in
Payne
v.
De Vaughn,
It therefore does not appear that plaintiff’s claim for compensation as an agent of defendants or as an architect, as distinguished from that of a contractor, was severable, or if severable, that he was an unlicensed architect whose acts would
*237
permit him to recover as one coming within the exception set forth in section 5537 of the Business and Professions Code. (17 C.J.S., p. 291;
Kirman
v.
Borzage,
In
Phillips
v.
McIntosh,
Alvarado
v.
Davis,
Plaintiff cites such cases as
Payne
v.
De Vaughn, supra; Jones
v.
Wickstrom,
The public policy involved here has been determined by the Legislature; it is not a subject of debate in the courts.
(Howard
v.
State of California,
Judgment affirmed.
Barnard, P. J., concurred.
A petition for a rehearing was denied August 31, 1948, and appellant’s petition for a hearing by the Supreme Court was denied October 15, 1948. Shenk, J., Carter, J., and Schauer, J., voted for a hearing.
