
244 Ga. 240 (1979)
260 S.E.2d 1
NATIONAL HERITAGE CORPORATION
v.
MOUNT OLIVE MEMORIAL GARDENS, INC.
34613.
Supreme Court of Georgia.
Argued May 14, 1979.
Decided September 5, 1979.
Rehearing Denied September 25, 1979.
Hull, Towill, Norman & Barrett, John L. Creson, Patrick J. Rice, Robert C. Norman, for appellant.
T. J. Foss, for appellee.
HILL, Justice.
We granted certiorari to determine whether the grant of summary judgment to the defendant in one suit is necessarily res judicata in a second suit between the same parties on the same contract. National Heritage Corp. v. *241 Mount Olive Memorial Gardens, Inc., 148 Ga. App. 398 (251 SE2d 311) (1978).
National Heritage is a foreign corporation transacting business in this state.
In early 1974, National Heritage filed suit (hereinafter "the first suit") against Mount Olive for breach of contract. In its answer and counterclaim, the defendant raised as an affirmative defense that while transacting business in this state, plaintiff, a foreign corporation, did not have and did not obtain prior to filing suit a certificate of authority, and that pursuant to Code Ann. § 22-1421(c) the defendant did void, avoid and disaffirm its contract with plaintiff.[1]
In October, 1976, plaintiff refiled its complaint against defendant for breach of the contract (hereinafter "the second suit").[2] Defendant's motion to dismiss the second suit based on prior pending action was overruled on the ground that, because plaintiff had no certificate of authority, the first suit was so defective that no recovery could be had.[3]
Defendant then moved for summary judgment in the first suit urging that plaintiff's failure to obtain a certificate prior to filing that suit rendered the first suit subject to being dismissed. Defendant's motion for summary judgment in the first suit was granted (and no appeal was filed).
*242 Defendant then amended its answer in the second suit to plead res judicata. The plea of res judicata was sustained, the second suit was dismissed, the plaintiff appealed, the Court of Appeals affirmed, and we granted certiorari.
The order granting summary judgment in the first suit, which was filed in the second suit as the finale of the plea of res judicata, expressly shows that that order was based on plaintiffs' failure to have a certificate of authority.
Although there is a facial inconsistency between subparagraphs (b) and (c) of Code Ann. § 22-1421 (Ga. L. 1968, pp. 565, 722, as amended by Ga. L. 1969, pp. 152, 196, 197), in order to avoid rendering sub-paragraph (c) entirely nugatory, it must be given effect. It provides that "The failure of a foreign corporation to obtain the certificate of authority to transact business in this State shall render voidable any contract of such foreign corporation arising out of business transacted in Georgia at the instance of any other party to such contract, but such voidability may be cured by the foreign corporation obtaining a certificate of authority provided such certificate of authority is obtained prior to final judgment in any action wherein this subsection is relied upon." Thus, the failure of a foreign corporation to obtain a certificate of authority can be made the basis of a dilatory plea (as opposed to a plea in bar; see Leverett, Hall, et al. Georgia Proc. & Prac. § 10-4 (1957)). The grant of a dilatory plea is not an adjudication on the merits. Georgia Proc. & Prac., supra. (Code Ann. § 81A-141 (b) is not applicable here because the dismissal of the first suit was based on plaintiff's failure to comply with a precondition requisite to the court's going forward to the merits. O'Kelley v. Alexander, 225 Ga. 32 (165 SE2d 648) (1969); Clover Realty Co. v. J. L. Todd Auction Co., 240 Ga. 124 (1) (239 SE2d 682) (1977). Anything to the contrary in Roach-Russell, Inc. v. A. B. R. Metals & Services, Inc., 140 Ga. App. 307 (231 SE2d 114) (1976), will not be followed.)
On the other hand, the grant of a motion for summary judgment (when properly used) is an adjudication on the merits. Summer-Minter & Assoc. v. Giordano, 231 Ga. *243 601, 604 (203 SE2d 173) (1973); see Ogden Equipment Co. v. Talmadge Farms, Inc., 232 Ga. 614 (208 SE2d 459) (1974).
Thus, the question in this case becomes: In a suit on a contract, where summary judgment is granted on a dilatory plea is the summary judgment res judicata in a second suit between the same parties on that same contract?
First, it should be noted that summary judgment (an adjudication on the merits) should not be used in ruling on a dilatory plea (a plea in abatement). Ogden Equipment Co. v. Talmadge Farms, Inc., supra. However, as often happens, we are not called upon only to decide how things should or should not be done; we are called upon also to decide what happens after they have been done improperly. Should plaintiff have been required to appeal in the first suit the order granting summary judgment in that suit, to urge only that summary judgment should not have been the vehicle used in ruling on a dilatory plea? We think not. There is no need for such an appeal because the matter can be rectified in the second suit.
We hold that where an order granting summary judgment in a prior suit is relied upon in final support of a plea of res judicata in a subsequent suit, the court considering the plea of res judicata should examine the underlying basis of the summary judgment. If that summary judgment actually was an adjudication of the merits (a plea in bar, or otherwise on the merits), the plea of res judicata should be sustained. However, if examination shows that the summary judgment actually was not an adjudication of the merits (a dilatory plea, etc.), the res judicata plea should be denied. Code Ann. § 110-503. (If it is unclear why summary judgment was granted, the order itself should be appealed.)
In the case before us, whether or not National Heritage ever got a certificate of authority is wholly immaterial.[4] The record shows that the first suit was *244 dismissed on summary judgment for lack of a certificate of authority. That is a dilatory plea; i.e., not on the merits. It was error to sustain the plea of res judicata in the second suit.
Judgment reversed. All the Justices concur.
NOTES
[1]  Plaintiff asserts that it obtained the certificate of authority in October, 1975. However, it was not considered by the Court of Appeals as being in the record of this appeal, which includes pleadings and orders from the first suit which were used in support of the plea of res judicata.
[2]  Plaintiff asserts that its failure to have obtained the certificate prior to filing the first suit was fatal to that suit and that even though defendant was furnished a copy of the certificate, defendant refused to waive its defense of avoidance. We do not approve or disapprove in this case the fatality argument.
[3]  Plaintiff avers that it would have dismissed the first suit but could not do so because of the counterclaim.
[4]  In this opinion, the footnotes are explanatory but they can be disregarded entirely as they are unnecessary to the decision.
