There is not a way to add an expense directly to a task, but there is one option that usually accomplishes the goal. When adding an expense there is a note field. The note field can be used to reference the task. If you need to track the person that the expense is associated with you can do that as well via the person drop down menu.
When running an expenses report the note field is viewable.
If you need to include a statement of work or detailed breakdown of all work performed for a client project, the project activity report is probably your best option. When running the report there are various filtration options that allow you to include the layer of granularity that you need. You can show how level work or very detailed work (including the description of work that was included when a timer was applied) depending on your preference.
This example shows including the billable hours and fees which includes the same project expense added above. With these options selected the project activity report totals the financial value of billable work up top, then shows each task and time entry, then any fees added for the date range of the project, and the grand total. If your client ever asks, “Why did it cost so much?” the project activity report is at your disposal ready to quickly justify your hard work.