Investors & landlords

It seems like this was a disqualifying disposition, assuming your ESPP used the maximum 15% discount allowed; the reported compensation is exactly the 15% discount times 278 shares.

 

To answer your question, you want to ultimately use the $3,906 basis figure - a number that includes the $585 of compensation reported on your W-2.  That will reduce your taxable gain from your "purchase price" basis.  If you didn't use the higher basis you'd be reporting the same income twice: once as "compensation" and then again as a phantom "capital gain."