93: raise ret_adj_err;
94: end if;
95:
96: -- call the cache for the primary transaction book
97: if NOT fa_cache_pkg.fazcbc
98: (X_book => px_asset_hdr_rec.book_type_code,
99: p_log_level_rec => g_log_level_rec) then
100: raise ret_adj_err;
101: end if;
122: -- that is not tied to a SOB_ID by getting the value from
123: -- the book struct
124:
125: -- Get the book type code P,R or N
126: if not fa_cache_pkg.fazcsob
127: (X_set_of_books_id => fa_cache_pkg.fazcbc_record.set_of_books_id,
128: X_mrc_sob_type_code => l_reporting_flag,
129: p_log_level_rec => g_log_level_rec) then
130: raise ret_adj_err;
123: -- the book struct
124:
125: -- Get the book type code P,R or N
126: if not fa_cache_pkg.fazcsob
127: (X_set_of_books_id => fa_cache_pkg.fazcbc_record.set_of_books_id,
128: X_mrc_sob_type_code => l_reporting_flag,
129: p_log_level_rec => g_log_level_rec) then
130: raise ret_adj_err;
131: end if;
239:
240: l_primary_cost number; -- ??? use ???
241:
242: l_period_rec FA_API_TYPES.period_rec_type;
243: l_rsob_tbl FA_CACHE_PKG.fazcrsob_sob_tbl_type;
244: l_reporting_flag varchar2(1);
245:
246: l_exchange_rate number;
247: l_avg_rate number;
259:
260: BEGIN
261:
262: -- load the initial values in structs
263: px_asset_hdr_rec.set_of_books_id := fa_cache_pkg.fazcbc_record.set_of_books_id;
264:
265: l_asset_hdr_rec := px_asset_hdr_rec;
266:
267: px_trans_rec.transaction_type_code := 'GROUP ADJUSTMENT'; -- **** ??? ****
294: greatest(l_period_rec.calendar_period_open_date,
295: least(sysdate,l_period_rec.calendar_period_close_date));
296:
297: if p_cost_of_removal_ccid is not null then
298: if not FA_ASSET_VAL_PVT.validate_ccid(p_book_type_code => fa_cache_pkg.fazcbc_record.book_type_code,
299: p_ccid => p_cost_of_removal_ccid,
300: p_gl_chart_id => fa_cache_pkg.fazcbc_record.accounting_flex_structure,
301: p_ledger_id => px_asset_hdr_rec.set_of_books_id,
302: p_validation_date => px_trans_rec.transaction_date_entered,
296:
297: if p_cost_of_removal_ccid is not null then
298: if not FA_ASSET_VAL_PVT.validate_ccid(p_book_type_code => fa_cache_pkg.fazcbc_record.book_type_code,
299: p_ccid => p_cost_of_removal_ccid,
300: p_gl_chart_id => fa_cache_pkg.fazcbc_record.accounting_flex_structure,
301: p_ledger_id => px_asset_hdr_rec.set_of_books_id,
302: p_validation_date => px_trans_rec.transaction_date_entered,
303: p_calling_fn => l_calling_fn,
304: p_log_level_rec => p_log_level_rec
306: return false;
307: end if;
308: end if;
309: if p_proceeds_ccid is not null then
310: if not FA_ASSET_VAL_PVT.validate_ccid(p_book_type_code => fa_cache_pkg.fazcbc_record.book_type_code,
311: p_ccid => p_proceeds_ccid,
312: p_gl_chart_id => fa_cache_pkg.fazcbc_record.accounting_flex_structure,
313: p_ledger_id => px_asset_hdr_rec.set_of_books_id,
314: p_validation_date => px_trans_rec.transaction_date_entered,
308: end if;
309: if p_proceeds_ccid is not null then
310: if not FA_ASSET_VAL_PVT.validate_ccid(p_book_type_code => fa_cache_pkg.fazcbc_record.book_type_code,
311: p_ccid => p_proceeds_ccid,
312: p_gl_chart_id => fa_cache_pkg.fazcbc_record.accounting_flex_structure,
313: p_ledger_id => px_asset_hdr_rec.set_of_books_id,
314: p_validation_date => px_trans_rec.transaction_date_entered,
315: p_calling_fn => l_calling_fn,
316: p_log_level_rec => p_log_level_rec
372: raise ret_adj_err;
373: end if;
374:
375: -- Call the reporting books cache to get rep books.
376: if (NOT fa_cache_pkg.fazcrsob (
377: x_book_type_code => l_asset_hdr_rec.book_type_code,
378: x_sob_tbl => l_rsob_tbl,
379: p_log_level_rec => p_log_level_rec
380: )) then
419:
420: l_mrc_asset_hdr_rec := l_asset_hdr_rec;
421:
422: if (l_mrc_index = 0) then
423: l_mrc_asset_hdr_rec.set_of_books_id := fa_cache_pkg.fazcbc_record.set_of_books_id;
424: l_reporting_flag := 'P';
425: else
426: l_mrc_asset_hdr_rec.set_of_books_id := l_rsob_tbl(l_mrc_index);
427: l_reporting_flag := 'R';
427: l_reporting_flag := 'R';
428: end if;
429:
430: -- Need to always call fazcbcs
431: if (NOT fa_cache_pkg.fazcbcs (
432: X_book => l_mrc_asset_hdr_rec.book_type_code,
433: X_set_of_books_id => l_mrc_asset_hdr_rec.set_of_books_id,
434: p_log_level_rec => p_log_level_rec
435: )) then
533: ) then
534: raise ret_adj_err;
535: end if; -- do_adjustment
536: l_secondary_sob_id := FA_XLA_EVENTS_PVT.get_secondary_sob_id(px_asset_hdr_rec.book_type_code);
537: if(l_reporting_flag = 'R') and (fa_cache_pkg.fazcbc_record.set_of_books_id <> l_mrc_asset_hdr_rec.set_of_books_id) and (l_secondary_sob_id = l_mrc_asset_hdr_rec.set_of_books_id) then
538: l_secondary_asset_hdr_rec := px_asset_hdr_rec;
539: l_secondary_trans_rec := px_trans_rec;
540: l_secondary_asset_hdr_rec.set_of_books_id := l_mrc_asset_hdr_rec.set_of_books_id;
541: if not FA_XLA_EVENTS_PVT.create_transaction_event