Annual report pursuant to Section 13 and 15(d)

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

v3.7.0.1
Assets and Liabilities, at Fair Value (Assets and Liabilities Measured at Fair Value on Recurring Basis) (Details) - USD ($)
$ in Thousands
Jun. 30, 2017
Jun. 30, 2016
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets $ 17,587 $ 33,732
Derivative liabilities 34,582 36,454
Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 284,619 245,041
Total assets valued at fair value 302,206 278,773
Other long-term liabilities 5,625 4,352
Product financing arrangement 135,343 59,358
Contingent earn-out liability 1,325  
Total liabilities, valued at fair value 176,875 100,164
Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Inventory 284,619 245,041
Total assets valued at fair value 302,206 278,773
Other long-term liabilities 5,625 4,352
Product financing arrangement 135,343 59,358
Contingent earn-out liability 0  
Total liabilities, valued at fair value 175,550 100,164
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 0 0
Product financing arrangement 0 0
Contingent earn-out liability 0  
Total liabilities, valued at fair value 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 0 0
Product financing arrangement 0 0
Contingent earn-out liability 1,325  
Total liabilities, valued at fair value 1,325 0
Liability on margin accounts | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,797 8,182
Liability on margin accounts | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 4,797 8,182
Liability on margin accounts | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Liability on margin accounts | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Open sale and purchase commitments | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 29,785 1,919
Open sale and purchase commitments | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 29,785 1,919
Open sale and purchase commitments | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Open sale and purchase commitments | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities 0 0
Future contracts | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   13,914
Future contracts | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   13,914
Future contracts | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   0
Future contracts | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   0
Forward contracts | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   12,439
Forward contracts | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   12,439
Forward contracts | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   0
Forward contracts | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative liabilities   0
Derivative Asset Open Purchases And Sales Commitments | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 931 32,347
Derivative Asset Open Purchases And Sales Commitments | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 931 32,347
Derivative Asset Open Purchases And Sales Commitments | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Derivative Asset Open Purchases And Sales Commitments | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Future contracts | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 1,273  
Future contracts | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 1,273  
Future contracts | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0  
Future contracts | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0  
Forward contracts | Fair Value on a Recurring Basis    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 15,383 1,385
Forward contracts | Fair Value on a Recurring Basis | Level 1    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 15,383 1,385
Forward contracts | Fair Value on a Recurring Basis | Level 2    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets 0 0
Forward contracts | Fair Value on a Recurring Basis | Level 3    
Fair Value, Assets and Liabilities Measured on Recurring and Nonrecurring Basis [Line Items]    
Derivative assets $ 0 $ 0