
    Margaret H. BRATCHER, Appellant, v. Rita M. WRONKOWSKI and Charles J. Wronkowski, her husband, Appellees.
    No. 81-1292.
    District Court of Appeal of Florida, Fifth District.
    Aug. 11, 1982.
    
      James A. Moreland, P. A. of Moreland & Palmer, Winter Park, for appellant.
    C. Andrew Coomes, Orlando, for appel-lees.
   FRANK D. UPCHURCH, Jr., Judge.

Appellant Margaret H. Bratcher was indebted to the Wronkowskis as evidenced by a note and second mortgage. She appeals from a judgment of foreclosure and an order denying her leave to amend her answer to include a counterclaim.

As to the court’s entry of summary judgment of foreclosure, we find no error and affirm. However, we find that the court miscalculated the amount of interest due. The note provided that interest was payable at twelve percent per annum. However, upon default, the note provided:

If default be made in the payment of any of the sums or interest mentioned herein or in said mortgage, or in the performance of any of the agreements contained herein or in said mortgage, then the entire principal sum and accrued interest shall at the option of the holder hereof become at once due and collectible without notice, time being of the essence; and said principal sum and accrued interest shall both bear interest from such time until paid at the highest rate allowable under the laws of the State of Florida.

In the final judgment of foreclosure, the Wronkowskis were awarded interest from February .16, 1980 through September 10, 1981 (the date of the judgment) in the amount of $3,852.17. This amount was apparently based on calculations from Mrs. Wronkowski’s affidavit wherein she claimed interest on the principal balance at the rate of twelve percent from February 16,1980 to March 16, 1980, and at eighteen percent (the maximum legal interest) from March 16,1980 to the present. Under the terms of the note, the use of the maximum legal interest rate was proper only after Mrs. Wronkowski had exercised her option to declare the entire sum due.

It is not clear from the record when Mrs. Wronkowski exercised her option to declare the entire sum due, but it is clear that the date was not March 16,1980, when the first default occurred. We therefore reverse and remand for proper calculation of the interest due.

With regard to the trial court’s refusal to grant Mrs. Bratcher leave to amend her answer to include a counterclaim, we find no error. The counterclaim was based on breach-of-warranty regarding the heating and air conditioning unit and other appliances contained in the house which Mrs. Bratcher had purchased from the Wron-kowskis and for which the note and mortgage evidenced a part of the purchase price.

While we recognize that leave to amend is to be liberally granted, e.g., Sarasota Comm. Rev. v. Schooley, 381 So.2d 1141 (Fla. 2d DCA 1980), the refusal to grant leave here would be an abuse of discretion only if the counterclaim were compulsory and therefore barred in a subsequent action. The test of the mandatory character of a counterclaim is whether its subject matter arose from the same transaction or occurrence as the subject matter of the complaint or petition. No definitive rule exists to determine if the cause of action in a counterclaim arose from the same transaction or occurence and hence each case must be determined on its own facts. Trawick, Fla.Prac. and Proc. § 12-3 (1979).

Generally, two tests may be used to determine whether a counterclaim is compulsory. One of the tests is whether the same evidence would support the complaint and the counterclaim. If the same evidence or the parts material to both the complaint and the counterclaim will support both pleadings, then the counterclaim is compulsory. The second test is whether the doctrine of res judicata will bar the counterclaim if it is asserted subsequent to the action. Id.

The complaint in the present case sought to foreclose on the second mortgage. The counterclaim Mrs. Bratcher attempted to plead involved an alleged breach of contract or warranty regarding appliances in the home purchased from the Wronkowskis. This counterclaim does not meet either of the tests for compulsory counterclaims outlined above. First, the evidence regarding the failure to make the mortgage payments is not related in any fashion to the condition of the appliances on the breach of warranty counterclaim. Second, principles of res judicata would not bar the counterclaim if asserted in a subsequent action as the same issues are not involved in the two claims. We therefore conclude the trial judge did not abuse his discretion in refusing to permit the amendment.

AFFIRMED in part; REVERSED and REMANDED in part.

ORFINGER, C. J., and COWART, J., concur. 
      
      . It should be noted that the counterclaim was not asserted as a defense to Mrs. Bratcher’s failure to make the mortgage payments. Thus, unlike the situation in Haag v. Phillips, 333 So.2d 507 (Fla. 2d DCA 1976), the counterclaim would not have prevented the entry of summary judgment.
     