/*
desription get The vd_flag_date's date
*/
vd_flag_date := to_date(substr(iv_date,1,4)||'0101','yyyymmdd');
/*
desription get The vd_flag_date's date in 2 condition,
ii_calendar_flag = 0 means first week start with Jan 1st
ii_calendar_flag = 1 means first week start with the first sunday of the year.
other means error
*/
vd_deal_date := to_date(iv_date,'yyyymmdd');
if ii_calendar_flag = 1 then
/*
desription get The week
*/
if to_char(vd_flag_date,'D') = '1' then
/*
desription The first week is begin at Jan 1st when Jan 1st is The first sunday of The dealing year
*/
ov_return := to_char(vd_deal_date,'yyyyww');