250: , dt.code_combination_id
251: , dt.location_id
252: , dt.assigned_to
253: , dt.transaction_units
254: FROM fa_transaction_headers th
255: , fa_distribution_history dt
256: WHERE th.book_type_code = p_book_type_code
257: AND th.asset_id = l_asset_hdr_rec.asset_id
258: AND dt.asset_id = l_asset_hdr_rec.asset_id
266:
267: /* 12844989 - to set correct old_adj_cost of asset in extended deprn period.*/
268: CURSOR c_mc_get_old_adj_cost IS
269: select fb.ADJUSTED_COST
270: from fa_mc_books fb,fa_transaction_headers fth
271: where fb.asset_id = l_asset_hdr_rec.asset_id
272: and fb. book_type_code = l_asset_hdr_rec.book_type_code
273: and fb.transaction_header_id_in = fth.transaction_header_id
274: and fb.book_type_code = fth.book_type_code
278: order by fth.transaction_header_id desc;
279:
280: CURSOR c_get_old_adj_cost IS
281: select fb.ADJUSTED_COST
282: from fa_books fb,fa_transaction_headers fth
283: where fb.asset_id = l_asset_hdr_rec.asset_id
284: and fb. book_type_code = l_asset_hdr_rec.book_type_code
285: and fb.transaction_header_id_in = fth.transaction_header_id
286: and fb.book_type_code = fth.book_type_code
661: if (p_mrc_sob_type_code = 'R') then
662: -- select impairment thid of primary book
663: -- Following update is to get thid from primary book
664: if (p_log_level_rec.statement_level) then
665: fa_debug_pkg.add(l_calling_fn,'Getting Records from ', 'FA_TRANSACTION_HEADERS', p_log_level_rec => p_log_level_rec);
666: end if;
667:
668: FORALL i in 1..t_request_id.count
669: UPDATE FA_TRANSACTION_HEADERS
665: fa_debug_pkg.add(l_calling_fn,'Getting Records from ', 'FA_TRANSACTION_HEADERS', p_log_level_rec => p_log_level_rec);
666: end if;
667:
668: FORALL i in 1..t_request_id.count
669: UPDATE FA_TRANSACTION_HEADERS
670: SET ATTRIBUTE15 = ATTRIBUTE15
671: WHERE ASSET_ID = t_asset_id(i)
672: AND BOOK_TYPE_CODE = p_book_type_code
673: AND TRANSACTION_TYPE_CODE = decode(G_release,'11',decode(t_period_of_addition_flag(i), 'Y', 'ADDITION', 'ADJUSTMENT'),'ADJUSTMENT')
697:
698: end if;
699: else
700: if (p_log_level_rec.statement_level) then
701: fa_debug_pkg.add(l_calling_fn,'Insert into ', 'FA_TRANSACTION_HEADERS', p_log_level_rec => p_log_level_rec);
702: end if;
703:
704: if G_release = 11 then
705: FORALL i in 1..t_request_id.count
702: end if;
703:
704: if G_release = 11 then
705: FORALL i in 1..t_request_id.count
706: UPDATE FA_TRANSACTION_HEADERS
707: SET TRANSACTION_TYPE_CODE = 'ADDITION/VOID'
708: WHERE t_period_of_addition_flag(i) = 'Y'
709: AND asset_id = t_asset_id(i)
710: AND book_type_code = p_book_type_code
711: AND transaction_type_code = 'ADDITION';
712: end if;
713:
714: FORALL i in 1..t_request_id.count
715: INSERT INTO FA_TRANSACTION_HEADERS(
716: TRANSACTION_HEADER_ID
717: , BOOK_TYPE_CODE
718: , ASSET_ID
719: , TRANSACTION_TYPE_CODE
726: , AMORTIZATION_START_DATE
727: , CALLING_INTERFACE
728: , MASS_TRANSACTION_ID
729: ) VALUES (
730: FA_TRANSACTION_HEADERS_S.NEXTVAL
731: , p_book_type_code
732: , t_asset_id(i)
733: , decode(G_release,'11',decode(t_period_of_addition_flag(i), 'Y', 'ADDITION', 'ADJUSTMENT'),'ADJUSTMENT')
734: , t_impairment_date(i)