The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT count(*)
INTO l_count
FROM gl_period_statuses glp
WHERE glp.ledger_id = X_ledger_id
AND glp.closing_status in ('O','F')
AND glp.application_id = 101
AND glp.adjustment_period_flag = 'N'
AND X_accounting_date BETWEEN
glp.start_date AND glp.end_date;
SELECT MIN(start_date)
INTO l_accounting_date
FROM gl_period_statuses
WHERE closing_status = 'O'
AND ledger_id = X_ledger_id
AND application_id = 101
AND adjustment_period_flag = 'N'
AND start_date >= nvl(X_accounting_date, X_cashflow_date);
PROCEDURE Update_SLA_Event_Status(X_event_id NUMBER,
X_event_status_code VARCHAR2,
X_event_source_info xla_events_pub_pkg.t_event_source_info,
X_security_context xla_events_pub_pkg.t_security) IS
l_event_type_code VARCHAR2(30);
XLA_EVENTS_PUB_PKG.update_event(p_event_source_info => X_event_source_info,
p_event_id => X_event_id,
p_event_type_code => null,
p_event_date => null,
p_event_status_code => X_event_status_code,
p_valuation_method => '',
p_security_context => X_security_context);
log('Updated SLA event: '|| X_event_id);
END Update_SLA_Event_Status;
UPDATE ce_cashflow_acct_h
SET event_id = l_event_id
WHERE rowid = X_rowid;
select cf.cashflow_legal_entity_id,
cf.cashflow_ledger_id,
cf.cashflow_legal_entity_id,
cf.cashflow_id,
cf.cleared_date,
cf.cleared_amount,
cf.cleared_exchange_date,
cf.cleared_exchange_rate_type,
cf.cleared_exchange_rate,
cf.clearing_charges_amount,
cf.clearing_error_amount,
cf.cashflow_date,
cf.cashflow_ledger_id
into l_event_source_info.legal_entity_id,
l_event_source_info.ledger_id,
l_security_context.security_id_int_1,
l_event_source_info.transaction_number,
l_cleared_date,
l_cleared_amount,
l_cleared_exchange_date,
l_cleared_exchange_rate_type,
l_cleared_exchange_rate,
l_clearing_charges_amount,
l_clearing_error_amount,
l_cashflow_date,
l_ledger_id
from ce_cashflows cf,
ce_payment_transactions trx
where trx.trxn_reference_number(+) = cf.trxn_reference_number
and cf.cashflow_id = X_trx_id;
SELECT rowid,
event_id,
status_code,
accounting_date
INTO l_previous_row_id,
l_previous_event_id,
l_previous_ae_status,
l_previous_acct_date
FROM ce_cashflow_acct_h
WHERE cashflow_id = X_trx_id
AND current_record_flag = 'Y';
UPDATE ce_cashflow_acct_h
SET current_record_flag = 'N'
WHERE event_id = l_previous_event_id;
CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
0,
X_trx_id,
X_event_type_code,
l_accounting_date,
'NOT_APPLICABLE', -- Bug 7409147
'Y',
null,
null,
null,
null,
null,
null,
null,
'N',
null,
null,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1));
CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
0,
X_trx_id,
X_event_type_code,
l_accounting_date,
'UNACCOUNTED',
'Y',
l_cleared_date,
l_cleared_amount,
l_cleared_exchange_rate,
l_cleared_exchange_date,
l_cleared_exchange_rate_type,
l_clearing_charges_amount,
l_clearing_error_amount,
'N',
null,
null,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1));
Update_SLA_Event_Status(l_previous_event_id,
XLA_EVENTS_PUB_PKG.c_event_noaction,
l_event_source_info,
l_security_context);
UPDATE ce_cashflow_acct_h
SET status_code = 'NOT_APPLICABLE'
WHERE event_id = l_previous_event_id;
CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
0,
X_trx_id,
X_event_type_code,
l_accounting_date,
'NOT_APPLICABLE',
'Y',
null,
null,
null,
null,
null,
null,
null,
'Y',
X_trx_id,
rowidtochar(l_previous_row_id),
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1));
CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
0,
X_trx_id,
X_event_type_code,
l_accounting_date,
'UNACCOUNTED',
'Y',
null,
null,
null,
null,
null,
null,
null,
'Y',
X_trx_id,
rowidtochar(l_previous_row_id),
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1));
SELECT event_id,
status_code,
accounting_date,
rowid
INTO l_creation_event_id,
l_creation_ae_status,
l_accounting_date,
l_creation_row_id
FROM ce_cashflow_acct_h
WHERE event_id = (SELECT Max(event_id)
FROM ce_cashflow_acct_h
WHERE cashflow_id = X_trx_id
AND event_type = 'CE_BAT_CREATED');
Update_SLA_Event_Status(l_creation_event_id,
XLA_EVENTS_PUB_PKG.c_event_noaction,
l_event_source_info,
l_security_context);
log('Inserting History with type code: ' ||X_event_type_code);
CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
0,
X_trx_id,
X_event_type_code,
l_accounting_date,
'NOT_APPLICABLE',
'Y',
null,
null,
null,
null,
null,
null,
null,
'Y',
X_trx_id,
rowidtochar(l_creation_row_id),
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1),
sysdate,
nvl(fnd_global.user_id, -1));
| Update cash flow acct history status (status_code) to 'Accounting Error'
| Else if process_status_code = 'P' then
| Update cash flow acct history status (status_code) to 'Accounted'
|
| KNOWN ISSUES
|
| NOTES
|
| MODIFICATION HISTORY
| Date Author Description of Changes
| 06-APR-2005 BHCHUNG CREATED
*=======================================================================*/
PROCEDURE postaccounting
(p_application_id NUMBER
,p_ledger_id NUMBER
,p_process_category VARCHAR2
,p_end_date DATE
,p_accounting_mode VARCHAR2
,p_valuation_method VARCHAR2
,p_security_id_int_1 NUMBER
,p_security_id_int_2 NUMBER
,p_security_id_int_3 NUMBER
,p_security_id_char_1 VARCHAR2
,p_security_id_char_2 VARCHAR2
,p_security_id_char_3 VARCHAR2
,p_report_request_id NUMBER ) IS
CURSOR event_cur IS
SELECT event_id,
process_status_code
FROM xla_entity_events_v
WHERE request_id = p_report_request_id
AND application_id = 260;
UPDATE ce_cashflow_acct_h
SET status_code = 'ACCOUNTING_ERROR'
WHERE event_id = c_rec.event_id;
UPDATE ce_cashflow_acct_h
SET status_code = 'ACCOUNTED'
WHERE event_id = c_rec.event_id
and status_code <> 'NOT_APPLICABLE'; -- Bug 7409147