? A state appeals court ruling in favor of a former Pizza Hut magnate could put Kansas on the hook to refund millions of dollars in taxes he was forced to pay two years ago.

The Kansas Court of Appeals last month said a lower tax court had blatantly ignored state regulations when it ordered Gene Bicknell to pay $42 million in taxes and penalties for the sale of NPC International in 2006.

The state audited Bicknell’s taxes from 2005 to 2008 and determined he owed the money, the Topeka Capital-Journal reported. Under protest, he handed the money over in 2013.

Bicknell — whose company was the nation’s largest holder of Pizza Hut franchises — argued that he lived in Florida at the time of the sale, while the Kansas Department of Revenue contends his primary residence was in Kansas.

In its ruling in September, the Kansas Court of Appeals scolded the tax appeals court for ruling Bicknell was a Kansas resident without considering Revenue Department regulations for determining residency for tax purposes.

The appeals court also criticized COTA for failing to explain why it made its ruling.

“It is well established that COTA must give adequate reasons for its decisions. In its order, COTA focused exclusively on Kansas statutory law and caselaw . concerning Gene’s tax-residency status. COTA expressly ignored or disregarded the applicable (Revenue) regulations in explaining its findings and conclusions,” the Court of Appeals opinion reads.

The ruling sends the case back to COTA and orders it to take into account state regulations potentially favorable to Bicknell. That doesn’t mean Bicknell will ultimately prevail, but if he does it could be a blow to a state that’s already struggling to balance its books.

The Legislature and Gov. Sam Brownback crafted a revenue and budget deal in June to pay for fiscal year 2016, which runs through June 2016, by raising sales taxes and cutting costs.

Those deals were supposed to leave the state with a balance of about $77 million at the end of the fiscal year, but revenue collections have fallen below expectations during the first three months. An additional $42 million hit from a Bicknell payout, if it came during the current fiscal year, could push the state’s end balance into the red.

House Appropriations Chairman Ron Ryckman Jr., an Olathe Republican, indicated any payout would likely come from the state’s general fund. Even if the state didn’t have to pay this year, an additional $42 million in required spending could complicate any year’s budget.

Department of Revenue spokeswoman Jeannine Koranda declined to comment, citing pending litigation.