20: l_amount number := p_amount;
21: l_amount_old number := p_amount;
22: --l_path varchar2(150) := g_path||'do_round';
23: begin
24: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'--- Inside Round() ---');
25: IF IGI_IAC_COMMON_UTILS.Iac_Round(X_Amount => l_amount, X_Book => p_book_type_code)
26: THEN
27: p_amount := l_amount;
28: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is TRUE');
24: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'--- Inside Round() ---');
25: IF IGI_IAC_COMMON_UTILS.Iac_Round(X_Amount => l_amount, X_Book => p_book_type_code)
26: THEN
27: p_amount := l_amount;
28: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is TRUE');
29: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
30: ELSE
31: p_amount := round( l_amount, 2);
32: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is FALSE');
25: IF IGI_IAC_COMMON_UTILS.Iac_Round(X_Amount => l_amount, X_Book => p_book_type_code)
26: THEN
27: p_amount := l_amount;
28: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is TRUE');
29: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
30: ELSE
31: p_amount := round( l_amount, 2);
32: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is FALSE');
33: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
28: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is TRUE');
29: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
30: ELSE
31: p_amount := round( l_amount, 2);
32: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is FALSE');
33: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
34: END IF;
35: exception when others then
36: p_amount := l_amount_old;
29: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
30: ELSE
31: p_amount := round( l_amount, 2);
32: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'IGI_IAC_COMMON_UTILS.Iac_Round is FALSE');
33: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
34: END IF;
35: exception when others then
36: p_amount := l_amount_old;
37: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
33: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_amount = '||p_amount);
34: END IF;
35: exception when others then
36: p_amount := l_amount_old;
37: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
38: Raise;
39: end;
40:
41: procedure do_round ( p_info in out NOCOPY IGI_IAC_TYPES.iac_reval_output_asset ) is
54: do_round( p_info.net_book_value , p_info.book_type_code ) ;
55:
56: exception when others then
57: p_info := p_info_old;
58: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
59: Raise;
60: end;
61:
62: procedure display ( p_info in IGI_IAC_TYPES.iac_reval_output_asset ) IS
61:
62: procedure display ( p_info in IGI_IAC_TYPES.iac_reval_output_asset ) IS
63: l_path varchar2(150) := g_path||'display';
64: begin
65: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
62: procedure display ( p_info in IGI_IAC_TYPES.iac_reval_output_asset ) IS
63: l_path varchar2(150) := g_path||'display';
64: begin
65: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
63: l_path varchar2(150) := g_path||'display';
64: begin
65: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
64: begin
65: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
65: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
66: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Adjusted cost '||p_info.adjusted_cost);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
67: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Operating Acc '||p_info.operating_acct);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
68: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn amount '||p_info.deprn_amount );
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
76: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
69: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Backlog '||p_info.backlog_deprn_reserve);
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
76: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
77: end;
70: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Deprn Reserve '||p_info.deprn_reserve);
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
76: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
77: end;
78:
71: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' General Fund '||p_info.general_fund);
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
76: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
77: end;
78:
79: Function Calculations ( p_iac_reval_params in out NOCOPY IGI_IAC_TYPES.iac_reval_params
72: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' Reval Reserve '||p_info.reval_reserve );
73: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' NBV '||p_info.net_book_value );
74: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' current rate '||p_info.current_reval_factor);
75: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' cumulve rate '||p_info.cumulative_reval_factor);
76: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
77: end;
78:
79: Function Calculations ( p_iac_reval_params in out NOCOPY IGI_IAC_TYPES.iac_reval_params
80: , p_second_set in boolean
93: l_path varchar2(150) := g_path||'Calculations';
94: BEGIN
95: p_iac_reval_params_old := p_iac_reval_params;
96:
97: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'begin calculations');
98: if not p_second_set then
99: l_curr_rate := p_iac_reval_params.reval_curr_rate_info_first.cumulative_reval_factor;
100: l_prev_rate := p_iac_reval_params.reval_prev_rate_info.cumulative_reval_factor;
101:
107:
108: l_py_factor := p_iac_reval_params.fa_asset_info.deprn_periods_prior_year /
109: p_iac_reval_params.fa_asset_info.deprn_periods_elapsed
110: ;
111: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_curr_rate '|| l_curr_rate);
112: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_prev_rate '|| l_prev_rate);
113: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_tran_rate '|| l_tran_rate);
114:
115: /* Apply the prev cumm rate to the fa info */
108: l_py_factor := p_iac_reval_params.fa_asset_info.deprn_periods_prior_year /
109: p_iac_reval_params.fa_asset_info.deprn_periods_elapsed
110: ;
111: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_curr_rate '|| l_curr_rate);
112: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_prev_rate '|| l_prev_rate);
113: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_tran_rate '|| l_tran_rate);
114:
115: /* Apply the prev cumm rate to the fa info */
116: l_reval_prev := p_iac_reval_params.reval_input_asset;
109: p_iac_reval_params.fa_asset_info.deprn_periods_elapsed
110: ;
111: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_curr_rate '|| l_curr_rate);
112: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_prev_rate '|| l_prev_rate);
113: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : l_tran_rate '|| l_tran_rate);
114:
115: /* Apply the prev cumm rate to the fa info */
116: l_reval_prev := p_iac_reval_params.reval_input_asset;
117: l_reval_curr := p_iac_reval_params.reval_input_asset;
115: /* Apply the prev cumm rate to the fa info */
116: l_reval_prev := p_iac_reval_params.reval_input_asset;
117: l_reval_curr := p_iac_reval_params.reval_input_asset;
118:
119: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' + calculations : deprn Resreve '|| p_iac_reval_params.fa_asset_info.deprn_reserve);
120: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+ calculations : YTD '|| p_iac_reval_params.fa_asset_info.Ytd_deprn);
121:
122: if (p_iac_reval_params.reval_control.first_time_flag) then
123: l_reval_prev.adjusted_cost := ( l_prev_rate * p_iac_reval_params.fa_asset_info.cost )
116: l_reval_prev := p_iac_reval_params.reval_input_asset;
117: l_reval_curr := p_iac_reval_params.reval_input_asset;
118:
119: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,' + calculations : deprn Resreve '|| p_iac_reval_params.fa_asset_info.deprn_reserve);
120: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+ calculations : YTD '|| p_iac_reval_params.fa_asset_info.Ytd_deprn);
121:
122: if (p_iac_reval_params.reval_control.first_time_flag) then
123: l_reval_prev.adjusted_cost := ( l_prev_rate * p_iac_reval_params.fa_asset_info.cost )
124: - p_iac_reval_params.fa_asset_info.cost ;
122: if (p_iac_reval_params.reval_control.first_time_flag) then
123: l_reval_prev.adjusted_cost := ( l_prev_rate * p_iac_reval_params.fa_asset_info.cost )
124: - p_iac_reval_params.fa_asset_info.cost ;
125: do_round(l_reval_prev.adjusted_cost,p_iac_reval_params.reval_asset_params.book_type_code);
126: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'l_reval_prev.adjusted_cost :'|| l_reval_prev.adjusted_cost);
127:
128: if l_curr_rate >= 1 and l_prev_rate >= 1 then
129: l_reval_prev.operating_acct := 0;
130: else
133:
134: p_iac_reval_params.reval_asset_params.prev_ytd_deprn := ( l_prev_rate * p_iac_reval_params.fa_asset_info.ytd_deprn)
135: - p_iac_reval_params.fa_asset_info.ytd_deprn;
136: do_round(p_iac_reval_params.reval_asset_params.prev_ytd_deprn,p_iac_reval_params.reval_asset_params.book_type_code);
137: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_iac_reval_params.reval_asset_params.prev_ytd_deprn :'|| p_iac_reval_params.reval_asset_params.prev_ytd_deprn);
138:
139: l_reval_prev.backlog_deprn_reserve := (l_prev_rate - 1) *
140: ( p_iac_reval_params.fa_asset_info.deprn_reserve -
141: p_iac_reval_params.fa_asset_info.ytd_deprn)
143: /*) -
144: ( p_iac_reval_params.fa_asset_info.deprn_reserve -
145: p_iac_reval_params.fa_asset_info.ytd_deprn)*/ ;
146: do_round(l_reval_prev.backlog_deprn_reserve,p_iac_reval_params.reval_asset_params.book_type_code);
147: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'l_reval_prev.backlog_deprn_reserve :'
148: || l_reval_prev.backlog_deprn_reserve);
149:
150: if l_reval_prev.adjusted_cost >= 0 then
151: l_reval_prev.general_fund := p_iac_reval_params.reval_asset_params.prev_ytd_deprn ;
159: l_reval_prev.deprn_reserve := ( l_prev_rate * p_iac_reval_params.fa_asset_info.deprn_reserve)
160: - p_iac_reval_params.fa_asset_info.deprn_reserve
161: - l_reval_prev.backlog_deprn_reserve;
162: do_round(l_reval_prev.deprn_reserve,p_iac_reval_params.reval_asset_params.book_type_code);
163: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'l_reval_prev.deprn_reserve :'
164: || l_reval_prev.deprn_reserve);
165:
166:
167: l_reval_prev.net_book_value := l_reval_prev.adjusted_cost - l_reval_prev.deprn_reserve
166:
167: l_reval_prev.net_book_value := l_reval_prev.adjusted_cost - l_reval_prev.deprn_reserve
168: - l_reval_prev.backlog_deprn_reserve;
169: else
170: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : not the first time');
171: p_iac_reval_params.reval_asset_params.prev_ytd_deprn := ( l_prev_rate * p_iac_reval_params.fa_asset_info.ytd_deprn)
172: - p_iac_reval_params.fa_asset_info.ytd_deprn;
173: do_round(p_iac_reval_params.reval_asset_params.prev_ytd_deprn,p_iac_reval_params.reval_asset_params.book_type_code);
174: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_iac_reval_params.reval_asset_params.prev_ytd_deprn :'
170: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+calculations : not the first time');
171: p_iac_reval_params.reval_asset_params.prev_ytd_deprn := ( l_prev_rate * p_iac_reval_params.fa_asset_info.ytd_deprn)
172: - p_iac_reval_params.fa_asset_info.ytd_deprn;
173: do_round(p_iac_reval_params.reval_asset_params.prev_ytd_deprn,p_iac_reval_params.reval_asset_params.book_type_code);
174: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'p_iac_reval_params.reval_asset_params.prev_ytd_deprn :'
175: || p_iac_reval_params.reval_asset_params.prev_ytd_deprn);
176: end if;
177:
178: /* Display prev record */
175: || p_iac_reval_params.reval_asset_params.prev_ytd_deprn);
176: end if;
177:
178: /* Display prev record */
179: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
180: if p_second_set then
181: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : START +++++++++++');
182: else
183: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++ FIRST SET : START +++++++++++');
177:
178: /* Display prev record */
179: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
180: if p_second_set then
181: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : START +++++++++++');
182: else
183: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++ FIRST SET : START +++++++++++');
184: end if;
185: Do_round( l_reval_prev );
179: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++++++++++++++++++++++++++++++++++++++');
180: if p_second_set then
181: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : START +++++++++++');
182: else
183: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'++++++++++++ FIRST SET : START +++++++++++');
184: end if;
185: Do_round( l_reval_prev );
186: Display( l_reval_prev );
187: /* Apply the curr cumm rate to the fa info */
230: l_blog := ( p_iac_reval_params.fa_asset_info.deprn_reserve -
231: p_iac_reval_params.fa_asset_info.ytd_deprn) *
232: ( l_curr_rate - l_prev_rate );
233: do_round(l_blog ,p_iac_reval_params.reval_asset_params.book_type_code);
234: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+current period backlog is '|| l_blog);
235: l_reval_curr.backlog_deprn_reserve := l_blog + l_reval_prev.backlog_deprn_reserve;
236: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+cumulative backlog is '|| l_reval_curr.backlog_deprn_reserve);
237: end;
238: else
232: ( l_curr_rate - l_prev_rate );
233: do_round(l_blog ,p_iac_reval_params.reval_asset_params.book_type_code);
234: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+current period backlog is '|| l_blog);
235: l_reval_curr.backlog_deprn_reserve := l_blog + l_reval_prev.backlog_deprn_reserve;
236: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+cumulative backlog is '|| l_reval_curr.backlog_deprn_reserve);
237: end;
238: else
239: l_reval_curr.backlog_deprn_reserve := 0;
240: end if;
254: l_reval_curr.deprn_reserve := ( l_curr_rate * p_iac_reval_params.fa_asset_info.deprn_reserve)
255: - p_iac_reval_params.fa_asset_info.deprn_reserve
256: - l_reval_curr.backlog_deprn_reserve;
257: do_round(l_reval_curr.deprn_reserve ,p_iac_reval_params.reval_asset_params.book_type_code);
258: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'l_reval_curr.deprn_reserve :'
259: || l_reval_curr.deprn_reserve);
260:
261: l_reval_curr.net_book_value := l_reval_curr.adjusted_cost - l_reval_curr.deprn_reserve
262: - l_reval_curr.backlog_deprn_reserve;
263: Do_round( p_info => l_reval_curr );
264: /* put the differences in the asset mvmt table */
265: -- note accounting entries are created from this mvmt table --
266: if p_iac_reval_params.reval_control.first_time_flag then
267: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+first time flag is set.');
268: l_reval_mvmt := l_reval_curr;
269: else
270: l_reval_mvmt.adjusted_cost := l_reval_curr.adjusted_cost - l_reval_prev.adjusted_cost;
271: l_reval_mvmt.operating_acct := l_reval_curr.operating_acct - l_reval_prev.operating_acct;
279: end if;
280: /* display results to the log file */
281: Do_round ( p_info => l_reval_mvmt );
282: if p_second_set then
283: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : REVAL MVMT ++++++++');
284: else
285: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ FIRST SET : REVAL MVMT ++++++++');
286: end if;
287:
281: Do_round ( p_info => l_reval_mvmt );
282: if p_second_set then
283: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : REVAL MVMT ++++++++');
284: else
285: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ FIRST SET : REVAL MVMT ++++++++');
286: end if;
287:
288: Display ( p_info => l_reval_mvmt );
289: if p_second_set then
286: end if;
287:
288: Display ( p_info => l_reval_mvmt );
289: if p_second_set then
290: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : REVAL END ++++++++');
291: else
292: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ FIRST SET : REVAL END ++++++++');
293: end if;
294: Display ( p_info => l_reval_curr );
288: Display ( p_info => l_reval_mvmt );
289: if p_second_set then
290: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ SECOND SET : REVAL END ++++++++');
291: else
292: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+++++++++++ FIRST SET : REVAL END ++++++++');
293: end if;
294: Display ( p_info => l_reval_curr );
295: if p_iac_reval_params.reval_control.first_time_flag then
296: p_iac_reval_params.reval_input_asset := l_reval_prev ;
298: p_iac_reval_params.reval_output_asset := l_reval_curr ;
299: p_iac_reval_params.reval_output_asset.cumulative_reval_factor := l_curr_rate;
300: p_iac_reval_params.reval_output_asset.current_reval_factor := l_tran_rate;
301: p_iac_reval_params.reval_output_asset_mvmt := l_reval_mvmt ;
302: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end calculations');
303: return TRUE;
304:
305: exception when others then
306: p_iac_reval_params := p_iac_reval_params_old;
303: return TRUE;
304:
305: exception when others then
306: p_iac_reval_params := p_iac_reval_params_old;
307: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
308: return FALSE;
309: END;
310:
311: Function First_set_calculations ( p_iac_reval_params in out NOCOPY IGI_IAC_TYPES.iac_reval_params )
315: BEGIN
316:
317: p_iac_reval_params_old := p_iac_reval_params;
318:
319: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'begin first set calculations');
320: IF NOT Calculations ( p_iac_reval_params => p_iac_reval_params, p_second_set => false )
321: THEN
322: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error first set calculations');
323: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
318:
319: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'begin first set calculations');
320: IF NOT Calculations ( p_iac_reval_params => p_iac_reval_params, p_second_set => false )
321: THEN
322: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error first set calculations');
323: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
324: return false;
325: END IF;
326: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
319: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'begin first set calculations');
320: IF NOT Calculations ( p_iac_reval_params => p_iac_reval_params, p_second_set => false )
321: THEN
322: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error first set calculations');
323: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
324: return false;
325: END IF;
326: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
327: return TRUE;
322: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error first set calculations');
323: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
324: return false;
325: END IF;
326: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
327: return TRUE;
328: exception when others then
329: p_iac_reval_params := p_iac_reval_params_old;
330: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
326: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'end first set calculations');
327: return TRUE;
328: exception when others then
329: p_iac_reval_params := p_iac_reval_params_old;
330: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
331: return FALSE;
332: END;
333:
334: Function Next_set_calculations ( p_iac_reval_params in out NOCOPY IGI_IAC_TYPES.iac_reval_params )
340: p_iac_reval_params_old := p_iac_reval_params;
341:
342: IF NOT Calculations ( p_iac_reval_params => p_iac_reval_params, p_second_set => true )
343: THEN
344: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'error next set calculations');
345: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'end next set calculations');
346: return false;
347: END IF;
348: return TRUE;
341:
342: IF NOT Calculations ( p_iac_reval_params => p_iac_reval_params, p_second_set => true )
343: THEN
344: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'error next set calculations');
345: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'end next set calculations');
346: return false;
347: END IF;
348: return TRUE;
349: exception when others then
347: END IF;
348: return TRUE;
349: exception when others then
350: p_iac_reval_params := p_iac_reval_params_old;
351: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
352: return FALSE;
353: END;
354: /*
355: -- Get the rate information and then call Set_Calculations : FIRST and NEXT
377: , fp_reval_curr_rate_info_first => p_iac_reval_params.reval_curr_rate_info_first
378: , fp_reval_curr_rate_info_next => p_iac_reval_params.reval_curr_rate_info_next
379: )
380: THEN
381: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Unable to split rates!');
382: return FALSE;
383: END IF;
384:
385: return TRUE;
384:
385: return TRUE;
386: exception when others then
387: p_iac_reval_params := p_iac_reval_params_old;
388: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
389: return FALSE;
390: END;
391:
392: function swap ( fp_reval_params1 IN IGI_IAC_TYPES.iac_reval_params
397: l_path varchar2(150) := g_path||'swap';
398: begin
399:
400: if fp_reval_params1.reval_control.mixed_scenario then
401: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+intializing for the second set of calculations');
402: fp_reval_params2 := fp_reval_params1;
403: fp_reval_params2.reval_control.first_time_flag := false;
404: fp_reval_params2.reval_input_asset := fp_reval_params1.reval_output_asset;
405: fp_reval_params2.reval_output_asset := fp_reval_params1.reval_output_asset;
419: end if;
420: return true;
421: exception when others then
422: fp_reval_params2 := fp_reval_params2_old;
423: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
424: return FALSE;
425: end;
426:
427: END;