Вот вариант способа решения:
select barcode, sum(if (tbl='incomes',quantity,0)) as inc_quant, sum(if (tbl='sales',quantity,0)) as sal_quant
from
(
select 'b' as barcode, 5 as quantity, 'incomes' as tbl
union all
select 'c' as barcode, 7 as quantity, 'incomes' as tbl
union all
select 'b' as barcode, 10 as quantity, 'sales' as tbl
union all
select 'c' as barcode, 100 as quantity, 'sales' as tbl
) subquery
group by barcode
;
Четыре селекта в подзапросе имитируют работу двух Ваших запросов к разным таблицам. Объединяем их и суммируем по
barcode. Получаем:
"barcode" "inc_quant" "sal_quant"
"b" "5" "10"
"c" "7" "100"