208: -----------------------------------------------------------------------------
209: -- Variables for transaction tracking --
210: -----------------------------------------------------------------------------
211:
212: x_transaction_header_id_in fa_transaction_headers.transaction_header_id%TYPE;
213: x_transaction_header_id_out fa_transaction_headers.transaction_header_id%TYPE;
214: x_date_effective fa_transaction_headers.date_effective%TYPE;
215: x_category_id fa_asset_history.category_id%TYPE;
216: x_prior_category_id fa_asset_history.category_id%TYPE;
209: -- Variables for transaction tracking --
210: -----------------------------------------------------------------------------
211:
212: x_transaction_header_id_in fa_transaction_headers.transaction_header_id%TYPE;
213: x_transaction_header_id_out fa_transaction_headers.transaction_header_id%TYPE;
214: x_date_effective fa_transaction_headers.date_effective%TYPE;
215: x_category_id fa_asset_history.category_id%TYPE;
216: x_prior_category_id fa_asset_history.category_id%TYPE;
217: x_old_category_id fa_asset_history.category_id%TYPE;
210: -----------------------------------------------------------------------------
211:
212: x_transaction_header_id_in fa_transaction_headers.transaction_header_id%TYPE;
213: x_transaction_header_id_out fa_transaction_headers.transaction_header_id%TYPE;
214: x_date_effective fa_transaction_headers.date_effective%TYPE;
215: x_category_id fa_asset_history.category_id%TYPE;
216: x_prior_category_id fa_asset_history.category_id%TYPE;
217: x_old_category_id fa_asset_history.category_id%TYPE;
218: x_asset_id fa_additions.asset_id%TYPE;
255: x_adj_reval_reserve_retired fa_retirements.reval_reserve_retired%TYPE;
256: x_adj_gain_loss_amount fa_retirements.gain_loss_amount%TYPE;
257:
258: x_retirement_type VARCHAR2 (1);
259: x_retirement_type_code fa_transaction_headers.transaction_type_code%TYPE;
260: x_source_transaction_header_id fa_transaction_headers.transaction_header_id%TYPE;
261: x_nbv_debit_credit_flag fa_adjustments.debit_credit_flag%TYPE;
262: x_nbv_retired_ccid fa_adjustments.code_combination_id%TYPE;
263: x_ia_cost_retired NUMBER;
256: x_adj_gain_loss_amount fa_retirements.gain_loss_amount%TYPE;
257:
258: x_retirement_type VARCHAR2 (1);
259: x_retirement_type_code fa_transaction_headers.transaction_type_code%TYPE;
260: x_source_transaction_header_id fa_transaction_headers.transaction_header_id%TYPE;
261: x_nbv_debit_credit_flag fa_adjustments.debit_credit_flag%TYPE;
262: x_nbv_retired_ccid fa_adjustments.code_combination_id%TYPE;
263: x_ia_cost_retired NUMBER;
264: x_ia_reserve NUMBER;
264: x_ia_reserve NUMBER;
265: x_ia_reserve_retired NUMBER;
266: x_gain_loss_changed BOOLEAN;
267:
268: x_global_source fa_transaction_headers.transaction_type_code%TYPE;
269: x_global_appraisal fa_transaction_headers.transaction_type_code%TYPE := 'APPRAISAL';
270: x_adj_cost_line NUMBER;
271: x_corp_cost_line NUMBER;
272: x_deprn_to_cost NUMBER;
265: x_ia_reserve_retired NUMBER;
266: x_gain_loss_changed BOOLEAN;
267:
268: x_global_source fa_transaction_headers.transaction_type_code%TYPE;
269: x_global_appraisal fa_transaction_headers.transaction_type_code%TYPE := 'APPRAISAL';
270: x_adj_cost_line NUMBER;
271: x_corp_cost_line NUMBER;
272: x_deprn_to_cost NUMBER;
273: x_addition_flag BOOLEAN;
335: nvl (bk.cost,0) adj_cost,
336: fnd_number.canonical_to_number(nvl (bk.global_attribute2,0)) appraisal_balance,
337: fnd_number.canonical_to_number(nvl (bk.global_attribute7,0)) deprn_to_cost,
338: bk.rowid book_rowid
339: FROM fa_transaction_headers th,
340: fa_deprn_periods dp,
341: fa_additions ad,
342: fa_asset_history ah,
343: fa_books bk
381: nvl (bk.cost,0),
382: fnd_number.canonical_to_number(nvl (bk.global_attribute2,0)),
383: fnd_number.canonical_to_number(nvl (bk.global_attribute7,0)),
384: bk.rowid
385: FROM fa_transaction_headers th,
386: fa_deprn_periods dp,
387: fa_additions ad,
388: fa_asset_history ah,
389: fa_books bk
674: dp.period_counter,
675: th.transaction_type_code
676: FROM fa_retirements rt,
677: fa_deprn_periods dp,
678: fa_transaction_headers th
679: WHERE rt.transaction_header_id_out = pc_transaction_header_id
680: AND dp.book_type_code = rt.book_type_code
681: AND dp.period_open_date <= rt.date_effective
682: AND rt.date_effective <= dp.period_close_date
3576:
3577: -----------------------------------------------------------------------------
3578: -- Identify retirement type --
3579: -- Technical Reference Manual define that column --
3580: -- FA_TRANSACTION_HEADERS.TRANSACTION_SUBTYPE contains the retirement --
3581: -- type, but standard application always leave this column as NULL --
3582: -----------------------------------------------------------------------------
3583:
3584: x_retirement_type := 'O';