Звучит так, будто вы хотите получить итоги только для одного кода. Если так, то примерно так:
select year,
sum(if(transaction_month <= concat(year,'-01'),amount,null)) Jan,
sum(if(transaction_month <= concat(year,'-02'),amount,null)) Feb,
sum(if(transaction_month <= concat(year,'-03'),amount,null)) Mar,
sum(if(transaction_month <= concat(year,'-04'),amount,null)) Apr,
sum(if(transaction_month <= concat(year,'-05'),amount,null)) May,
sum(if(transaction_month <= concat(year,'-06'),amount,null)) Jun,
sum(if(transaction_month <= concat(year,'-07'),amount,null)) Jul,
sum(if(transaction_month <= concat(year,'-08'),amount,null)) Aug,
sum(if(transaction_month <= concat(year,'-09'),amount,null)) Sep,
sum(if(transaction_month <= concat(year,'-10'),amount,null)) Oct,
sum(if(transaction_month <= concat(year,'-11'),amount,null)) Nov,
sum(if(transaction_month <= concat(year,'-12'),amount,null)) "Dec"
from (select distinct(year(date)) year from tblSales where CodeDebit='411' or CodeCredit='411') years
join (
select date_format(date, '%Y-%m') transaction_month, Amount amount
from tblSales where CodeCredit='411'
union all
select date_format(date, '%Y-%m'), -Amount
from tblSales where CodeDebit='411'
union all
select '0000-00', Amount
from tblOpenBalance where Code='411'
) transactions on transaction_month <= concat(year,'-12')
group by year