12: p_precision IN NUMBER) IS
13:
14: l_count number;
15: /* ************************************************************************
16: This procedure will select all the rows in fa_books for each asset being
17: converted and insert them into fa_mc_books. All amount columns will be
18: converted either with the exchange rate or a derived rate of
19: cost/primary_cur_cost based on the conversion basis of R or C.
20: The converted amounts will also be rounded using the precision and
24: BEGIN
25:
26: if (g_print_debug) then
27: fa_debug_pkg.add('convert_assets',
28: 'Converting FA_BOOKS records',
29: 'start');
30: end if;
31:
32: INSERT INTO fa_mc_books(
420: bk.original_deprn_start_date,
421: bk.salvage_type,
422: bk.deprn_limit_type
423: FROM
424: fa_books bk,
425: fa_mc_conversion_rates cr
426: WHERE
427: cr.asset_id = bk.asset_id AND
428: cr.set_of_books_id = p_rsob_id AND
431: cr.status = 'S';
432:
433: if (g_print_debug) then
434: fa_debug_pkg.add('convert_assets',
435: 'Converted FA_BOOKS records',
436: 'success');
437: end if;
438:
439:
711: p_precision IN NUMBER) IS
712: /* ************************************************************************
713: This procedure will insert a row for each asset converted to reporting
714: book. It will contain the transaction_header_id_in from the active row
715: fa_books at the time of conversion and has the rate that was used
716: to convert the asset transactions. This is the ratio of the cost in
717: reporting book divided by the cost in primary book. For assets that
718: have a cost of 0 we will use the exchange_rate as of the initial
719: conversion date for the Reporting Book
775: mcbk.last_update_login,
776: 'Y'
777: FROM
778: fa_mc_books mcbk,
779: fa_books bk,
780: fa_mc_conversion_rates cr
781:
782: WHERE
783: cr.status = 'S' AND
1672: convert_order is L, only the last DEPRN in a prior fiscal year is
1673: converted.
1674: The rows in fa_deprn_summary are fetched one at a time and ordered by
1675: asset_id and period_counter. The deprn_amount column for pc is
1676: calculated using a ratio of cost in fa_mc_books * cost in fa_books/
1677: deprn_amount in primary currency. deprn_reserve and ytd_deprn for the
1678: first period_counter in the current year are also calulated the same way.
1679: For subsequent period counters the deprn_amount for current period is
1680: added to deprn_reserve of previous period. This is necessary to round
1812: FROM
1813: fa_deprn_summary ds,
1814: fa_deprn_periods dp,
1815: fa_mc_books mcbk,
1816: fa_books bk,
1817: fa_mc_conversion_rates cr
1818: WHERE
1819: ds.asset_id = mcbk.asset_id AND
1820: cr.book_type_code = p_book_type_code AND
1969: FROM
1970: fa_deprn_summary ds,
1971: fa_deprn_periods dp,
1972: fa_mc_books mcbk,
1973: fa_books bk,
1974: fa_mc_conversion_rates cr
1975: WHERE
1976: ds.asset_id = mcbk.asset_id AND
1977: ds.deprn_source_code = 'BOOKS' AND
2242: FROM
2243: fa_deprn_summary ds,
2244: fa_deprn_periods dp,
2245: fa_mc_books mcbk,
2246: fa_books bk,
2247: fa_mc_conversion_rates cr
2248: WHERE
2249: cr.book_type_code = p_book_type_code AND
2250: cr.set_of_books_id = p_rsob_id AND
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)
2363: index(mcbk fa_mc_books_u1)
2364: index(ah fa_asset_history_n2) */
2365: dd.book_type_code,
2366: dd.asset_id,
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,
2430: fa_distribution_history dh,
2431: fa_asset_history ah,
2432: fa_mc_conversion_rates cr