SELECT
MONTH(c.feccotizacion) as mes,
ies.ingresos, ies.egresos,
SUM(c.totalcotizacion) AS totalcotizacion,
ord.totalorden
FROM cotizaciones AS c
LEFT JOIN (
SELECT r.fecregistro, SUM(IF(r.idmovimiento = 1,r.vlrregistro,NULL)) AS ingresos, SUM(IF(r.idmovimiento = 2 AND r.idcategoria <> 8,r.vlrregistro,NULL)) AS egresos FROM registros AS r WHERE r.idmovimiento IN (1, 2) AND r.idestado <> 7 GROUP BY month(r.fecregistro)) ies
ON ies.fecregistro = c.feccotizacion
LEFT JOIN (
SELECT IF(feciop IS NULL, fecicom, feciop) AS fecorden, SUM(totalorden) AS totalorden FROM ordenes WHERE id_estado <> 7 GROUP BY fecorden ) ord
ON ord.fecorden = c.feccotizacion
WHERE c.id_estado <> 7 AND c.feccotizacion BETWEEN '2020-01-01' AND '2020-03-15'
GROUP BY MONTH(c.feccotizacion) DESC