Boeing Co. took an almost $5 billion hit to its bottom line in the second quarter over the grounding and delayed deliveries of its 737 Max planes—but tax benefits created by the charge will help the company for years to come.

Thanks to a revision to the tax code made by the 2017 tax overhaul, Boeing can carry losses from the 737 Max debacle forward to offset future taxes indefinitely, tax professionals said. Before the law’s changes to tax code Section 172, it would have faced a 20-year deadline.

While it reported the charge on its financial statements, the company won’t recognize the projected expenses for tax purposes until they have actually been incurred, according to tax professionals.

If companies record more deductions than income, they can generally carry forward the write-offs they didn’t take in the form of net operating losses. They can then use those NOLs to shrink the amount of their profits subject to tax in later years. So even if the company doesn’t turn a profit again for years, it can hold onto the losses and deploy them later to shield those future profits from tax.

If a company’s ownership changes, its ability to use those NOLs may be restricted, but that’s unlikely in this case, tax professionals said.

“The only thing potentially stopping Boeing from using the losses in future years would be lack of income,” said Larry Zelenak, a tax professor at Duke University School of Law. The tax overhaul “changed the law so that unused NOLs never expire, which means that timing of losses doesn’t matter going forward.”

Boeing expects to make the $4.9 billion payment piecemeal to airlines over “a number of years” and fully write off those expenses from its taxable income in the process, said Boeing spokesman Peter Pedraza.

The payment is tied to “potential concessions and other considerations to customers for disruptions” tied to the grounding of the plane, the company has previously said.

“Additional details of the tax implications will be dependent upon form and timing of customer considerations,” Pedraza said, referring to the airlines receiving the payments.

He declined to say whether they would take the form of current-year deductions, net operating losses, or a mix of the two, and the time period over which the company intended to use them.

“It should be a big NOL that the company can work through for several years, like the losses that the banks took in 2007,” said Andrew Silverman, a Bloomberg Intelligence tax policy analyst. He also noted that net operating losses can only offset 80% of income under the tax law’s change to the code.

Other Expenses Deductible Too

Boeing announced the $4.9 billion after-tax charge on July 18, and reported a $2.94 billion loss for the second quarter—resulting in a $793 million loss for the first six months of the year—in its second-quarter financial disclosure.

But that $4.9 billion payment isn’t the only expense stemming from the 737 Max fallout. The cost of producing the aircraft climbed $1.7 billion in the second quarter, the company reported in the July 18 announcement. The multinational has said it would offer compensation to families of the victims of two 737 Max crashes, but it also faces a slew of lawsuits.

The 2017 overhaul’s changes to Section 162 made penalties paid in a settlement with a government or similar entity non-deductible. But payments made to a non-government claimant should still be deductible, as are attorneys fees and other “ordinary and necessary expenses” incurred in a given year, tax professionals said.

The 737 Max was grounded after an Ethiopian Airlines flight crashed near Addis Ababa in March, killing all 157 people on board. That followed the crash of a Lion Air flight off the coast of Indonesia, with 189 fatalities, in October. Both resulted from a malfunctioning flight-control system that caused the planes to nosedive, prompting the U.S. Federal Aviation Administration to ground the jet.

The company reduced its production of the plane and plans to submit software updates to the FAA in September.

Future Financial Accounting Fallout

Rick Antle, a professor of accounting at Yale School of Management, said that the company had to make the accounting entry to acknowledge those future concessions once it could reasonably estimate the effect of delaying the delivery of all those planes.

But it is the amount, not the accounting entry itself, that is noteworthy, Antle said.

The $5.6 billion pre-tax accounting charge—which translated to a $4.9 billion post-tax expense—rippled across Boeing’s financial statement: reducing revenue, increasing other current assets and adding to accrued liabilities, the company said in its quarterly report.

Boeing CFO Greg Smith said on a July 24 earnings call that the drop in deliveries lowered cash receipts for the quarter. Building and storing the grounded planes also lowered the cash flow.

“You can expect the impacts on our cash flow to affect 2019 and beyond. We currently see this impact to be more front-end loaded in the first few years,” Smith said. “But it will depend on individual discussions with our customers.”

Boeing’s drop in deliveries of the 737 also contributed to the company’s lowered revenue, said Brandon Gipper, assistant professor of accounting at Stanford University’s Graduate School of Business.

Updated financial accounting rules for revenue recognition require companies to book revenue only once the product or service has been delivered to the customer. So no deliveries, no revenue, Gipper said.

Meanwhile, the cost to produce the 737 Max also increased. That means that for every plane that is delivered and revenue recognized, it will come with lower profits for Boeing, Gipper said.