[Home] [Help]
39: fp_Reval_control := l_reval_control;
40: return true;
41: exception when others then
42: fp_Reval_control := l_reval_control;
43: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
44: return false;
45: end;
46:
47: function initialize ( fp_reval_asset_params in out NOCOPY IGI_IAC_TYPES.iac_reval_asset_params )
53: fp_reval_asset_params := l_reval_asset_params;
54: return true;
55: exception when others then
56: fp_reval_asset_params := l_reval_asset_params;
57: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
58: return false;
59: end;
60:
61: function initialize ( fp_reval_input_asset in out NOCOPY IGI_IAC_TYPES.iac_Reval_input_asset )
87: fp_reval_input_asset.last_updated_by := 0;
88: return true;
89: exception when others then
90: fp_reval_input_asset := fp_reval_input_asset_old;
91: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
92: return false;
93: end;
94:
95: function initialize ( fp_reval_asset_rules in out NOCOPY IGI_IAC_TYPES.iac_Reval_asset_rules )
118: fp_reval_asset_rules.allow_prof_update := null;
119: return true;
120: exception when others then
121: fp_reval_asset_rules := fp_reval_asset_rules_old;
122: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
123: return false;
124: end;
125:
126: function initialize ( fp_asset_info in out NOCOPY IGI_IAC_TYPES.fa_hist_asset_info )
132: fp_Asset_info := l_asset_info;
133: return true;
134: exception when others then
135: fp_Asset_info := l_asset_info;
136: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
137: return false;
138: end;
139:
140: function initialize ( fp_Reval_Rates in out NOCOPY IGI_IAC_TYPES.iac_reval_rate_params )
162: fp_Reval_Rates.adjustment_id := 0;
163: return true;
164: exception when others then
165: fp_Reval_Rates := fp_Reval_Rates_old;
166: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
167: return false;
168: end;
169:
170: function initialize ( fp_Reval_exceptions in out NOCOPY IGI_IAC_TYPES.iac_reval_exception_line )
228:
229: return true;
230: exception when others then
231: fp_reval_params := fp_reval_params_old;
232: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
233: return false;
234: end;
235:
236: function init_struct_for_srs ( fp_asset_id in number
253: l_path := g_path||'init_struct_for_srs';
254:
255: if not initialize ( fp_reval_params => l_Reval_params )
256: then
257: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
258: return false;
259: end if;
260:
261: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'Begin init_struct_for_srs');
257: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
258: return false;
259: end if;
260:
261: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'Begin init_struct_for_srs');
262:
263: /* update or populate the reval_control record */
264: l_reval_params.reval_control.revaluation_mode := fp_revaluation_mode;
265: -- get the revaluation type!
286: l_reval_params.reval_control.transaction_sub_type := 'PROFESSIONAL';
287: end if;
288:
289: exception when others then
290: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+failed to get the asset rules');
291: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
292: return false;
293: end;
294: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control based on reval mode');
287: end if;
288:
289: exception when others then
290: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+failed to get the asset rules');
291: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
292: return false;
293: end;
294: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control based on reval mode');
295: if l_reval_params.reval_control.revaluation_mode = 'P'
290: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+failed to get the asset rules');
291: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
292: return false;
293: end;
294: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control based on reval mode');
295: if l_reval_params.reval_control.revaluation_mode = 'P'
296: then
297: l_reval_params.reval_control.message_level := 3;
298: l_reval_params.reval_control.validate_business_rules := true;
311: l_reval_params.reval_control.create_acctg_entries := false;
312: l_reval_params.reval_control.crud_allowed := false;
313: l_reval_params.reval_control.modify_balances := false;
314: end if;
315: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control other defaults');
316: l_reval_params.reval_control.print_report := false;
317: /* populate the reval_asset_params record, category id would be calculated later in the code
318: when fa information is retrieved.
319: */
316: l_reval_params.reval_control.print_report := false;
317: /* populate the reval_asset_params record, category id would be calculated later in the code
318: when fa information is retrieved.
319: */
320: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_asset_params record');
321: l_reval_params.reval_asset_params.asset_id := fp_asset_id;
322: l_reval_params.reval_asset_params.book_type_code := fp_book_type_code;
323: l_reval_params.reval_asset_params.revaluation_id := fp_revaluation_id;
324: l_reval_params.reval_asset_params.period_counter := fp_period_counter;
324: l_reval_params.reval_asset_params.period_counter := fp_period_counter;
325: l_Reval_params.reval_asset_params.first_set_adjustment_id := 0;
326: l_reval_params.reval_asset_params.second_set_adjustment_id := 0;
327: /* populate the reval_input_asset record */
328: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_input_asset record');
329: declare
330: l_max_period_counter number := 0;
331: begin
332: select nvl(max(period_counter),0)
376: exception when others then
377: return false;
378: end;
379: if l_reval_params.reval_control.first_time_flag then
380: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+first time processing for this asset');
381: end if;
382: /* populate the reval_output_asset record */
383: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_output_asset record');
384: l_reval_params.reval_output_asset := l_reval_params.reval_input_asset;
379: if l_reval_params.reval_control.first_time_flag then
380: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+first time processing for this asset');
381: end if;
382: /* populate the reval_output_asset record */
383: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_output_asset record');
384: l_reval_params.reval_output_asset := l_reval_params.reval_input_asset;
385: /* populate the reval_output_asset_mvmt record */
386: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_output_asset_mvmt record');
387: if not initialize ( l_reval_params.reval_output_asset_mvmt ) then
382: /* populate the reval_output_asset record */
383: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_output_asset record');
384: l_reval_params.reval_output_asset := l_reval_params.reval_input_asset;
385: /* populate the reval_output_asset_mvmt record */
386: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_output_asset_mvmt record');
387: if not initialize ( l_reval_params.reval_output_asset_mvmt ) then
388: return false;
389: end if;
390:
391: l_reval_params.reval_output_asset_mvmt.asset_id := fp_asset_id;
392: l_reval_params.reval_output_asset_mvmt.book_type_code := fp_book_type_code;
393: l_reval_params.reval_output_asset_mvmt.period_counter := fp_period_counter;
394: /* populate the reval_prev_rate_info record */
395: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_prev_rate_info record');
396: declare
397: l_dummy varchar2(1);
398: begin
399: select *
422: l_reval_params.reval_prev_rate_info.last_update_login := g_who_login_id;
423: l_reval_params.reval_prev_rate_info.last_update_date := g_who_date;
424: l_reval_params.reval_prev_rate_info.last_updated_by := g_who_user_id;
425: when too_many_rows then
426: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+more than 1 revaluation record found with latest record set. aborting.');
427: return false;
428: when others then
429: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error getting information from revaluation rates table'||sqlerrm);
430: return false;
425: when too_many_rows then
426: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+more than 1 revaluation record found with latest record set. aborting.');
427: return false;
428: when others then
429: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'error getting information from revaluation rates table'||sqlerrm);
430: return false;
431: end;
432:
433: /* fa information from fa_books and fa_deprn summary from the historic books! */
430: return false;
431: end;
432:
433: /* fa information from fa_books and fa_deprn summary from the historic books! */
434: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the fa_asset_info record');
435: declare
436: cursor c_fa_books is
437: select fb.cost
438: , fb.adjusted_cost
487: P_value=>l_b.deprn_reserve,
488: P_cost=>l_b.cost,
489: P_salvage_value=>l_b.salvage_value,
490: P_calling_program=>'REVALUATION') THEN
491: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
492: return false;
493: END IF;
494: -- YTD
495: IF NOT igi_iac_salvage_pkg.correction(p_asset_id => fp_asset_id,
498: P_cost=>l_b.cost,
499: P_salvage_value=>l_b.salvage_value,
500: P_calling_program=>'REVALUATION') THEN
501:
502: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
503: return false;
504: END IF;
505: -- deprn amount
506: IF NOT igi_iac_salvage_pkg.correction(p_asset_id => fp_asset_id,
509: P_cost=>l_b.cost,
510: P_salvage_value=>l_b.salvage_value,
511: P_calling_program=>'REVALUATION') THEN
512:
513: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
514: return false;
515: END IF ;
516: END IF;
517: /*salvage value correction*/
520:
521: l_reval_params.fa_asset_info.cost := l_b.cost;
522: l_reval_params.fa_asset_info.adjusted_cost := l_b.adjusted_cost;
523: l_reval_params.fa_asset_info.original_cost := l_b.original_cost;
524: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+original cost : '|| l_b.original_cost);
525: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+cost : '|| l_b.cost);
526: l_reval_params.fa_asset_info.salvage_value := l_b.salvage_value;
527: l_reval_params.fa_asset_info.life_in_months := l_b.life_in_months;
528: l_reval_params.fa_asset_info.rate_adjustment_factor := l_b.rate_adjustment_factor;
521: l_reval_params.fa_asset_info.cost := l_b.cost;
522: l_reval_params.fa_asset_info.adjusted_cost := l_b.adjusted_cost;
523: l_reval_params.fa_asset_info.original_cost := l_b.original_cost;
524: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+original cost : '|| l_b.original_cost);
525: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+cost : '|| l_b.cost);
526: l_reval_params.fa_asset_info.salvage_value := l_b.salvage_value;
527: l_reval_params.fa_asset_info.life_in_months := l_b.life_in_months;
528: l_reval_params.fa_asset_info.rate_adjustment_factor := l_b.rate_adjustment_factor;
529: l_reval_params.fa_asset_info.period_counter_fully_reserved := l_b.period_counter_fully_reserved;
534: l_reval_params.fa_asset_info.last_period_counter := l_b.last_period_counter;
535: l_reval_params.fa_asset_info.gl_posting_allowed_flag := l_b.gl_posting_allowed_flag;
536: l_reval_params.fa_asset_info.ytd_deprn := l_b.ytd_deprn;
537: l_reval_params.fa_asset_info.deprn_reserve := l_b.deprn_reserve;
538: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+deprn reserve : '|| l_b.deprn_reserve);
539: l_reval_params.fa_asset_info.deprn_amount := l_b.deprn_amount;
540: l_reval_params.fa_asset_info.depreciate_flag := l_b.depreciate_flag;
541: l_reval_params.reval_asset_params.category_id := l_b.asset_category_id;
542:
553:
554: end loop;
555:
556: exception when others then
557: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+error in get period info from common utils'||sqlerrm);
558: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'End init_struct_for_srs');
559: return false;
560: end;
561:
554: end loop;
555:
556: exception when others then
557: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+error in get period info from common utils'||sqlerrm);
558: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'End init_struct_for_srs');
559: return false;
560: end;
561:
562: fp_reval_params := l_reval_params;
559: return false;
560: end;
561:
562: fp_reval_params := l_reval_params;
563: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+successful processing for init_struct_for_srs');
564: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'End init_struct_for_srs');
565:
566: return true;
567: exception when others then
560: end;
561:
562: fp_reval_params := l_reval_params;
563: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+successful processing for init_struct_for_srs');
564: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'End init_struct_for_srs');
565:
566: return true;
567: exception when others then
568: fp_reval_params := fp_reval_params_old;
565:
566: return true;
567: exception when others then
568: fp_reval_params := fp_reval_params_old;
569: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
570: return false;
571: end;
572:
573: /*
594: l_path := g_path||'init_struct_for_calc';
595:
596: if not initialize ( fp_reval_params => l_Reval_params )
597: then
598: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
599: return false;
600: end if;
601:
602: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
598: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
599: return false;
600: end if;
601:
602: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'Error initializing structure');
603:
604: /* update or populate the reval_control record */
605: l_reval_params.reval_control.revaluation_mode := fp_revaluation_mode;
606: begin
625: l_reval_params.reval_control.transaction_sub_type := 'PROFESSIONAL';
626: end if;
627:
628: exception when others then
629: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+failed to get the asset rules');
630: return false;
631: end;
632: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control based on reval mode');
633: l_reval_params.reval_control.message_level := 3;
628: exception when others then
629: igi_iac_debug_pkg.debug_other_string(g_unexp_level,l_path,'+failed to get the asset rules');
630: return false;
631: end;
632: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control based on reval mode');
633: l_reval_params.reval_control.message_level := 3;
634: l_reval_params.reval_control.validate_business_rules := false;
635: l_reval_params.reval_control.create_acctg_entries := false;
636: l_reval_params.reval_control.crud_allowed := false;
634: l_reval_params.reval_control.validate_business_rules := false;
635: l_reval_params.reval_control.create_acctg_entries := false;
636: l_reval_params.reval_control.crud_allowed := false;
637: l_reval_params.reval_control.modify_balances := false;
638: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+set the reval control other defaults');
639: l_reval_params.reval_control.print_report := false;
640: /* populate the reval_asset_params record, category id would be calculated later in the code
641: when fa information is retrieved.
642: */
639: l_reval_params.reval_control.print_report := false;
640: /* populate the reval_asset_params record, category id would be calculated later in the code
641: when fa information is retrieved.
642: */
643: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_asset_params record');
644: l_reval_params.reval_asset_params.asset_id := fp_asset_id;
645: l_reval_params.reval_asset_params.book_type_code := fp_book_type_code;
646: l_reval_params.reval_asset_params.revaluation_id := fp_revaluation_id;
647: l_reval_params.reval_asset_params.period_counter := fp_period_counter;
647: l_reval_params.reval_asset_params.period_counter := fp_period_counter;
648: l_Reval_params.reval_asset_params.first_set_adjustment_id := 0;
649: l_reval_params.reval_asset_params.second_set_adjustment_id := 0;
650: /* populate the reval_input_asset record */
651: igi_iac_debug_pkg.debug_other_string(g_state_level,l_path,'+populate the reval_input_asset record');
652: declare
653: l_max_period_counter number := 0;
654: begin
655: select nvl(max(period_counter),0)
790: P_value=>l_b.deprn_reserve,
791: P_cost=>l_b.cost,
792: P_salvage_value=>l_b.salvage_value,
793: P_calling_program=>'REVALUATION') THEN
794: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
795: Return false;
796: END IF;
797: -- YTD
798: IF NOT igi_iac_salvage_pkg.correction(p_asset_id => fp_asset_id,
801: P_cost=>l_b.cost,
802: P_salvage_value=>l_b.salvage_value,
803: P_calling_program=>'REVALUATION') THEN
804:
805: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
806: Return false;
807: END IF;
808: -- deprn amount
809: IF NOT igi_iac_salvage_pkg.correction(p_asset_id => fp_asset_id,
811: P_value=>l_b.deprn_amount,
812: P_cost=>l_b.cost,
813: P_salvage_value=>l_b.salvage_value,
814: P_calling_program=>'REVALUATION') THEN
815: igi_iac_debug_pkg.debug_other_string(g_error_level,l_path,'+Salvage Value Correction Failed : ');
816: Return false;
817: END IF;
818: End If;
819: /*salvage value correction*/
850:
851: end loop;
852:
853: exception when others then
854: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
855: return false;
856: end;
857:
858: fp_reval_params := l_reval_params;
859:
860: return true;
861: exception when others then
862: fp_reval_params := fp_reval_params_old;
863: igi_iac_debug_pkg.debug_unexpected_msg(l_path);
864: return false;
865: end;
866:
867: BEGIN