The following lines contain the word 'select', 'insert', 'update' or 'delete':
select 'Y'
from fa_deprn_summary ds
where ds.book_type_code = bks_book_type_code and
ds.asset_id = bks_asset_id and
ds.deprn_source_code = 'DEPRN' and
ds.deprn_amount <> 0 and
rownum <2;
select 'Y'
from fa_deprn_summary ds,
fa_deprn_periods dp
where dp.book_type_code= bks_book_type_code and
ds.asset_id = bks_asset_id and
ds.book_type_code= bks_book_type_code and
ds.deprn_source_code = 'BOOKS' and
dp.period_close_date is null and
ds.period_counter = dp.period_counter - 1;
select least(bks_cost - bks_salvage_value,
nvl(ce.limit, bks_cost - bks_salvage_value))
from fa_ceilings ce
where ce.ceiling_name = bks_ceiling_name
and bks_date_placed_in_service
between ce.start_date
and nvl(ce.end_date, bks_date_placed_in_service);
select bks_cost - bks_salvage_value -
bks_itc_basis * ir.basis_reduction_rate
from fa_itc_rates ir
where ir.itc_amount_id = bks_itc_amount_id;
select least(bks_cost - bks_salvage_value -
bks_itc_basis * ir.basis_reduction_rate,
nvl(ce.limit, bks_cost - bks_salvage_value -
bks_itc_basis * ir.basis_reduction_rate))
from fa_ceilings ce, fa_itc_rates ir
where ir.itc_amount_id = bks_itc_amount_id
and ce.ceiling_name = bks_ceiling_name
and bks_date_placed_in_service
between ce.start_date
and nvl(ce.end_date, bks_date_placed_in_service);
procedure update_and_check_amts(
bks_depreciation_check in varchar2,
bks_current_period_flag in varchar2,
bks_recoverable_cost in number,
bks_deprn_reserve in number,
bks_ytd_deprn in number,
bks_cost in number,
bks_salvage_value in number,
x_return_status out nocopy boolean,
bks_calling_fn varchar2,
p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null)
is
amt_error exception; -- syoung.
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts',
NAME => 'FA_BOOK_NEG_SALVAGE_VALUE',
p_log_level_rec => p_log_level_rec);
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts',
NAME => 'FA_BOOK_POS_SALVAGE_VALUE',
p_log_level_rec => p_log_level_rec);
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts',
NAME => 'FA_BOOK_INVALID_RESERVE',
p_log_level_rec => p_log_level_rec);
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts',
NAME => 'FA_BOOK_ALL_POSITIVE',
p_log_level_rec => p_log_level_rec);
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts',
NAME => 'FA_BOOK_ALL_NEGATIVE',
p_log_level_rec => p_log_level_rec);
CALLED_FN => 'fa_fin_adj1_pkg.update_and_check_amts',
CALLING_FN => bks_Calling_Fn,
p_log_level_rec => p_log_level_rec); */
CALLING_FN => 'FA_FIN_ADJ1.Update_And_Check_Amts'
,p_log_level_rec => p_log_level_rec);
end update_and_check_amts;
select 'Y'
from fa_book_controls bc,
fa_fiscal_year fy
where bc.book_type_code = bks_book_type_code
and bc.fiscal_year_name = fy.fiscal_year_name
and bks_date_placed_in_service between
fy.start_date and fy.end_date
and fy.fiscal_year = bc.current_fiscal_year;
SELECT 'Y'
FROM fa_transaction_headers th,
fa_book_controls bc,
fa_deprn_periods dp
WHERE th.book_type_code = bks_book_type_code
AND th.book_type_code = bc.book_type_code
AND bc.book_type_code = dp.book_type_code
AND th.transaction_type_code = 'PARTIAL RETIREMENT'
AND dp.period_counter = bc.last_period_counter +1
AND th.transaction_date_entered between
dp.calendar_period_open_date and nvl(dp.calendar_period_close_date,
sysdate);
select 'Y'
from fa_flat_rates fr, fa_methods mth
where mth.method_code = bks_deprn_method_code
and mth.life_in_months is null
and mth.method_id = fr.method_id
and fr.basic_rate = bks_basic_rate
and fr.adjusted_rate = bks_adjusted_rate;
select 'Y'
from fa_methods mth
where mth.method_code = bks_deprn_method_code
and bks_life_years * 12 + bks_life_months = mth.life_in_months;
select 'Y'
from fa_formulas f, fa_methods mth
where mth.method_code = bks_deprn_method_code
and mth.method_id = f.method_id (+)
and ((mth.rate_source_rule = 'PRODUCTION') or
((mth.rate_source_rule = 'FORMULA') and
(instr (f.formula_actual, 'CAPACITY') <> 0)))
and bks_depreciate_flag = 'NO';
2. Added the code to check the return status of update_and_check_amts(
,p_log_level_rec => p_log_level_rec)
3. Added the exception block which was commented out. - aling
*/
if bks_cost is null then
message_name := 'FA_BOOK_NO_FINANCIAL_INFO';
update_and_check_amts(
bks_depreciation_check,
bks_current_period_flag,
bks_recoverable_cost,
bks_deprn_reserve,
bks_ytd_deprn,
bks_cost,
bks_salvage_value,
h_status, -- syoung: added this local.
'fa_fin_adj1_pkg.chk_val_before_commit',
p_log_level_rec);
SELECT f.formula_actual
INTO h_formula_actual
FROM fa_formulas f, fa_methods m
WHERE m.method_id = f.method_id
AND m.method_code = bks_deprn_method_code
AND rownum = 1
ORDER BY m.method_id;
select 'Y'
from fa_books bk
where bk.rowid = bks_row_id;
select 'Y'
from fa_books bk
where bk.prorate_convention_code = bks_prorate_convention_code
and bk.rowid = bks_row_id;
select 'Y'
from fa_books bk
where bk.rowid = bks_row_id
and bk.cost = bks_cost
and bk.recoverable_cost = bks_recoverable_cost
and bk.date_placed_in_service = bks_date_placed_in_service
and bk.deprn_method_code = bks_deprn_method_code
and nvl(bk.life_in_months, 99999) =
nvl(bks_life_years * 12 + bks_life_months, 99999)
and bk.prorate_convention_code = bks_prorate_convention_code
and bk.salvage_value = bks_salvage_value
/* BUG# 1514366
the rates are already passes in decimal format - no need to convert
also removing the global attributes from this statement as they have
not financial impact.
-- bridgway 11/26/00
and nvl(bk.basic_rate, 99999) = nvl(bks_basic_rate_dsp/100, 99999);
select 'Y'
from fa_books bk
where bk.rowid = bks_row_id
and nvl(bk.unit_of_measure, 99999) = nvl(bks_unit_of_measure, 99999);
select 'Y'
from fa_books bk
where bk.rowid = bks_row_id
and bk.depreciate_flag = bks_depreciate_flag;
select 'Y'
from fa_books bk,
fa_transaction_headers th,
fa_deprn_summary ds
where bk.rowid = bks_row_id
and bks_depreciate_flag = 'YES'
and bk.depreciate_flag = 'NO'
and bk.transaction_header_id_in = th.transaction_header_id
and th.transaction_type_code = 'ADDITION'
and th.book_type_code = bk.book_type_code
and ds.asset_id = bk.asset_id
and ds.deprn_reserve = 0
and ds.book_type_code = bk.book_type_code
and ds.deprn_source_code = 'BOOKS';