begin
drop table if exists temp1;
drop table if exists temp2;
drop table if exists temp3 ;
select date_from,date_to into ldt_date1,ldt_date2 from year_master where
year_code = ls_year1 ;
create temp table temp1 as
SELECT cast(ls_year2 as char(4)) as year_code, branch_id||extension_id as
branch_id, gl_id,cast(0 as numeric(15,2)) as debit,cast(0 as numeric(15,2)) as
credit
FROM branch_extension_master a,gl_master where gl_id<>'0000';
/*
insert into temp1
select ls_year2,branch_id,'0000',cash_closing,0 from branch_day_closing
a
where txn_date=(select max(txn_date) from branch_day_closing b where
a.branch_id = b.branch_id and txn_date<= ldt_date2) ;
return ;
End;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION acc_gl_balance_transfer(character, character, refcursor)
OWNER TO postgres;