1 PACKAGE pn_index_amount_pkg AUTHID CURRENT_USER AS
2 -- $Header: PNINAMTS.pls 120.6 2011/02/14 12:32:29 pstawar ship $
3
4 -- +===========================================================================+
5 -- | Copyright (c) 2001 Oracle Corporation
6 -- | Redwood Shores, California, USA
7 -- | All rights reserved.
8 -- +===========================================================================+
9 -- | Name
10 -- | pn_index_amount_pkg
11 -- |
12 -- | Description
13 -- | This package contains procedures used to calculate index amounts.
14 -- |
15 -- |
16 -- | History
17 -- | 27-MAR-01 jreyes Created
18 -- | 19-JUN-01 jreyes Adding call to create schedules and items..
19 -- | 21-JUN-01 jreyes Adding call to get amount precision from fnd_currency.
20 -- | get_info...
21 -- | 24-JUN-01 jreyes Opened increase on types to all payment term types
22 -- | (LOOKUP Code: PN_PAYMENT_TERM_TYPE)
23 -- | 25-JUl-01 jreyes Added NVL clause to all cursors that use increase_on
24 -- | of pn_index_leases.
25 -- | 26-JUl-01 jreyes Removed CCID parm of PNT_PAYMENT_TERMS_PKG.
26 -- | 03-AUG-01 jreyes Incorporated payment aggregation.
27 -- | 20-SEP-01 psidhu Added param p_called_from to CREATE_PAYMENT_TERM_RECORD
28 -- | 05-dec-01 achauhan In create_payment_term_record added out NOCOPY param
29 -- | op_payment_term_id.
30 -- | 15-JAN-02 Mrinal Added dbdrv command.
31 -- | 01-FEB-02 Mrinal Added checkfile command.
32 -- | 06-May-02 psidhu bug 2356045 - Added parameter p_negative_rent_type to
33 -- | procedure create_payment_terms.
34 -- | 19-Jul-02 psidhu bug 2452909. Added procedure process_currency_code.
35 -- | 01-Aug-02 psidhu Changes for carry forward funtionality. Added param
36 -- | p_index_period_id, p_carry_forward_flag,
37 -- | op_constraint_applied_amount,op_carry_forward_amount
38 -- | to derive_constrained_rent. Added functions
39 -- | derive_carry_forward_amount, derive_prev_negative_rent,
40 -- | get_increase_over_constraint and get_max_assessment_dt.
41 -- | Added procedure calculate_subsequent_periods.
42 -- | 17-Oct-02 psidhu Changes for carry forward funtionality.Removed function
43 -- | derive_carry_forward_amount. Added function
44 -- | derive_cum_carry_forward.Added param
45 -- | op_carry_forward_percent and
46 -- | op_constraint_applied_percent to derive_constrained_rent
47 -- | Added param op_constraint_applied_percent and
48 -- | op_carry_forward_percent to calculate_period.
49 -- | 06-AUG-04 ftanudja o add parameter ip_auto_find_sch_day in
50 -- | approve_index_pay_term_batch. #3701195.
51 -- | 08-OCT-04 stripath o BUG 3961117, added new param p_calculate_date to
52 -- | create_payment_terms, create_payment_term_record.
53 -- | 19-OCT-04 stripath o Added function Get_Calculate_Date.
54 -- | 19-SEP-05 piagrawa o Overload Get_Calculate_Date for R12 - use ORG_ID
55 -- | 05-MAY-06 Hareesha o Bug # 5115291 Added paramater p_norm_st_date to
56 -- | procedure create_payment_term_record.
57 -- | 01-Nov-06 Prabhakar o Added parameter p_end_date to create_payment_term_record.
58 -- | 12-DEC-06 Prabhakar o Added p_prorate_factor parameter to derive_constrined_rent and
59 -- | create_payemnt_terms procedures.
60 -- +===========================================================================+
61
62
63 g_currency_code pn_index_leases.currency_code%TYPE;
64 g_calculate_date DATE := TO_DATE('01/01/0001', 'MM/DD/YYYY');
65 --
66 -- These are constants used throught this package.
67 --
68 -- BASIS TYPES
69 c_basis_type_fixed CONSTANT CHAR (5) := 'FIXED';
70 c_basis_type_rolling CONSTANT CHAR (7) := 'ROLLING';
71 c_basis_type_compound CONSTANT CHAR (8) := 'COMPOUND';
72 -- INCREASE ON
73 c_increase_on_base_rent CONSTANT CHAR (9) := 'BASE_RENT';
74 c_increase_on_oper_expenses CONSTANT CHAR (12) := 'OPER_EXPENSE';
75 c_increase_on_gross CONSTANT CHAR (5) := 'GROSS';
76 -- RELATION TYPES
77 c_relation_basis_only CONSTANT CHAR (10) := 'BASIS_ONLY';
78 c_relation_greater_of CONSTANT CHAR (10) := 'GREATER_OF';
79 c_relation_index_only CONSTANT CHAR (10) := 'INDEX_ONLY';
80 c_relation_lesser_of CONSTANT CHAR (9) := 'LESSER_OF';
81 -- RELATION TYPES
82 c_constraint_period_to_period CONSTANT CHAR (16) := 'PERIOD_TO_PERIOD';
83 c_constraint_rent_due CONSTANT CHAR (8) := 'RENT_DUE';
84 -- INDEX FINDER TYPES
85 c_index_finder_backbill CONSTANT CHAR (8) := 'BACKBILL';
86 c_index_finder_finder_date CONSTANT CHAR (11) := 'FINDER_DATE';
87 c_index_finder_most_recent CONSTANT CHAR (11) := 'MOST_RECENT';
88 -- REFERENCE TYPES
89 c_ref_period_base_year CONSTANT CHAR (9) := 'BASE_YEAR';
90 c_ref_period_prev_year_asmt_dt CONSTANT CHAR (24) := 'PREV_YEAR_ASSMT_DATE_DUR';
91 c_ref_period_prev_year_prv_cpi CONSTANT CHAR (26) := 'PREV_YEAR_PREV_CURRENT_CPI';
92 -- INVOICE SPREAD TYPES
93 c_spread_frequency_monthly CONSTANT CHAR (3) := 'MON';
94 c_spread_frequency_one_time CONSTANT CHAR (2) := 'OT';
95 c_spread_frequency_quarterly CONSTANT CHAR (3) := 'QTR';
96 c_spread_frequency_semiannual CONSTANT CHAR (2) := 'SA';
97 c_spread_frequency_annually CONSTANT CHAR (2) := 'YR';
98 -- NEGATIVE RENT TYPES
99 c_negative_rent_this_period CONSTANT CHAR (11) := 'THIS_PERIOD';
100 c_negative_rent_ignore CONSTANT CHAR (6) := 'IGNORE';
101 c_negative_rent_next_period CONSTANT CHAR (11) := 'NEXT_PERIOD';
102 -- LEASE CLASS
103 c_lease_class_direct CONSTANT CHAR (6) := 'DIRECT';
104 -- PAYMENT TERM
105 c_payment_term_type_index CONSTANT CHAR (4) := 'INDX';
106 -- PAYMENT TERM STATUS
107 c_payment_term_status_draft CONSTANT CHAR (5) := 'DRAFT';
108 c_payment_term_status_approved CONSTANT CHAR (8) := 'APPROVED';
109 --ACCOUNT CLASS
110 c_account_class_liability CONSTANT CHAR (3) := 'LIA';
111 c_account_class_receivable CONSTANT CHAR (3) := 'REC';
112 c_account_class_expenses CONSTANT CHAR (3) := 'EXP';
113 c_account_class_revenue CONSTANT CHAR (3) := 'REV';
114 c_account_class_accurual CONSTANT CHAR (3) := 'ACC';
115 c_account_class_unearn CONSTANT CHAR (6) := 'UNEARN';
116 --INDEX PAYMENT TERM TYPE
117 c_index_pay_term_type_atlst CONSTANT CHAR (7) := 'ATLEAST';
118 c_index_pay_term_type_atlst_bb CONSTANT CHAR (16) := 'ATLEAST-BACKBILL';
119 c_index_pay_term_type_recur CONSTANT CHAR (9) := 'RECURRING';
120 c_index_pay_term_type_backbill CONSTANT CHAR (8) := 'BACKBILL';
121 g_include_in_var_rent VARCHAR2(30) := NULL;
122 g_include_in_var_check VARCHAR2(1) := NULL;
123 g_create_terms_ext_period VARCHAR2(1) := NULL;
124
125 TYPE item_rec IS RECORD (payment_term_id NUMBER, amount NUMBER);
126
127 item_sum_rec item_rec;
128
129 TYPE item_sum IS TABLE OF item_sum_rec%TYPE
130 INDEX BY BINARY_INTEGER;
131
132 item_amt_tab item_sum;
133
134 ------------------------------------------------------------------------
135 -- PROCEDURE : calculate
136 -- DESCRIPTION: This procedure will perform the following calculations
137 --
138 ------------------------------------------------------------------------
139 PROCEDURE calculate (
140 ip_index_lease_id IN NUMBER
141 ,ip_index_lease_period_id IN NUMBER
142 ,ip_recalculate IN VARCHAR2
143 ,ip_commit IN VARCHAR2 DEFAULT 'N'
144 ,op_msg OUT NOCOPY VARCHAR2
145 );
146
147 ------------------------------------------------------------------------
148 -- PROCEDURE : derive_term_end_date
149 -- DESCRIPTION : This procedure will derive the RI term end date
150 --
151 -- 18-MAY-2010 jsundara o Bug9263195 Created.
152 --
153 ------------------------------------------------------------------------
154 PROCEDURE derive_term_end_date (ip_index_lease_id IN NUMBER
155 ,ip_index_period_id IN NUMBER
156 ,ip_main_lease_termination_date IN DATE
157 ,op_term_end_date OUT NOCOPY DATE);
158
159 ------------------------------------------------------------------------
160 -- PROCEDURE : calculate_period
161 -- DESCRIPTION: This procedure will calculate the index amount for a period
162 --
163 -- - Calculate Basis Amount
164 -- - Calculate Index Percentage Change (if necessary)
165 -- asdasdfas
166 --
167 ------------------------------------------------------------------------
168 PROCEDURE calculate_period (
169 ip_index_lease_id IN NUMBER
170 ,ip_index_lease_period_id IN NUMBER
171 ,ip_recalculate IN VARCHAR2
172 ,op_current_basis OUT NOCOPY NUMBER
173 ,op_unconstraint_rent_due OUT NOCOPY NUMBER
174 ,op_constraint_rent_due OUT NOCOPY NUMBER
175 ,op_index_percent_change OUT NOCOPY NUMBER
176 ,op_current_index_line_id OUT NOCOPY NUMBER
177 ,op_current_index_line_value OUT NOCOPY NUMBER
178 ,op_previous_index_line_id OUT NOCOPY NUMBER
179 ,op_previous_index_line_value OUT NOCOPY NUMBER
180 ,op_previous_index_amount IN OUT NOCOPY NUMBER
181 ,op_previous_asmt_date IN OUT NOCOPY DATE
182 ,op_constraint_applied_amount OUT NOCOPY NUMBER
183 ,op_carry_forward_amount OUT NOCOPY NUMBER
184 ,op_constraint_applied_percent OUT NOCOPY NUMBER
185 ,op_carry_forward_percent OUT NOCOPY NUMBER
186 ,op_msg OUT NOCOPY VARCHAR2
187 );
188
189
190 ------------------------------------------------------------------------
191 -- PROCEDURE : calculate_initial_basis
192 -- DESCRIPTION: This procedure will derive the initial basis;
193 --
194 ------------------------------------------------------------------------
195
196 PROCEDURE calculate_initial_basis (
197 p_index_lease_id IN NUMBER
198 ,op_basis_amount OUT NOCOPY NUMBER
199 ,op_msg OUT NOCOPY VARCHAR2
200 );
201
202
203 ------------------------------------------------------------------------
204 -- PROCEDURE : calculate_basis_amount
205 -- DESCRIPTION: This procedure will calculate the basis amount for a given index rent period
206 --
207 ------------------------------------------------------------------------
208 PROCEDURE calculate_basis_amount (
209 p_index_lease_id IN NUMBER
210 ,p_basis_start_date IN DATE
211 ,p_basis_end_date IN DATE
212 ,p_assessment_date IN DATE
213 ,p_initial_basis IN NUMBER
214 ,p_line_number IN NUMBER
215 ,p_increase_on IN VARCHAR2
216 ,p_basis_type IN VARCHAR2
217 ,p_prev_index_amount IN NUMBER DEFAULT NULL
218 ,p_recalculate IN VARCHAR2
219 ,op_basis_amount OUT NOCOPY NUMBER
220 ,op_msg OUT NOCOPY VARCHAR2
221 );
222
223
224 ------------------------------------------------------------------------
225 -- PROCEDURE : calculate_index_amount
226 -- DESCRIPTION: This procedure will calculate the UNCONSTRAINED index amount for
227 -- a given index rent period
228 --
229 ------------------------------------------------------------------------
230 PROCEDURE calculate_index_amount (
231 p_relationship IN VARCHAR2
232 ,p_basis_percent_change IN NUMBER
233 ,p_adj_index_percent_change IN NUMBER
234 ,p_current_basis IN NUMBER
235 ,op_index_amount OUT NOCOPY NUMBER
236 ,op_msg OUT NOCOPY VARCHAR2
237 );
238
239
240 ------------------------------------------------------------------------
241 -- PROCEDURE : derive_constrained_rent
245 ------------------------------------------------------------------------
242 -- DESCRIPTION: This procedure will apply all constraints that have been defined
243 -- for a given index rent
244 --
246 PROCEDURE derive_constrained_rent (
247 p_index_lease_id IN NUMBER
248 ,p_current_basis IN NUMBER
249 ,p_index_period_id IN NUMBER
250 ,p_assessment_date IN DATE
251 ,p_negative_rent_type IN VARCHAR2
252 ,p_unconstrained_rent_amount IN NUMBER
253 ,p_prev_index_amount IN NUMBER DEFAULT NULL
254 ,p_carry_forward_flag IN VARCHAR2
255 ,p_prorate_factor IN NUMBER
256 ,op_constrained_rent_amount OUT NOCOPY NUMBER
257 ,op_constraint_applied_amount OUT NOCOPY NUMBER
258 ,op_constraint_applied_percent OUT NOCOPY NUMBER
259 ,op_carry_forward_amount OUT NOCOPY NUMBER
260 ,op_carry_forward_percent OUT NOCOPY NUMBER
261 ,op_msg OUT NOCOPY VARCHAR2
262 );
263
264
265 ------------------------------------------------------------------------
266 -- PROCEDURE : sum_payment_items
267 -- DESCRIPTION: This procedure will sum all the CASH payment items that is
268 -- within the date range specified of the type specified.
269 --
270 ------------------------------------------------------------------------
271 PROCEDURE sum_payment_items (
272 p_index_lease_id IN NUMBER
273 ,p_basis_start_date IN DATE
274 ,p_basis_end_date IN DATE
275 ,p_type_code IN VARCHAR2
276 ,p_include_index_items in VARCHAR2 DEFAULT 'Y'
277 ,op_sum_amount OUT NOCOPY NUMBER
278 );
279
280
281 ------------------------------------------------------------------------
282 -- PROCEDURE : calculate_index_percentage
283 -- DESCRIPTION: This procedure will derive the current and previous CPI for a given index period.
284 -- It will also calculate the index change percentage
285 --
286 ------------------------------------------------------------------------
287 PROCEDURE calculate_index_percentage (
288 p_index_finder_type IN VARCHAR2
289 ,p_reference_period_type IN VARCHAR2
290 ,p_index_finder_date IN DATE
291 ,p_index_history_id IN NUMBER
292 ,p_base_index IN NUMBER
293 ,p_base_index_line_id IN NUMBER
294 ,p_index_lease_id IN NUMBER
295 ,p_assessment_date IN DATE
296 ,p_prev_assessment_date IN DATE
297 ,op_current_cpi_value IN OUT NOCOPY NUMBER
298 ,op_current_cpi_id IN OUT NOCOPY NUMBER
299 ,op_previous_cpi_value IN OUT NOCOPY NUMBER
300 ,op_previous_cpi_id IN OUT NOCOPY NUMBER
301 ,op_index_percent_change OUT NOCOPY NUMBER
302 ,op_msg OUT NOCOPY VARCHAR2
303 );
304
305
306 ------------------------------------------------------------------------
307 -- PROCEDURE : lookup_index_history
308 -- DESCRIPTION: This procedure will derive the cpi value and index history id using
309 -- finder date provided. This procedure
310 --
311 ------------------------------------------------------------------------
312 PROCEDURE lookup_index_history (
313 p_index_history_id IN NUMBER
314 ,p_index_finder_date IN DATE
315 ,op_cpi_value OUT NOCOPY NUMBER
316 ,op_cpi_id OUT NOCOPY NUMBER
317 ,op_msg OUT NOCOPY VARCHAR2
318 );
319
320
321 ------------------------------------------------------------------------
322 -- PROCEDURE : create_payment_terms
323 -- DESCRIPTION: This procedure will create payment terms for a particular index
324 -- period id.
325 --
326 ------------------------------------------------------------------------
327 PROCEDURE create_payment_terms (
328 p_lease_id IN NUMBER
332 ,p_index_period_id IN NUMBER
329 ,p_index_lease_id IN NUMBER
330 ,p_location_id IN NUMBER
331 ,p_purpose_code IN VARCHAR2
333 ,p_term_template_id IN NUMBER
334 ,p_relationship IN VARCHAR2
335 ,p_assessment_date IN DATE
336 ,p_basis_amount IN NUMBER
337 ,p_basis_percent_change IN NUMBER
338 ,p_spread_frequency IN VARCHAR2
339 ,p_rounding_flag IN VARCHAR2
340 ,p_index_amount IN NUMBER
341 ,p_index_finder_type IN VARCHAR2
342 ,p_basis_type IN VARCHAR2
343 ,p_basis_start_date IN DATE
344 ,p_basis_end_date IN DATE
345 ,p_increase_on IN VARCHAR2
346 ,p_negative_rent_type IN VARCHAR2
347 ,p_carry_forward_flag IN VARCHAR2
348 ,p_calculate_date IN DATE DEFAULT g_calculate_date
349 ,p_prorate_factor IN NUMBER
350 ,op_msg OUT NOCOPY VARCHAR2
351 );
352
353
354 ------------------------------------------------------------------------
355 -- PROCEDURE : create_payment_term_record
356 -- DESCRIPTION: This procedure will insert records to the following tables \
357 -- necessary to create a complete index rent payment record.
358 -- 05-MAY-06 Hareesha o Bug#5115291 Added parameter p_norm_st_date
359 -- 10-AUG-06 Pikhar 0 Codev. Added include_in_var_rent
360 -- 01-NOV-06 Prabhakar o Added p_end_date parameter.
361 -- 02-JAN-07 Hareesha o M28#16 Added p_recur_bb_calc_date
362 ------------------------------------------------------------------------
363 PROCEDURE create_payment_term_record (
364 p_lease_id IN NUMBER
365 ,p_location_id IN NUMBER
366 ,p_purpose_code IN VARCHAR2
367 ,p_index_period_id IN NUMBER
368 ,p_term_template_id IN NUMBER
369 ,p_spread_frequency IN VARCHAR2
370 ,p_rounding_flag IN VARCHAR2
371 ,p_payment_amount IN NUMBER
372 ,p_normalized IN VARCHAR2
373 ,p_start_date IN DATE
374 ,p_index_term_indicator IN VARCHAR2
375 ,p_payment_term_id IN NUMBER
376 ,p_basis_relationship IN VARCHAR2
377 ,p_called_from IN VARCHAR2
378 ,p_calculate_date IN DATE DEFAULT g_calculate_date
379 ,p_norm_st_date IN DATE DEFAULT NULL
380 ,p_end_date IN DATE
381 ,p_recur_bb_calc_date IN DATE DEFAULT NULL
382 ,op_payment_term_id OUT NOCOPY NUMBER
383 ,op_msg OUT NOCOPY VARCHAR2
384 ,p_include_in_var_rent IN VARCHAR2 DEFAULT NULL
385 );
386
387
388 ------------------------------------------------------------------------
389 -- PROCEDURE : print_basis_periods
390 -- DESCRIPTION: This procedure is will print basis information for a given
391 -- index lease.
392 --
393 ------------------------------------------------------------------------
394 PROCEDURE print_basis_periods (
395 p_index_lease_id IN NUMBER
396 ,p_index_period_id IN NUMBER
397 );
398
399
400 ------------------------------------------------------------------------
401 -- PROCEDURE : calculate_batch
402 -- DESCRIPTION: This procedure is used by concurrent process that will
403 -- allow user to choose on or more index leases to process
404 --
405 ------------------------------------------------------------------------
406 PROCEDURE calculate_batch (
407 errbuf OUT NOCOPY VARCHAR2
408 ,retcode OUT NOCOPY VARCHAR2
409 ,ip_index_lease_number_lower IN VARCHAR2
410 ,ip_index_lease_number_upper IN VARCHAR2
411 ,ip_assessment_date_lower IN VARCHAR2
412 ,ip_assessment_date_upper IN VARCHAR2
413 ,ip_lease_class IN VARCHAR2
414 ,ip_main_lease_number IN VARCHAR2
415 ,ip_location_code IN VARCHAR2
416 ,ip_user_responsible IN VARCHAR2
417 ,ip_recalculate IN VARCHAR2
418 );
419
420
421 ------------------------------------------------------------------------
422 -- PROCEDURE : update_index_hist_line
423 -- DESCRIPTION: This procedure is by the index history window u
424 --
425 ------------------------------------------------------------------------
426 PROCEDURE update_index_hist_line (
427 ip_index_history_line_id IN NUMBER
428 ,ip_recalculate IN VARCHAR2
429 ,op_msg OUT NOCOPY VARCHAR2
430 );
431
432
433 ------------------------------------------------------------------------
434 -- PROCEDURE : update_index_hist_line_batch
435 -- DESCRIPTION: This procedure is used by the index history window any time index
436 -- history line is updated. It will be submitted as a batch program
437 -- by the form.
438 --
439 ------------------------------------------------------------------------
440 PROCEDURE update_index_hist_line_batch (
441 errbuf OUT NOCOPY VARCHAR2
445 );
442 ,retcode OUT NOCOPY VARCHAR2
443 ,ip_index_history_id IN NUMBER
444 ,ip_recalculate IN VARCHAR2
446
447
448 ------------------------------------------------------------------------
449 -- PROCEDURE : approve_index_pay_term
450 -- DESCRIPTION: This procedure is called every time a index rent payment is term
451 -- is approved.
452 --
453 ------------------------------------------------------------------------
454
455 PROCEDURE approve_index_pay_term (
456 ip_lease_id IN NUMBER
457 ,ip_index_pay_term_id IN NUMBER
458 ,op_msg OUT NOCOPY VARCHAR2
459 );
460
461
462 ------------------------------------------------------------------------
463 -- PROCEDURE : approve_index_pay_term_batch
464 -- DESCRIPTION: This procedure is called every time a index rent payment is term
465 -- is approved.
466 -- HISTORY
467 -- 06-AUG-04 ftanudja o add parameter ip_auto_find_sch_day. #3701195.
468 ------------------------------------------------------------------------
469
470 PROCEDURE approve_index_pay_term_batch (
471 errbuf OUT NOCOPY VARCHAR2
472 ,retcode OUT NOCOPY VARCHAR2
473 ,ip_index_lease_number_lower IN VARCHAR2
474 ,ip_index_lease_number_upper IN VARCHAR2
475 ,ip_assessment_date_lower IN VARCHAR2
476 ,ip_assessment_date_upper IN VARCHAR2
477 ,ip_lease_class IN VARCHAR2
478 ,ip_main_lease_number_lower IN VARCHAR2
479 ,ip_main_lease_number_upper IN VARCHAR2
480 ,ip_location_code IN VARCHAR2
481 ,ip_user_responsible IN VARCHAR2
482 ,ip_payment_start_date_lower IN VARCHAR2
483 ,ip_payment_start_date_upper IN VARCHAR2
484 ,ip_approve_normalize_only IN VARCHAR2
485 ,ip_index_period_id IN VARCHAR2
486 ,ip_payment_status IN VARCHAR2
487 ,ip_auto_find_sch_day IN VARCHAR2
488 );
489
490
491
492 FUNCTION build_distributions_string (
493 ip_payment_term_id IN NUMBER
494 ) RETURN VARCHAR2 ;
495
496
497 ------------------------------------------------------------------------
498 -- PROCEDURE : process_currency_code
499 -- DESCRIPTION: This procedure is called by the index rent form
500 -- when the currency_code field is changed. Fix for
501 -- bug# 2452909.
502 ------------------------------------------------------------------------
503
504 PROCEDURE process_currency_code (p_index_lease_id in number);
505
506
507 ------------------------------------------------------------------------
508 -- PROCEDURE : derive_cum_carry_forward
509 -- DESCRIPTION: Derive the value of the column carry_forward_amount and
510 -- carry_forward_percent of the period prior to the current period.
511 --
512 ------------------------------------------------------------------------
513 PROCEDURE derive_cum_carry_forward (
514 p_index_lease_id IN NUMBER,
515 p_assessment_date IN DATE,
516 op_carry_forward_amount OUT NOCOPY NUMBER,
517 op_carry_forward_percent OUT NOCOPY NUMBER);
518
519 ------------------------------------------------------------------------
520 -- FUNCTION : derive_prev_negative_rent
521 -- DESCRIPTION: If the negative rent option for the index rent agreement
522 -- is next period for the current period derive the negative
523 -- unconstrained rent amounts of the previous periods.
524 ------------------------------------------------------------------------
525
526 FUNCTION derive_prev_negative_rent (
527 p_index_lease_id IN NUMBER
528 ,p_assessment_date IN DATE)
529 RETURN number;
530
531 ------------------------------------------------------------------------
532 -- FUNCTION : get_increase_over_constraint
533 -- DESCRIPTION :
534 --
535 ------------------------------------------------------------------------
536
537 FUNCTION get_increase_over_constraint (
538 p_carry_forward_flag IN VARCHAR2,
539 p_constraint_amount IN NUMBER,
540 p_unconstrained_rent IN NUMBER,
541 p_constrained_rent IN NUMBER)
542 RETURN number;
543
544
545 ------------------------------------------------------------------------
546 -- FUNCTION : get_max_assessment_dt
547 -- DESCRIPTION: get the maximum assessment date after the current assessment
548 -- date for which the rent increase has been calcuated.
549 --
550 ------------------------------------------------------------------------
551
552 FUNCTION get_max_assessment_dt(p_index_lease_id IN NUMBER,
553 p_assessment_date IN DATE)
554 RETURN DATE;
555
556
557 -------------------------------------------------------------------------------
558 -- FUNCTION : Get_Calculate_Date
559 -- DESCRIPTION: This function returns the lease of assessment date and
560 -- the profile option cut off date (change from Legacy to PN).
561 -------------------------------------------------------------------------------
562 FUNCTION Get_Calculate_Date (p_assessment_date IN DATE,
563 p_period_str_date IN DATE)
564 RETURN DATE;
565
566 -------------------------------------------------------------------------------
567 -- FUNCTION : Get_Calculate_Date (Overloaded)
568 -- DESCRIPTION: This function returns the lease of assessment date and
569 -- the profile option cut off date (change from Legacy to PN).
570 -- IMP - Use this function in R12. The one with 2 params is for backward
571 -- compatiability ONLY.
572 -------------------------------------------------------------------------------
573 FUNCTION Get_Calculate_Date (p_assessment_date IN DATE,
574 p_period_str_date IN DATE,
575 p_org_id IN NUMBER)
576 RETURN DATE;
577
578
579 ------------------------------------------------------------------------
580 -- PROCEDURE : calculate_subsequent_periods
581 -- DESCRIPTION: This procedure is called by pn_index_periods_pkg
582 -- while calculating rent increase for an index lease
583 -- period. If carry forward flag is 'Y' then calculate for
584 -- all subsequent periods after the current period.
585 --
586 ------------------------------------------------------------------------
587
588 PROCEDURE calculate_subsequent_periods(p_index_lease_id IN NUMBER,
589 p_assessment_date IN DATE);
590
591
592 END pn_index_amount_pkg;
593
594