
607 F.3d 528 (2010)
TRIM FIT, LLC, Plaintiff-Appellee, Counter Defendant-Appellee,
v.
Donald O. DICKEY, Defendant-Appellant, Counterclaimant-Appellant.
No. 08-3711.
United States Court of Appeals, Eighth Circuit.
Submitted: December 15, 2009.
Filed: June 7, 2010.
*529 Kenneth Lee Marshall, argued (Daniel M. O'Keefe, Hannah F. Preston, on the brief), St. Louis, MO, for appellant.
Mitchell A. Margo, argued (Kenneth J. Heinz, on the brief), St. Louis, MO, for appellee.
*530 Before LOKEN[1], Chief Judge, ARNOLD, and BENTON, Circuit Judges.
BENTON, Circuit Judge.
Trim Fit, LLC, sued Donald O. Dickey for, as relevant here, breach of a non-compete agreement and unfair competition. Dickey counterclaimed for unpaid commissions and attorney's fees. Joseph E. Voss, the principal of Trim Fit, separately sued Dickey on a promissory note. The cases were consolidated. At the close of Trim Fit's evidence, the district court granted judgment as a matter of law to Dickey on Trim Fit's claims. The jury returned a verdict of $140,743.92 for Voss on the promissory note, and $45,514.14 for Dickey on the counterclaim for unpaid commissions.
Dickey appeals the district court's denial of: his pre-trial request to amend his counterclaim to include the Missouri commissions statute; his post-trial motion to amend the pleadings to conform to the proof, and to grant relief not demanded in his pleadings; and his motion for attorney's fees. Having jurisdiction under 28 U.S.C. § 1291, this court affirms, but remands Dickey's motion for attorney's fees.

I.
Dickey and a partner started TE Services, a truss business. Dickey funded TE by borrowing $75,000 from Voss (by the promissory note). Dickey's partner later locked him out of TE, and Dickey stopped making payments on the note in 2003.
Dickey then became a salesman for Voss's company, Trim Fit. By an "Independent Contractor Agreement" signed in January 2004, Dickey began selling construction blocks made by Trim Fit. The agreement was for one year with automatic renewals. Dickey received a straight commission percent, with an additional percent for new accounts, and a year-end bonus. The agreement had a non-compete clause.
In January 2005, Voss tried to renegotiate the agreement. With the promissory note unpaid, the relationship between the two men deteriorated. In October 2005, Voss accused Dickey of selling another company's blocks at a trade show in violation of the non-compete clause. Voss testified that at the show, Dickey quit, and that Voss responded that he was fired. Dickey denied selling for a competitor and that he ever quit working for Trim Fit. Trim Fit stopped paying Dickey, although he continued to sell its products. Dickey maintained he curtailed his sales only to the extent that Trim Fit did not reimburse his expenses. In 2006 and 2007, Trim Fit continued to fill orders Dickey sent. Trim Fit asserts that many of Dickey's sales were to a company he partly owned for "his own account."
In January 2006, Trim Fit sued Dickey. Dickey counterclaimed for unpaid commissions and attorney's fees "to the extent allowed by law." Trim Fit answered the counterclaim and amended its complaint. Dickey answered the amended complaint, re-filing his counterclaim. Trim Fit did not file an answer to the re-filed counterclaim. The district court's scheduling order stated that all pleadings should be amended by August 21, 2006. The discovery deadline was May 1, 2007.
Fifteen days before trial, on September 24, 2007, Dickey requested leave to amend the counterclaim to include damages and attorney's fees under Missouri's statute on *531 commissions for sales representatives. The operative section provides:
Any principal who fails to timely pay the sales representative commissions earned by such sales representative shall be liable to the sales representative in a civil action for the actual damages sustained by the sales representative and an additional amount as if the sales representative were still earning commissions calculated on an annualized pro rata basis from the date of termination to the date of payment. In addition the court may award reasonable attorney's fees and costs to the prevailing party.
Mo.Rev.Stat. § 407.913 (2005). Before a 2005 amendment to the definitions section, the Missouri commissions statute applied only to sales at wholesale. See Mo. Rev. Stat § 407.911(2)(a), (3) (2000), amended by 2005 Mo. Laws vii, 1172 (S.B.211), effective August 28, 2005, and deleting "wholesale" from the definitions of "principal" and "sales representative."
Dickey's pre-trial request to amend the counterclaim was denied based on prejudice to the opposing party. After trial, Dickey moved for prejudgment interest, to amend the pleadings to conform to the evidence, and to grant relief not demanded in the pleadings. Trim Fit moved for attorney's fees and to amend the judgment to offset the damage awards. Dickey separately moved for attorney's fees. The district court denied Dickey's motions, except to award pre-judgment interest. Voss was awarded attorney's fees. In the amended judgment, the district court offset Voss's damages (which had been assigned to Trim Fit) against Dickey's damages and prejudgment interest.

II.
Dickey sought to amend his counterclaim to include the Missouri commissions statute in order to receive actual damages and an "additional amount" of commissions authorized by the statute. The denial of a motion to amend is reviewed for an abuse of discretion. MSK EyEs, Ltd. v. Wells Fargo Bank, 546 F.3d 533, 545 (8th Cir.2008).
Dickey contends that his motion to amend should have been granted because Rule 15(a)(1)(B) gives him the right to amend his counterclaim once as a matter of right before a responsive pleading is served. See Fed.R.Civ.P. 15(a)(1)(B) and 12(a)(1)(B).[2] He also argues that by Rule 15(a)(2), a court should grant such a request when "justice so requires." Dickey moved to amend 13 months after the deadline set by the scheduling order, and 15 days before trial. Rule 16(b)(4) provides that a scheduling order may be modified only for good cause. When leave to amend is sought after the scheduling order's deadline, a judge may require good cause under Rule 16(b)(4) before permitting an amendment. Sherman v. Winco Fireworks, Inc., 532 F.3d 709, 716 (8th Cir. 2008), Thomas v. Corwin, 483 F.3d 516, 532 (8th Cir.2007). There is no absolute right to amend after the deadline for amendment in a scheduling order, and a court may deny the motion based on undue prejudice to the other party. See MSK EyEs Ltd., 546 F.3d at 545, citing Baptist Health v. Smith, 477 F.3d 540, 544 (8th Cir.2007).
The district court found undue prejudice because Trim Fit's discovery and evidence would have been different if Dickey had sued under the Missouri commissions statute. *532 See MSK EyEs, Ltd., 546 F.3d at 545. The district court found that additional facts would have to be developed in order to support a claim under the statute (particularly as to whether sales were wholesale). See Hoffman v. Van Pak Corp., 16 S.W.3d 684, 689-90 (Mo.App. 2000) (the Missouri commissions statute pre-August 28, 2005covers only sales at wholesale). See also McKay v. WilTel Commc'n. Sys., Inc., 87 F.3d 970, 975 (8th Cir.1996) (the Missouri commissions statute applies only if the sales representative is terminated by discharge from employment, not if the sales representative resigns).
On the facts here, it was not an abuse of discretion to deny the amendment of the counterclaim.

III.
Dickey's after-trial motion to amend the pleadings to conform to the evidence should have been granted if the issues were tried by consent. Fed. R.Civ.P. 15(b)(2). In addition, a final judgment "should grant the relief to which each party is entitled, even if the party has not demanded that relief in its pleadings." Fed.R.Civ.P. 54(c). Dickey asserts that because the evidence at trial supported a claim under the Missouri commissions statute, the court should have awarded statutory damages. However, both before and after trial, the district court found that additional evidence would be required to support an "additional amount" claim under the statute. A party will not be granted relief that is not pled when it would unduly prejudice the opposing party. Baker v. John Morrell & Co., 382 F.3d 816, 831-32 (8th Cir.2004); Bowles v. Osmose Utils. Servs., Inc., 443 F.3d 671, 675 (8th Cir.2006). The district court did not abuse its discretion in denying the motions to amend the pleadings, or to grant relief for damages under a statute not pled.

IV.
Dickey made a separate post-trial motion for attorney's fees, specifically arguing, "Missouri's Sales Commissions Statute provides for a discretionary award of attorney's fees in the event that a sales person is forced to sue to recover commissions owed under his/her sales commissions contract." The judge denied the motion, relying entirely on her previous refusals to allow amendment of the counterclaim to include the Missouri commissions statute.
Dickey's motion for attorney's fees cited Rule 54(d)(2), which authorizes a motion for attorney's fees after trial (unless those fees must be proved at trial as damages). See Rule 54(d)(2)(A). Dickey's motion was filed no later than 20 days after entry of final judgment. See E.D. Mo. R. 54-8.02 (effective until December 1, 2009), implementing Rule 54(d)(2)(B)(i). It sought a specified amount, with underlying documentation. See Fed.R.Civ.P. 54(d)(2)(B)(iii) and (iv). It specified the judgment on the counterclaim for unpaid sales commissions and cited the Missouri commissions statute. See Fed.R.Civ.P. 54(d)(2)(B)(ii).
Rule 54(d)(2) is clear that the first time a party must specify the statute authorizing attorney's fees is in the Rule 54 motion (unless otherwise provided by statute or court order). In Missouri, attorney's fees are not recoverable from another party, except when a contract or statute allows it. Essex Contracting, Inc. v. Jefferson County, 277 S.W.3d 647, 657 (Mo. banc 2009). The second sentence of the Missouri commissions statute is such an exception to the general Missouri rule. Kraft v. Edwards, 946 S.W.2d 775, 776 (Mo.App.1997). The district judge's ruling *533 that there was no statutory basis for an award of attorney's fees is erroneous as a matter of law.
On remand, the district court should consider whether to award attorney's fees. See Chem-Trend, Inc. v. Newport Indus., Inc., 279 F.3d 625, 631 (8th Cir.2002) (recognizing discretion of district court in determining a fee award). Because this case as tried addressed only actual damages, the district court, on remand, need not address any issue as to the "additional amount" authorized by the second half of the first sentence of section 407.913, but may address any other issue as to the applicability of sections 407.911-407.915. One factor may be the proportion of Dickey's damages within the scope of the Missouri commissions statute, because damages not within the statute do not entitle Dickey to attorney's fees. See Kraft, 946 S.W.2d at 776; O'Brien v. B.L.C. Ins. Co., 768 S.W.2d 64, 71 (Mo. banc 1989) (requiring segregation of attorney's fees where some counts do not authorize attorney's fees); cf. Gary Brown & Assocs., Inc. v. Ashdon, Inc., 268 Fed.Appx. 837, 845 (11th Cir.2008) (unpublished) (analyzing award of attorney's fees for claims under the Illinois Sales Representative Act, in case also including non-ISRA claims).
One issue as to the applicability of sections 407.911-407.915which has been fully briefed and is certain to recur on remandthis court will now resolve. Under Missouri law, the 2005 amendment to the Missouri commissions statute cannot be applied retrospectively before August 28, 2005. See Hess v. Chase Manhattan Bank, U.S.A., 220 S.W.3d 758, 771 (Mo. banc 2007), approving State ex rel. Webster v. Cornelius, 729 S.W.2d 60, 66 (Mo. App.1987) (right to recover attorney's fees, first allowed by statutory amendment, could not be applied retrospectively because it attached a new disability on past transactions). Even so, attorney's fees may be recoverable as to sales within the scope of the applicable version of the Missouri commissions statute.

* * * * * *
The judgment is affirmed, and the motion for attorney's fees remanded for further proceedings consistent with this opinion.
NOTES
[1]  The Honorable James B. Loken stepped down as Chief Judge of the United States Court of Appeals for the Eighth Circuit at the close of business on March 31, 2010. He has been succeeded by the Honorable William J. Riley.
[2]  All citations to the Federal Rules of Civil Procedure are to the version effective December 1, 2009.
