[Home] [Help]
The following lines contain the word 'select', 'insert', 'update' or 'delete':
select asset_id
from fa_books
where group_asset_id = p_group_asset_id
and book_type_code = p_book_type_code
and transaction_header_id_out is null;
select group_asset_id,
tracking_method
into l_group_asset_id,
l_tracking_method
from fa_books
where asset_id = px_asset_hdr_rec.asset_id
and book_type_code = px_asset_hdr_rec.book_type_code
and transaction_header_id_out is null;
select event_id, deprn_run_id
into l_event_id,
l_deprn_run_id
from fa_deprn_events_v de
where de.book_type_code = px_asset_hdr_rec.book_type_code
and de.asset_id = px_asset_hdr_rec.asset_id
and de.period_counter = l_period_rec.period_counter
and de.reversal_event_id is null;
XLA_EVENTS_PUB_PKG.delete_event
(p_event_source_info => l_deprn_source_info,
p_event_id => l_event_id,
p_valuation_method => px_asset_hdr_rec.book_type_code,
p_security_context => l_security_context);
l_result := XLA_EVENTS_PUB_PKG.delete_entity
(p_source_info => l_deprn_source_info,
p_valuation_method => px_asset_hdr_rec.book_type_code,
p_security_context => l_security_context);
fa_debug_pkg.add(l_calling_fn, 'Unable to delete entity for rb event',
l_event_id, p_log_level_rec => p_log_level_rec);
SELECT deprn_run_id
into l_secondary_deprn_run_id
from fa_mc_deprn_summary
where set_of_books_id = l_secondary_exists
and book_type_code = px_asset_hdr_rec.book_type_code
and period_counter = l_period_rec.period_counter
and asset_id = px_asset_hdr_rec.asset_id;
select event_id
into l_secondary_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = 'DEPRECIATION'
and xent.application_id = xeve.application_id
and source_id_char_1 = px_asset_hdr_rec.book_type_code
and source_id_int_1 = px_asset_hdr_rec.asset_id
and source_id_int_2 = l_period_rec.period_counter
and source_id_int_3 = l_secondary_deprn_run_id
and ledger_id = l_secondary_exists
and xeve.entity_id = xent.entity_id;
XLA_EVENTS_PUB_PKG.delete_event
(p_event_source_info => l_secondary_deprn_source_info,
p_event_id => l_secondary_event_id,
p_valuation_method => l_mrc_asset_hdr_rec.book_type_code,
p_security_context => l_security_context);
l_result := XLA_EVENTS_PUB_PKG.delete_entity
(p_source_info => l_secondary_deprn_source_info,
p_valuation_method => l_mrc_asset_hdr_rec.book_type_code,
p_security_context => l_security_context);
fa_debug_pkg.add(l_calling_fn, 'Unable to delete entity for sec rb event',
l_secondary_event_id, p_log_level_rec => p_log_level_rec);
select count(*)
into l_deprn_count
from fa_deprn_summary ds
where ds.book_type_code = px_asset_hdr_rec.book_type_code
and ds.asset_id = px_asset_hdr_rec.asset_id
and ds.period_counter = l_period_rec.period_counter;
select count(*)
into l_deprn_count
from fa_mc_deprn_summary ds
where ds.book_type_code = px_asset_hdr_rec.book_type_code
and ds.asset_id = px_asset_hdr_rec.asset_id
and ds.period_counter = l_period_rec.period_counter
and ds.set_of_books_id = l_mrc_asset_hdr_rec.set_of_books_id;