You are on page 1of 42

TECHNICAL DESIGN Property Manager PN Variable Rent and Breakpoints APIs

Author: Last Updated: File URL: Version: Sreedhar Maya 24-Nov-10 http://files.oraclecorp.com/ 1.4 Creation Date: 2-Sep-10

Company Confidential - For Oracle Internal Use Only


Copyright 2013 Oracle Corporation All Rights Reserved

This document is not a promise to deliver and may not be included as part of any contract.

1.

Document Control

1.1

Change Record

Date 18-Aug-2010 2-Sep-2010 30-Sep-2010 03-Nov-2010 24-Nov-2010

Author Sreedhar Maya Sreedhar Maya Sreedhar Maya Vamshi Katta Vamshi Katta

Version 1.0 1.1 1.2 1.3 1.4

Change Reference First Draft Updated the API details with new approach, separate procedures for generate periods and generate abatement, constraints and break points. Updated with Update Variable Rent part of the API. Updated Record types, table types of the API & also Apendix. Updated TDD.

1.2

Contributors

Contributor Kranti Maddi Badsaheb Noorbhasha Nikhil Mishra

Role Property Manager Development Property Manager Development Property Manager Development

Position

1.3

Reviewers

Name

Role

Position

Document Status

Date Reviewed

Comments Incorporated

Document Control

Oracle Confidential - For internal use only

Page ii of 34

Contents

1.Document Control.................................................................................ii
1.1 Change Record............................................................................................ii 1.2 Contributors...............................................................................................ii 1.3 Reviewers...................................................................................................ii

2.Introduction.......................................................................................... 1
2.1 Scope for this Document..............................................................................1 2.2 Document Reference...................................................................................1
2.2.1 Current Document References.............................................................................................................................................1 2.2.2 Historical Document References.........................................................................................................................................1

3.Technical Overview................................................................................ 2
3.1 Design Goals...............................................................................................2 3.2 Technology.................................................................................................2 3.3 Design Assumptions ...................................................................................2
3.3.1 Create Variable Rent............................................................................................................................................................2 3.3.2 Update Variable Rent: ........................................................................................................................................................2 3.3.3 Generate Periods: ...............................................................................................................................................................2 3.3.4 Calculation Override ...........................................................................................................................................................2

3.4 Design Constraints......................................................................................3

4.Architecture ......................................................................................... 4
4.1 System Flow and Interaction Diagram..........................................................4 4.2 System Interfaces.......................................................................................5 4.3 Physical Data Model....................................................................................5

5.Technical Components...........................................................................6 6.PN_VAR_RENT_PUB Program Design........................................................7


6.1 Parameters (IN/OUT)...................................................................................7
6.1.1 Procedure CREATE_VAR_RENT accepts the following parameters................................................................................7 6.1.2 Procedure GENERATE_PERIODS accepts the following parameters...............................................................................7 6.1.3 Procedure CREATE_BKPT_CONST_ALLOW_ABAT accepts the following parameters..............................................8 6.1.4 Procedure UPDATE_VAR_RENT accepts the following parameters................................................................................8 6.1.5 Package PN_VRA_CLIENT_EXTN.CALCULATE_OVERRIDE accepts the following parameters..............................9

6.2 Calling Arguments.....................................................................................10 6.3 Special Validation Logic.............................................................................10


6.3.1 PN_VAR_RENT_PUB Pseudo-Code ..............................................................................................................................10 6.3.1.1 CREATE_VAR_RENT Pseudo-Code......................................................................................10 6.3.1.2 GENERATE_PERIODS Pseudo-Code....................................................................................11 6.3.1.3 GENERATE_ABAT_BREAKPOINTS Pseudo-Code..................................................................11 6.3.1.4 UPDATE_VAR_RENT Pseudo-Code.....................................................................................12

Document Control

Oracle Confidential - For internal use only

Page iii of 34

6.3.2 PN_VAREN_PVT Pseudo-Code.......................................................................................................................................13 6.3.2.1 PN_VAREN_PVT.CREATE_VAR_RENT Procedure.................................................................14 6.3.2.2 PN_VAREN_PVT.GENERATE_PERIODS Procedure..............................................................17 6.3.2.3 PN_VAREN_PVT.UNDO_BREAKPOINTS Procedure..............................................................18 6.3.2.4 PN_VAREN_PVT.UNDO_CONSTRAINTS Procedure..............................................................19 6.3.2.5 PN_VAREN_PVT.GENERATE_ABAT_BREKPOINTS Procedure...............................................19 6.3.2.6 PN_VAREN_PVT.UPDATE_VAR_RENT Procedure.................................................................19 6.3.2.7 PN_VAREN_UTIL Pseudo-Code................................................................................................................................22 6.3.2.8 PN_VRA_CLIENT_EXTN.CALCULATE_OVERRIDE Pseudo-Code......................................................................25

7 Log Output..................................................................................................27 8 Concurrent Request Output..........................................................................28 a. Table and View Usage..................................................................................28 b. Sequence Usage..........................................................................................29 c. Restart Strategy..........................................................................................29 d. Crash Recovery...........................................................................................29 e. Database Triggers.......................................................................................29 f. Table Handlers (NEW/ CHANGED)..................................................................29

9Seed Data............................................................................................ 30 10Installation and Upgrade ....................................................................31


a. Installation.................................................................................................31

11Unit Test Considerations.....................................................................32


a. Create Variable Rent...................................................................................32 b. Update Variable Rent..................................................................................32

12Open and Closed Issues....................................................................... 34


a. Closed Issues..............................................................................................34 b. Solution for issues raised by McDonalds team.............................................34

13Appendix A: Parameters for PN_VAR_RENT_PUB....................................35


13.1 CREATE_VAR_RENT Record Type...............................................................35
13.1. 1 Variable Rent Record Type .........................................................................................................................................35 13.1.2 Variable Rent Lines Table Type ...................................................................................................................................35 13.1.3 Breakpoint Header Table Type ....................................................................................................................................35 13.1.4 Breakpoint Details Table Type ............................................................................................................................35

............................................................................................................35
13.1.5 Constraints Table Type ......................................................................................................................................35 13.1.6 Allowances & Abatements Table Type ........................................................................................................................35

13.2 UPDATE_VAR_RENT Record Type

............................................................36

13.2.1 Update Variable Rent record type..................................................................................................................................36

14Appendix B: Parameters for PN_VAREN_PVT.........................................37


14.1 CREATE_VAR_RENT Record Type...............................................................37 13.1 UPDATE_VAR_RENT Record Type..............................................................37

Document Control

Oracle Confidential - For internal use only

Page iv of 34

2.

Introduction
This document defines the technical components required to create the Variable Rent and Breakpoint APIs for Property Manager. This Application Extension Technical Design document complements the application extension function design document for Variable Rent and Breakpoint APIs (FDD PN Variable Rent and Breakpoints APIs v1.3.doc).

2.1

Scope for this Document


The scope of this document is confined to the Functional document of Variable Rent and Breakpoint APIs (FDD PN Variable Rent and Breakpoints APIs v1.3.doc).

2.2

Document Reference
2.2.1 Current Document References

Author Vamshi Katta

Document Name FDD PN Variable Rent and Breakpoints APIs v1.3.doc

URL N/A

Comments None

2.2.2

Historical Document References

Author Vamshi Katta

Document Name FDD PN Variable Rent and Breakpoints APIs v1.3.doc

URL N/A

Comments None

Document Control

Oracle Confidential - For internal use only

Page 1 of 34

3.

Technical Overview
The section list the technical overview for creating Variable rent and Breakpoint APIs.

3.1

Design Goals
Below is the list of goals defined in this document. 1. 2. Designing an API for Create Variable Rent. Designing and API for Update Variable Rent.

3.2

Technology
No New technology is used for designing and developing the APIs for Variable Rent and Breakpoints.

3.3

Design Assumptions
This design assumes that the following assumptions are true:

3.3.1

Create Variable Rent


This section lists the design assumption for Create Variable Rent. Lease is created and in Final status to create the variable rent. Term templates are defined prior to creation of variable rent. Agreement template should be defined prior to creation of variable rent. Note: Creation of Lease is not part of this API.

3.3.2

Update Variable Rent:


This section lists the design assumptions for Update Variable Rent. Variable Rent is created and ready for update Note: Creation of Variable rent will not be part of Update Variable rent API.

3.3.3

Generate Periods:
This section lists the design assumptions for Generate Periods. Periods are generated by calling an existing concurrent program for Generate Periods Calculate Variable Rent Calculate Variable Rent is initiated if the input variable generate_periods is Yes for the calling program i.e., Create program for Variable Rent. Periods can be generated from Create APIs for Variable Rent If the Calculate Variable Rent program completes in status Error or Warning, the creation/updating of Variable Rent cannot be reverted.

3.3.4

Calculation Override
This section lists the design assumptions for Variable rent Override. Profile option PN: Override Variable Rent is set to Yes, to override the calculations

Document Control

Oracle Confidential - For internal use only

Page 2 of 34

Hook is customized to override the calculations Calculations are overridden only upon Calculate All button is pressed manually. No pl/sql code is provided for initiating Calculate All buttons logic.

3.4

Design Constraints
Not Applicable

Document Control

Oracle Confidential - For internal use only

Page 3 of 34

4.

Architecture
This section describes the technical architecture for Variable Rent and Breakpoint APIs.

4.1

System Flow and Interaction Diagram


This section shows the technical components of the Create/Update Variable Rent APIs and the database logic from one form of component to the other.

Document Control

Oracle Confidential - For internal use only

Page 4 of 34

4.2

System Interfaces
This document doesnt capture the interaction of Oracle application user interface.

4.3

Physical Data Model


Not Applicable

Document Control

Oracle Confidential - For internal use only

Page 5 of 34

5.

Technical Components
There are no new Tables/Views are created as part of Create/Update Variable Rent APIs.

Document Control

Oracle Confidential - For internal use only

Page 6 of 34

6.

PN_VAR_RENT_PUB Program Design


This section describes the technical design considerations for Create/Update Variable Rent APIs.

6.1

Parameters (IN/OUT)
6.1.1 Procedure CREATE_VAR_RENT accepts the following parameters
Usage IN IN IN IN Type NUMBER NUMBER NUMBER VARCHAR2 Required Yes Yes Yes No Description API Standard API Standard API Standard Default value is N. If Y then, program takes care of validation of the input parameters and returns whether they are valid or not. If N then, program not only validates the input parameters but also after successful validation inserts records into base tables. Variable Rent Record Type Variable Rent Lines Table Type Breakpoint Header Table Type Breakpoint Details Table Type Constraints Table Type Allowances & Abatements Table Type Default value is N. If Y then generate the periods and able to create Breakpoints, Constraints, Allowances and Abatements. Generate Breakpoints Button. If Value is 'Y' then needs to generate Breakpoints. Default Value is 'N". Generate Constraints Button. If the Value is 'Y' then, need to generate constraints. Default value is 'N'. Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard Variable rent Id Variable Rent Number

Parameter P_API_VERSION P_INIT_MSG_LIST P_COMMIT P_VALIDATE_FLAG

P_VAR_RENT_REC P_VARIABLE_RENT_LINES_TB L P_BREAKPOINT_HEADER_TBL P_BREAKPOINT_DETAILS_TBL P_CONSTRAINTS_TBL P_ALLOW_ABAT_TBL P_GENERATE_PERIODS P_GENERATE_BREAKPOINTS P_GENERATE_CONSTRAINTS X_RETURN_STATUS X_MSG_COUNT X_MSG_DATA X_VAR_RENT_ID X_VAR_RENT_NUM

IN IN IN IN IN IN IN IN IN OUT OUT OUT OUT OUT

RECORD TYPE TABLE TYPE TABLE TYPE TABLE TYPE TABLE TYPE TABLE TYPE VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2

Yes Yes Yes Yes Yes Yes No No No

6.1.2

Procedure GENERATE_PERIODS accepts the following parameters


Usage IN IN IN IN Type NUMBER NUMBER NUMBER VARCHAR2 Required Yes Yes Yes No Description API Standard API Standard API Standard Default value is N. If Y then, program takes care of validation of the input parameters and returns whether they are valid or not. If N then, program not only validates the input parameters but also after successful validation inserts records into base tables. Variable Rent ID Default N. If Value is Y, then for the variable rent periods would be generated.

Parameter P_API_VERSION P_INIT_MSG_LIST P_COMMIT P_VALIDATE_FLAG

P_VAR_RENT_ID P_GENERATE_PERIODS

IN IN

NUMBER VARCHAR2

Document Control

Oracle Confidential - For internal use only

Page 7 of 34

Parameter X_RETURN_STATUS X_MSG_COUNT X_MSG_DATA

Usage OUT OUT OUT

Type VARCHAR2 NUMBER VARCHAR2

Required

Description Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard

6.1.3 Procedure CREATE_BKPT_CONST_ALLOW_ABAT accepts the following parameters


Parameter P_API_VERSION P_INIT_MSG_LIST P_COMMIT P_VALIDATE_FLAG Usage IN IN IN IN Type NUMBER NUMBER NUMBER VARCHAR2 Required Yes Yes Yes No Description API Standard API Standard API Standard Default value is N. If Y then, program takes care of validation of the input parameters and returns whether they are valid or not. If N then, program not only validates the input parameters but also after successful validation inserts records into base tables. Variable Rent Lines Table Type Breakpoint Header Table Type Breakpoint Details Table Type Constraints Table Type Allowances & Abatements Table Type Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard Variable rent Id Variable Rent Number

P_VARIABLE_RENT_LINES_TB L P_BREAKPOINT_HEADER_TBL P_BREAKPOINT_DETAILS_TBL P_CONSTRAINTS_TBL P_ALLOW_ABAT_TBL X_RETURN_STATUS X_MSG_COUNT X_MSG_DATA X_VAR_RENT_ID X_VAR_RENT_NUM

IN IN IN IN IN OUT OUT OUT OUT OUT

TABLE TYPE TABLE TYPE TABLE TYPE TABLE TYPE TABLE TYPE VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2

Yes Yes Yes Yes Yes

6.1.4

Procedure UPDATE_VAR_RENT accepts the following parameters


Usage IN IN IN IN Type NUMBER NUMBER NUMBER VARCHAR2 Required Yes Yes Yes No Description API Standard API Standard API Standard Default value is N. If Y then, program takes care of validation of the input parameters and returns whether they are valid or not. If N then, program not only validates the input parameters but also after successful validation inserts records into base tables. Update Variable Rent Record Type Variable Rent Lines Table Type Update of Variable Rent will handle creation of a new VRA line, if LINE_DEFAULT_ID is null of that record type. Breakpoint Header Table Type Update of Variable Rent will handle creation of a new Breakpoint Header line, if BKHD_DEFAULT_ID is null of that record type. Breakpoint Details Table Type Update of Variable Rent will handle creation

Parameter P_API_VERSION P_INIT_MSG_LIST P_COMMIT P_VALIDATE_FLAG

P_UPD_VAR_RENT_REC P_VARIABLE_RENT_LINES_TBL

IN IN

TABLE TYPE TABLE TYPE

Yes Yes

P_BREAKPOINT_HEADER_TBL

IN

TABLE TYPE

Yes

P_BREAKPOINT_DETAILS_TBL

IN

TABLE TYPE

Yes

Document Control

Oracle Confidential - For internal use only

Page 8 of 34

Parameter

Usage

Type

Required

Description of a new Breakpoint Detail line, if BKDT_DEFAULT_ID is null of that record type. Constraints Table Type Update of Variable Rent will handle creation of a new Constraint line, if CONSTR_DEFAULT_ID is null of that record type. Note: Need to make sure that for single VRA we can have only two constraint records i.e. of constraint type as Maximum and Minimum. Allowances & Abatements Table Type Update of Variable Rent will handle creation of a new Allowance and Abatement line, if ABATEMENT_ID is null of that record type. If Y then Undo the periods and able to update Breakpoints, Constraints, Allowances and Abatements. If N, then no need to undo periods i.e., no need to update the Variable Rent details. Default value is 'Y'. Undo Breakpoints Button. If Value is 'Y' means undo Breakpoints. If N then no need to undo Breakpoints i.e., no need to update breakpoints details. Default value is 'Y'. Undo Constraints Button. If the Value is 'Y' means Undo constraints. If the Value is N means no need to undo constraints i.e., no need to update the constraints. Default value is 'Y'. Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard

P_CONSTRAINTS_TBL

IN

TABLE TYPE

Yes

P_ALLOW_ABAT_TBL

IN

TABLE TYPE

Yes

P_UNDO_PERIODS

IN

VARCHAR2

No

P_UNDO_BREAKPOINTS

IN

VARCHAR2

No

P_UNDO_CONSTRAINTS

IN

VARCHAR2

No

X_RETURN_STATUS X_MSG_COUNT X_MSG_DATA

OUT OUT OUT

VARCHAR2 NUMBER VARCHAR2

6.1.5 Package PN_VRA_CLIENT_EXTN.CALCULATE_OVERRIDE accepts the following parameters

Parameter P_VAR_RENT_ID P_TRX_HEADER_ID P_CALCULATED_RENT P_PRORATED_RENT P_PERCENT_RENT P_YTD_PERCENT_RENT P_FIRST_YR_RENT X_RETURN_STATUS X_MSG_COUNT X_MSG_DATA

Usage IN IN IN OUT IN OUT IN OUT IN OUT IN OUT OUT OUT OUT

Type NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER VARCHAR2 NUMBER VARCHAR2

Requi red Yes Yes No No No No No No No No

Description Var_rent_id for which the calculation override is used. Trx_header_id Calculated_rent Prorated_rent Percent_rent Ytd_percent_rent First_yr_rent API Standard API Standard API Standard

Document Control

Oracle Confidential - For internal use only

Page 9 of 34

6.2

Calling Arguments
This program is called by: Any custom package which passes the above parameters (Section 6.1.1) for creating new variable rent agreement.

The program calls the following other programs:


Program Unit PN_VAREN_PVT Argument Listed in Appendix B Description This is a Private package for calling Utility packages and already existing variable rent create packages. This package is called by PN_VAR_RENT_PUB API. This is Validation package; it contains all the validations which have to be performed before Creating the Variable Rent agreement.

PN_VAREN_UTIL

Based on the validation, different arguments are passed to call this package.

6.3

Special Validation Logic


PN_VAREN_UTIL Utility package contains all the validations for Create and Update Variable Rent API. PN_VAREN_PVT private package uses utility package and validate the records for creating Variable rent. PN_VAR_RENT_PUB is public API which can be called by any custom program and can Create/Update Variable Rent.

6.3.1

PN_VAR_RENT_PUB Pseudo-Code
6.3.1.1 CREATE_VAR_RENT Pseudo-Code

--Get the debug profile value for PN PN_DEBUG_MODE pg_debug VARCHAR2 (1) := NVL (fnd_profile.VALUE('PN_DEBUG_MODE'),'N'); Begin -- Initialize MOAC for R12 --Check if the api version passed as a parameter is equal to the existing api version(global variable) If ( l_api_version = g_api_version) THEN
--Call private api to validate the input parameters and call inbuilt package PN_VAR_RENTS_PKG.INSERT_ROW package to create the variable rent.

PN_VAREN_PVT.create_var_rent (p_commit , p_validate_flag , p_var_rent_rec , p_variable_rent_lines_tbl , p_breakpoint_header_tbl , p_breakpoint_details_tbl , p_constraints_tbl , p_allow_abat_tbl , p_generate_periods , p_generate_breakpoints

=> p_commit => p_validate_flag => p_var_rent_rec => p_variable_rent_lines_tbl => p_breakpoint_header_tbl => p_breakpoint_details_tbl => p_constraints_tbl => p_allow_abat_tbl => p_generate_periods => p_generate_breakpoints

Document Control

Oracle Confidential - For internal use only

Page 10 of 34

, p_generate_constraints , x_return_status , x_msg_count , x_msg_data , x_var_rent_id , x_var_rent_num ); ELSE --Log message with the api version error END IF; --Standard check for the commit. IF fnd_api.to_boolean (p_commit) THEN COMMIT WORK; END IF; EXCEPTION --Calling api standard package to check the errors WHEN fnd_api.g_exc_error THEN ROLLBACK; <Log message with the error message> WHEN fnd_api.g_exc_unexpected_error THEN ROLLBACK; <Log message with the error message> WHEN OTHERS THEN ROLLBACK; <Log message with the error message> END create_var_rent;

=> p_generate_constraints => x_return_status => x_msg_count => x_msg_data => x_var_rent_id => x_var_rent_num

6.3.1.2 6.3.1.3

GENERATE_PERIODS Pseudo-Code Input parameter for this api is variable rent id Call private package to call the concurrent program to generate the periods, for the given variable rent id. GENERATE_ABAT_BREAKPOINTS Pseudo-Code Input paramters for this api is variable rent id

Document Control

Oracle Confidential - For internal use only

Page 11 of 34

6.3.1.4

Call private package to call the concurrent program to generate the periods, for the given variable rent id. UPDATE_VAR_RENT Pseudo-Code

--Get the debug profile value for PN PN_DEBUG_MODE pg_debug VARCHAR2 (1) := NVL (fnd_profile.VALUE('PN_DEBUG_MODE'),'N'); Begin -- Initialize MOAC for R12 --Check if the api version passed as a parameter is equal to the existing api version(global variable) If ( l_api_version = g_api_version) THEN
--Call private api to validate the input parameters and update the variable rent tables accordingly.

PN_VAREN_PVT.update_var_rent (p_commit , p_validate_flag , p_upd_var_rent_rec , p_variable_rent_lines_tbl , p_breakpoint_header_tbl , p_breakpoint_details_tbl , p_constraints_tbl , p_allow_abat_tbl , p_generate_periods , p_generate_breakpoints , p_generate_constraints , x_return_status , x_msg_count , x_msg_data ); ELSE --Log message with the api version error END IF; --Standard check for the commit. IF fnd_api.to_boolean (p_commit) THEN COMMIT WORK; END IF; EXCEPTION --Calling api standard package to check the errors WHEN fnd_api.g_exc_error THEN ROLLBACK; <Log message with the error message> WHEN fnd_api.g_exc_unexpected_error THEN

=> p_commit => p_validate_flag => p_upd_var_rent_rec => p_variable_rent_lines_tbl => p_breakpoint_header_tbl => p_breakpoint_details_tbl => p_constraints_tbl => p_allow_abat_tbl => p_generate_periods => p_generate_breakpoints => p_generate_constraints => x_return_status => x_msg_count => x_msg_data

Document Control

Oracle Confidential - For internal use only

Page 12 of 34

ROLLBACK; <Log message with the error message> WHEN OTHERS THEN ROLLBACK; <Log message with the error message> END update_var_rent;

6.3.2

PN_VAREN_PVT Pseudo-Code
PN_VAREN_PVT Specification contains all the global variables for lookup codes, record types and table types declared as shown below: -- Declaring Lookup Type constants g_cumulative_vol CONSTANT VARCHAR2 (30) := 'PN_VAR_CALCULATION_METHOD'; g_proration_rule CONSTANT VARCHAR2 (30) := 'PN_VAR_PRORATION_RULE'; g_invoice_on CONSTANT VARCHAR2 (30) := 'PN_VAR_INVOICE_ON'; g_negative_rent CONSTANT VARCHAR2 (30) := 'PN_VAR_NEGATIVE_RENT'; g_rent_type CONSTANT VARCHAR2 (30) := 'PN_VAR_RENT_TYPE'; g_payment_purpose CONSTANT VARCHAR2 (30) := 'PN_PAYMENT_PURPOSE_TYPE'; g_payment_frequency CONSTANT VARCHAR2 (30) := 'PN_PAYMENT_FREQUENCY_TYPE'; g_sales_channel CONSTANT VARCHAR2 (30) := 'PN_SALES_CHANNEL'; g_item_category CONSTANT VARCHAR2 (30) := 'PN_ITEM_CATEGORY'; g_break_type CONSTANT VARCHAR2 (30) := 'PN_VAR_BREAK_TYPE'; g_type_code CONSTANT VARCHAR2 (30) := 'PN_MAX_MIN'; g_appl_order CONSTANT VARCHAR2 (30) := 'PN_APPLICATION_ORDER'; g_excess_abate_code CONSTANT VARCHAR2 (30) := 'PN_EXCESS_ABATEMENT'; g_abate_type_code CONSTANT VARCHAR2 (30) := 'PN_ABATEMENT_TYPE'; g_pay_terms_status CONSTANT VARCHAR2 (30) := 'PN_INDEX_PAYMENT_TERM_STATUS'; --Record type for variable rent details TYPE var_rent_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.1); --Record type for Variable rent lines details TYPE variable_rent_lines_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.2); --Table type for variable rent lines details TYPE variable_rent_lines_tbl_type IS TABLE OF variable_rent_lines_rec_type INDEX BY BINARY_INTEGER; --Record type for Breakpoint header details TYPE breakpoint_header_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.3); --Table type for breakpoint header details TYPE breakpoint_header_tbl_type IS TABLE OF breakpoint_header_rec_type INDEX BY BINARY_INTEGER; --Record type for Breakpoint details TYPE breakpoint_details_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.4);

Document Control

Oracle Confidential - For internal use only

Page 13 of 34

--Table type for breakpoint details TYPE breakpoint_details_tbl_type IS TABLE OF breakpoint_details_rec_type INDEX BY BINARY_INTEGER; --Record type for constraints details TYPE constraints_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.5); --Table type for constraints details TYPE constraints_tbl_type IS TABLE OF constraints_rec_type INDEX BY BINARY_INTEGER; --Record type for allow abatement details TYPE allow_abat_rec_rec_type IS RECORD (definition contains all the columns as shown in section 11.1.6); --Table type for allow abatement details TYPE allow_abat_rec_tbl_type IS TABLE OF allow_abat_rec_rec_type INDEX BY BINARY_INTEGER; 6.3.2.1 PN_VAREN_PVT.CREATE_VAR_RENT Procedure

BEGIN -- Validate Lease Id or Lease Num or Lease Name IF ( lease_id or lease_num or lease_name is not null) THEN Call the package pn_varen_utils_pkg.validate_lease with appropriate parameters. <Error handing based on the l_return_status from the above package> END IF; BEGIN -- Validate Variable Rent Number IF ( rent_num is not null) THEN Call the package pn_varen_utils_pkg.validate_rent_num with appropriate parameters. <Error handing based on the l_return_status from the above package> END IF; --Variable Rent : Commencement date validation Check if the below conditions for commencement date to be success 1. commencement date is not null 2. commencement date > = lease commencement date 3. commencement date < = termination date If the commencement date is NULL then commencement date := lease commencement date; Else Capture the error; END IF; Similarly check the below conditions for Termination date 1. Termination date is not null 2. Termination date > lease commencement date 3. Termination date <= lease Termination date If the Termination date is NULL then Termination date := lease Termination date; Else Capture the error;

Document Control

Oracle Confidential - For internal use only

Page 14 of 34

END IF; END IF; -- Validating location id, based on the lease_id IF ( location_id or location_code is not null) THEN Call the package pn_varen_utils_pkg.validate_location with appropriate parameters <Error handing based on the l_return_status from the above package> END IF;

-- Validating CATEGORY i.e., PROCESS_CODE IF ( purpose_code or purpose_code_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups with appropriate parameters for validating purpose_code. <Error handing based on the l_return_status from the above package> END IF; -- Validating VOLUME TYPE i.e.,Variable Rent type IF ( type_code or type_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups with appropriate parameters for validating type_code. <Error handing based on the l_return_status from the above package> END IF; -- Validating ABSTRACTED BY i.e., USER IF (abstracted_by_user IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_abst_user to validate the abstracted by user. <Error handing based on the l_return_status from the above package> END IF; -- Validating CUMMULATIVE VOLUME i.e., Calculation Method IF ( cumulative_vol_code or cumulative_vol_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups to validate the cummulative volume <Error handing based on the l_return_status from the above package> END IF; -- Validating PRORATION RULE i.e., Partial Year method IF ( proration_rule_code or proration_rule_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups to validate proration rule. <Error handing based on the l_return_status from the above package> END IF; -- Validating invoice on

Document Control

Oracle Confidential - For internal use only

Page 15 of 34

IF ( invoice_on_code or invoice_on_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups to validate invoice_on_code. <Error handing based on the l_return_status from the above package> END IF; -- Validating NEGATIVE RENT IF ( negative_rent_code Or negative_rent_meaning IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_lookups to validate Negative Rent. <Error handing based on the l_return_status from the above package> END IF; -- Validating TERM TEMPLATE IF ( term_template_id or term_template_name IS NOT NULL) THEN Call package pn_varen_utils_pkg.validate_term_template to validate the term template. <Error handing based on the l_return_status from the above package> END IF; --Validating CURRENCY code IF ( currency_code IS NOT NULL) THEN Call pn_varen_utils_pkg.validate_currency to validate the currency code. <Error handing based on the l_return_status from the above package> END IF; --If the program is not run with validate mode, then the insert_row program is called to insert the records into pn_var_rents_all table IF l_validate_falg <> 'Y' THEN PN_VAR_RENTS_PKG.INSERT_ROW ( <Pass the parameters required by this package> ); PN_VAR_RENT_DATES_PKG.INSERT_ROW( <Pass the parameters required by this package> ); END IF; IF the variable rent record has been created without errors and p_generate_periods = 'Y' Then <Concurrent program Calculate Variable Rent is called with appropriate paramters> If the periods are generated without warning/error THEN <Call the Validation program for breakpoints headers and break point details > End IF; IF p_generate_constraints = 'Y' Then < validated the mandatory fields> <Create the constraints using below package> PN_VAR_CONSTRAINTS_PKG.INSERT_ROW( <Pass the parameters required by this package> ); < Call the package to generate Constraints> <Concurrent program Calculate Variable Rent is called with appropriate paramters> END IF; IF p_generate_breakpoints= 'Y' Then <Validate the mandatory columns for breakpoints > <Create the breakpoints header and details using below package>

Document Control

Oracle Confidential - For internal use only

Page 16 of 34

PN_VAR_BKPTS_HEAD_PKG.INSERT_ROW( <Pass the parameters required by this package> ); PN_VAR_BKPTS_DET_PKG.INSERT_ROW( <Pass the parameters required by this package> ); < Call the package to generate the Break Point periods> <Concurrent program Calculate Variable Rent is called with appropriate paramters> END IF; IF p_recurring_abatements = 'Y' Then <Validate the mandatory columns for abatements/allowances > < Call the package to generate recurring abatements> <Concurrent program Calculate Variable Rent is called with appropriate paramters> END IF; END create_var_rent; 6.3.2.2 PN_VAREN_PVT.GENERATE_PERIODS Procedure <Check if dates are created using below query> CURSOR c_dates_created IS SELECT COUNT (*) FROM pn_var_rent_dates_all WHERE var_rent_id = p_var_rent_id; If <the dates are created> THEN Fetch the dates related columns from pn_var_rent_dates_all table as shown below. SELECT pvrd.use_gl_calendar , pvrd.year_start_date , pvra.var_rent_id , pvra.cumulative_vol , pvra.chg_cal_var_rent_id FROM pn_var_rents_all pvra , pn_var_rent_dates_all pvrd WHERE pvra.var_rent_id = pvrd.var_rent_id AND pvra.var_rent_id = p_var_rent_id; END IF; --Check if periods exists l_period_exists := pn_var_rent_pkg.find_if_period_exists (l_varentid); IF NVL (l_period_exists , 9898 ) = 9898 THEN IF NVL (l_use_gl_calendar , 'N' ) = 'Y' THEN -Call create_var_rent_periods with parameters var_rent_id and cummulative_vol pn_var_rent_pkg.create_var_rent_periods (l_varentid , l_cumulativevol ); x_return_status := fnd_api.g_ret_sts_success; ELSIF NVL (l_use_gl_calendar , 'N' ) = 'N' THEN -Call create_var_rent_periods_nocal with parameters var_rent_id, cummulative_vol and year_start_date pn_var_rent_pkg.create_var_rent_periods_nocal (l_varentid , l_cumulativevol , l_yearstartdate ); END IF; ELSE x_return_status := fnd_api.g_ret_sts_error;

Document Control

Oracle Confidential - For internal use only

Page 17 of 34

END IF; 6.3.2.3 PN_VAREN_PVT.UNDO_BREAKPOINTS Procedure l_period_exists := PN_VAR_RENT_PKG.find_if_period_exists(l_varentId); IF l_period_exists IS NOT NULL THEN /*codev*/ IF name_in('vol_hist_blk.vol_hist_id') IS NOT NULL THEN go_block('vol_hist_blk'); clear_block(NO_VALIDATE); END IF; DELETE FROM PN_VAR_VOL_HIST_ALL WHERE period_id IN (SELECT period_id FROM PN_VAR_PERIODS_ALL WHERE var_rent_id = l_varentId); DELETE FROM pn_var_constraints_all WHERE period_id IN (SELECT period_id FROM PN_VAR_PERIODS_ALL WHERE var_rent_id = l_varentId); DELETE FROM pn_var_bkpts_det_all WHERE var_rent_id = l_varentid; DELETE pn_var_bkpts_head_all WHERE var_rent_id = l_varentid; DELETE pn_var_lines_all WHERE var_rent_id = l_varentid; DELETE FROM pn_var_abatements_all abat WHERE abat.var_rent_id=l_varentId; PN_VAR_RENT_PKG.delete_var_rent_periods(l_varentId); PN_VAR_TRX_PKG.delete_transactions( p_var_rent_id =&gt; l_varentId ,p_period_id =&gt; NULL ,p_line_item_id =&gt; NULL); PN_VAR_DEFAULTS_PKG.delete_default_lines(l_varentId); DELETE FROM pn_var_abat_defaults_all WHERE var_rent_id = l_varentId; DELETE FROM pn_var_bkdt_defaults_all WHERE var_rent_id = l_varentid; DELETE pn_var_bkhd_defaults_all WHERE var_rent_id = l_varentid; DELETE pn_var_line_defaults_all WHERE var_rent_id = l_varentid; DELETE pn_var_constr_defaults_all WHERE var_rent_id = l_varentid; Commit;

Document Control

Oracle Confidential - For internal use only

Page 18 of 34

6.3.2.4 PN_VAREN_PVT.UNDO_CONSTRAINTS Procedure delete from pn_var_constraints_all where constr_default_id in (select constr_default_id from pn_var_constr_defaults_all where var_rent_id = l_var_rent_id); COMMIT; 6.3.2.5 PN_VAREN_PVT.GENERATE_ABAT_BREKPOINTS Procedure --Generate Constraints --Check if constraint_default_id exists from pn_var_constr_defaults_all for the given var_rent_id. IF constraint_default_id <> 0 THEN pn_var_defaults_pkg.create_default_constraints (p_var_rent_id); END IF; --Generate Breakpoints --Check if breakpoint defaults are created from the table pn_var_bkdt_defaults_all for the given var_rent_id IF breakpoints_defaults created THEN --Call the below packages to generate breakpoints pn_var_defaults_pkg.create_setup_data (p_var_rent_id); pn_var_chg_cal_pkg.populate_transactions (p_var_rent_id); END IF; 6.3.2.6 PN_VAREN_PVT.UPDATE_VAR_RENT Procedure

PN_VAREN_PVT Specification contains all the global variables for lookup codes, as shown in section 6.3.2 <Declaration section> --Cursor to fetch the records from PN_VAR_RENTS_ALL Cursor1 --Cursor to fetch the records from PN_VAR_RENT_DATES_ALL Cursor2 --Cursor to fetch the records from PN_VAR_LINE_DEFAULTS_ALL Cursor3 --Cursor to fetch the records from PN_VAR_BKHD_DEFAULTS_ALL cursor4 --Cursor to fetch the records from PN_VAR_BKDT_DEFAULTS_ALL cursor5 --Cursor to fetch the records from PN_VAR_CONSTR_DEFAULTS_ALL cursor6 --Cursor to fetch the records from PN_VAR_ABAT_DEFAULTS_ALL cursor7 BEGIN -- Update for Variable Rent -- Open cursor1 and fetch all the cursor values into variables

Document Control

Oracle Confidential - For internal use only

Page 19 of 34

-- Compare each column from the parameter P_VAR_RENT_REC variable with the cursor1 variables -- If the input parameter from p_var_rent_rec is different from the existing value from the cursor1 then assign the new value to p_var_rent_rec column -- Below is an example for above 3 validation points IF cursor1.cumulative_vol IS NULL or cursor1.cumulative_vol = g_mis_char THEN cursor1.cumulative_vol := p_var_rent_rec.cumulative_vol; ELSIF cursor1.cumulative_vol IS NOT NULL and (cursor1.cumulative_vol = p_var_rent_rec.cumulative_vol) THEN cursor1.cumulative_vol := p_var_rent_rec.cumulative_vol; ELSIF cursor1.cumulative_vol IS NOT NULL and (cursor1.cumulative_vol <> p_var_rent_rec.cumulative_vol) THEN validate cursor1.cumulative_vol; IF cursor1.cumulative_vol - Validated THEN cursor1.cumulative_vol := cursor1.cumulative_vol; ELSE fnd_api.set_error; END IF; END IF; -- After all the validations call the UPDATE_ROW package with the appropriate parameters IF l_validate_falg <> 'Y' THEN PN_VAR_RENTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); END IF; -- Update for Variable Rent Dates -- Open Cursor2 and fetch all the cursor values into variables -- Compare each column from the parameter P_VAR_RENT_REC variable with the cursor2 variables -- If the input parameter from p_var_rent_rec is different from the existing value from the cursor2 then assign the new value to p_var_rent_rec column -- After all the validations, call the update_row for dates IF l_validate_falg <> 'Y' THEN PN_VAR_RENT_DATES_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); END IF; -- Undo Periods -- Check if periods exist -- Call the private procedure to Undo Periods -- See section 6.3.2.3 for Undo periods logic -- Update for Breakpoints lines, headers, and details -- Call UNDO generate Breakpoints procedure before updating the breakpoints --Below is the procedures for UNDO Breakpoints pn_var_defaults_pkg.delete_default_lines (l_var_rent_id, exists_hd_def_rec.bkhd_default_id, l_bkpt_header_id); pn_var_defaults_pkg.delete_transactions (l_var_rent_id, exists_hd_def_rec.bkhd_default_id, l_bkpt_header_id); -- Open Cursor3, Cursor4 and Cursor5 and fetch the cursor values into variables -- Validate Cursor3 variables with P_VARIABLE_RENT_LINES_TBL -- Validate cursor4 variables with P_BREAKPOINT_HEADER_TBL -- and Validate cursor5 variables with P_BREAKPOINT_DETAILS_TBL

Document Control

Oracle Confidential - For internal use only

Page 20 of 34

--Upon validation of all the cursor values with corresponding IN parameters, call respective UPDATE_ROW package -- Below is the packages for updating Variable Lines, Breakpoint Headers and Breakpoint Details respectively If row exists Then PN_VAR_LINE_DEFAULTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); Else PN_VAR_LINE_DEFAULTS_PKG.INSERT_ROW( <Pass the parameters required by this package> ); End if; If row exists Then PN_VAR_BKHD_DEFAULTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); ELSE PN_VAR_BKHD_DEFAULTS_PKG.INSERT_ROW( <Pass the parameters required by this package> ); END IF; If row exists Then PN_VAR_BKDT_DEFAULTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); ELSE package> ); END IF; --After successful updating, call Generate Breakpoints procedure shown in section 6.3.2.4 -- Update Constraints -- Undo constraints -- Below is the logic to undo Constraints delete from pn_var_constraints_all where constr_default_id in (select constr_default_id from pn_var_constr_defaults_all where var_rent_id = l_var_rent_id); -- Open the cursor6 and fetch all the values into variables -- Compare the values from P_CONSTRAINTS_TBL with cursor6 variables -- upon validations, call the update_row package IF ROW EXISTS (CONSTR_DEFAULT_ID IS NOT NULL) THEN PN_VAR_CONSTR_DEFAULTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); ELSE PN_VAR_CONSTR_DEFAULTS_PKG.INSERT_ROW( <Pass the parameters required by this package> ); -- After successful updating of constraints, call Generate Constraints procedure as shown in section 6.3.2.4 -- Update Abatements -- Open the cursor7 and fetch the values into variables -- Compare each variable from cursor7 with the values from P_ALLOW_ABAT_TBL -- Upon validation call the update_row package for Allow abatements IF ROW EXISTS (ABATEMENT_ID IS NOT NULL) THEN

Document Control

Oracle Confidential - For internal use only

Page 21 of 34

PN_VAR_ABAT_DEFAULTS_PKG.UPDATE_ROW( <Pass the parameters required by this package> ); ELSE PN_VAR_ABAT_DEFAULTS_PKG.INSERT_ROW( <Pass the parameters required by this package> ); END IF; -- Call generate periods END update_var_rent;

6.3.2.7 PN_VAREN_UTIL Pseudo-Code


Utility package contains all the validations required for Variable Rent Creation/Updating. This section lists the validations and the SQL query used for validation. 1. Initialize MOAC for R12 Initialize the log in and application details using below package FND_GLOBAL.APPS_INITIALIZE(p_user ,p_responsibility ,p_Application ); Initialize the Multi Org access control (MOAC) for PN application MO_GLOBAL.INIT('SQLPN'); --This will initialize MOAC for PN application 2. Validate Variable Rent Number This query is used when either of variable rent id or variable Rent number is given. This procedure checks if the variable_rent_id is null. IF variable_rent_id IS NULL THEN SELECT pn_var_rents_s.NEXTVAL INTO x_var_rent_id FROM DUAL; END IF; Check for unique varibale_rent_number pn_var_rents_pkg.check_unique_rent_number (l_return_status , x_var_rent_id , x_rent_num , p_org_id ); Check for org_id, if the p_org_id is Null, then get the org_id from pn_leases_all based on lease_id. SELECT org_id FROM pn_leases_all WHERE lease_id = p_lease_id; SELECT ROWID FROM pn_var_rents_all WHERE var_rent_id = x_var_rent_id; 3. Validate Lease Id/Lease Num/Lease Name

Document Control

Oracle Confidential - For internal use only

Page 22 of 34

4.

Validate if the lease details given as the parameter are existing in pn_leases_all table, using below query. Lease_num, lease_name or lease_id can be passed as parameter for the below query. SELECT lease_id , status , payment_term_proration_rule FROM pn_leases_all WHERE lease_class_code = 'DIRECT' AND ( lease_id = x_lease_id OR UPPER (lease_num) = UPPER (p_lease_num) OR UPPER (NAME) = UPPER (p_lease_name)) AND org_id = p_org_id; If the lease Status is not Final, variable rent cannot be created. Thus log messages are displayed if the Status <> Final If the lease details are not found, log messages are displayed and variable rent cannot be created. Lease cannot be created from CREATE_VAR_RENT API.

Validate Location Location details are validated based on lease_id and Location_code or Location_id. Below query is used to validate the location details. SELECT pl.location_code FROM pn_tenancies_all pt , pn_locations_all pl , pn_properties_all prop , fnd_lookups loc_lkp , fnd_lookups flg_lkp WHERE pt.location_id = pl.location_id AND prop.property_id(+) = pl.property_id AND NVL (pt.occupancy_date, pt.estimated_occupancy_date) BETWEEN pl.active_start_date AND pl.active_end_date AND pt.lease_id = p_lease_id AND pl.location_id = p_location_id AND loc_lkp.lookup_code = pl.location_type_lookup_code AND loc_lkp.lookup_type = 'PN_LOCATION_TYPE' AND flg_lkp.lookup_code = pt.primary_flag AND flg_lkp.lookup_type = 'PN_YES_NO';

5.

Validate Lookups This validation procedure validates all the parameters which are based on lookup. All the global variables listed in section 6.3.2 are validated by this procedure. Below is the query used for validation lookup based values: SELECT meaning , lookup_code FROM fnd_lookups WHERE lookup_type = p_lookup_type AND ( UPPER (lookup_code) = UPPER (x_lookup_code) OR UPPER (meaning) = UPPER (x_lookup_meaning)) AND enabled_flag = 'Y' AND TRUNC (SYSDATE) BETWEEN TRUNC (NVL (start_date_active, SYSDATE)) AND TRUNC (NVL (end_date_active, SYSDATE));

6.

Validate Term Template Term templates are validated based on the below query

Document Control

Oracle Confidential - For internal use only

Page 23 of 34

SELECT term.term_template_id , term.NAME FROM pn_term_templates_all term WHERE active = 'Y' AND ( UPPER (NAME) = UPPER (x_term_template_name) OR term_template_id = x_term_template_id) AND term.term_template_type IN ('NEUTRAL', 'PAYMENT') AND org_id = p_org_id; 7. If the term_template details are not given, then based on the org_id the term template details are fetched send it to the private package for creating variable rent. This validation procedure checks if the abstracted by user exist and valid during the creation of variable rent. SELECT user_id , user_name FROM fnd_user WHERE ( UPPER (user_name) = x_user_name OR user_id = x_user_id) AND TRUNC (SYSDATE) BETWEEN TRUNC (NVL (start_date, SYSDATE)) AND TRUNC (NVL (end_date, SYSDATE)); 8. Validate Currency This procedure checks if the currency code passed to the PUB is valid. SELECT COUNT (1) INTO l_count FROM pn_currencies pn , gl_daily_conversion_types gl WHERE pn.conversion_type = gl.conversion_type AND currency_code = p_currency_code;

Validate Abstracted by User

9.

Validate Periods This procedure is basically used for validating Calculation frequency, Reporting frequency and Invoicing frequency. Below query is used to validate above fields: SELECT meaning , lookup_code FROM fnd_lookups WHERE lookup_type = p_lookup_type AND ( UPPER (lookup_code) = UPPER (x_lookup_code) OR UPPER (meaning) = UPPER (x_lookup_meaning)) AND enabled_flag = 'Y' AND lookup_code <> 'OT' AND TRUNC (SYSDATE) BETWEEN TRUNC (NVL (start_date_active, SYSDATE)) AND TRUNC (NVL (end_date_active, SYSDATE));

10. Validate Attribute Category Attribute category is validated against the existing descriptive flex field setups. Flex field context value has to be fetched from FND_DESCR_FLEX_COL_USAGE_VL

11. VAL_RENT_DETAILS This Procedure for Fetching Lease id, Location Id and Variable Rent Details

Document Control

Oracle Confidential - For internal use only

Page 24 of 34

Below query is used to for Fetching Lease id, Location Id and Variable Rent Details. SELECT var_rent_id , lease_id , location_id FROM pn_var_rents_all WHERE UPPER (rent_num) = UPPER (p_rent_num);

12. PVT_DEBUG This Procedure for capture custom messages based on the package pn_debug.write.

13. VALIDATE_PERIOD_SET_TYPE Procedure for validate Period set type Below query is used to for validate Period set type. SELECT period_type , period_set_name FROM gl_periods WHERE UPPER (period_set_name) = UPPER (p_gl_period_set_name) AND UPPER (period_type) = UPPER (p_period_type) GROUP BY period_type , period_set_name; 14. BREAKPOINT_EXT Procedure for verifying whether breakpoint are generated or not Below query is used to for verifying whether breakpoints are generated or not. SELECT COUNT (1) FROM pn_var_bkpts_head_all WHERE var_rent_id = p_var_rent_id; 15. CONSTR_EXT Procedure for verifying whether Constraints are generated or not. Below query is used to for verifying whether Constraints are generated or not. SELECT COUNT (1) FROM pn_var_constr_defaults_all WHERE var_rent_id = p_var_rent_id;

6.3.2.8 PN_VRA_CLIENT_EXTN.CALCULATE_OVERRIDE Pseudo-Code


PROCEDURE calculate_override ( p_api_version IN NUMBER , p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false , p_commit IN VARCHAR2 DEFAULT fnd_api.g_false , p_var_rent_id IN NUMBER , p_trx_header_id IN NUMBER

Document Control

Oracle Confidential - For internal use only

Page 25 of 34

, p_calculated_rent , p_prorated_rent , p_percent_rent , p_ytd_percent_rent , p_first_yr_rent , x_return_status , x_msg_count , x_msg_data ) IS BEGIN

IN OUT IN OUT IN OUT IN OUT IN OUT OUT OUT OUT

NOCOPY NUMBER NOCOPY NUMBER NOCOPY NUMBER NOCOPY NUMBER NOCOPY NUMBER NOCOPY VARCHAR2 NOCOPY NUMBER NOCOPY VARCHAR2

<Customize the hook to override the input parameters, do not change the output parameters>. END;

Document Control

Oracle Confidential - For internal use only

Page 26 of 34

Log Output

.........1.........2.........3.........4.........5.........6.........7.........8

Document Control

Oracle Confidential - For internal use only

Page 27 of 34

Concurrent Request Output


Not Applicable

a. Table and View Usage

Object Name PN_LEASES_ALL PN_VAR_RENTS_ALL PN_VAR_RENT_DATES_ALL PN_VAR_LINE_DEFAULTS_ALL PN_VAR_BKHD_DEFAULTS_ALL PN_VAR_BKDT_DEFAULTS_ALL PN_VAR_CONSTR_DEFAULTS_ALL PN_VAR_ABAT_DEFAULTS_ALL PN_VAR_TEMPLATES_ALL PN_SYSTEM_SETUP_OPTIONS PN_TENANCIES_ALL PN_LOCATIONS_ALL PN_PROPERTIES_ALL FND_LOOKUPS PN_TERM_TEMPLATES_ALL FND_USER PN_CURRENCIES GL_DAILY_CONVERSION_TYPES

Object Type

Select X X

Insert

Update

Delete

Table Table Table Table Table Table Table Table Table Table Table Table Table

X X X X X X X

X X X X X X X

X X X X X X X X X X

Document Control

Oracle Confidential - For internal use only

Page 28 of 34

b. Sequence Usage
Used below sequence for generating variable_rent_id. If PN_SYSTEM_OPTION contains generate auto numbering for variable rent as Yes then the same variable_rent_id is used for variable rent number pn_var_rents_s

c. Restart Strategy
Not Applicable

d. Crash Recovery
Not Applicable

e. Database Triggers
Not Applicable

f. Table Handlers (NEW/ CHANGED)


Not Applicable

Document Control

Oracle Confidential - For internal use only

Page 29 of 34

9 Seed Data
No Seeded data changes.

Document Control

Oracle Confidential - For internal use only

Page 30 of 34

10 Installation and Upgrade

a. Installation
There are no impacts on a fresh install. This API will be installed as a part of patch release, thus no impact on installation or upgrade.

Document Control

Oracle Confidential - For internal use only

Page 31 of 34

11 Unit Test Considerations

a. Create Variable Rent


Component (s) Create Variable Rent Step No. 1 General Step Description Invoke the Create Variable Rent API with input parameters. Test Data The input parameters specified should include appropriate parameters and they should be valid. Expected Results Variable Rent, Variable Rent Lines, Breakpoints, Constraints, Allowances and Abatements in the PN System with specified data should be created in the PN System with specified data. Variable Rent, Variable Rent Lines, Breakpoints, Constraints, Allowances and Abatements in the PN System with specified data should not be created and the corresponding error messages should be captured in a log file. Periods should be generated Allow abatements and constraints should be created with all the validations.

Create Variable Rent

Invoke the Create Variable Rent API with invalid input parameters.

The input parameters specified include invalid data.

Generate Periods

Invoke GENERATE_PERIODS with variable rent id as input Invoke CREATE_BKPT_CONST_ALLOW_ABA T with valid input parameters

Allow Abatements

The input parameters specified include invalid data. The input parameters specified include invalid data.

b. Update Variable Rent


Component (s) Update Variable Rent Step No. 1 General Step Description Invoke the Update Variable Rent API with input parameters. Test Data The input parameters specified should include appropriate parameters and they should be valid. The input parameters specified should include appropriate parameters and they should be valid. The input parameters specified should include Expected Results Variable Rent parameters which are different from the existing variable rent value are updated. Variable Rent dates parameters which are different from the existing variable rent values are updated. Variable Rent Breakpoint is updated with the parameters

Update Variable Rent dates

Invoke the Update Variable Rent API with input parameters

Update Breakpoints

Invoke the Update Variable Rent API with input parameters

Document Control

Oracle Confidential - For internal use only

Page 32 of 34

Component (s)

Step No.

General Step Description

Test Data appropriate parameters and they should be valid.

Expected Results which are different from the existing variable rent breakpoint details. Variable Rent Constraints is updated with the input parameters which are different from the existing constraint details. Variable Rent Abatements is updated with the input parameters which are different from the existing constraint details. Undo Periods is initiated. Undo Breakpoint is initiated. Undo Constraints is initiated.

Update Constraints

Invoke the Update Variable Rent API with input parameters

The input parameters specified should include appropriate parameters and they should be valid. The input parameters specified should include appropriate parameters and they should be valid. Input parameter p_undo_periods is passed as Y Input parameter p_undo_breakpoints is passed as Y Input parameter p_undo_constraints is passed as Y

Update Abatements

Invoke the Update Variable Rent API with input parameters

Undo Periods Undo Breakpoints Undo Constraints

6 7 8

Invoke the Update Variable Rent API with input parameters Invoke the Update Variable Rent API with input parameters Invoke the Update Variable Rent API with input parameters

Document Control

Oracle Confidential - For internal use only

Page 33 of 34

12 Open and Closed Issues

a. Closed Issues

Number

Description

Date Raised

Priority

Owner

Resolution

Date Closed

Priority: H= High; M=Medium, L=Low

b. Solution for issues raised by McDonalds team.

While you should include any and all comments you have, please use the questions and guidelines for each of the applicable sections to assess the solution described in the document.

Document Section

Focus Group Member Name


Harvinder Rakhra

User Comment
Variable Rent could be created even if the Base Lease is in Draft status. There are a few features in Variable Rent which cant be generated until lease is Finalized, like creating sales figures, but Variable Rent definition could be created in Draft status of the base lease. Both the scenarios of updating the present VRA Lines and creating a new VRA Line should be handled in Procedure Update_Vra_Rent. In description of parameter P_VARIABLE_RENT_LINES_TBL, its mentioned: If they are passing new variable rent lines details then API is not going to consider it. Same applies for Breakpoint Header, Break Point Details, Constraints and Allowances & Abatements Information.

Product Management Comment These scenarios are taken care while coding.

3.3.1

6.1.4

Harvinder Rakhra

These scenarios are taken care while coding.

Document Control

Oracle Confidential - For internal use only

Page 34 of 34

13 Appendix A: Parameters for PN_VAR_RENT_PUB


This section details the Input Record/Table type parameter details for PN_VAR_RENT_PUB.

13.1

CREATE_VAR_RENT Record Type

13.1. 1 Variable Rent Record Type

Variable Rent

13.1.2 Variable Rent Lines Table Type

Variable Rent Lines

13.1.3 Breakpoint Header Table Type

Breakpoint Header

13.1.4 Breakpoint Details Table Type

Breakpoint Details

13.1.5 Constraints Table Type

Constraints

13.1.6 Allowances & Abatements Table Type

Allowances and Abatem ent

Document Control

Oracle Confidential - For internal use only

Page 35 of 34

13.2

UPDATE_VAR_RENT Record Type


13.2.1 Update Variable Rent record type

Update Variable Rent

Document Control

Oracle Confidential - For internal use only

Page 36 of 34

14 Appendix B: Parameters for PN_VAREN_PVT


This section details the Input Record/Table type parameters for PN_VAREN_PVT package.

14.1

CREATE_VAR_RENT Record Type


Below is the list of parameters for private package PN_VAREN_PVT.CREATE_VAR_RENT.

Parameter

Usage

Type

Require d

Description

p_api_version p_init_msg_list p_commit p_validate_flag p_var_rent_rec p_variable_rent_lines_tbl p_breakpoint_header_tbl p_breakpoint_details_tbl p_constraints_tbl p_allow_abat_tbl p_generate_periods p_generate_breakpoints p_generate_constraints x_return_status x_msg_count x_msg_data x_var_rent_id x_var_rent_num

IN IN IN IN IN IN IN IN IN IN IN IN IN

OUT OUT OUT OUT OUT OUT OUT

NUMBER VARCHAR2 VARCHAR2 VARCHAR2 Record Type Table Type Table Type Table Type Table Type Table Type VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 NUMBER VARCHAR2 NUMBER VARCHAR2

Yes Yes Yes No Yes Yes Yes Yes Yes Yes No No No

OUT OUT OUT OUT OUT

API Standard API Standard API Standard Default value is 'N' Similar to section 13.1.1 Similar to section 13.1.2 Similar to section 13.1.3 Similar to section 13.1.4 Similar to section 13.1.5 Similar to section 13.1.6 Default value is 'N' Default value is 'N' Default value is 'N' Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard Variable rent Id Variable Rent Number

13.1

UPDATE_VAR_RENT Record Type


Below is the list of parameters for private package PN_VAREN_PVT.UPDATE_VAR_RENT.

Document Control

Oracle Confidential - For internal use only

Page 37 of 34

Parameter

Usage

Type

Require d

Description

p_api_version p_init_msg_list p_commit p_validate_flag p_upd_var_rent_rec p_variable_rent_lines_tbl p_breakpoint_header_tbl p_breakpoint_details_tbl p_constraints_tbl p_allow_abat_tbl p_undo_periods p_ undo _breakpoints p_ undo _constraints x_return_status x_msg_count x_msg_data

IN IN IN IN IN IN IN IN IN IN IN IN IN

OUT OUT OUT OUT OUT OUT

NUMBER VARCHAR2 VARCHAR2 VARCHAR2 Record Type Table Type Table Type Table Type Table Type Table Type VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 NUMBER VARCHAR2

Yes Yes Yes No Yes Yes Yes Yes Yes Yes No No No

OUT OUT OUT

API Standard API Standard API Standard Default value is 'N' Similar to section 13.2.1 Similar to section 13.1.2 Similar to section 13.1.3 Similar to section 13.1.4 Similar to section 13.1.5 Similar to section 13.1.6 Default value is 'N' Default value is 'N' Default value is 'N' Return status. Valid values are: S (Success), E (Error), and U (Unexpected error). API Standard API Standard

Document Control

Oracle Confidential - For internal use only

Page 38 of 34

You might also like