26 USC 1341 – Computation of tax where taxpayer restores substantial amount held under claim of right
(a) General rule
If—
(1) an item was included in gross income for a prior taxable year (or years) because it appeared that the taxpayer had an unrestricted right to such item;
(2) a deduction is allowable for the taxable year because it was established after the close of such prior taxable year (or years) that the taxpayer did not have an unrestricted right to such item or to a portion of such item; and
(3) the amount of such deduction exceeds $3,000,
then the tax imposed by this chapter for the taxable year shall be the lesser of the following:
(4) the tax for the taxable year computed with such deduction; or
(5) an amount equal to—
(A) the tax for the taxable year computed without such deduction, minus
(B) the decrease in tax under this chapter (or the corresponding provisions of prior revenue laws) for the prior taxable year (or years) which would result solely from the exclusion of such item (or portion thereof) from gross income for such prior taxable year (or years).
For purposes of paragraph (5)(B), the corresponding provisions of the Internal Revenue Code of 1939 shall be chapter 1 of such code (other than subchapter E, relating to self-employment income) and subchapter E of chapter 2 of such code.
(b) Special rules
(1) If the decrease in tax ascertained under subsection (a)(5)(B) exceeds the tax imposed by this chapter for the taxable year (computed without the deduction) such excess shall be considered to be a payment of tax on the last day prescribed by law for the payment of tax for the taxable year, and shall be refunded or credited in the same manner as if it were an overpayment for such taxable year.
(2) Subsection (a) does not apply to any deduction allowable with respect to an item which was included in gross income by reason of the sale or other disposition of stock in trade of the taxpayer (or other property of a kind which would properly have been included in the inventory of the taxpayer if on hand at the close of the prior taxable year) or property held by the taxpayer primarily for sale to customers in the ordinary course of his trade or business. This paragraph shall not apply if the deduction arises out of refunds or repayments with respect to rates made by a regulated public utility (as defined in section 7701(a)(33) without regard to the limitation contained in the last two sentences thereof) if such refunds or repayments are required to be made by the Government, political subdivision, agency, or instrumentality referred to in such section, or by an order of a court, or are made in settlement of litigation or under threat or imminence of litigation.
(3) If the tax imposed by this chapter for the taxable year is the amount determined under subsection (a)(5), then the deduction referred to in subsection (a)(2) shall not be taken into account for any purpose of this subtitle other than this section.
(4) For purposes of determining whether paragraph (4) or paragraph (5) of subsection (a) applies—
(A) in any case where the deduction referred to in paragraph (4) of subsection (a) results in a net operating loss, such loss shall, for purposes of computing the tax for the taxable year under such paragraph (4), be carried back to the same extent and in the same manner as is provided under section 172; and
(B) in any case where the exclusion referred to in paragraph (5)(B) of subsection (a) results in a net operating loss or capital loss for the prior taxable year (or years), such loss shall, for purposes of computing the decrease in tax for the prior taxable year (or years) under such paragraph (5) (B), be carried back and carried over to the same extent and in the same manner as is provided under section 172 or section 1212, except that no carryover beyond the taxable year shall be taken into account.
(5) For purposes of this chapter, the net operating loss described in paragraph (4)(A) of this subsection, or the net operating loss or capital loss described in paragraph (4)(B) of this subsection, as the case may be, shall (after the application of paragraph (4) or (5)(B) of subsection (a) for the taxable year) be taken into account under section 172 or 1212 for taxable years after the taxable year to the same extent and in the same manner as—
(A) a net operating loss sustained for the taxable year, if paragraph (4) of subsection (a) applied, or
(B) a net operating loss or capital loss sustained for the prior taxable year (or years), if paragraph (5)(B) of subsection (a) applied.