SELECT
  e.first_name, e.last_name, e.job_title,
  l.work_date, l.hours, l.hourly_rate,
  (l.hours * l.hourly_rate) AS total_cost,
  o.id AS order_id
FROM consumption_labor l
JOIN consumption_orders o ON o.id=l.order_id
JOIN employees e ON e.id=l.employee_id
WHERE o.project_id = ?
ORDER BY l.work_date, o.id, e.last_name;
