You may try with:
INSERT INTO table1 (date, voucherno, cashbalance, bankbalance, narration)
SELECT date,voucherno
,Case ledgerhead when 'cash' then balance else 0 end as cashbalance
,Case ledgerhead when 'bank' then balance else 0 end as bankbalance
,narration FROM table2