
777 So.2d 151 (2000)
William D. HOFFMAN
v.
TRUCK DRIVING ACADEMY, INC., et al.
2990591.
Court of Civil Appeals of Alabama.
September 15, 2000.
*152 Jack Daniel, Huntsville, for appellant.
L. Dale Fuller, Boaz, for appellees.
ROBERTSON, Presiding Judge.
William D. Hoffman filed a multicount civil action in the Madison County Circuit Court in November 1998, seeking damages and the return of various items of personal property; he demanded a jury trial. Named as defendants were Truck Driving Academy, Inc. ("TDA"), Larry Coker, and Sandra Coker. The defendants answered the complaint, denying its allegations and asserting three affirmative defenses: accord and satisfaction, contributory negligence, and the statute of limitations. The defendants also counterclaimed for attorney fees, claiming that Hoffman's action was frivolous. See § 12-19-270 et seq., Ala.Code 1975 (the Alabama Litigation Accountability Act, or "ALAA").
On the day that a scheduled jury trial was to take place, but before jury selection, the defendants orally moved for the dismissal of Hoffman's claims, on the basis of a judicial estoppel arising from bankruptcy proceedings involving Hoffman. Hoffman was sworn and was briefly questioned by counsel for both parties; Hoffman's bankruptcy petition and an affidavit of his bankruptcy attorney were admitted into evidence. Two days later, the trial court entered a judgment dismissing the action, citing as authority Luna v. Dominion Bank of Middle Tennessee, Inc., 631 So.2d 917 (Ala.1993), and concluding, in pertinent part:
"The evidence is uncontroverted that [Hoffman] failed to include in his Petition in Bankruptcy (Chapter 7), or any Amendment thereto, the fact that these *153 claims were pending or that they existed in any form. The Court finds that [Hoffman] failed to indicate on any bankruptcy document that he had these claims against the defendant[s]. The Court further finds that all of the claims had at least accrued prior to the discharge, and could have been presented as counterclaims in the adversary proceeding in which these same parties appeared in the bankruptcy case. Therefore, [Hoffman] is judicially estopped from proceeding against [these defendants]."
Hoffman appealed from that judgment[1] to the Alabama Supreme Court, which transferred the appeal to this court, pursuant to § 12-2-7(6), Ala.Code 1975.
Although the procedural posture of this case is unusual, because the defendants asserted their judicial-estoppel defense immediately before a jury trial was scheduled to begin, the trial court has the authority to hear a claim of failure to state a valid claim in a preliminary hearing before a trial on the application of any party. Rule 12(d), Ala.R.Civ.P. However, because matters outside the pleadings[2] were presented to the trial court in connection with its consideration of the judicial-estoppel defense, Rules 12(b) and 12(c), Ala.R.Civ.P., mandate that we review the trial court's judgment of dismissal as a summary judgment. Accord, Battle v. Alpha Chem. & Paper Co., 770 So.2d 626, 628-29 (reviewing dismissal as a summary judgment where papers filed in bankruptcy court were presented to trial court in support of judicial-estoppel claim).
"Rule 56, Ala.R.Civ.P., sets forth a two-tiered standard for determining whether to enter a summary judgment. In order to enter a summary judgment, the trial court must determine: 1) that there is no genuine issue of material fact, and 2) that the moving party is entitled to a judgment as a matter of law. No presumption of correctness attaches to the decision of the trial court regarding the summary judgment motion, and our review is de novo. Hipps v. Lauderdale Cty. Bd. of Educ., 631 So.2d 1023, 1025 (Ala.Civ.App.1993) (citing Gossett v. Twin County Cable T.V., Inc., 594 So.2d 635 (Ala.1992)). Moreover, when an appeal focuses on the application of the law to the facts, no presumption of correctness is accorded to the trial court's judgment and we review de novo the application of the law to the facts of such a case. Allstate Ins. Co. v. Skelton, 675 So.2d 377, 379 (Ala.1996)."
Pearson v. City of Hoover, 706 So.2d 1251, 1252 (Ala.Civ.App.1997).
Hoffman's complaint contained eight separate counts. Hoffman sought (1) $4,680 for unpaid wages and vacation time between January 10, 1997, and January 24, 1997, as well as August 25, 1997, and October 2, 1997; (2) $3,965.92 for uncashed car-payment checks for January 1997 through July 1997; (3) $13,597.44 for car payments from August 1997 through July 1999 on a leased corporate automobile provided to Hoffman; (4) $50,000 for mental anguish and loss of livelihood as a result of the Cokers' alleged failure to properly operate TDA as a corporation; (5) unspecified damages from Sandra Coker for intentional interference with a business or contractual *154 relationship between Hoffman and Larry Coker; (6) the return of certain personal items of Hoffman's; (7) $2,359.41 for the expense of automobile insurance on the leased automobile; and (8) $4,600 in attorney fees.
A review of Hoffman's Chapter 7 bankruptcy petition, filed on April 2, 1997, reveals that Hoffman did not disclose any accounts receivable or any contingent and unliquidated claims on Schedule B thereof. Hoffman's bankruptcy attorney testified by affidavit that the Cokers contacted the United States bankruptcy trustee after the creditors' meeting in Hoffman's bankruptcy case, and that the trustee then brought a turnover proceeding against Hoffman and Larry Coker to recover 500 shares of TDA stock that had allegedly been held by Hoffman before he filed his petition. According to Hoffman's bankruptcy attorney, Coker asserted a breach-of-contract cross-claim against Hoffman in the turnover proceeding. The turnover proceeding was later dismissed after the stock was transferred to the bankruptcy trustee by a subsequent purchaser of the stock; the trustee then conveyed the stock to the Cokers. On October 2, 1997, Hoffman received a discharge of his debts under 11 U.S.C. § 524.
At the hearing in the trial court, Hoffman admitted having signed the bankruptcy petition in March 1997 and having failed to list claims against the Cokers and TDA. He also admitted that he did not file any counterclaims to Larry Coker's cross-claim during the trustee's turnover proceeding. However, Hoffman also testified that his bankruptcy attorney had informed him that wage claims against employers did not have to be asserted in bankruptcy. Hoffman further testified that he worked for TDA until August 25, 1997, but that he was not paid for his work after June 1997. Upon questioning by the trial court, Hoffman testified that his action concerned not only lost wages, but also expenses arising from an automobile apparently leased to him at the direction of TDA that could not be returned before the end of the automobile's lease term without payment of the full amount due under the lease.
As they did in the trial court, TDA and the Cokers assert that Hoffman's failure to disclose his claims against them in his bankruptcy petition estops him from asserting them in the trial court. However, as we noted in Battle, supra, under the Alabama Supreme Court's recent holding in Jinright v. Paulk, 758 So.2d 553 (Ala. 2000), mere knowledge and nondisclosure of a potential claim do not alone suffice to warrant the entry of a summary judgment on the grounds of judicial estoppel:
"No longer will a plaintiff's mere failure to list a potential pre-petition cause of action in his or her bankruptcy filings amount to an automatic procedural default as to that claim. Rather, a court evaluating a judicial-estoppel defense must now look to a number of additional factors in concluding whether that defense warrants the entry of a judgment as a matter of law. Among these are (1) the chapter of the Bankruptcy Code under which the plaintiff-debtor has sought bankruptcy protection, (2) whether the plaintiff-debtor has been discharged in bankruptcy, (3) whether the plaintiff-debtor has amended his or her filings in the bankruptcy court to reflect the existence of the omitted cause of action, and (4) whether the defendant has been prejudiced by the omission of the claim in the bankruptcy court."
Battle, 770 So.2d at 633; see also Jinright, 758 So.2d at 559.
In this case, all that was before the trial court was Hoffman's bankruptcy petition, an affidavit of his bankruptcy attorney, and Hoffman's testimony (which, when transcribed, amounted to only 16 pages). While the trial court could have concluded that some or all of Hoffman's claims arose pre-petition, nowhere in the abbreviated record does it appear that TDA or the Cokers adduced evidence of any prejudice to them arising from Hoffman's *155 failure to disclose his claims in the bankruptcy court. In the absence of such evidence of prejudice, the trial court erred in concluding that Hoffman's claims are barred under the judicial-estoppel doctrine. Accord, Jones v. Lanthrip, 765 So.2d 682 (Ala.Civ.App.2000) (reversing summary judgment where defendants did not show that they were prejudiced by debtor's failure to disclose claims against them).
TDA and the Cokers also assert that Hoffman's claims are barred by the doctrine of res judicata because he failed to assert them in a counterclaim to Larry Coker's cross-claim in the bankruptcy trustee's turnover proceeding. The defendants' answer did not raise this affirmative defense, however (see Rule 8(c), Ala.R.Civ. P., listing res judicata as an affirmative defense that must be "set forth affirmatively"), and the record does not show that it was raised in the hearing in the trial court. It is true that "[t]his court reviews judgments and not opinions, and we will affirm a correct judgment on any valid basis, regardless of whether that basis was accepted, or even considered by the trial court." Cove Properties, Inc. v. Walter Trent Marina, Inc., 702 So.2d 472, 474 (Ala.Civ.App.1997). However, a significant limitation on that principle is that an appellate court may not affirm a judgment on the basis of an affirmative defense that has not been properly pleaded or raised in the trial court. Ex parte State. ex rel. State. of Ohio, 718 So.2d 669, 670-71 (Ala.1998) (reversing this court's affirmance based upon affirmative defense of statute of limitations where that defense had not been pleaded or argued in the trial court).
Moreover, because the bankruptcy trustee's complaint, Larry Coker's cross-claim, and the bankruptcy court's judgments[3] as to those pleadings are not in the record, it is impossible for this court to determine the precise claims made in those pleadings, much less whether Hoffman's claims would be "compulsory" counterclaims under Rule 7013, Fed.R.Bankr.P., or whether Alabama's own "same-cause-of-action" test of res judicata would bar Hoffman's claims. See Selma Foundry & Supply Co. v. Peoples Bank & Trust Co., 598 So.2d 844, 847-49 (Ala.1992) (refusing to apply doctrine of res judicata to claims that defendant alleged should have been brought in turnover proceeding in bankruptcy court). Thus, we do not address the issue of res judicata on this appeal.
Based upon the foregoing facts and authorities, we reverse the summary judgment in favor of TDA and the Cokers, and we remand the cause for further proceedings. The defendants' motion to strike Hoffman's reply brief is denied.
MOTION TO STRIKE REPLY BRIEF DENIED; REVERSED AND REMANDED.
YATES, MONROE, CRAWLEY, and THOMPSON, JJ., concur.
NOTES
[1]  The trial court's judgment did not adjudicate the counterclaim for attorney fees; however, because TDA and the Cokers did not have the trial court rule on whether to grant relief under the ALAA when it entered a final judgment, or, alternatively, to reserve jurisdiction as to this matter, we conclude that the trial court no longer has jurisdiction with respect to that counterclaim and that the judgment appealed from constitutes a final judgment. E.g., Williams v. Deerman, 724 So.2d 18, 20 n. 1 (Ala.Civ.App.1998) (citing Donnell Trucking Co. v. Shows, 659 So.2d 667, 669 (Ala.Civ.App.1995)).
[2]  Under Rule 43(e), Ala.R.Civ.P., a court may hear a motion wholly or partly on oral testimony. See also Middaugh v. City of Montgomery, 621 So.2d 275, 279-80 (Ala.1993) (noting trial court's discretion in receiving oral testimony on summary-judgment motion).
[3]  In fact, it would appear from the affidavit of Hoffman's bankruptcy attorney that the bankruptcy court never reached the merits of the trustee's or Larry Coker's claims because that proceeding was dismissed by consent.
