DBA Data[Home] [Help]

PACKAGE BODY: APPS.PNRX_RENT_INCREASE_SUMMARY

Source


1 PACKAGE BODY pnrx_rent_increase_summary AS
2 /* $Header: PNRXRSRB.pls 120.0 2007/10/03 14:27:01 rthumma noship $ */
3    PROCEDURE rent_increase_summary (
4       p_lease_number_low    IN              VARCHAR2 DEFAULT NULL,
5       p_lease_number_high   IN              VARCHAR2 DEFAULT NULL,
6       p_ri_number_low       IN              VARCHAR2 DEFAULT NULL,
7       p_ri_number_high      IN              VARCHAR2 DEFAULT NULL,
8       p_assess_date_from    IN              DATE,
9       p_assess_date_to      IN              DATE,
10       p_lease_class         IN              VARCHAR2 DEFAULT NULL,
11       p_property_id         IN              NUMBER DEFAULT NULL,
12       p_building_id         IN              NUMBER DEFAULT NULL,
13       p_location_id         IN              NUMBER DEFAULT NULL,
14       p_include_draft       IN              VARCHAR2 DEFAULT NULL,
15       l_request_id          IN              NUMBER,
16       l_user_id             IN              NUMBER,
17       retcode               OUT NOCOPY      VARCHAR2,
18       errbuf                OUT NOCOPY      VARCHAR2
19    )
20    IS
21       l_login_id                  NUMBER;
22       l_org_id                    NUMBER;
23       l_lease_num                 VARCHAR2 (30);
24       l_assess_date               VARCHAR2 (10);
25       l_precision                 NUMBER;  -- slk
26       l_ext_precision             NUMBER;  -- slk
27       l_min_acct_unit             NUMBER;  -- slk
28       l_currency_code             pn_index_leases.currency_code%TYPE;  -- slk
29       l_vendor_rec                pnrx_rent_increase_detail.vendor_rec;
30       l_customer_rec              pnrx_rent_increase_detail.customer_rec;
31       l_lease_detail              pnrx_rent_increase_detail.lease_detail;
32       l_lease_detail_null         pnrx_rent_increase_detail.lease_detail;
33       v_status                    VARCHAR2 (30) :='APPROVED';
34 
35       TYPE cur_typ IS REF CURSOR;
36 
37       c_lease_pn                  cur_typ;
38       -- term_Rec      c_lease_pn%ROWTYPE;
39       term_rec                    pn_rent_increase_summary_itf%ROWTYPE;
40       term_rec_null               pn_rent_increase_summary_itf%ROWTYPE;
41       query_str                   VARCHAR2 (20000);
42       --declare the 'where clauses here........'
43       lease_number_where_clause   VARCHAR2 (4000) := NULL;
44       ri_number_where_clause      VARCHAR2 (4000) := NULL;
45       lease_date_where_clause     VARCHAR2 (4000) := NULL;
46       location_code_where         VARCHAR2 (4000) := NULL;
47       lease_class_where           VARCHAR2 (4000) := NULL;
48       property_name_where         VARCHAR2 (4000) := NULL;
49       building_name_where         VARCHAR2 (4000) := NULL;
50       location_code_from          VARCHAR2 (4000) := NULL;
51       property_name_from          VARCHAR2 (4000) := NULL;
52       building_name_from          VARCHAR2 (4000) := NULL;
53       location_code_field         VARCHAR2 (4000) := NULL;
54       include_draft_where         VARCHAR2 (4000) := NULL;
55    --declare all columns as variables here
56 
57    -- declare cursors.....
58      CURSOR cur_carry_forward
59                    (p_index_lease_id IN pn_index_lease_periods_all.index_lease_id%TYPE,
60                     p_l_precision IN  NUMBER) IS
61          SELECT ROUND(carry_forward_amount, p_l_precision) carry_forward_amount,
62                 carry_forward_percent,
63                 ROUND (constraint_rent_due, p_l_precision) old_rent
64            FROM pn_index_lease_periods_all
65           WHERE index_lease_id = p_index_lease_id
66             AND assessment_date =
67                                    ADD_MONTHS (
68                                                term_rec.ilp_assessment_date,
69                                                -12 * term_rec.assessment_interval
70                                                );
71 
72    BEGIN
73       pnp_debug_pkg.put_log_msg ('pn_rentincdet_where_cond_set(+)');
74 
75 --Initialise status parameters...
76       retcode := 0;
77       errbuf := '';
78       fnd_profile.get ('LOGIN_ID', l_login_id);
79 
80 --SELECT Fnd_Profile.value('ORG_ID') INTO l_org_id
81 --FROM dual;
82 
83       l_org_id := TO_NUMBER (fnd_profile.VALUE ('ORG_ID'));
84 
85 --lease number conditions.....
86 --lease_number_where_clause := 'AND l.lease_num = '||'''NE213142''';
87 
88       IF  p_lease_number_low IS NOT NULL
89           AND p_lease_number_high IS NOT NULL
90       THEN
91          lease_number_where_clause :=    ' AND l.lease_num  BETWEEN '
92                                       || ''''
93                                       || p_lease_number_low
94                                       || ''''
95                                       || ' AND '
96                                       || ''''
97                                       || p_lease_number_high
98                                       || '''';
99       ELSIF  p_lease_number_low IS NULL
100              AND p_lease_number_high IS NOT NULL
101       THEN
102          lease_number_where_clause :=
103                      ' AND l.lease_num = ' || '''' || p_lease_number_high || '''';
104       ELSIF  p_lease_number_low IS NOT NULL
105              AND p_lease_number_high IS NULL
106       THEN
107          lease_number_where_clause :=
108                       ' AND l.lease_num = ' || '''' || p_lease_number_low || '''';
109       ELSE
110          lease_number_where_clause := ' AND 4=4 ';
111       END IF;
112 
113       IF  p_ri_number_low IS NOT NULL
114           AND p_ri_number_high IS NOT NULL
115       THEN
116          ri_number_where_clause :=    ' AND il.index_lease_number  BETWEEN '
117                                    || ''''
118                                    || p_ri_number_low
119                                    || ''''
120                                    || ' AND '
121                                    || ''''
122                                    || p_ri_number_high
123                                    || '''';
124       ELSIF  p_ri_number_low IS NULL
125              AND p_ri_number_high IS NOT NULL
126       THEN
127          ri_number_where_clause :=
128               ' AND il.index_lease_number = ' || '''' || p_ri_number_high || '''';
129       ELSIF  p_ri_number_low IS NOT NULL
130              AND p_ri_number_high IS NULL
131       THEN
132          ri_number_where_clause :=
133                ' AND il.index_lease_number = ' || '''' || p_ri_number_low || '''';
134       ELSE
135          ri_number_where_clause := ' AND 4=4 ';
136       END IF;
137 
138       IF p_assess_date_from IS NOT NULL
139       THEN
140 	lease_date_where_clause :=    ' AND ilp.ASSESSMENT_DATE  BETWEEN '
141                                    || ''''
142                                    || p_assess_date_from
143                                    || ''''
144                                    || ' AND '
145                                    || ''''
146                                    || p_assess_date_to
147                                    || '''';
148       END IF;
149 
150       pnp_debug_pkg.put_log_msg (
151          'lease_date_where_clause = '|| lease_date_where_clause
152       );
153 
154       IF p_lease_class IS NOT NULL
155       THEN
156          lease_class_where :=
157                     ' AND l.lease_class_code = ' || '''' || p_lease_class || '''';
158       END IF;
159 
160       IF p_location_id IS NOT NULL
161       THEN
162          location_code_from :=
163                               ', PN_TENANCIES_ALL ten , PN_LOCATIONS_ALL loc';
164          location_code_where :=
165                   ' AND l.lease_id = ten.lease_id
166                            AND ten.location_id = loc.location_id
167                      AND loc.rowid = (select max(loc1.rowid) from pn_locations_all loc1
168                            where loc.location_id = loc1.location_id)
169                      AND ten.location_id = '
170                || ''''
171                || p_location_id
172                || '''';
173       END IF;
174 
175       IF p_include_draft='N' OR p_include_draft IS NULL
176       THEN
177           include_draft_where  :=
178                               ' AND it.status='
179 			      || ''''
180 			      || v_status
181 			      || '''';
182       END IF;
183 
184 
185 
186       IF p_property_id IS NOT NULL
187       THEN
188          property_name_from :=
189                   ', PN_TENANCIES_ALL ten, (select bld.location_id, bld.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
190                                              pn_properties_all    prop,
191                                        pn_locations_all     bld
192                                        WHERE
193                                        bld.location_type_lookup_code IN ('
194                || ''''
195                || 'BUILDING'
196                || ''''
197                || ','
198                || ''''
199                || 'LAND'
200                || ''''
201                || ')     AND
202                                        bld.property_id  = prop.property_id (+)
203                                        UNION
204                                        select flr.location_id, flr.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
205                                        pn_properties_all    prop,
206                                        pn_locations_all     bld,
207                                        pn_locations_all     flr
208                                        WHERE  flr.location_type_lookup_code IN ('
209                || ''''
210                || 'FLOOR'
211                || ''''
212                || ','
213                || ''''
214                || 'PARCEL'
215                || ''''
216                || ')     AND
217                                        bld.property_id  = prop.property_id (+)     AND
218                                        bld.location_id = flr.parent_location_id     AND
219                                        ((flr.active_start_date BETWEEN bld.active_start_date AND
220                                        bld.active_end_date)            OR (flr.active_end_date BETWEEN bld.active_start_date AND
221                                        bld.active_end_date))
222                                        UNION
223                                        select off.location_id, off.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
224                                        pn_properties_all    prop,
225                                        pn_locations_all     bld,
226                                        pn_locations_all     flr,
227                                        pn_locations_all     off
228                                        WHERE  off.location_type_lookup_code IN ('
229                || ''''
230                || 'OFFICE'
231                || ''''
232                || ','
233                || ''''
234                || 'SECTION'
235                || ''''
236                || ')     AND
237                                        bld.property_id  = prop.property_id (+)     AND
238                                        flr.location_id = off.parent_location_id     AND
239                                        bld.location_id = flr.parent_location_id     AND
240                                        ((off.active_start_date BETWEEN flr.active_start_date AND
241                                        flr.active_end_date)            OR (off.active_end_date BETWEEN flr.active_start_date AND
242                                        flr.active_end_date)) ) loc';
243          property_name_where :=
244                   ' AND l.lease_id = ten.lease_id
245                            AND ten.location_id = loc.location_id
246                      AND loc.property_id = '
247                || ''''
248                || p_property_id
249                || '''';
250       END IF;
251 
252       IF p_building_id IS NOT NULL
253       THEN
254          building_name_from :=
255                   ', PN_TENANCIES_ALL ten, (select bld.location_id, bld.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
256                                              pn_properties_all    prop,
257                                        pn_locations_all     bld
258                                        WHERE
259                                        bld.location_type_lookup_code IN ('
260                || ''''
261                || 'BUILDING'
262                || ''''
263                || ','
264                || ''''
265                || 'LAND'
266                || ''''
267                || ')     AND
268                                        bld.property_id  = prop.property_id (+)
269                                        UNION
270                                        select flr.location_id, flr.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
271                                        pn_properties_all    prop,
272                                        pn_locations_all     bld,
273                                        pn_locations_all     flr
274                                        WHERE  flr.location_type_lookup_code IN ('
275                || ''''
276                || 'FLOOR'
277                || ''''
278                || ','
279                || ''''
280                || 'PARCEL'
281                || ''''
282                || ')     AND
283                                        bld.property_id  = prop.property_id (+)     AND
284                                        bld.location_id = flr.parent_location_id     AND
285                                        ((flr.active_start_date BETWEEN bld.active_start_date AND
286                                        bld.active_end_date)            OR (flr.active_end_date BETWEEN bld.active_start_date AND
287                                        bld.active_end_date))
288                                        UNION
289                                        select off.location_id, off.location_type_lookup_code , bld.location_id building_id, prop.property_id FROM
290                                        pn_properties_all    prop,
291                                        pn_locations_all     bld,
292                                        pn_locations_all     flr,
293                                        pn_locations_all     off
294                                        WHERE  off.location_type_lookup_code IN ('
295                || ''''
296                || 'OFFICE'
297                || ''''
298                || ','
299                || ''''
300                || 'SECTION'
301                || ''''
302                || ')     AND
303                                        bld.property_id  = prop.property_id (+)     AND
304                                        flr.location_id = off.parent_location_id     AND
305                                        bld.location_id = flr.parent_location_id     AND
306                                        ((off.active_start_date BETWEEN flr.active_start_date AND
307                                        flr.active_end_date)            OR (off.active_end_date BETWEEN flr.active_start_date AND
308                                        flr.active_end_date)) ) loc';
309          building_name_where :=
310                   ' AND l.lease_id = ten.lease_id
311                            AND ten.location_id = loc.location_id
312                      AND loc.building_id = '
313                || ''''
314                || p_building_id
315                || '''';
316       END IF;
317 
318       IF p_location_id IS NOT NULL
319          OR p_property_id IS NOT NULL
320          OR p_building_id IS NOT NULL
321       THEN
322          location_code_field := ',ten.location_id ';
323       ELSE
324          location_code_from :=
325                               ', PN_TENANCIES_ALL ten , PN_LOCATIONS_ALL loc';
326          location_code_where :=
327                ' AND l.lease_id = ten.lease_id
328                            AND ten.location_id = loc.location_id
329                      AND loc.rowid = (select max(loc1.rowid) from pn_locations_all loc1
330                         where loc.location_id = loc1.location_id) ';
331          location_code_field := ',ten.location_id ';
332       END IF;
333 
334       IF p_location_id IS NOT NULL
335       THEN
336          building_name_from := NULL;
337          building_name_where := NULL;
338          property_name_from := NULL;
339          property_name_where := NULL;
340       ELSIF p_building_id IS NOT NULL
341       THEN
342          property_name_from := NULL;
343          property_name_where := NULL;
344       END IF;
345 
346       pnp_debug_pkg.put_log_msg ('pn_rentincdet_where_cond_set(-)');
347 
348 --lease cursor.....
349       OPEN c_lease_pn FOR    'SELECT
350   distinct l.name         --2
351   ,l.lease_num       --3
352   ,l.payment_term_proration_rule --5
353   ,l.abstracted_by_user           --6
354   ,l.lease_class_code   --9
355   ,ld.lease_commencement_date  --12
356   ,ld.lease_termination_date     --13
357   ,ld.lease_execution_date       --14
358   ,ld.lease_extension_end_date
359   ,il.location_id               --32
360   ,il.index_lease_id       --53
361   ,il.index_id              --54
362   ,il.commencement_date il_commencement_date --55
363   ,il.termination_date il_termination_date      --56
364   ,il.index_lease_number      --57
365   ,il.assessment_date il_assessment_date  --58
366   ,il.assessment_interval    --59
367   ,il.spread_frequency       --60
368   ,il.basis_percent_default --62
369   ,il.initial_basis          --63
370   ,il.base_index             --64
371   ,il.index_finder_method     --66
372   ,il.index_finder_months    --67
373   ,il.negative_rent_type     --68
374   ,il.increase_on            --69
375   ,il.basis_type             --70
376   ,il.reference_period      --71
377   ,il.base_year              --72
378   ,il.proration_rule   -- slk
379   ,il.index_multiplier       -- slk
380   ,ilp.assessment_date ilp_assessment_date --73
381   ,ilp.basis_start_date         --74
382   ,ilp.basis_end_date            --75
383   ,ilp.index_finder_date         --76
384   ,ilp.current_basis              --77
385   ,ilp.relationship              --78
386   ,ilp.index_percent_change      --79
387   ,ilp.basis_percent_change       --80
388   ,ilp.unconstraint_rent_due     --81
389   ,ilp.constraint_rent_due       --82
390   ,ilp.carry_forward_amount
391   ,ilp.carry_forward_percent
392   ,ilp.constraint_applied_amount
393   ,ilp.constraint_applied_percent
394   ,ilp.current_index_line_value
395   ,ilp.previous_index_line_value
396 FROM
397 pn_leases_all        l,
398 pn_lease_details_all ld,
399 pn_index_leases  il ,
400 pn_payment_terms_all it,
401 pn_index_lease_periods_all ilp'
402                           || location_code_from
403                           || property_name_from
404                           || building_name_from
405                           || ' WHERE l.lease_id = ld.lease_id
406 AND il.lease_id = l.lease_id
407 AND ilp.index_lease_id = il.index_lease_id
408 AND ilp.index_period_id = it.index_period_id
409 AND it.index_period_id IS NOT NULL'
410                           || lease_number_where_clause
411                           || ri_number_where_clause
412                           || lease_date_where_clause
413                           || lease_class_where
414                           || location_code_where
415                           || property_name_where
416                           || building_name_where
417 			  || include_draft_where ;
418       pnp_debug_pkg.put_log_msg ('pn_rentincdet_open_cursor(+)');
419 
420       LOOP --start lease loop....
421          term_rec := term_rec_null;
422          l_lease_detail := l_lease_detail_null;
423          term_rec.creation_date := SYSDATE;
424          term_rec.created_by := l_user_id;
425          term_rec.last_update_date := SYSDATE;
426          term_rec.last_updated_by := l_user_id;
427          term_rec.last_update_login := l_user_id;
428          term_rec.request_id := l_request_id;
429 
430          FETCH c_lease_pn INTO term_rec.NAME, --2
431                                term_rec.lease_num, --3
432                                term_rec.payment_term_proration_rule, --5
433                                l_lease_detail.abstracted_by_user,--6
434                                l_lease_detail.lease_class_code, --9
435                                term_rec.lease_commencement_date, --12
436                                term_rec.lease_termination_date, --13
437                                term_rec.lease_execution_date, --14
438 			       term_rec.lease_extension_end_date,
439                                l_lease_detail.location_id, --32
440 			       l_lease_detail.index_lease_id, --53
441                                l_lease_detail.index_id, --54
442                                term_rec.il_commencement_date, --55
443                                term_rec.il_termination_date, --56
444                                term_rec.index_lease_number, --57
445                                term_rec.il_assessment_date, --58
446                                term_rec.assessment_interval, --59
447                                l_lease_detail.spread_frequency, --60
448                                term_rec.basis_percent_default, --62
449                                term_rec.initial_basis, --63
450                                term_rec.base_index, --64
451                                l_lease_detail.index_finder_method, --66
452                                term_rec.index_finder_months, --67
453                                l_lease_detail.negative_rent_type, --68
454                                l_lease_detail.increase_on, --69
455                                l_lease_detail.basis_type, --70
456                                l_lease_detail.reference_period, --71
457                                term_rec.base_year, --72
458                                l_lease_detail.proration_rule,  -- slk
459                                term_rec.index_multiplier,  -- slk
460                                term_rec.ilp_assessment_date, --73
461                                term_rec.basis_start_date, --74
462                                term_rec.basis_end_date, --75
463                                term_rec.index_finder_date, --76
464                                term_rec.current_basis, --77
465                                l_lease_detail.relationship, --78
466                                term_rec.index_percent_change, --79
467                                term_rec.basis_percent_change, --80
468                                term_rec.unconstraint_rent_due, --81
469                                term_rec.constraint_rent_due, --82
470                                term_rec.carry_forward_amount,
471                                term_rec.carry_forward_percent,
472                                term_rec.constraint_applied_amount,
473                                term_rec.constraint_applied_percent,
474                                term_rec.current_index_line_value,
475                                term_rec.previous_index_line_value;
476 
477          EXIT WHEN c_lease_pn%NOTFOUND;
478 
479          pnp_debug_pkg.put_log_msg ('pn_rentincdet_get_details(+)');
480 
481          term_rec.abstracted_by_user_name :=
482                pn_index_lease_common_pkg.get_approver (
483                   l_lease_detail.abstracted_by_user
484                );
485          term_rec.index_name :=
486                pnrx_rent_increase_detail.get_index_name (
487                   l_lease_detail.index_id
488                );
489          term_rec.location_code :=
490                pnrx_rent_increase_detail.get_location_code (
491                   l_lease_detail.location_id
492                );
493          term_rec.lease_class_meaning :=
494                pnrx_rent_increase_detail.get_lookup_meaning (
495                   l_lease_detail.lease_class_code,
496                   'PN_LEASE_CLASS'
497                );
498          term_rec.increase_on_meaning :=
499                pnrx_rent_increase_detail.get_lookup_meaning (
500                   l_lease_detail.increase_on,
501                   'PN_PAYMENT_TERM_TYPE'
502                );
503          term_rec.reference_period_meaning :=
504                pnrx_rent_increase_detail.get_lookup_meaning (
505                   l_lease_detail.reference_period,
506                   'PN_INDEX_REF_PERIOD'
507                );
508          term_rec.negative_rent_type_meaning :=
509                pnrx_rent_increase_detail.get_lookup_meaning (
510                   l_lease_detail.negative_rent_type,
511                   'PN_INDEX_NEGATIVE_RENT'
512                );
513          term_rec.relationship_meaning :=
514                pnrx_rent_increase_detail.get_lookup_meaning (
515                   l_lease_detail.relationship,
516                   'PN_INDEX_RELATION'
517                );
518 	  term_rec.spread_frequency_meaning :=
519                pnrx_rent_increase_detail.get_lookup_meaning (
520                   l_lease_detail.spread_frequency,
521                   'PN_PAYMENT_FREQUENCY_TYPE'
522                );
523 	  term_rec.constraint_proration :=
524                pnrx_rent_increase_detail.get_lookup_meaning (
525                    l_lease_detail.proration_rule,
526                   'PN_CONSTRAINT_PRORATION'
527                );
528 	   term_rec.index_finder_method :=
529                pnrx_rent_increase_detail.get_lookup_meaning (
530                   l_lease_detail.index_finder_method,
531                   'PN_INDEX_FINDER_METHOD'
532                );
533 	    term_rec.basis_type :=
534 		pnrx_rent_increase_detail.get_lookup_meaning (
535                   l_lease_detail.basis_type,
536                   'PN_INDEX_BASIS_TYPE'
537                );
538          pnp_debug_pkg.put_log_msg ('pn_rentincdet_get_details(-)');
539 
540 -- slk start
541          SELECT currency_code
542            INTO l_currency_code
543            FROM pn_index_leases
544           WHERE index_lease_id = l_lease_detail.index_lease_id;
545 
546          fnd_currency.get_info (l_currency_code,
547                                 l_precision,
548                                 l_ext_precision,
549                                 l_min_acct_unit);
550 -- slk end
551 
552 
553       FOR rec_cur_carry_forward
554          IN cur_carry_forward(l_lease_detail.index_lease_id,
555                                                       l_precision)
556           LOOP
557             term_rec.open_carry_forward_amount := rec_cur_carry_forward.carry_forward_amount;
558 	    term_rec.open_carry_forward_percent := rec_cur_carry_forward.carry_forward_percent;
559 	    term_rec.old_rent := rec_cur_carry_forward.old_rent;
560           END LOOP;
561 
562 
563          INSERT INTO pn_rent_increase_summary_itf
564                      (name,
565                       lease_num,
566                       payment_term_proration_rule,
567                       lease_class_meaning,
568                       lease_commencement_date,
569                       lease_termination_date,
570                       lease_execution_date,
571 		      lease_extension_end_date,
572                       il_commencement_date,
573                       il_termination_date,
574                       index_lease_number,
575 		      il_assessment_date,
576                       assessment_interval,
577                       spread_frequency_meaning,
578                       basis_percent_default,
579                       initial_basis,
580                       base_index,
581                       index_finder_method,
582                       index_finder_months,
583                       negative_rent_type_meaning,
584                       increase_on_meaning,
585                       basis_type,
586                       reference_period_meaning,
587                       base_year,
588                       ilp_assessment_date,
589                       basis_start_date,
590                       basis_end_date,
591                       index_finder_date,
592                       current_basis,
593                       relationship_meaning,
594                       index_percent_change,
595                       basis_percent_change,
596                       unconstraint_rent_due,
597                       constraint_rent_due,
598                       carry_forward_amount,
599                       carry_forward_percent,
600                       constraint_applied_amount,
601                       constraint_applied_percent,
602                       current_index_line_value,
603                       previous_index_line_value,
604                       abstracted_by_user_name,
605                       index_name,
606                       location_code,
607                       constraint_proration,  -- slk
608                       index_multiplier,  -- slk
609                       unadjusted_index_change,  -- slk
610 		      adjusted_index_change_percent,
611                       last_update_date,
612                       last_updated_by,
613                       creation_date,
614                       created_by,
615                       last_update_login,
616                       request_id,
617 		      open_carry_forward_amount,
618 		      open_carry_forward_percent,
619 		      old_rent,
620 		      new_rent,
621 		      change_rent,
622 		      app_carry_forward_amount,
623 		      app_carry_forward_percent
624                      )
625               VALUES (term_rec.name,
626                       term_rec.lease_num,
627                       term_rec.payment_term_proration_rule,
628                       term_rec.lease_class_meaning,
629                       term_rec.lease_commencement_date,
630                       term_rec.lease_termination_date,
631                       term_rec.lease_execution_date,
632 		      term_rec.lease_extension_end_date,
633                       term_rec.il_commencement_date,
634                       term_rec.il_termination_date,
635                       term_rec.index_lease_number,
636 		      term_rec.il_assessment_date,
637                       term_rec.assessment_interval,
638 		      term_rec.spread_frequency_meaning,
639                       term_rec.basis_percent_default,
640                       ROUND (term_rec.initial_basis, l_precision),  -- slk
641                       term_rec.base_index,
642                       term_rec.index_finder_method,
643                       term_rec.index_finder_months,
644                       term_rec.negative_rent_type_meaning,
645                       NVL (term_rec.increase_on_meaning, 'Gross'),
646                       term_rec.basis_type,
647                       term_rec.reference_period_meaning,
648                       term_rec.base_year,
649                       term_rec.ilp_assessment_date,
650                       term_rec.basis_start_date,
651                       term_rec.basis_end_date,
652                       term_rec.index_finder_date,
653                       ROUND (term_rec.current_basis, l_precision),  -- slk
654                       term_rec.relationship_meaning,
655                       term_rec.index_percent_change,
656                       term_rec.basis_percent_change,
657                       ROUND (term_rec.unconstraint_rent_due, l_precision),  -- slk
658                       ROUND (term_rec.constraint_rent_due, l_precision),  -- slk
659                       ROUND (term_rec.carry_forward_amount, l_precision),  -- slk
660                       term_rec.carry_forward_percent,
661                       ROUND (term_rec.constraint_applied_amount, l_precision),  -- slk
662                       term_rec.constraint_applied_percent,
663                       term_rec.current_index_line_value,
664                       term_rec.previous_index_line_value,
665                       term_rec.abstracted_by_user_name,
666                       term_rec.index_name,
667                       term_rec.location_code,
668                       term_rec.constraint_proration,  -- slk
669                       term_rec.index_multiplier,  -- slk
670                       term_rec.index_percent_change,
671                       term_rec.index_percent_change * NVL (term_rec.index_multiplier, 1),  -- slk
672                       term_rec.last_update_date,
673                       term_rec.last_updated_by,
674                       term_rec.creation_date,
675                       term_rec.created_by,
676                       term_rec.last_update_login,
677                       term_rec.request_id,
678 		      term_rec.open_carry_forward_amount,
679 		      term_rec.open_carry_forward_percent,
680 		      term_rec.old_rent,
681 		      ROUND (term_rec.constraint_rent_due, l_precision),
682 		      NVL (term_rec.constraint_rent_due, 0) - NVL (term_rec.old_rent, 0),
683 		      NVL (term_rec.open_carry_forward_amount, 0) - NVL (term_rec.carry_forward_amount, 0),
684 		      NVL (term_rec.open_carry_forward_percent, 0) - NVL (term_rec.carry_forward_percent, 0)
685                      );
686 
687          pnp_debug_pkg.put_log_msg ('pn_rentincdet_insert(-)');
688 
689         END LOOP; --end lease loop...
690 
691       pnp_debug_pkg.put_log_msg ('pn_rentincdet_open_cursor(-)');
692       pnp_debug_pkg.put_log_msg ('pn_rentincdet_updates(+)');
693       pnp_debug_pkg.put_log_msg ('pn_rentincdet_updates(-)');
694    EXCEPTION
695       WHEN OTHERS
696       THEN
697          retcode := 2;
698          errbuf := SUBSTR (SQLERRM, 1, 235);
699          RAISE;
700          COMMIT;
701    END rent_increase_summary;
702 END pnrx_rent_increase_summary;