create or replace package body pk_srv_mis_rpt as --ประมาณการยอดคงเหลือเงินฝาก procedure of_post_dep_sum(avc_coop varchar2,ad_start date,ad_est date) as type cursor_data is ref cursor; cur_data cursor_data; la_bizzrpt misrptest%rowtype; ld_bizz misrptest.bizz_date%type; ln_sumbizz1 misrptest.sumbizz1_value%type; ln_sumbizz2 misrptest.sumbizz2_value%type; ln_sumbizz3 misrptest.sumbizz3_value%type; ln_sumbizz4 misrptest.sumbizz4_value%type; ln_sumbizzrl4 misrptest.sumbizzrl4_value%type; ln_calbizz4 misrptest.sumbizz4_value%type; ln_sumcalbizz4 misrptest.sumbizz4_value%type; ln_sumbizz5 misrptest.sumbizz5_value%type; ln_ratio1 misrptest.ratio1_percent%type; ln_ratio2 misrptest.ratio2_percent%type; ln_sumall1 misrptest.sumall1_value%type; ln_sumall2 misrptest.sumall2_value%type; lb_firstrw boolean; begin delete from misrptest where coop_id = avc_coop and bizz_system = 'DEP' and rpt_code = 'SS'; open cur_data for select deplastmth , deplastmth04_value , deplastmth03_value , deplastmth02_value , deplastmth01_value , sumall01 , sumall02 , ( ratio1 / 100 ) as ratio1 , ( ratio2 / 100 ) as ratio2 from( select deplastmth , deplastmth04_value , deplastmth03_value , deplastmth02_value , deplastmth01_value , ( deplastmth03_value + deplastmth02_value + deplastmth01_value ) as sumall01 , ( deplastmth04_value + deplastmth03_value + deplastmth02_value ) as sumall02 , decode( rown , 1 , 0 , ( ( deplastmth03_value + deplastmth02_value + deplastmth01_value ) / decode( ( bfdeplastmth03_value + bfdeplastmth02_value + bfdeplastmth01_value ) , 0 , 1 , ( bfdeplastmth03_value + bfdeplastmth02_value + bfdeplastmth01_value ) ) ) ) as ratio1 , decode( rown , 1 , 0 , ( ( deplastmth04_value + deplastmth03_value + deplastmth02_value ) / decode( ( bfdeplastmth04_value + bfdeplastmth03_value + bfdeplastmth02_value ) , 0 , 1 , ( bfdeplastmth04_value + bfdeplastmth03_value + bfdeplastmth02_value ) ) ) ) as ratio2 from( select rown , deplastmth , deplastmth04_value , deplastmth03_value , deplastmth02_value , deplastmth01_value , nvl( lag( deplastmth04_value , 1 ) over( order by deplastmth ) , deplastmth04_value ) as bfdeplastmth04_value , nvl( lag( deplastmth03_value , 1 ) over( order by deplastmth ) , deplastmth03_value ) as bfdeplastmth03_value , nvl( lag( deplastmth02_value , 1 ) over( order by deplastmth ) , deplastmth02_value ) as bfdeplastmth02_value , nvl( lag( deplastmth01_value , 1 ) over( order by deplastmth ) , deplastmth01_value ) as bfdeplastmth01_value from ( select ( du.rown + 10 ) as rown , last_day( add_months( ad_start , du.rown - 1 ) ) as deplastmth , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= last_day( add_months( ad_start , sdu.rwn - 1 ) ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth04_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= last_day( add_months( ad_start , sdu.rwn - 13 ) ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth03_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= last_day( add_months( ad_start , sdu.rwn - 25 ) ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth02_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= last_day( add_months( ad_start , sdu.rwn - 37 ) ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth01_value from ( select rownum rown from dual connect by level <= 12 ) du union select du.rown as rown , ( trunc( add_months( ad_start , du.rown - 1 ) , 'mm' ) + 14 ) as deplastmth , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= ( trunc( add_months( ad_start , sdu.rwn - 1 ) , 'mm' ) + 14 ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth04_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= ( trunc( add_months( ad_start , sdu.rwn - 13 ) , 'mm' ) + 14 ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth03_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= ( trunc( add_months( ad_start , sdu.rwn - 25 ) , 'mm' ) + 14 ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth02_value , nvl( ( select sum( dtm.prncbal ) as sumdep from dpdeptstatement dtm , ( select d.coop_id as coop_id, d.deptaccount_no as deptno , max( d.seq_no ) as seqno , sdu.rwn as rwn from dpdeptstatement d , ( select rownum as rwn from dual connect by level <= 12 ) sdu where d.item_status = 1 and d.operate_date <= ( trunc( add_months( ad_start , sdu.rwn - 37 ) , 'mm' ) + 14 ) group by d.coop_id , d.deptaccount_no , sdu.rwn ) mst where dtm.coop_id = mst.coop_id and dtm.deptaccount_no = mst.deptno and dtm.seq_no = mst.seqno and du.rown = mst.rwn and dtm.coop_id = avc_coop ) , 0 ) / 1000000 as deplastmth01_value from ( select rownum as rown from dual connect by level <= 12 ) du ) ) ) order by deplastmth ; loop fetch cur_data into ld_bizz , ln_sumbizz4 , ln_sumbizz3 , ln_sumbizz2 , ln_sumbizz1 , ln_sumall1 , ln_sumall2 , ln_ratio1 , ln_ratio2 ; exit when cur_data%notfound; ln_sumbizzrl4 := ln_sumbizz4; if ad_est < ld_bizz then ln_calbizz4 := ln_ratio1 * ln_sumcalbizz4; ln_sumcalbizz4 := ln_sumcalbizz4 + ln_calbizz4; ln_sumbizz4 := ln_sumcalbizz4; else ln_sumcalbizz4 := ln_sumbizz4; end if; insert into misrptest ( coop_id , bizz_system , rpt_code , bizz_date , sumbizz1_value , sumbizz2_value , sumbizz3_value , sumbizz4_value , sumbizzrl4_value , sumbizz5_value , ratio1_percent , ratio2_percent , sumall1_value , sumall2_value ) values ( avc_coop , 'DEP' , 'SS' , ld_bizz , ln_sumbizz1 , ln_sumbizz2 , ln_sumbizz3 , ln_sumbizz4 , ln_sumbizzrl4 , ln_sumbizz5 , ln_ratio1, ln_ratio2 , ln_sumall1 , ln_sumall2 ); end loop; close cur_data; lb_firstrw := true; open cur_data for select * from misrptest where coop_id = avc_coop and bizz_system = 'DEP' and rpt_code = 'SS' order by coop_id , bizz_date ; loop fetch cur_data into la_bizzrpt; exit when cur_data%notfound; if lb_firstrw then ln_sumbizz5 := ln_sumbizz4; else ln_calbizz4 := la_bizzrpt.ratio2_percent * ln_sumbizz5 ; ln_sumbizz5 := ln_sumbizz5 + ln_calbizz4; end if; update misrptest set sumbizz5_value = ln_sumbizz5 where coop_id = la_bizzrpt.coop_id and bizz_system = la_bizzrpt.bizz_system and rpt_code = la_bizzrpt.rpt_code and bizz_date = la_bizzrpt.bizz_date; lb_firstrw := false ; end loop; close cur_data; end of_post_dep_sum; --ประมาณการยอดคงเหลือหุ้น procedure of_post_shr_sum(avc_coop varchar2,ad_start date,ad_est date) as type cursor_data is ref cursor; cur_data cursor_data; la_bizzrpt misrptest%rowtype; ld_bizz misrptest.bizz_date%type; ln_sumbizz1 misrptest.sumbizz1_value%type; ln_sumbizz2 misrptest.sumbizz2_value%type; ln_sumbizz3 misrptest.sumbizz3_value%type; ln_sumbizz4 misrptest.sumbizz4_value%type; ln_sumbizzrl4 misrptest.sumbizzrl4_value%type; ln_calbizz4 misrptest.sumbizz4_value%type; ln_sumcalbizz4 misrptest.sumbizz4_value%type; ln_sumbizz5 misrptest.sumbizz5_value%type; ln_ratio1 misrptest.ratio1_percent%type; ln_ratio2 misrptest.ratio2_percent%type; ln_sumall1 misrptest.sumall1_value%type; ln_sumall2 misrptest.sumall2_value%type; lb_firstrw boolean; begin delete from misrptest where coop_id = avc_coop and bizz_system = 'SHR' and rpt_code = 'SS'; open cur_data for select shrlastmth , shrlastmth04_value , shrlastmth03_value , shrlastmth02_value , shrlastmth01_value , sumall01 , sumall02 , ( ratio1 / 100 ) as ratio1 , ( ratio2 / 100 ) as ratio2 from( select shrlastmth , shrlastmth04_value , shrlastmth03_value , shrlastmth02_value , shrlastmth01_value , ( shrlastmth03_value + shrlastmth02_value + shrlastmth01_value ) as sumall01 , ( shrlastmth04_value + shrlastmth03_value + shrlastmth02_value ) as sumall02 , decode( rown , 1 , 0.01 , ( ( shrlastmth03_value + shrlastmth02_value + shrlastmth01_value ) / decode( ( bfshrlastmth03_value + bfshrlastmth02_value + bfshrlastmth01_value ) , 0 , 1 , ( bfshrlastmth03_value + bfshrlastmth02_value + bfshrlastmth01_value ) ) ) ) as ratio1 , decode( rown , 1 , 0.01 , ( ( shrlastmth04_value + shrlastmth03_value + shrlastmth02_value ) / decode( ( bfshrlastmth04_value + bfshrlastmth03_value + bfshrlastmth02_value ) , 0 , 1 , ( bfshrlastmth04_value + bfshrlastmth03_value + bfshrlastmth02_value ) ) ) ) as ratio2 from( select rown , shrlastmth , shrlastmth04_value , shrlastmth03_value , shrlastmth02_value , shrlastmth01_value , nvl( lag( shrlastmth04_value , 1 ) over( order by shrlastmth ) , shrlastmth04_value ) as bfshrlastmth04_value , nvl( lag( shrlastmth03_value , 1 ) over( order by shrlastmth ) , shrlastmth03_value ) as bfshrlastmth03_value , nvl( lag( shrlastmth02_value , 1 ) over( order by shrlastmth ) , shrlastmth02_value ) as bfshrlastmth02_value , nvl( lag( shrlastmth01_value , 1 ) over( order by shrlastmth ) , shrlastmth01_value ) as bfshrlastmth01_value from ( select ( du.rown + 10 ) as rown , last_day( add_months( ad_start , du.rown - 1 ) ) as shrlastmth , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= last_day( add_months( ad_start , sdu.rwn - 1 ) ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth04_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= last_day( add_months( ad_start , sdu.rwn - 13 ) ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth03_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= last_day( add_months( ad_start , sdu.rwn - 25 ) ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth02_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= last_day( add_months( ad_start , sdu.rwn - 37 ) ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth01_value from ( select rownum rown from dual connect by level <= 12 ) du union select du.rown as rown , ( trunc( add_months( ad_start , du.rown - 1 ) , 'mm' ) + 14 ) as shrlastmth , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= ( trunc( add_months( ad_start , sdu.rwn - 1 ) , 'mm' ) + 14 ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth04_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= ( trunc( add_months( ad_start , sdu.rwn - 13 ) , 'mm' ) + 14 ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth03_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= ( trunc( add_months( ad_start , sdu.rwn - 25 ) , 'mm' ) + 14 ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth02_value , nvl( ( select sum( stm.sharestk_amt * st.unitshare_value ) as sumshr from shsharestatement stm , shsharetype st , ( select s.coop_id as coop_id, s.member_no as memno , max( s.seq_no ) as seqno , sdu.rwn as rwn from shsharestatement s , ( select rownum as rwn from dual connect by level <= 12 ) sdu where s.item_status = 1 and s.account_date <= ( trunc( add_months( ad_start , sdu.rwn - 37 ) , 'mm' ) + 14 ) group by s.coop_id , s.member_no , sdu.rwn ) mst where stm.coop_id = st.coop_id and stm.sharetype_code = st.sharetype_code and stm.coop_id = mst.coop_id and stm.member_no = mst.memno and stm.seq_no = mst.seqno and du.rown = mst.rwn and stm.coop_id = avc_coop ) , 0 ) / 1000000 as shrlastmth01_value from ( select rownum as rown from dual connect by level <= 12 ) du ) ) ) order by shrlastmth ; loop fetch cur_data into ld_bizz , ln_sumbizz4 , ln_sumbizz3 , ln_sumbizz2 , ln_sumbizz1 , ln_sumall1 , ln_sumall2 , ln_ratio1 , ln_ratio2 ; exit when cur_data%notfound; ln_sumbizzrl4 := ln_sumbizz4; if ad_est < ld_bizz then ln_calbizz4 := ln_ratio1 * ln_sumcalbizz4; ln_sumcalbizz4 := ln_sumcalbizz4 + ln_calbizz4; ln_sumbizz4 := ln_sumcalbizz4; else ln_sumcalbizz4 := ln_sumbizz4; end if; insert into misrptest ( coop_id , bizz_system , rpt_code , bizz_date , sumbizz1_value , sumbizz2_value , sumbizz3_value , sumbizz4_value , sumbizzrl4_value , sumbizz5_value , ratio1_percent , ratio2_percent , sumall1_value , sumall2_value ) values ( avc_coop , 'SHR' , 'SS' , ld_bizz , ln_sumbizz1 , ln_sumbizz2 , ln_sumbizz3 , ln_sumbizz4 , ln_sumbizzrl4 , ln_sumbizz5 , ln_ratio1, ln_ratio2 , ln_sumall1 , ln_sumall2 ); end loop; close cur_data; lb_firstrw := true; open cur_data for select * from misrptest where coop_id = avc_coop and bizz_system = 'SHR' and rpt_code = 'SS' order by coop_id , bizz_date ; loop fetch cur_data into la_bizzrpt; exit when cur_data%notfound; if lb_firstrw then ln_sumbizz5 := ln_sumbizz4; else ln_calbizz4 := la_bizzrpt.ratio2_percent * ln_sumbizz5 ; ln_sumbizz5 := ln_sumbizz5 + ln_calbizz4; end if; update misrptest set sumbizz5_value = ln_sumbizz5 where coop_id = la_bizzrpt.coop_id and bizz_system = la_bizzrpt.bizz_system and rpt_code = la_bizzrpt.rpt_code and bizz_date = la_bizzrpt.bizz_date; lb_firstrw := false ; end loop; close cur_data; end of_post_shr_sum; --ตัวเลือกการทำรายการ procedure of_save_est (avc_coop varchar2,avc_bizz varchar2,avc_rptcode varchar2,ad_start date,ad_est date ) as begin case avc_bizz --หุ้น when 'SHR' then case avc_rptcode when 'SS' then pk_srv_mis_rpt.of_post_shr_sum( avc_coop , ad_start , ad_est ); --When 'SA' Then --Pk_Srv_Mis_Rpt.Of_Post_Shr_Add( Avc_Coop , Ad_start , Ad_est ) --When 'SR' Then --Pk_Srv_Mis_Rpt.Of_Post_Shr_Rec( Avc_Coop , Ad_start , Ad_est ) --When 'GS' Then --Pk_Srv_Mis_Rpt.Of_Post_Shr_Grpsum( Avc_Coop , Ad_start , Ad_est ) end case; --เงินฝาก when 'DEP' then pk_srv_mis_rpt.of_post_dep_sum( avc_coop , ad_start , ad_est ); end case; end of_save_est; end pk_srv_mis_rpt;