Recently wrote a query for payroll detail information - so this is one line per employee/payroll code.
We've also added in header level withholding, direct deposit information, and comments
The resulting query might not be exactly what I'll need on the next job, but this template will be a good starting place. If I use it again I'll continue to update it.