8223: df.corp_period_counter,
8224: df.tax_period_counter,
8225: glsob.currency_code,
8226: nvl (bc.je_deferred_deprn_category, 'OTHER') je_category_name
8227: from fa_deferred_deprn df,
8228: fa_deprn_periods dp,
8229: gl_sets_of_books glsob,
8230: fa_book_controls bc,
8231: fa_lookups_tl lk_de,
8269: lk_dr.description,
8270: gljh.je_batch_id,
8271: df.je_header_id,
8272: decode (df.je_header_id, null, 'N', 'Y')
8273: from fa_deferred_deprn df,
8274: fa_lookups_tl lk_de,
8275: fa_lookups_tl lk_dr,
8276: gl_je_headers gljh
8277: where df.corp_book_type_code = l_corp_book_type_code
8369: from dual;
8370:
8371: END LOOP;
8372:
8373: -- Update fa_deferred_deprn table with event_id
8374: FORALL l_count IN 1..l_event_id_tbl.count
8375: update fa_deferred_deprn
8376: set event_id = l_event_id_tbl(l_count)
8377: where rowid between p_start_rowid and p_end_rowid
8371: END LOOP;
8372:
8373: -- Update fa_deferred_deprn table with event_id
8374: FORALL l_count IN 1..l_event_id_tbl.count
8375: update fa_deferred_deprn
8376: set event_id = l_event_id_tbl(l_count)
8377: where rowid between p_start_rowid and p_end_rowid
8378: and asset_id = l_asset_id_tbl(l_count)
8379: and corp_book_type_code = l_corp_book_type_code_tbl(l_count)
8393: and tax_book_type_code = l_tax_book_type_code_tbl(l_count)
8394: and corp_period_counter = l_corp_period_counter_tbl(l_count)
8395: and event_id is null;
8396:
8397: -- Add events to fa_deferred_deprn_events table
8398: FOR l_count IN 1..l_event_id_tbl.count LOOP
8399: insert into fa_deferred_deprn_events (
8400: asset_id,
8401: corp_book_type_code,
8395: and event_id is null;
8396:
8397: -- Add events to fa_deferred_deprn_events table
8398: FOR l_count IN 1..l_event_id_tbl.count LOOP
8399: insert into fa_deferred_deprn_events (
8400: asset_id,
8401: corp_book_type_code,
8402: tax_book_type_code,
8403: corp_period_counter,
8423: from dual
8424: where not exists
8425: (
8426: select 'x'
8427: from fa_deferred_deprn_events
8428: where asset_id = l_asset_id_tbl(l_count)
8429: and corp_book_type_code = l_corp_book_type_code_tbl(l_count)
8430: and corp_period_counter = l_corp_period_counter_tbl(l_count)
8431: and tax_book_type_code = l_tax_book_type_code_tbl(l_count)