58:
59: -- override
60: adj_ptr_faxiat.deprn_override_flag := '';
61:
62: if not fa_cache_pkg.fazccb(h_book_type_code,
63: h_category_id,
64: p_log_level_rec
65: )
66: then
75: then
76: h_cost_source := 'CIP ADJUSTMENT';
77: h_cost_acct_type := 'CIP_COST_ACCT';
78: h_clearing_acct_type := 'CIP_CLEARING_ACCT';
79: h_cost_acct := FA_CACHE_PKG.fazccb_record.cip_cost_acct;
80: h_clearing_acct := FA_CACHE_PKG.fazccb_record.cip_clearing_acct;
81: else
82: h_cost_source := 'ADJUSTMENT';
83: h_cost_acct_type := 'ASSET_COST_ACCT';
76: h_cost_source := 'CIP ADJUSTMENT';
77: h_cost_acct_type := 'CIP_COST_ACCT';
78: h_clearing_acct_type := 'CIP_CLEARING_ACCT';
79: h_cost_acct := FA_CACHE_PKG.fazccb_record.cip_cost_acct;
80: h_clearing_acct := FA_CACHE_PKG.fazccb_record.cip_clearing_acct;
81: else
82: h_cost_source := 'ADJUSTMENT';
83: h_cost_acct_type := 'ASSET_COST_ACCT';
84: h_clearing_acct_type := 'ASSET_CLEARING_ACCT';
81: else
82: h_cost_source := 'ADJUSTMENT';
83: h_cost_acct_type := 'ASSET_COST_ACCT';
84: h_clearing_acct_type := 'ASSET_CLEARING_ACCT';
85: h_cost_acct := FA_CACHE_PKG.fazccb_record.asset_cost_acct;
86: h_clearing_acct:=FA_CACHE_PKG.fazccb_record.asset_clearing_acct;
87: end if;
88: adj_ptr_faxiat.annualized_adjustment:=0;
89: adj_ptr_faxiat.source_type_code := h_cost_source;
82: h_cost_source := 'ADJUSTMENT';
83: h_cost_acct_type := 'ASSET_COST_ACCT';
84: h_clearing_acct_type := 'ASSET_CLEARING_ACCT';
85: h_cost_acct := FA_CACHE_PKG.fazccb_record.asset_cost_acct;
86: h_clearing_acct:=FA_CACHE_PKG.fazccb_record.asset_clearing_acct;
87: end if;
88: adj_ptr_faxiat.annualized_adjustment:=0;
89: adj_ptr_faxiat.source_type_code := h_cost_source;
90: adj_ptr_faxiat.adjustment_amount
171: end if;
172: end if; /* adjustment_amount<>0 */
173:
174: h_expense_acct_type := 'DEPRN_EXPENSE_ACCT';
175: h_expense_acct := FA_CACHE_PKG.fazccb_record.deprn_expense_acct;
176: h_expense_source:='DEPRECIATION';
177: adj_ptr_faxiat.source_type_code:=h_expense_source;
178: adj_ptr_faxiat.adjustment_type:='EXPENSE';
179: adj_ptr_faxiat.debit_credit_flag:='DR';
239: if nvl(X_bonus_deprn_exp,0) <> 0 then
240:
241: h_expense_acct_type := 'BONUS_DEPRN_EXPENSE_ACCT';
242: -- account could be derived from somewhere else, derive from account generat.
243: h_expense_acct := FA_CACHE_PKG.fazccb_record.bonus_deprn_expense_acct;
244: h_expense_source:='DEPRECIATION';
245: adj_ptr_faxiat.source_type_code:=h_expense_source;
246: adj_ptr_faxiat.adjustment_type:='BONUS EXPENSE';
247: adj_ptr_faxiat.debit_credit_flag:='DR';
434: where th.transaction_header_id = c_thid
435: and th.date_effective between dp.period_open_date and
436: nvl(dp.period_close_date,sysdate)
437: and dp.book_type_code = X_fin_info_ptr.book
438: and fy.fiscal_year_name = fa_cache_pkg.fazcbc_record.fiscal_year_name
439: and cp.start_date = fy.start_date
440: and cp.period_num = 1
441: and cp.calendar_type = fa_cache_pkg.fazcbc_record.deprn_calendar
442: and dp.calendar_period_open_date between fy.start_date and fy.end_date
437: and dp.book_type_code = X_fin_info_ptr.book
438: and fy.fiscal_year_name = fa_cache_pkg.fazcbc_record.fiscal_year_name
439: and cp.start_date = fy.start_date
440: and cp.period_num = 1
441: and cp.calendar_type = fa_cache_pkg.fazcbc_record.deprn_calendar
442: and dp.calendar_period_open_date between fy.start_date and fy.end_date
443: and X_fin_info_ptr.amortization_start_date between fy.start_date and fy.end_date;
444:
445: --
484: value=>X_fin_info_ptr.life,
485: p_log_level_rec => p_log_level_rec);
486: end if;
487:
488: if (not FA_CACHE_PKG.fazccmt(X_fin_info_ptr.method_code,
489: X_fin_info_ptr.life
490: ,p_log_level_rec => p_log_level_rec))
491: then
492: FA_SRVR_MSG.ADD_MESSAGE
494: p_log_level_rec => p_log_level_rec);
495: return FALSE;
496: end if;
497:
498: h_method_id := fa_cache_pkg.fazccmt_record.method_id;
499: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
500: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
501:
502: if fa_cache_pkg.fazccmt_record.exclude_salvage_value_flag = 'YES' then
495: return FALSE;
496: end if;
497:
498: h_method_id := fa_cache_pkg.fazccmt_record.method_id;
499: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
500: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
501:
502: if fa_cache_pkg.fazccmt_record.exclude_salvage_value_flag = 'YES' then
503: h_excl_salvage_val_flag := TRUE;
496: end if;
497:
498: h_method_id := fa_cache_pkg.fazccmt_record.method_id;
499: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
500: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
501:
502: if fa_cache_pkg.fazccmt_record.exclude_salvage_value_flag = 'YES' then
503: h_excl_salvage_val_flag := TRUE;
504: else
498: h_method_id := fa_cache_pkg.fazccmt_record.method_id;
499: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
500: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
501:
502: if fa_cache_pkg.fazccmt_record.exclude_salvage_value_flag = 'YES' then
503: h_excl_salvage_val_flag := TRUE;
504: else
505: h_excl_salvage_val_flag := FALSE;
506: end if;
504: else
505: h_excl_salvage_val_flag := FALSE;
506: end if;
507:
508: if fa_cache_pkg.fazccmt_record.depreciate_lastyear_flag = 'YES' then
509: h_deprn_last_year_flag := TRUE;
510: else
511: h_deprn_last_year_flag := FALSE;
512: end if;
580:
581: -- Added for Dated Adjustment
582: if (X_fin_info_ptr.amortization_start_date is not null) then
583: -- removed fazcbc cache call as it should already be loaded - BMR
584: last_per_ctr := fa_cache_pkg.fazcbc_record.last_period_counter;
585: cur_fy := fa_cache_pkg.fazcbc_record.current_fiscal_year;
586: cur_per_num := mod((last_per_ctr+1),cur_fy);
587: amortization_start_jdate := to_number(to_char(X_fin_info_ptr.amortization_start_date, 'J'));
588: fy_name := fa_cache_pkg.fazcbc_record.fiscal_year_name;
581: -- Added for Dated Adjustment
582: if (X_fin_info_ptr.amortization_start_date is not null) then
583: -- removed fazcbc cache call as it should already be loaded - BMR
584: last_per_ctr := fa_cache_pkg.fazcbc_record.last_period_counter;
585: cur_fy := fa_cache_pkg.fazcbc_record.current_fiscal_year;
586: cur_per_num := mod((last_per_ctr+1),cur_fy);
587: amortization_start_jdate := to_number(to_char(X_fin_info_ptr.amortization_start_date, 'J'));
588: fy_name := fa_cache_pkg.fazcbc_record.fiscal_year_name;
589: if not fa_cache_pkg.fazccp (
584: last_per_ctr := fa_cache_pkg.fazcbc_record.last_period_counter;
585: cur_fy := fa_cache_pkg.fazcbc_record.current_fiscal_year;
586: cur_per_num := mod((last_per_ctr+1),cur_fy);
587: amortization_start_jdate := to_number(to_char(X_fin_info_ptr.amortization_start_date, 'J'));
588: fy_name := fa_cache_pkg.fazcbc_record.fiscal_year_name;
589: if not fa_cache_pkg.fazccp (
590: h_dpr_row.calendar_type, fy_name,amortization_start_jdate,
591: amortize_per_num, amortize_fy, start_jdate, p_log_level_rec) then
592: fa_srvr_msg.add_message (calling_fn => 'FA_AMORT_PKG.faxraf',
585: cur_fy := fa_cache_pkg.fazcbc_record.current_fiscal_year;
586: cur_per_num := mod((last_per_ctr+1),cur_fy);
587: amortization_start_jdate := to_number(to_char(X_fin_info_ptr.amortization_start_date, 'J'));
588: fy_name := fa_cache_pkg.fazcbc_record.fiscal_year_name;
589: if not fa_cache_pkg.fazccp (
590: h_dpr_row.calendar_type, fy_name,amortization_start_jdate,
591: amortize_per_num, amortize_fy, start_jdate, p_log_level_rec) then
592: fa_srvr_msg.add_message (calling_fn => 'FA_AMORT_PKG.faxraf',
593: p_log_level_rec => p_log_level_rec);
593: p_log_level_rec => p_log_level_rec);
594: return (FALSE);
595: end if;
596: if (not((cur_fy = amortize_fy) and (cur_per_num = amortize_per_num))) then
597: if not fa_cache_pkg.fazcct (h_dpr_row.calendar_type) then
598: fa_srvr_msg.add_message (calling_fn => 'FA_AMORT_PKG.faxraf',
599: p_log_level_rec => p_log_level_rec);
600: return (FALSE);
601: end if;
598: fa_srvr_msg.add_message (calling_fn => 'FA_AMORT_PKG.faxraf',
599: p_log_level_rec => p_log_level_rec);
600: return (FALSE);
601: end if;
602: pers_per_yr := fa_cache_pkg.fazcct_record.number_per_fiscal_year;
603: if (amortize_per_num = 1) then
604: h_dpr_row.y_end := amortize_fy - 1;
605: else
606: h_dpr_row.y_end := amortize_fy;
719: -- Cost - Regular Reserve (without bonus deprn res) for cost assets
720:
721: -- Add the calling Depreciable Basis Formula.
722: --if (nvl(fnd_profile.value('FA_ENABLED_DEPRN_BASIS_FORMULA'), 'N') = 'Y') then
723: if (fa_cache_pkg.fa_enabled_deprn_basis_formula)then
724: -- new_raval_amo_basis and Production rate source rule are
725: -- not calculated on Depreciable Basis Formula
726:
727: X_new_reval_amo_basis := h_dpr_row.reval_rsv;
912:
913:
914: -- Add for the Depreciable Basis Formula.
915: -- if (nvl(fnd_profile.value('FA_ENABLED_DEPRN_BASIS_FORMULA'), 'N') <> 'Y') then
916: if (not fa_cache_pkg.fa_enabled_deprn_basis_formula)then
917:
918: if (not FA_AMORT_PKG.faxnac(X_fin_info_ptr.method_code,
919: X_fin_info_ptr.life,
920: X_fin_info_ptr.rec_cost,
1079: fetch c_get_reserve into deprn_summary.deprn_rsv,
1080: deprn_summary.bonus_deprn_rsv;
1081: close c_get_reserve;
1082: end if;
1083: if (fa_cache_pkg.fa_print_debug) then
1084: fa_debug_pkg.add('FA_AMORT_PKG.faxraf',
1085: 'Got reserve using BOOKS row', 'reserve - ytd',
1086: p_log_level_rec => p_log_level_rec);
1087: fa_debug_pkg.add('FA_AMORT_PKG.faxraf',
1107:
1108: deprn_summary.deprn_rsv := h_deprn_rsv;
1109: deprn_summary.bonus_deprn_rsv := h_bonus_deprn_rsv;
1110:
1111: if (fa_cache_pkg.fa_print_debug) then
1112: fa_debug_pkg.add('FA_AMORT_PKG.faxraf',
1113: 'Got reserve from get_reserve function', ' ',
1114: p_log_level_rec => p_log_level_rec);
1115: fa_debug_pkg.add('FA_AMORT_PKG.faxraf',
1236:
1237: -- Add for the Depreciable Basis Formula.
1238: -- if (nvl(fnd_profile.value('FA_ENABLED_DEPRN_BASIS_FORMULA'), 'N') = 'Y') then
1239:
1240: if (fa_cache_pkg.fa_enabled_deprn_basis_formula) then
1241: fa_rx_conc_mesg_pkg.log('x_new_raf D: ' || to_char(x_new_raf));
1242: -- Depreciable Basis Formula
1243: -- set h_rule_in paremters
1244:
1440: -- Added for Depreciable Basis Formula.
1441: -- if (nvl(fnd_profile.value('FA_ENABLED_DEPRN_BASIS_FORMULA'), 'N') = 'Y') then
1442:
1443:
1444: if (fa_cache_pkg.fa_enabled_deprn_basis_formula) then
1445:
1446: -- Depreciable Basis Formula
1447: -- set h_rule_in paremters
1448:
2090:
2091: if X_adj_cost is null then return false;
2092: end if;
2093:
2094: h_deprn_basis_formula := fa_cache_pkg.fazccmt_record.deprn_basis_formula;
2095:
2096: if h_deprn_basis_formula is null then
2097: return true;
2098: end if;
2099:
2100: -- following cache call is redundant as cache shoudl already be loaded - BMR (double check)
2101: -- if h_deprn_basis_formula = fa_std_types.FAD_DBF_FLAT then
2102: if h_deprn_basis_formula = 'STRICT_FLAT' then
2103: if ( not fa_cache_pkg.fazccmt(x_method_code,
2104: x_life
2105: ,p_log_level_rec => p_log_level_rec)) then
2106: fa_srvr_msg.add_message(calling_fn => 'FA_AMORT_PKG.faxnac',
2107: p_log_level_rec => p_log_level_rec);
2107: p_log_level_rec => p_log_level_rec);
2108: return false;
2109: end if;
2110:
2111: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
2112: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
2113:
2114: if h_rate_source_rule = FA_STD_TYPES.FAD_RSR_FLAT and h_deprn_basis_rule = FA_STD_TYPES.FAD_DBR_COST then
2115: if x_rec_cost is null then
2108: return false;
2109: end if;
2110:
2111: h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
2112: h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
2113:
2114: if h_rate_source_rule = FA_STD_TYPES.FAD_RSR_FLAT and h_deprn_basis_rule = FA_STD_TYPES.FAD_DBR_COST then
2115: if x_rec_cost is null then
2116: fa_srvr_msg.add_message(calling_fn => 'FA_AMORT_PKG.faxnac',