The following lines contain the word 'select', 'insert', 'update' or 'delete':
if (p_calling_fn = 'fa_addition_pvt.insert_asset') then
l_event_type_code := 'ADDITIONS';
insert into xla_events_int_gt
(APPLICATION_ID ,
LEDGER_ID ,
LEGAL_ENTITY_ID ,
ENTITY_CODE ,
event_type_code ,
event_date ,
event_number ,
event_status_code ,
transaction_number ,
source_id_int_1 ,
source_id_char_1 ,
source_id_int_2 ,
source_id_int_3 ,
valuation_method
)
values
(140 ,
nvl(p_secondary_sob_id,fa_cache_pkg.fazcbc_record.set_of_books_id),
l_legal_entity_id ,
p_entity_type_code ,
'DEPRECIATION' ,
p_period_close_date ,
l_dummy_number(i) ,
XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
l_dummy_number(i) ,
p_asset_id_tbl(i) ,
p_book_type_code ,
p_period_counter ,
p_deprn_run_id ,
p_book_type_code
);
select event_id bulk collect
into x_event_id_tbl
from xla_events_int_gt
where source_id_int_3 = p_deprn_run_id
order by event_number;
insert into xla_events_int_gt
(APPLICATION_ID ,
LEDGER_ID ,
LEGAL_ENTITY_ID ,
ENTITY_CODE ,
event_type_code ,
event_date ,
event_number ,
event_status_code ,
transaction_number ,
source_id_int_1 ,
source_id_char_1 ,
source_id_char_2 ,
source_id_int_2 ,
valuation_method
)
values
(140 ,
l_sob_id ,
l_legal_entity_id ,
p_entity_type_code ,
'DEFERRED_DEPRECIATION' ,
p_period_close_date ,
l_dummy_number(i) ,
XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
l_dummy_number(i) ,
p_asset_id_tbl(i) ,
p_corp_book ,
p_tax_book ,
p_corp_period_counter,
p_corp_book
);
select event_id bulk collect
into x_event_id_tbl
from xla_events_int_gt
order by event_number;
PROCEDURE update_event_status
(p_event_source_info IN xla_events_pub_pkg.t_event_source_info
,p_event_class_code IN VARCHAR2 DEFAULT NULL
,p_event_type_code IN VARCHAR2 DEFAULT NULL
,p_event_date IN DATE DEFAULT NULL
,p_event_status_code IN VARCHAR2
,p_valuation_method IN VARCHAR2
,p_security_context IN xla_events_pub_pkg.t_security
,p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null);
FUNCTION update_transaction_event
(p_ledger_id IN NUMBER,
p_transaction_header_id IN NUMBER,
p_book_type_code IN VARCHAR2,
p_event_type_code IN VARCHAR2,
p_event_date IN DATE,
p_event_status_code IN VARCHAR2,
p_secondary_flag IN BOOLEAN DEFAULT FALSE,
p_secondary_sob_id IN number default null,
p_calling_fn IN VARCHAR2,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return boolean IS
l_trx_source_info XLA_EVENTS_PUB_PKG.t_event_source_info;
l_calling_fn varchar2(80) := 'fa_xla_events_pvt.update_transaction_event';
select event_id
into l_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = p_event_type_code
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = p_transaction_header_id
and ledger_id = p_secondary_sob_id
and xeve.entity_id = xent.entity_id;
select event_id
into l_event_id
from fa_transaction_headers
where transaction_header_id = p_transaction_header_id;
XLA_EVENTS_PUB_PKG.update_event
(p_event_source_info => l_trx_source_info,
p_event_id => l_event_id,
p_event_type_code => p_event_type_code,
p_event_date => l_event_date,
p_event_status_code => p_event_status_code,
p_valuation_method => p_book_type_code,
p_security_context => l_security_context);
end update_transaction_event;
FUNCTION update_inter_transaction_event
(p_ledger_id IN NUMBER,
p_trx_reference_id IN NUMBER,
p_book_type_code IN VARCHAR2,
p_event_type_code IN VARCHAR2,
p_event_date IN DATE,
p_event_status_code IN VARCHAR2,
p_is_secondary_ledger IN boolean default false,
p_calling_fn IN VARCHAR2,
p_log_level_rec in fa_api_types.log_level_rec_type default null
) return boolean is
l_trx_source_info XLA_EVENTS_PUB_PKG.t_event_source_info;
l_calling_fn varchar2(80) := 'fa_xla_events_pvt.update_inter_transaction_event';
select event_id, dest_transaction_header_id
into l_event_id, l_destination_trx_header_id
from fa_trx_references
where trx_reference_id = p_trx_reference_id;
select event_id
into l_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code in ('SOURCE_LINE_TRANSFERS', 'CIP_SOURCE_LINE_TRANSFERS')
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = l_destination_trx_header_id; --need to check. Secondary Changes
XLA_EVENTS_PUB_PKG.update_event
(p_event_source_info => l_trx_source_info,
p_event_id => l_event_id,
p_event_type_code => p_event_type_code,
p_event_date => p_event_date,
p_event_status_code => p_event_status_code,
p_valuation_method => p_book_type_code,
p_security_context => l_security_context);
end update_inter_transaction_event;
FUNCTION delete_transaction_event
(p_ledger_id IN NUMBER,
p_transaction_header_id IN NUMBER,
p_book_type_code IN VARCHAR2,
p_asset_type IN VARCHAR2,
p_secondary_sob_id IN number default null,
p_calling_fn IN VARCHAR2,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return boolean IS
l_event_id NUMBER;
l_calling_fn varchar2(80) := 'fa_xla_events_pvt.delete_transaction_event';
select event_id
into l_event_id
from fa_transaction_headers
where transaction_header_id = p_transaction_header_id;
select event_id
into l_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = 'REINSTATEMENTS'
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = p_transaction_header_id
and ledger_id = p_secondary_sob_id
and xeve.entity_id = xent.entity_id;
select event_id
into l_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = 'RETIREMENTS'
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = p_transaction_header_id
and ledger_id = p_secondary_sob_id
and xeve.entity_id = xent.entity_id;
select event_id
into l_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = 'CAPITALIZATION'
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = p_transaction_header_id
and ledger_id = p_secondary_sob_id
and xeve.entity_id = xent.entity_id;
XLA_EVENTS_PUB_PKG.delete_event
(p_event_source_info => l_trx_source_info,
p_event_id => l_event_id,
p_valuation_method => p_book_type_code,
p_security_context => l_security_context);
l_result := XLA_EVENTS_PUB_PKG.delete_entity
(p_source_info => l_trx_source_info,
p_valuation_method => p_book_type_code,
p_security_context => l_security_context);
fa_debug_pkg.add(l_calling_fn, 'Unable to delete entity for trx event',
l_event_id, p_log_level_rec => p_log_level_rec);
END delete_transaction_event;
FUNCTION delete_deprn_event
(p_event_id IN NUMBER,
p_ledger_id IN NUMBER,
p_asset_id IN NUMBER,
p_book_type_code IN VARCHAR2,
p_period_counter IN NUMBER,
p_deprn_run_id IN NUMBER,
p_calling_fn IN VARCHAR2,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) return boolean IS
l_event_id NUMBER;
l_calling_fn varchar2(80) := 'fa_xla_events_pvt.delete_deprn_event';
XLA_EVENTS_PUB_PKG.delete_event
(p_event_source_info => l_deprn_source_info,
p_event_id => p_event_id,
p_valuation_method => p_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 => p_book_type_code,
p_security_context => l_security_context);
fa_debug_pkg.add(l_calling_fn, 'Unable to delete entity for event',
p_event_id, p_log_level_rec => p_log_level_rec);
END delete_deprn_event;
select event_type_code
into x_event_type_code
from xla_events
where application_id = 140
and event_id = p_event_id;
select set_of_books_id
into l_secondary_sob_id
from fa_mc_book_controls famcbc
where book_type_code = p_book_type_code
and nvl(enabled_flag,'N') = 'Y'
and not exists
(select 1
from fa_book_controls
where book_type_code = p_book_type_code
and book_class = 'TAX'
and set_of_books_id = famcbc.set_of_books_id)
and exists
(select 1
from gl_ledgers
where ledger_id = set_of_books_id
and ledger_category_code = 'SECONDARY');
select event_id
into l_secondary_cap_event_id
from xla_events xeve,
xla_transaction_entities xent
where xeve.application_id = 140
and xeve.event_type_code = 'CAPITALIZATION'
and xent.application_id = xeve.application_id
and source_id_char_1 = p_book_type_code
and source_id_int_1 = p_source_id_int_1
and xeve.entity_id = xent.entity_id
and ledger_id = p_ledger_id;
SELECT deprn_run_id
into l_secondary_deprn_run_id
from fa_mc_deprn_summary
where set_of_books_id = p_ledger_id
and book_type_code = p_book_type_code
and period_counter = p_source_id_int_2
and asset_id = p_source_id_int_1;
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 = p_book_type_code
and source_id_int_1 = p_source_id_int_1
and source_id_int_2 = p_source_id_int_2
and source_id_int_3 = l_secondary_deprn_run_id
and xeve.entity_id = xent.entity_id;