[Home] [Help]
1664: p_mau IN NUMBER,
1665: p_precision IN NUMBER) IS
1666: /* ************************************************************************
1667: This procedure converts rows in fa_deprn_summary for each asset and
1668: inserts them into fa_mc_deprn_summary. First it selects and converts
1669: the BOOKS row for all the assets. Then depending on the convert order of
1670: of F or L it converts the DEPRN rows for the assets. When the convert_order
1671: is F, all the DEPRN rows in current year are converted and when the
1672: convert_order is L, only the last DEPRN in a prior fiscal year is
1850: fa_debug_pkg.add('Convert_summary','convert_order',
1851: p_convert_order);
1852: end if;
1853:
1854: INSERT INTO fa_mc_deprn_summary(set_of_books_id,
1855: book_type_code,
1856: asset_id,
1857: deprn_run_date,
1858: deprn_amount,
2077: l_last_reval_rsv := l_reval_reserve;
2078: l_last_ytd_reval_exp := l_ytd_reval_exp;
2079:
2080:
2081: INSERT INTO fa_mc_deprn_summary(set_of_books_id,
2082: book_type_code,
2083: asset_id,
2084: deprn_run_date,
2085: deprn_amount,
2123: 'Y');
2124: END LOOP;
2125: CLOSE ds_row;
2126: ELSIF (p_convert_order = 'L') THEN
2127: INSERT INTO fa_mc_deprn_summary(set_of_books_id,
2128: book_type_code,
2129: asset_id,
2130: deprn_run_date,
2131: deprn_amount,
2354:
2355: -- cursor to select all rows from fa_deprn_detail
2356: CURSOR dd_row IS
2357: SELECT /*+ ordered leading(cr)
2358: index(ds fa_mc_deprn_summary_u1)
2359: index(dd fa_deprn_detail_n1)
2360: index(dh fa_distribution_history_u1)
2361: index(dp fa_deprn_periods_u3)
2362: index(bk fa_books_n1)
2421: p_mau) * p_mau),
2422: ds.deprn_amount,
2423: dd.deprn_run_date
2424: FROM
2425: fa_mc_deprn_summary ds,
2426: fa_deprn_detail dd,
2427: fa_deprn_periods dp,
2428: fa_books bk,
2429: fa_mc_books mcbk,