Multiple Joins with Sums
SELECT (CASE WHEN N.wbs_item_id IS NULL  THEN 'Grand Total' ELSE N.name END) AS '',
(CASE WHEN N.Materials IS NULL  THEN 'Total(Materials)', ELSE N.name END) AS '',
(CASE WHEN N.Labour IS NULL  THEN 'Total(Labour)' ELSE N.name END) AS '',

Total AS ''
FROM(
SELECT (CASE WHEN F.name='Materials' THEN F.name END ) AS 'Materials',
(CASE WHEN F.name='Labour' THEN F.name END ) AS 'Labour',wbs_item_id,SUM(Total) AS 'Total'
FROM(  
SELECT b.wbs_item_id,w.name,w.parent_id,b.Total AS 'Total'
FROM wbs_items w,budgets t
LEFT JOIN  budget_items b  ON  b.wbs_item_id = w.id  AND b.id=t.id
)E,(SELECT name,id FROM wbs_item  WHERE parent_id IS NULL )F


WHERE E.wbs_item_id = F.id)N
    GROUP BY Materials,Labour,wbs_item_id WITH ROLLUP;