Quarterly report pursuant to Section 13 or 15(d)

Assets and Liabilities, at Fair Value (Assets and Liabilities Measured at Fair Value on Recurring Basis) (Details)

v3.8.0.1
Assets and Liabilities, at Fair Value (Assets and Liabilities Measured at Fair Value on Recurring Basis) (Details) - USD ($)
$ in Thousands
Dec. 31, 2017
Jun. 30, 2017
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets $ 1,399 $ 17,587
Derivative liabilities 27,420 34,582
Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 335,106 284,619
Total assets valued at fair value 336,505 302,206
Other long-term liabilities (related party) 19,526 5,625
Product financing arrangements 120,161 135,343
Other Liabilities, Price Protection Program, Fair Value Disclosure 84  
Contingent earn-out liability 588 1,325
Total liabilities, valued at fair value 167,695 176,875
Fair Value on a Recurring Basis | Liability on margin accounts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,252 4,797
Fair Value on a Recurring Basis | Open sale and purchase commitments    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 2,561 29,785
Fair Value on a Recurring Basis | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,167  
Fair Value on a Recurring Basis | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 16,356  
Fair Value on a Recurring Basis | Derivative assets — open sale and purchase commitments, net    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 1,009 931
Fair Value on a Recurring Basis | Options Held    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 158  
Fair Value on a Recurring Basis | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 179 1,273
Fair Value on a Recurring Basis | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 53 15,383
Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 335,106 284,619
Total assets valued at fair value 336,505 302,206
Other long-term liabilities (related party) 19,526 5,625
Product financing arrangements 120,161 135,343
Other Liabilities, Price Protection Program, Fair Value Disclosure 0  
Contingent earn-out liability 0 0
Total liabilities, valued at fair value 167,023 175,550
Fair Value on a Recurring Basis | Level 1 | Liability on margin accounts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,252 4,797
Fair Value on a Recurring Basis | Level 1 | Open sale and purchase commitments    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 2,561 29,785
Fair Value on a Recurring Basis | Level 1 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,167  
Fair Value on a Recurring Basis | Level 1 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 16,356  
Fair Value on a Recurring Basis | Level 1 | Derivative assets — open sale and purchase commitments, net    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 1,009 931
Fair Value on a Recurring Basis | Level 1 | Options Held    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 158  
Fair Value on a Recurring Basis | Level 1 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 179 1,273
Fair Value on a Recurring Basis | Level 1 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 53 15,383
Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 0 0
Total assets valued at fair value 0 0
Other long-term liabilities (related party) 0 0
Product financing arrangements 0 0
Other Liabilities, Price Protection Program, Fair Value Disclosure 0  
Contingent earn-out liability 0 0
Total liabilities, valued at fair value 0 0
Fair Value on a Recurring Basis | Level 2 | Liability on margin accounts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Fair Value on a Recurring Basis | Level 2 | Open sale and purchase commitments    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Fair Value on a Recurring Basis | Level 2 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0  
Fair Value on a Recurring Basis | Level 2 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0  
Fair Value on a Recurring Basis | Level 2 | Derivative assets — open sale and purchase commitments, net    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Fair Value on a Recurring Basis | Level 2 | Options Held    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0  
Fair Value on a Recurring Basis | Level 2 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Fair Value on a Recurring Basis | Level 2 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 0 0
Total assets valued at fair value 0 0
Other long-term liabilities (related party) 0 0
Product financing arrangements 0 0
Other Liabilities, Price Protection Program, Fair Value Disclosure 84  
Contingent earn-out liability 588 1,325
Total liabilities, valued at fair value 672 1,325
Fair Value on a Recurring Basis | Level 3 | Liability on margin accounts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Fair Value on a Recurring Basis | Level 3 | Open sale and purchase commitments    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Fair Value on a Recurring Basis | Level 3 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0  
Fair Value on a Recurring Basis | Level 3 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0  
Fair Value on a Recurring Basis | Level 3 | Derivative assets — open sale and purchase commitments, net    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Fair Value on a Recurring Basis | Level 3 | Options Held    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0  
Fair Value on a Recurring Basis | Level 3 | Future contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Fair Value on a Recurring Basis | Level 3 | Forward contracts    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets $ 0 $ 0