
135 Cal.App.3d 451 (1982)
185 Cal. Rptr. 341
IMO DEVELOPMENT CORPORATION, Plaintiff, Cross-defendant and Appellant,
v.
DOW CORNING CORPORATION, Defendant, Cross-complainant and Appellant.
Docket No. 25820.
Court of Appeals of California, Fourth District, Division Two.
August 26, 1982.
*454 COUNSEL
Martin P. Eramo for Plaintiff, Cross-defendant and Appellant.
Johnsen, Manfredi & Thorpe, George A. Manfredi and Brien F. McMahon for Defendant, Cross-complainant and Appellant.
OPINION
McDANIEL, J.
Plaintiff IMO Development Corporation (IMO) has appealed from a judgment on the pleadings in an action brought for damages for breach of contract involving a conveyance of real property by defendant Dow Corning Corporation (Dow Corning) and for declaratory relief as to the validity of a waiver provision in a later contract. *455 Defendant for its part has appealed from that portion of the judgment awarding it attorneys' fees because it believes that the award should have been larger.
Dow Corning owned nine acres of unimproved real property, and entered into negotiations to sell it to IMO, a developer. In October 1975, the parties first entered into an agreement under which Dow Corning agreed to sell the property and to help IMO obtain financing for the purchase of the land by executing all necessary documents. An amendment to this agreement explicitly provided that Dow Corning's execution of the financing documents would in no way obligate it to repay the loans, that IMO would be responsible for all sums borrowed and that IMO would hold Dow Corning harmless for any liability incurred as a result of its execution of any financing documents.
To carry forward this agreement, IMO and Dow Corning then obtained a loan commitment from Farmers New World Life Insurance Company (Farmers). For some unexplained reason, the loan commitment from Farmers showed Dow Corning as the sole applicant and purported to obligate Dow Corning to repay the loan to be made. While an amendment to the loan commitment added IMO as a signator and guarantor, the documents continued to identify Dow Corning as the party principally liable for the loan. Because Farmers refused to amend the loan commitment to release Dow Corning from liability to reflect its agreement with IMO, Dow Corning rescinded the loan commitment by letter dated July 15, 1976.
Thereafter IMO obtained alternative financing from Phoenix Mutual Life Insurance Company at less advantageous terms than those which had been available from Farmers. However, the loan proceeds did not become available until November 1976, by which time title to the property had passed to IMO.
Before taking title IMO had begun to construct improvements on the property and incurred other obligations in promoting its development which became due on September 21, 1976. With reference to these obligations, various contractors, materialmen and lessors of equipment threatened to record mechanic's liens on the property and to interdict development.
On that same day, IMO and Dow Corning entered into a second agreement for the sale of the property and to settle all disputes arising *456 from the first agreement. The second, or sales agreement, also provided that Dow Corning would lend IMO $250,000 in order to continue development of the property. The agreement contained a waiver and hold harmless undertaking by IMO with reference to all its claims against Dow Corning arising out of any previous contracts or agreements for financing of the property.[1]
In November 1976, as earlier noted, IMO took title to the property and shortly thereafter sued Dow Corning to recoup the differential arising from the increased financing costs.
The first cause of action for breach of contract alleged that Dow Corning breached the first agreement by repudiating the loan commitment with Farmers. IMO's alleged damages consisted of certain loan deposit fees and additional costs incurred in obtaining the alternative financing. In the fourth cause of action, IMO sought a declaration that the waiver and hold harmless provision in paragraph 9 (c) of the sales agreement was invalid and thus unenforceable because it was allegedly obtained under economic duress. Among other things, the fourth count alleged: (1) that Dow Corning knew that IMO had begun development of the land into an industrial park; (2) that Dow Corning knew that various contractors and materialmen threatened to record mechanic's liens and cease construction work if the sums due were not paid; (3) that on September 21, 1976, Dow Corning knew that IMO could not borrow additional sums to pay the outstanding claims and on the same day Dow informed IMO it would transfer title and make a loan of $250,000 only if IMO would waive any claims it had against Dow; (4) that the parties then entered into the "Sales Agreement"; and (5) that consent to paragraph 9 (c), above noted, was obtained through duress.
Dow Corning cross-complained seeking to recover $250,000 on the promissory note executed in accordance with the sales agreement. In its answer, IMO admitted it held title to the property and its failure to repay *457 the $250,000 loan. IMO pleaded an affirmative defense based on the unenforceability of the waiver clause.
Dow Corning moved for judgment on the pleadings on the grounds that the fourth cause of action: (1) sought a partial rescission which is an improper remedy; and (2) failed to state facts establishing a claim for economic duress. Dow Corning argued that a favorable ruling on either ground would result in the waiver clause's surviving intact, thereby barring the first cause of action based on breach of the earlier agreement.
The trial court, in granting the motion without leave to amend, based its ruling on the proposition that partial rescission is not recognized as a remedy. Thereafter, the court entered judgment in favor of Dow Corning on the promissory note for $250,000 together with interest and attorneys' fees in the sum of $6,000.

DISCUSSION

Appeal
(1) A motion for judgment on the pleadings is in effect a general demurrer and on review is to be tested by the same rules. (Colberg, Inc., v. State of California ex rel. Dept. Pub. Wks. (1967) 67 Cal.2d 408, 411-412 [62 Cal. Rptr. 401, 432 P.2d 3].) Thus, a defendant may move for judgment on the pleadings on the ground that the complaint fails to state a legally cognizable cause of action. (Crain v. Electronic Memories & Magnetics Corp. (1975) 50 Cal. App.3d 509, 512 [123 Cal. Rptr. 419].) Because such a motion has the purpose and effect of a general demurrer, the allegations of the complaint must be taken as true in deciding whether a cause of action has been stated. (Mathews v. State of California ex rel. Dept. of Transportation (1978) 82 Cal. App.3d 116, 119-120 [145 Cal. Rptr. 443].) We proceed to determine the propriety of the trial court's ruling in view of these principles.
(2) The trial court granted the motion for judgment on the pleadings on the ground that the law does not permit partial rescission of a contract. IMO assigns that as error, and maintains that the fourth count does not seek partial rescission of the contract, but rather a declaration that the waiver clause is unenforceable as an unconscionable provision under Civil Code section 1670.5.
*458 It is well settled that "a contract entered into by reason of duress or economic compulsion may be rescinded by the injured party. However, it is axiomatic that in such an instance the entitled party must rescind the entire contract and may not retain the rights under it which he deems desirable and repudiate the remainder [citation]." (Yeng Sue Chow v. Levi Strauss & Co. (1975) 49 Cal. App.3d 315, 326 [122 Cal. Rptr. 816]; accord: Larsen v. Johannes (1970) 7 Cal. App.3d 491, 503 [86 Cal. Rptr. 744]; Hayutin v. Weintraub (1962) 207 Cal. App.2d 497, 509 [24 Cal. Rptr. 761].) The rationale underlying the rule is that retention of only the benefits constitutes unjust enrichment and binds the parties to terms not contemplated within the agreement. (Simmons v. Cal. Institute of Technology (1949) 34 Cal.2d 264, 275 [209 P.2d 581].)
Here IMO sought a declaration only as to the unenforceability of the waiver provision in paragraph 9 (c). It did not seek to invalidate any other portion of the sales agreement, nor did it offer to return the property or proceeds of the loan as restitution of the benefits obtained. In its answer to the cross-complaint, IMO specifically admitted it held title to the property and accepted the proceeds of the loan. Thus, IMO alleged its entitlement to the benefits of the sales agreement and sought a declaration that it was free of the obligations contained in the waiver of claims provision. Furthermore, it is noteworthy that the fourth count expressly alleged that IMO's consent to the waiver provision was obtained through economic duress. Generally, rescission is available as a remedy where consent to a transaction is given under duress. (Civ. Code, § 1689, subd. (b)(1).) In view of the allegations of the pleading, we conclude that the trial court properly determined that IMO in effect sought a partial rescission of the contract, and, because no such remedy is recognizable, the fourth count failed to state a cause of action.
(3) IMO argues, however, that the rule against partial rescission does not apply to a contract which is severable and that determination of severability of the waiver clause here presented a triable issue of fact.
Plaintiff IMO is correct in its assertion that total rescission is not required where a contract is divisible or severable. The test in determining severability for purposes of rescission is set forth in Yeng Sue Chow v. Levi Strauss & Co., supra, 49 Cal. App.3d 315. "[W]here there is a showing that it was the intention of the parties to treat the agreement as an entire contract, and where it appears that their engagements would not have been entered into except upon the clear understanding *459 that the full object of the contract should be performed, the contract is not divisible [citations]." (Id., at p. 326.) In other words, if the consideration is apportioned, the contract is divisible. (Simmons v. Cal. Institute of Technology, supra, 34 Cal.2d 264, 275.)
Here, the complaint specifically alleged that Dow Corning informed IMO that it would transfer title to the property and make the $250,000 loan only if IMO would waive any claims it had against Dow Corning. Furthermore, the sales agreement, incorporated into the complaint, provides for the sale of the property and advance of the loan in exchange for waiver of the claims and payment of the purchase price. Thus, solely on the basis of the pleadings, we conclude, as a matter of law, that the parties intended to treat the sales agreement as an entire contract, that the contract is not divisible and that it is therefore not subject to partial rescission.
(4) Nevertheless, IMO's major contention on appeal is that the trial court had the authority to permit differential enforcement of the contract under newly enacted Civil Code section 1670.5. (Added by Stats. 1979, ch. 819, § 3, p. 2827.)
Section 1670.5 codifies the judicially developed doctrine of unconscionability and is identical to section 2-302 of the Uniform Commercial Code which has long been adopted by the majority of states. Section 1670.5 authorizes the court, after finding as a matter of law that the contract is unconscionable, in whole or part, to: (1) refuse to enforce the contract; (2) enforce the contract without the unconscionable provision; or (3) limit the application so as to avoid an unconscionable result.[2] The Legislative Committee comment following Civil Code section 1670.5 states that the purpose of the section is to allow "the courts to police explicitly against the contracts or clauses which they find to be unconscionable. In the past such policy has been accomplished by adverse construction of language, by manipulation of the rules of offer *460 and acceptance or by determinations that the clause is contrary to public policy or to the dominant purpose of the contract." The comment further states that the basic test of unconscionability is whether "the clauses involved are so one-sided as to be unconscionable." While unconscionability is not expressly defined, the comment indicates that "[t]he principle is one of prevention of oppression and unfair surprise...."
IMO's contention, as we understand it, is: (1) that by merely pleading economic duress it has invoked the court's power to declare paragraph 9 (c) unconscionable; and (2) that such pleading entitled it to a trial on the merits in order to present evidence as to the contract's commercial setting, purpose, and effect. That contention is without merit, if not specious.
Nowhere did IMO allege in the pleading that it sought a declaration of the invalidity of paragraph 9 (c) as an "unconscionable" provision, nor did it allege ultimate facts demonstrating its unconscionability. For instance, there are no allegations that the sales agreement constituted a contract of adhesion whereby one party unfairly took advantage of another's weaker bargaining position or that the waiver provision was unduly one-sided, oppressive, or inherently unfair. In short, plaintiff has failed to allege any facts to bring itself within the purview of section 1670.5.
What IMO does allege is that its consent was obtained by economic duress. Business or economic duress "... exists when threats to business or property interests by way of coercion and/or wrongful compulsion are present." (U.S. Hertz, Inc. v. Niobrara Farms (1974) 41 Cal. App.3d 68, 81 [116 Cal. Rptr. 44], italics omitted.) That however, is not tantamount to a showing of unconscionability. In other words, the presence of a supposed unconscionable contract provision, such as would admit to differential enforcement, does not logically provide for differential rescission.
Because of our conclusion that Civil Code section 1670.5 is inapplicable, we need not discuss defendant's contentions that section 1670.5 does not apply retroactively and that if it did, it would violate the constitutional prohibition against impairment of contracts.
We next turn to IMO's contention that the trial court abused its discretion in granting the motion without leave to amend.
*461 (5) The general rule allows great liberality at all stages of the proceeding in permitting the amendment of pleadings in order to dispose of cases upon their merits. (Dunzweiler v. Superior Court (1968) 267 Cal. App.2d 569, 576 [73 Cal. Rptr. 331].) However, an appellate court will not interfere with the denial of a motion to amend unless there is an abuse of discretion. (Security First Nat. Bank v. Rospaw (1951) 107 Cal. App.2d 220, 224 [237 P.2d 76].) The granting of a motion for judgment on the pleadings, without leave to amend, is not an abuse of discretion, where even if leave were granted, the complaint cannot be made to state a cause of action by amendment. (Stiebel v. Roberts (1941) 42 Cal. App.2d 434, 440 [109 P.2d 22]; see HFH, Ltd. v. Superior Court (1975) 15 Cal.3d 508, 513, fn. 3 [125 Cal. Rptr. 365, 542 P.2d 237].)
Here the trial court granted the motion for judgment on the pleadings without leave to amend after counsel for plaintiff stated that no new facts could be alleged entitling it to the remedy sought. Likewise, on appeal, plaintiff has not suggested any facts with which the complaint could be supplemented in order to change the legal effect of its pleading. Accordingly, it cannot be said that the trial court abused its discretion in granting the motion without leave to amend.

The Cross-appeal
(6) The sole issue presented on the cross-appeal concerns the extent of Dow Corning's right to attorneys' fees as provided for by contract. The court's award was less than Dow Corning believes it is entitled to.
The record discloses that there are two contractual provisions which authorize the award of attorneys' fees. The promissory note provides: "If this Note is not paid when due, or if any Event of Default occurs, Borrower hereby promises to pay all costs of collection including, but not limited to, reasonable attorneys' fees incurred by the holder hereof on account of such collection, whether or not suit is filed hereon." The sales agreement provides: "If either party commences an action against the other to enforce any of the terms hereof or because of the breach by either party of any of the terms hereof, the losing or defaulting party shall pay to the prevailing party reasonable attorneys fees, costs and expenses incurred in connection with the prosecution or defense of such action."
Pursuant to these provisions, Dow Corning sought attorneys' fees for substantially all of the legal work done in the case which relates to establishing *462 the validity of the waiver clause. However, the trial court ruled that Dow Corning was entitled only to attorneys' fees incurred in connection with collection of the note on the cross-complaint, but that it was not entitled to attorneys' fees incurred in litigating the declaratory relief action, because such litigation did not fall within the scope of the attorneys' fee clause contained in the sales agreement.
The court then ordered Dow Corning to apportion its request for attorneys' fees between time spent defending the declaratory relief action on the one hand and for collection of the note on the other. Thereafter, counsel for Dow Corning submitted a declaration stating his inability to apportion time spent between the cross-complaint and the declaratory relief action. He requested attorneys' fees based upon Orange County Rule 23 setting forth reasonable attorneys' fees to be awarded in default cases. On this basis, the court awarded attorneys' fees of $6,000 based solely on the cross-complaint for collection of the note. Dow Corning appealed the award, contending the trial court erred in not awarding the full amount of $110,441.44 requested.
Dow Corning argues that it was entitled to the full amount of the fees requested under the attorneys' fee provision in the note In doing so it contends that the cause of action for declaratory relief and cause of action for collection on the note are inextricably intertwined and involve exactly the same issue, namely, the validity of the waiver clause. Therefore, the argument goes, the attorneys' fees incurred for litigation of the issue in the main action are recoverable.
As already noted, both the note and the sales agreement contain attorney fee clauses which provide for an award of attorney fees to the prevailing party in any action commenced by either party thereunder. Both documents were executed as part of the transaction whereby IMO took title to the property. The entire litigation between IMO and Dow Corning related to a single issue, IMO's right to relief from the waiver provisions of the sales agreement. Dow Corning prevailed, and it contends therefore that it should have been awarded attorney fees in full and without regard to any purported segregation of the time which was spent.
Dow Corning attempted to collect the note by obtaining a judgment for payment in full. IMO defended solely on the ground that the note obligations should be offset against the damages alleged in the breach of contract action. Dow Corning successfully eliminated this defense by *463 showing that the claims on which IMO relied to establish payment had been waived, and obtained judgment for full payment of the note, without reduction or setoff.
In our view, the cost of litigating the issue raised by IMO's defense constituted part of the cost of collection, and Dow Corning should have been awarded attorney fees on that issue. The fact that the waiver issue was raised by the declaratory relief cause of action is of no legal significance. IMO argued to the trial court that it was not necessary for Dow Corning to attempt to enforce the waiver provision of the sales agreement in order to collect the note. The short answer to such contention is that Dow Corning was required to litigate the enforceability of IMO's waiver because IMO alleged the invalidity of that waiver as an affirmative defense to the cross-complaint. Both causes of action therefore were inextricably intertwined, as were the documents from which they arose.
The test for determining whether two documents constitute part of a single contract was recently stated in Huckell v. Matranga (1979) 99 Cal. App.3d 471 [160 Cal. Rptr. 177], "Under Civil Code section 1642, it is the general rule that several papers relating to the same subject matter and executed as parts of substantially one transaction, are to be construed together as one contract [citation]. Thus, a note, mortgage and agreement of sale constitute one contract where they are a part of the same transaction [citation]." (Id., at p. 481.)
Even a cursory review of the documents demonstrates that the sales agreement and the note involved in this case are part of a single transaction. The sales agreement provides in paragraph 11 that Dow Corning will make a loan to IMO of not more than $250,000 on condition that IMO execute a promissory note in the form attached to the agreement, and that said note should provide that it shall be due and payable not later than December 31, 1976. The note recites that IMO agrees to pay the sums disbursed pursuant to the contemporaneous agreement for purchase and sale between borrower and lender. Thus, the note and the Sales Agreement constitute a single transaction as a matter of law.
The attorney fee clause of the sales agreement provides for an award of reasonable attorney fees to the prevailing party "if either party commences an action against the other to enforce any of the terms hereof...." By its complaint, IMO commenced an action by which it sought *464 to retain the benefits of the sales agreement, i.e., the property and the proceeds of the loan, while disregarding the waiver provision it found unattractive. Thus, IMO sought both to enforce the sales agreement on its own behalf and to prevent the enforcement by Dow Corning of a portion of that agreement. As so analyzed, the attorney fee clause clearly applies to the entire litigation.
Dow Corning's cross-complaint clearly constituted an action to enforce the sales agreement. Dow Corning incorporated the sales agreement in the cross-complaint, and alleged that the $250,000 promissory note "... was given by IMO as part of IMO's obligation under the purchase and sale agreement." Because the sales agreement provided for the execution of the note, the payment of that note necessarily constituted one of the obligations of the sales agreement, and Dow Corning's suit to collect the note also constituted a suit to enforce the sales agreement. The successful litigation by Dow Corning of the central issue, i.e., enforcement of IMO's waiver, was necessary in order for Dow Corning to prevail on its collection efforts under the cross-complaint; thus the two were clearly interrelated.
That Dow Corning also was forced to defend against IMO's claim that paragraph 9(c) of the sales agreement was unenforceable does not diminish its entitlement to attorney fees. The First District of this court has recently held, in an analogous case, that it is improper to distinguish between "offensive" and "defensive" costs and expenses. In Wagner v. Benson (1980) 101 Cal. App.3d 27 [161 Cal. Rptr. 516], the plaintiffs sued Lloyds Bank for misrepresentation and negligence in connection with the handling of a loan transaction, and the bank cross-complained upon promissory notes executed by the plaintiffs. The bank prevailed on the misrepresentation claim, but the trial court limited the bank's recovery of attorney's fees to the reasonable cost of suing on the promissory note. Fees incurred in defending against the fraud claim were not included in the award. The court reversed, holding "... the Bank's collection efforts were interrelated with its defense against the Wagners' fraud allegations. Defense of the charge of fraud was necessary in the Bank's efforts to collect the notes ... Attorney's fees incurred by the Bank in defending against the fraud action are compensable under the attorney fees provision of the promissory notes [citations]. The trial court erred in apportioning its award of legal fees between the defense and collection aspects of the Bank's case." (Id., at p. 37.)
*465 In sum, the issues in this case cannot be segregated, and it was error for the trial court to attempt to do so for purposes of the attorney fee award. The finding that IMO was not entitled to a partial rescission of the sales agreement was necessarily dispositive of IMO's defenses to any obligation on the note under provisions of both the sales agreement and the note.
Based upon the foregoing analysis, we hold that the judgment in Dow Corning's favor, as to the central issue litigated, entitled it to an award of attorney's fees for all of the time spent on the case by its attorneys. Although there was evidence offered on the reasonable value of such time, the trial court did not make a finding thereon. As a consequence, an appropriate motion to the trial court will be necessary to obtain an order for fees representing the value of the entire time devoted to the case by Dow Corning's attorneys with no segregation of such time as to the promissory note itself.

DISPOSITION
The award of attorney's fees appearing on line 3, page 3 of the judgment is reversed with directions that the trial court, upon appropriate motion by Dow Corning, fix a reasonable attorney's fee consistent with the holding above recited, and with further directions that it modify the judgment on line 5, page 3 thereof, to reflect an aggregate amount which includes the corrected award of attorney's fees. Otherwise, the judgment is affirmed, and Dow Corning is entitled to reasonable attorney's fees and costs on appeal likewise to be fixed by the trial court under procedure appropriate for that purpose.
Morris, P.J., and Kaufman, J., concurred.
NOTES
[1]  Paragraph 9 (c) of the sales agreement, containing the waiver and hold harmless provision provided: "Buyer agrees to (i) indemnify, defend and hold Seller harmless from and against any and all claims, liability or loss arising from, and does hereby (ii) waive any claims against Seller for, Buyer's use or occupancy of the Property, or from any activity, work or things done, permitted or suffered by Buyer in or about the Property, or from any agreements, contracts or other arrangements for financing of the purchase of the Property, or the construction of improvements thereon, whether interim or permanent financing, and any fees or charges paid in connection therewith, including without limitation any agreement with Phoenix Mutual Life Insurance Company, United California Mortgage Company, Farmers New World Life Insurance Company or the George Elkins Company."
[2]  Civil Code section 1670.5 provides: "(a) If the court as a matter of law finds the contract or any clause of the contract to have been unconscionable at the time it was made the court may refuse to enforce the contract, or it may enforce the remainder of the contract without the unconscionable clause, or it may so limit the application of any unconscionable clause as to avoid any unconscionable result. [¶] (b) When it is claimed or appears to the court that the contract or any clause thereof may be unconscionable the parties shall be afforded a reasonable opportunity to present evidence as to its commercial setting, purpose, and effect to aid the court in making the determination."
