
860 A.2d 625 (2004)
WILSON AREA SCHOOL DISTRICT, Appellant
v.
Franklin E. SKEPTON, Joseph Bozzelli, Individually and t/a J.B. Plumbing Company, and Dual Temp Company, Inc., and Borough of Wilson.
Commonwealth Court of Pennsylvania.
Argued June 7, 2004.
Decided October 28, 2004.
*627 Michael A. Gaul, Bethlehem, for appellant.
Robert A. Alpert, Allentown, for appellee, Dual Temp Co., Inc.
Joseph F. Leeson, Jr., Bethlehem, for appellees, F. Skepton and J. Bozzelli individually and t/a J.B. Plumbing Co.
BEFORE: COLINS, President Judge, and FRIEDMAN, Judge, and MIRARCHI, JR., Senior Judge.
OPINION BY Senior Judge MIRARCHI, JR.
The Wilson Area School District (School District) appeals from an order of the Court of Common Pleas of Northampton County that found against the School District and in favor of Franklin E. Skepton (Skepton), Joseph Bozzelli, trading as J.B. Plumbing Company (J.B. Plumbing), and Dual Temp Company, Inc. (Dual Temp) (collectively, Contractors) in the action filed by the School District asserting a superior interest in the permit fees which had been ordered by the Pennsylvania Supreme Court to be refunded to the Contractors as illegally collected by the Borough of Wilson (Borough). We affirm.
The relevant facts are set forth in the parties' Stipulation of Facts (Stipulation) and the trial court's findings. The Contractors were successful bidders in public bids invited by the School District in 1992 for construction of a new high school. On June 3, 1992, the School District awarded a general construction contract to Skepton for $11,318,000, a plumbing contract to J.B. Plumbing for $812,000, and a heating, cooling and ventilation contract to Dual Temp for $2,201,612. The bid specifications set forth in the Notice to Contractors, Instructions to Bidders and General Conditions of the Contract (General Conditions) were incorporated into separate contracts (Contracts) entered into between the School District and the Contractors pursuant to Section 751(a) of the Public School Code of 1949, Act of March 10, 1949, P.L. 30, as amended, 24 P.S. § 7-751(a).[1] In the Contracts, the Contractors agreed to furnish labor, materials, tools, equipment, facilities and supplies for the construction and secure and pay for all required construction permits and licenses, in consideration of the School District's payment of the lump sum contract price.
Subsequently, Skepton, J.B. Plumbing and Dual Temp each applied for the construction permits with the Borough and were assessed permit fees in the amount of $88,838, $9120 and $22,021, respectively, under the fee schedule set forth in the Borough's permit fee ordinances and resolution (Ordinances). After paying the assessed permit fees under protest, the Contractors filed separate actions against the Borough in 1992 and 1993 challenging the validity of the Ordinances.
In those actions, the trial court found that the assessed fees were grossly disproportionate to the actual costs of regulating and inspecting the construction project, $1234 or 1% of the assessed fees, and that the Borough collected the permit fees primarily to raise its revenues in violation of Section 1202 of The Borough Code, Act of February 1, 1966, P.L. (1965), as amended, *628 53 P.S. § 46202. The trial court accordingly declared the Ordinances invalid and ordered the Borough to fully refund the permit fees to the Contractors. On appeal, this Court affirmed the trial court's determination that the Ordinances were invalid. This Court concluded, however, that the Contractors were not entitled to receive a refund of the permit fees because the lump sum contract price paid by the School District covered the permit fees paid by the Contractors to the Borough.
The Pennsylvania Supreme Court granted appeal on the sole issue of the Borough's obligation to refund the illegally collected permit fees to the Contractors. The Supreme Court held that under Section 1 of the Act of May 21, 1943, P.L. 349, as amended, 72 P.S. § 5566b, the Borough must refund the illegally collected permit fees to the Contractors, regardless of their ability to pass on the costs of the permit fees to others. Skepton v. Borough of Wilson, 562 Pa. 344, 755 A.2d 1267 (2000). The Court stated that "[e]ven if the Contractors receive a complete windfall, the return of the illegally appropriated funds to the Contractors, rather than to the Borough, will be the lesser of two evils" Id. at 352, 755 A.2d at 1272. In a footnote, the Court further stated: "In fact, the determination that the Contractors ... will receive a windfall is not necessarily a foregone conclusion. Upon the Contractors['] receipt of a refund, the School District might very well initiate an action against the Contractors asserting, perhaps, a restitution interest in the funds. Thus, any purported windfall might very well be short lived." Id. at 352 n. 4, 755 A.2d at 1272 n. 4.
The School District thereafter demanded that the Borough refund the permit fees directly to the School District. The School District also commenced the instant action against the Contractors and the Borough, seeking an order declaring that the School District has a superior interest in the refunded permit fees; imposing a constructive trust on the refunded fees; and directing the Borough to refund the fees directly to the School District. The Borough then filed a petition for interpleader seeking to pay the permit fee refund to the court pending resolution of the dispute. Pursuant to the parties' subsequent agreement, the Borough deposited the permit fees and accrued interests thereon in the amount of $181,978.25 into an escrow account. The Borough was then dismissed from the case.
Based on the Stipulation and the evidence presented at a bench trial, at which only the Contractors' witnesses testified, the trial court concluded that the Contractors had no contractual obligation to return the refunded permit fees to the School District, that under the Contracts, the Contractors were not agents owing a fiduciary duty to return cost savings to the School District, and that the School District is not entitled to restitution under the equitable doctrines of unjust enrichment and a mistake of law. The trial court accordingly issued a decree nisi finding in favor of the Contractors and against the School District. The trial court later denied the School District's motion for post-trial relief and made the decree nisi a final decree. The School District's appeal to this Court followed.[2]
The School District first contends that because the School District ultimately *629 paid the permit fees, the Contractors should be ordered to return cost savings resulting from the permit fee refund to the School District to prevent them from receiving a windfall.
The facts in this matter are similar to those in Planters Nut & Chocolate Co. v. Brown-Murray Co., 128 Pa.Super. 239, 193 A. 381 (1937). In that case, the seller sold the bags of peanuts to the buyer at $6.90 per hundredweight. At that time, the sale of shelled peanuts was subject to the processing tax of one cent per pound. The sales contract and the invoices, however, set forth only the total sale price without separately listing the tax included in the price. Subsequently, the processing tax was held unconstitutional. The seller later cancelled the sales contract because of the buyer's failure to furnish shipping instructions and sold remaining shipments to mitigate damages.
The issue in Planters Nut was whether the buyer was entitled to a setoff of the processing tax on the sale against damages to be recovered by the seller. The Court held that the buyer could not claim a setoff, even if the sale price included the tax. The Court reasoned:
The invoices received in evidence show only the price of the merchandise supplied. They do not disclose a tax billed to the plaintiff's assignor and collected by defendant in addition to the stated price of the merchandise, since there is no segregation of the tax item on the invoices. It thus appears that the tax was absorbed in a total or composite price paid at all events. In such a case the buyer is without remedy, though the annulment of the tax may increase the profit to the seller.
Id. at 384 (quoting Christopher v. Hoger & Co., 160 Misc. 21, 22, 289 N.Y.S. 105, 106 (1936)). The Court further stated: "The purchaser does not pay the tax. He pays or may pay the seller more for the goods because of the seller's obligation, but that is all.... The price is the total sum paid for the goods. The amount added because of the tax is paid to get the goods and for nothing else." Planters Nut, 193 A. at 384 (quoting Lash's Products Co. v. United States, 278 U.S. 175, 176, 49 S.Ct. 100, 73 L.Ed. 251 (1929)).
In this matter, the Contractors were not required to itemize the estimated costs in submitting the bids. Nor did the Contracts include a breakdown of the construction costs. The School District instead paid the Contractors the lump sum contract price as the total costs of the construction and did not agree to re-adjust the contract price in the event of the Contractors' cost savings or losses. Thus, the permit fees were not separate and additional costs. Rather, the permit fees were absorbed and buried in the total or composite contract price, as the processing tax in Planters Nut. Therefore, the School District is not entitled to the refunded permit fees even if the refund results in cost savings to the Contractors.[3]
Further, the School District failed to reserve a right to claim an interest in the refunded permit fees. The General Condition provided in relevant part:

*630 9.7.4 The making of final payment shall constitute a waiver of all claims by the Owner except those arising from:
1 unsettled liens,
2 faulty or defective work appearing after acceptance,
3 failure of the work to comply with the requirements of the Contracts, OR
4 terms of any special guarantees required by the Contract documents.
9.7.5 The acceptance of final payment shall constitute a waiver of all claims by the Contractor except those previously made in wring and still unsettled.
The School District made the final payment of the contract price in 1995 upon the completion of construction. It is undisputed that the exceptions listed in Paragraph 9.7.4 of the General Condition are inapplicable to this matter. Consequently, upon its final payment of the contract price the School District waived all claims it may have against the Contractors and may not now assert its interest in the refunded permit fees several years later. Where, as here, the party failed to anticipate foreseeable events in entering into the contract, the court may not rewrite the contract to grant requested relief. In re Estate of Hall, 517 Pa. 115, 535 A.2d 47 (1987).
The School District next contends that the Contractors were agents of the School District owing a fiduciary duty to return the refunded permit fees to the School District.
There are three basic elements for a principal-agent relationship: (1) manifestation by a principal that an agent shall act for the principal; (2) the agent's acceptance of the undertaking; and (3) the parties' understanding that the principal is to be in control of the undertaking. Basile v. H & R Block, Inc., 563 Pa. 359, 761 A.2d 1115 (2000). An agency relationship may exist "only if there is an agreement for the creation of a fiduciary relationship with control by the beneficiary." Smalich v. Westfall, 440 Pa. 409, 413, 269 A.2d 476, 480 (1970). The party asserting an agency relationship has the burden of establishing such relationship. Basile.
To support an alleged agency relationship, the School District relies on the following language in the Contracts:
The Contractor, recognizing the relations of trust and confidence established between himself and the Owner by the terms of this agreement, undertakes to furnish his best skill and judgment and to cooperate loyally with the Architect in forwarding the interests of the Owner, and to have no pecuniary interest, direct, or indirect, in the contract, or in its performance other than as disclosed in this agreement.
Second Paragraph of the Contracts. The School District also relies on Section 6.2.5 of the General Conditions, which provides:
Each Contractor shall cooperate with all other Contractors in forwarding the interest of the Owner, and shall coordinate his work with that of all other Contractors under the general direction of the General Contractor, who shall be in charge of the progress of the project and all divisions and subdivisions thereof.
These provisions, however, merely set forth the Contractors' general duty to use best skill and judgment and cooperate with the architect, the general contractor and others in performing their contractual obligations and do not in any way imply the parties' intent to create an agency relationship. In the Contracts drafted by the School District, the parties referred the School District as the "Owner" and Skepton, J.B. Plumbing and Dual Temp as the "Contractors." In paying the lump sum contract price, the School District did not *631 reserve a right to control the manner, in which the Contractors performed their contractual duties. Moreover, Section 4.17.1 of the General Conditions specifically provides:
It is hereby mutually covenanted and agreed that the status of the Contractors in the work to be performed by him under the contract is that of an independent contractor and ... that as such he alone shall be responsible for any and all damage, loss or injury to persons or property that may arise, or be incurred in or during the conduct or progress of said work without regard to whether or not the Contractor, his Subcontractors, agents, or employees have been negligent.... (Emphasis added.)
Under the express terms of the Contracts, therefore, the Contractors were independent contractors, not agents, and did not owe the School District a fiduciary duty to return any cost savings.
The School District further contends that it is entitled to restitution of the refunded permit fees under the equitable doctrines of unjust enrichment and a mistake of law.
The elements of unjust enrichment include (1) benefits conferred on the defendant by the plaintiff; (2) appreciation of the benefits by the defendant; and (3) the defendant's acceptance and retention of the benefits under circumstances that it would be inequitable to do so. Wiernik v. PHH U.S. Mortgage Corp., 736 A.2d 616 (Pa.Super.1999), appeal denied, 561 Pa. 700, 751 A.2d 193 (2000). The mere fact that the defendant may have benefited from the plaintiff's action alone is insufficient to grant relief under the doctrine. Meehan v. Cheltenham Township, 410 Pa. 446, 189 A.2d 593 (1963). It must be shown that the defendant's enrichment is "unjust." Styer v. Hugo, 422 Pa.Super. 262, 619 A.2d 347 (1993), aff'd, 535 Pa. 610, 637 A.2d 276 (1994). The defendant is "unjustly" enriched where he or she receives the benefits wrongfully or passively. Torchia v. Torchia, 346 Pa.Super. 229, 499 A.2d 581 (1985).
In this matter, the Contractors obtained the permit fee refund pursuant to the Supreme Court's order after the protracted litigation they commenced in 1992 and 1993. Therefore, they did not obtain the benefits wrongfully or passively. Further, they were not unjustly "enriched" because they did not have the contractual obligation to return any cost savings to the School District. Hence, the School District failed to establish its entitlement to relief under the doctrine of unjust enrichment.
Further, in Pennsylvania a party is generally not entitled to equitable relief based on ignorance or mistake of law where the party had full knowledge of all the material facts in entering into a contract. First National Bank of Sunbury v. Rockefeller, 333 Pa. 553, 5 A.2d 205 (1939); Brady Township v. Ashley, 17 Pa.Cmwlth. 226, 331 A.2d 585 (1975). At the trial, the School District did not present any evidence to support the alleged mistake of law. Nor does the Stipulation reveal any special circumstances that may support the requested relief under a mistake of law. Therefore, the trial court properly rejected the School District's reliance on that theory.
Finally, the School District relies on the common law doctrine of money had and received. Where one receiving money from another for a particular purpose neglects or refuses to apply the money to such purpose, the money may be recovered in an action for money had and received. First Nat. Bank of Monongahela City v. Carroll Tp., 150 Pa.Super. 241, 27 A.2d 527 (1942). The School District, *632 however, failed to allege such cause of action in its pleadings. Further, the dispute in this matter concerns the refund of the permit fees paid by the Contractors under protest and later refunded as illegally collected. Because the Contractors neither neglected nor refused to pay the fees to obtain the permits, the doctrine is inapplicable to this matter.
Accordingly, the order of the trial court is affirmed.[4]

O R D E R
AND NOW, this 28th day of October, 2004, the order of the Court of Common Pleas of Northampton County in the above-captioned matter is affirmed.
NOTES
[1]  Section 751(a) provides that "[a]ll construction, reconstruction, repairs, maintenance or work of any nature ... upon any school building or upon any school property ... shall be done under separate contracts to be entered into by such school district with the lowest responsible bidder."
[2]  This Court's review of the trial court's order granting or denying a motion for post-trial relief is limited to determining whether the trial court abused its discretion or committed an error of law. City of Chester v. Chester Redevelopment Authority, 686 A.2d 30 (Pa.Cmwlth.1996), appeal denied, 548 Pa. 650, 695 A.2d 787 (1997).
[3]  In calculating the bid amount, J.B. Plumbing estimated the permit fees to be $9120 and paid the same amount to obtaining the permits. Skepton and Dual Temp each estimated $6000 and $21,561 and paid $88,838 and $22,021, respectively, for the permits. Paragraphs 22, 35 and 65 of the Stipulation. At the trial, the Contractors asserted that they actually suffered losses in the construction project. Under the School District's theory, the Contractors would be equally entitled to re-adjustment of the contract price based on their losses.
[4]  Because we affirm the trial court's decision, it is unnecessary to address the Contractors' contention that they are entitled to a setoff of attorney's fees incurred to obtain the permit fee refund against any amount to be awarded to the School District.
