SELECT timecontrollings.id,
       areas.id as area,
       areas.nombre as nombreArea,
       categoria_centro_costos.id as catCentroCosto,
       categoria_centro_costos.nombre as nombreCatCentroCosto,
       ROUND(SUM(timecontrollings.horas),2) as horas,
       categoria_centro_costos.color,
       MONTH(timecontrollings.fecha) as mes,
       YEAR(timecontrollings.fecha) as year,
       timecontrollings.createdAt,
       timecontrollings.updatedAt
FROM   timecontrollings, centro_costos,categoria_centro_costos, areas, usuarios
WHERE timecontrollings.centroCosto=centro_costos.id AND
        centro_costos.categoria=categoria_centro_costos.id AND
        timecontrollings.usuario = usuarios.id AND
        usuarios.area = areas.id
GROUP BY areas.id,categoria_centro_costos.id,MONTH(timecontrollings.fecha), YEAR(timecontrollings.fecha)
