The total amounts presented in the Consolidated Statements of Income and Comprehensive Income due to changes in the fair value of the following derivative instruments for the fiscal years ended July 31, 2024, 2023 and 2022 are as follows: | | | | | | | | | | | | | | | | | | | | | | | 2024 | | 2023 | | 2022 | | Gain (Loss) on Derivatives Designated as Cash Flow Hedges | | | | | | | | Gain (loss) recognized in Other comprehensive income (loss), net of tax | | | | | | | | Foreign currency forward contracts | | $ | — | | | $ | — | | | $ | 6 | | Interest rate swap agreements (1) | | — | | | (675) | | | 9,324 | | | Total gain (loss) | | $ | — | | | $ | (675) | | | $ | 9,330 | |
(1)Other comprehensive income, net of tax, before reclassification from AOCI was $0, $702 and $3,626 for fiscal years 2024, 2023 and 2022, respectively. | | | | | | | | | | | | | | | | | | | 2024 | | | Sales | | | | Interest Expense | | | | | | | | | | | | | | | | | | | | | | | (Loss) on Derivatives Not Designated as Hedging Instruments | | | | | | | | Amount of (loss) recognized in income, net of tax | | | | | | | | Foreign currency forward contracts | | $ | (962) | | | | | $ | — | | | | | | | | | | Interest rate swap agreements | | — | | | | | (160) | | | Total (loss) | | $ | (962) | | | | | $ | (160) | |
| | | | | | | | | | | | | | | | | | | 2023 | | | Sales | | | | Interest Expense | | Gain (Loss) Reclassified from AOCI, Net of Tax | | | | | | | | Foreign currency forward contracts | | $ | (58) | | | | | $ | — | | | Interest rate swap agreements | | — | | | | | 1,377 | | | Gain (Loss) on Derivatives Not Designated as Hedging Instruments | | | | | | | | Amount of gain (loss) recognized in income, net of tax | | | | | | | | Foreign currency forward contracts | | 2,742 | | | | | — | | | Commodities swap agreements | | (2,229) | | | | | — | | | Interest rate swap agreements | | — | | | | | 167 | | | Total gain (loss) | | $ | 455 | | | | | $ | 1,544 | |
| | | | | | | | | | | | | | | | | | | 2022 | | | Sales | | | | Interest Expense | | Gain (Loss) Reclassified from AOCI, Net of Tax | | | | | | | | Foreign currency forward contracts | | $ | (723) | | | | | $ | — | | | Interest rate swap agreements | | — | | | | | (5,698) | | | Gain (Loss) on Derivatives Not Designated as Hedging Instruments | | | | | | | | Amount of gain (loss) recognized in income, net of tax | | | | | | | | | | | | | | | | | | | | | | Interest rate swap agreements | | — | | | | | 428 | | | Total gain (loss) | | $ | (723) | | | | | $ | (5,270) | |
|