Can you use departments with payroll.

Can you use departments with payroll.  Will the expenses go to the appropriate departments.