Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Property Manager

IFRS Data Model Document

Author: Oracle Support


Creation Date: 20-Jun-2018
Last Updated:
Document Ref:
Version: 1.1
Organization: Oracle India Private Limited.
Contents
1. Overview of IFRS ................................................................................................................................... 3
2. Property Manager EBS setups For IFRS................................................................................................. 3
2.1 Discount Rate Index ........................................................................................................................ 3
2.2 Sub Ledger Accounting Changes ..................................................................................................... 4
2.3 Transition Setup: ............................................................................................................................. 5
3. Sample Flow of IFRS Cycle..................................................................................................................... 6
4. Technical Changes and details for IFRS ................................................................................................... 13
5. Objects (Packages) added/modified for IFRS .......................................................................................... 15
5.1 Details of packages........................................................................................................................ 20
5.2 Source Code to Capture Lease change events .............................................................................. 25
6.Reports for IFRS and its technical details................................................................................................. 30
6.1 Portfolio Summary & Portfolio Detail report ................................................................................ 30
6.2 Lease Analysis Report ................................................................................................................... 32
6.3 Generate Lease Details Report ..................................................................................................... 33
7.Technical Flow for code from lease creation ........................................................................................... 34
8. ER Diagram for the Data Flow ................................................................................................................. 35
1. Overview of IFRS
Financial reporting for leasing businesses around the globe are going to be impacted as a result of
changes to leasing Accounting Standards under IFRS and US-ASCs (US GAAPs). These new accounting
standards will be in force from December 2018 and Jan 2019 and hence leasing applications like Oracle
Property Manager need to prepare for the changes. One of the objectives of these accounting standards
is to provide information on Financial Obligations and Rights of tenants by bringing the leases onto the
balance sheets of the tenants. This will also ease comparability of financial statements of tenants and
organizations not leasing property but acquiring them.

The impacts from the standards can be classified under two categories:

a) Changes to Lessor Accounting

b) Changes to Lessee Accounting

Of the two above changes, the changes to Lessee/Tenant Accounting are significant and this document
deals with the primary requirements and their solution implemented in Oracle Property Manager. These
new standards significantly impact the accounting for lessees for real estate tenants, requiring them to
recognize most leases (example: rental contracts) on their balance sheets as lease liabilities with
corresponding right-of-use assets.

2. Property Manager EBS setups For IFRS:


The following new components have been added/updated in property manager for generating the
calculations and reports:

2.1 Discount Rate Index


An index of rates (interest rates) for different dates will need to be created by the user. This index can
be created at OU level or for across OU’s. The index will need to be added on the lease header and for
calculation of balances applicable interest rate from the index is used.
Navigation: Property Manager Responsibility ->Setup -> Discount Index Rate

2.2 Sub Ledger Accounting Changes

Subledger Accounting Method (SLA) so that create accounting can process the IFRS related Accounting
events and interface the same to General Ledger.

New Accounting events have been seeded to solution accounting for lifecycle of lease. They are:

Booking Event- When Lease is activated first time or Migrated, carrying balances for ROU/Lease Liability
are brought onto the books through this event

Revision Event - All changes to the lease in the form of amendments for Extending life of lease, addition
of new payment terms, reclassification of lease, change in discount rate etc impact ROU/Liability
balances and also the future streams for Interest and Amortizations. This event will capture amounts
from such recalculations

Termination Event - Lease/Payment Term Contraction leads to decrease in ROU/Liability balances and
can also lead to gain/loss from such changes. Future streams and balances need to be negated and
accruals till termination date will need to be calculated.

Accruals- Period end expenses for Lease Expense-FASB and Interest/Amortization for IFRS are generated
at the time of Lease Activation. Transactions for these expenses are however are generated during
accrual process.

AP Invoice - Lease liability is maintained by decreasing it with every Lease Payment(Lease Liability
checked) and adding interest expense to it.

Below slides capture suggested debits and credits over the life of the lease. This accounting is triggered
only after “Transition Process” is completed
For more details on the accounting setup refer metalink note: Whitepaper : Sub Ledger Accounting
Configuration for Property Manager IFRS Accounting (Doc ID 2396463.1)

2.3Transition Setup:

This generate both IFRS16 and ASC842 streams for a lease, identified by regime code. This setup is done
at OU level.

Navigation: Property Manager Responsibility->Setup-> Options-> System Options-> Compliance


Setups

Note: * Need to provide transaction Date

** If GAAP regime is both then we need to provide Primary Regime also

*** Calculation Frequency: Periodical – If customer is using Monthly Calculations

Daily- For Irregular calendars defined in GL like 4-4-5


3. Sample Flow of IFRS Cycle
Creating lease

Payment Terms:

Payment Term Template Details:


Impact of Options in IFRS:

Options feature has been enhanced to include options, which are certain to be exercised from tenant’s
perspective, into the calculations. Payment term information like amounts, start date, escalation
amount, escalation percentage etc have been included to capture information needed for calculations.

Options are used to capture information on “Termination”, “Purchase”, “Renewal” options. This tab is
optional

Finalizing the lease and Schedules and items program get kicked off
Post this Run Generate Lease Details Report to get the ROU Asset Calculation, Lease Liability Calculation
and ROU Balance and Amortization Calculation. This report is divided into 3 parts:

Header: It provides basic lease details and parameters which affect the calculation

Report Body:

Interest and Expense calculation: This part of report shows periodic interest and amortization expense
calculation for the lease. Below is a sample output
Amortization Schedules for lease: This part of the report body shows detailed calculation based on
compliance select for ROU Asset, Lease Liability and Balance calculation for US GAAP and IFRS option.
Below is the sample screenshot:

Now viewing the transaction.

As a part of this enhancement request, a new “Transaction page” has been introduced for the user to
view the different transaction events generated for a particular lease and also to drill down to the
accounting event of each of these transaction types

Navigation: Property Manager Responsibility -> Transactions -> View Transactions

Further checking the transaction details. Click transaction Number value for the details
Similarly using View Journal Button Journal status and event can be checked

Now Authorize the schedules

Navigation: Leases and Documents > Payments > Authorize

Export the lines to GL

Navigation: Leases and Documents > Payments > Export to payables


Running Transfer Normalized Lines to GL

Running Create Accounting


Sample output
4. Technical Changes and details for IFRS
New Tables added:

Source Code Table Name Table details


PN_ACCT_TRX_HEADERS_ALL PNTAB.odf This is a base table which
stores the header details of
view transaction page for a
lease
PN_ACCT_TRX_LINES_ALL PNTAB.odf This is a base table which
stores the line level details of
view transaction page for a
lease. It shows breakdown
for ROU, Liability
PN_LEASE_CHG_DETAILS PNTAB.odf This is a base table which
stores data for the changes
made into the lease, this
table has flag ROU, Liability
flag
PN_LEASE_ACCNT_TEMP PNTAB.odf Contains all the eligible lease
details for calculation and
recalculation
PN_OPTION_PERIODS_ALL PNTAB.odf
PN_OPTION_ITEMS_ALL PNTAB.odf
PN_PMT_ITEM_AMRTZN_ALL PNTAB.odf Contains Amortization
calculation details all the
payment terms and options
eligible for ROU or Liability
Calculations.
PN_PMT_ITEM_AMRTZN_GTT PN_PMT_ITEM_AMR
TZN_GTT.xdf
PN_PMT_ITEM_AMRTZN_HIST PNTAB.odf This table stores the history
of Amortization schedules
and Balance amounts. When
the calculation of streams
and balances program is
executed in FINAL Mode then
data of
PN_PMT_ITEM_AMRTZN_AL
L is loaded into the table.
PN_PMT_ITEM_PV_ALL PNTAB.odf Contains Present Value
calculations for all the
payment terms and options
eligible for ROU or Liability
Calculations.
PN_PMT_ITEM_PV_GTT PN_PMT_ITEM_PV_G
TT.xdf
PN_PMT_ITEM_PV_HIST PNTAB.odf This table stores the history
of PV calculation of ROU,
Liability details. When the
calculation of streams and
balances program is executed
in FINAL Mode then data of
PN_PMT_ITEM_PV_ALL is
loaded into the table.
PN_PMT_ITEM_PV_HST_CRRNCY_CHG PNTAB.odf
PN_PMT_ITEM_PV_STREAM_ALL PNTAB.odf This is a base table which
stores Principal value
calculation for ROU and
Liability stream period wise
PN_PMT_ITM_AMTZ_HST_CRRNCY_CHG PNTAB.odf
PN_INTEREST_INDEX_HEADERS PNTAB.odf This is the base table for
discount rate index created
for calculation of present
value of lease liability and
asset.

PN_INTEREST_INDEX_LINES PNTAB.odf This is the base table for


discount rates created for
discount rate index

PN_LEASE_STREAM_TEMP PNTAB.odf
PN_STREAMS_ALL PNTAB.odf This is a base table which
stores various streams based
on lease change id
PN_STREAM_LINES_ALL PNTAB.odf This is a base table which
stores data based on each
stream id and lease id for
various stream date
5. Objects (Packages) added/modified for IFRS

Source code Package Description

PNARCHVS.pls PN_ARCHIVE Package Spec Delete


existing archive lease data
PNARCHVB.pls PN_ARCHIVE Package Body Delete
existing archive lease data
PNCACBSS.pls PN_ACCNTING_BAL_STREAMS Package Spec Contains logic
for calculation of PV getting
interest rate, checking
eligible leases for
calculation and
recalculation
PNCACBSB.pls PN_ACCNTING_BAL_STREAMS Package Body Contains
logic for calculation of PV
getting interest rate,
checking eligible leases for
calculation and
recalculation
PNCRACCS.pls PN_CREATE_ACC Package Spec This is create
accounting package and
takes care of accounting
PNCRACCB.pls PN_CREATE_ACC Package Body This is create
accounting package and
takes care of accounting
PNGENTRXS.pls PN_LEASE_TRX_PKG Package Spec This package
is to generate PN
transaction
PNGENTRXB.pls PN_LEASE_TRX_PKG Package Body This package
is to generate PN
transaction
PNIIHPKS.pls pn_interest_index_header_pkg Package Spec This script
inserts updates PN Interest
PNIIHPKB.pls pn_interest_index_header_pkg Package Body This script
inserts updates PN Interest
PNIILPKS.pls pn_interest_index_line_pkg Package Spec This package
contains script for inserting,
updating and deleting line
level data of PN interest
PNIILPKB.pls pn_interest_index_line_pkg Package Body This package
contains script for inserting,
updating and deleting line
level data of PN interest
PNIIPUBS.pls PN_INTEREST_INDEX_PUB Package Spec This package
contains code to create and
update interest index in PN
PNIIPUBB.pls PN_INTEREST_INDEX_PUB Package Body This package
contains code to create and
update interest index in PN
PNIIPVTS.pls pn_interest_index_pvt Package Spec Private API to
create and update interest
index
PNIIPVTB.pls pn_interest_index_pvt Package Body Private API to
create and update interest
index
PNINAMTS.pls pn_index_amount_pkg Package Spec This is one of
a major package in PN. It
contains various logic and
functionality like call for
schedule and Item,
normalization calculation
etc. For IFRS this contains
logic for ROU Asset and
Liability calculation
PNINAMTB.pls pn_index_amount_pkg Package Body This is one of
a major package in PN. It
contains various logic and
functionality like call for
schedule and Item,
normalization calculation
etc. For IFRS this contains
logic for ROU Asset and
Liability calculation
PNINRPRS.pls pn_index_rent_periods_pkg Package Spec This package
has ROU and Liability flag
columns are part of
Aggregation, New payment
terms inherit values thru
aggregation or from
payment term template for
IFRS changes
PNINRPRB.pls pn_index_rent_periods_pkg Package Body This package
has ROU and Liability flag
columns are part of
Aggregation, New payment
terms inherit values thru
aggregation or from
payment term template for
IFRS changes
PNLCHGDS.pls pn_lease_change_details_pkg Package Spec This is a new
package created for IFRS to
insert data in
pn_lease_chg_details
PNLCHGDB.pls pn_lease_change_details_pkg Package Body This is a new
package created for IFRS to
insert data in
pn_lease_chg_details
PNLEASETRXS.pls pn_transaction_util Package Spec This is a new
public package added for
PN transaction
PNLEASETRXB.pls pn_transaction_util Package Body This is a new
public package added for
PN transaction
PNLSPUBB.pls pn_lease_pub Package Body This is lease
creation public API and is
called when lease is created
PNLSPVTS.pls Pn_Lease_Pvt Package Spec This is a
Private lease creation API
called by pn_lease_pub
PNLSPVTB.pls Pn_Lease_Pvt Package Body This is a
Private lease creation API
called by pn_lease_pub
PNLSUTLS.pls PN_LEASE_UTILS Package Spec This is a lease
creation and updating
utility package
PNLSUTLB.pls PN_LEASE_UTILS Package Body This is a lease
creation and updating
utility package
PNSCHITS.pls pn_schedules_items Package Spec This is an
existing public package
which generates Schedules
and Items for Terms. It
generates both Cash and
Normalized Items.
PNSCHITB.pls pn_schedules_items Package Body This is an
existing public package
which generates Schedules
and Items for Terms. It
generates both Cash and
Normalized Items.
PNSTREAMS.pls pn_streams_calculation Package Spec This is a
newly added package for
IFRS enhancement and
generates streams of ROU,
Liability, Cash, Interest,
Amortization and lease
expense
PNSTREAMB.pls pn_streams_calculation Package Body This is a
newly added package for
IFRS enhancement and
generates streams of ROU,
Liability, Cash, Interest,
Amortization and lease
expense
PNSTRMUTLS.pls pn_streams_util Package Spec This is a
newly added package for
IFRS enhancement and is
util package for Streams
PNSTRMUTLB.pls pn_streams_util Package Body This is a
newly added package for
IFRS enhancement and is
util package for Streams
PNSYSPUBS.pls Pn_System_Pub Package Spec This is a
newly added code for IFRS
requirement
PNSYSPUBB.pls Pn_System_Pub Package Body This is a
newly added code for IFRS
requirement. This code
checks whether transition
balances calculated or not
PNTLCHGS.pls pn_lease_changes_pkg Package Spec This is an
existing package which is
table handler for
PN_LEASE_CHANGES
PNTLCHGB.pls pn_lease_changes_pkg Package Body This is an
existing package which is
table handler for
PN_LEASE_CHANGES. It has
been modified as per IFRS
Enhancement to include
parameter accounting
method, adder rate, index
rate
PNTRBALS.pls pn_accnting_bal_trans_dt Package Spec This program
generates streams,
transaction and events for
transition date balances
PNTRBALB.pls pn_accnting_bal_trans_dt Package Body This program
generates streams,
transaction and events for
transition date balances
PNTTRMTS.pls pn_term_templates_pkg Package Spec This program
is table handler for
PN_TERM_TEMPLATES.
PNTTRMTB.pls pn_term_templates_pkg Package Body This program
is table handler for
PN_TERM_TEMPLATES.
Added fields rou_asset_flag
and liability_flag
PNTXPMTS.pls pn_exp_to_ap Package Spec This package
loads PNs Invoice details
into APs Interface Tables
PNTXPMTB.pls pn_exp_to_ap Package Body This package
loads PNs Invoice details
into APs Interface Tables.
For IFRS added code to
interface ROU Asset and
Liability Flag to AP interface
tables
PNUPGLSS.pls PN_UPGRADE_LEASE Package Spec This is a new
package added as part of
IFRS enhancement
requirement and contains
code to upgrade PN leases
to make eligible for ROU
asset and liability balance
calculations
PNUPGLSB.pls PN_UPGRADE_LEASE Package Body This is a new
package added as part of
IFRS enhancement
requirement and contains
code to upgrade PN leases
to make eligible for ROU
asset and liability balance
calculations
PNXLACCEVENTS.pls Pn_Xla_Accounting_Events Package Spec This is a
newly added package for
Create Accounting Events
for the transitions
PNXLACCEVENTB.pls Pn_Xla_Accounting_Events Package Body This is a
newly added package for
Create Accounting Events
for the transitions
PN_RENT_ROLL_LEASE_EXP_ITF_X PN_RENT_ROLL_LEASE_EXP_ITF_X This is a trigger added on
1.sql 1.sql table
PN_RENT_ROLL_LEASE_EXP
_ITF
pnupgclc.sql pnupgclc.sql This is the upgrade script
for PN IFRS ER

5.1 Details of packages

PNARCHVS.pls and PNARCHVB.pls

Deletes existing data and is called by lease archive program for the given date range.

DELETE_ARCHIVE_LEASE_DATA : Deletes data from PN_LEASES_HIST, PN_LEASE_DETAILS_HIST,


PN_PAYMENT_TERMS_HIST, PN_PAYMENT_SCHEDULES_HIST and PN_PAYMENT_ITEMS_HIST.

ARCHIVE_LEASE_ACCNTING_DATA: This procedure is used to archive lease and accounting data. It


inserts data into PN_LEASES_HIST, PN_LEASE_DETAILS_HIST, PN_PAYMENT_TERMS_HIST,
PN_PAYMENT_SCHEDULES_HIST, PN_PAYMENT_ITEMS_HIST, PN_OPTIONS_HIST,
PN_OPTION_PERIODS_HIST, PN_OPTION_ITEMS_HIST, PN_PMT_ITEM_PV_HIST,
PN_PMT_ITEM_AMRTZN_HIST

PNCACBSS.pls and PNCACBSB.pls

This package has various functions to get commencement date, interest rate, calculate PV, calculation
logic to full period or partial period, to check all eligible leases for calculation, generate amortization
schedule and calculation of ROU balance, Liability Balance and amortization amount for each period.

Function/procedure to fetch data: get_all_eligible_leases ,get_rate ,


get_days,get_change_commencement_Date , get_cash_items_recalc_lease
,get_all_leases_with_new_terms, get_all_eligible_recalc_leases , GET_CUM_EXP_AMT
,get_cash_items_new_Terms, get_cash_items, get_accounted_amount, GET_INTEREST_RATE

Function procedure for calculation: CALCULATE_PV , gen_amrtzn_schdls


,gen_amrtzn_schdls_new_Terms, gen_amrtzn_schdls_recalc_lease, calc_full_partial_amounts.

PNCRACCS.pls and PNCRACCB.pls

This is the create accounting package and has various functions and procedures to logic to Normalization
accounting ROU and Liability account, logic for accrual process

Function/procedure to fetch data: get_period_info, get_pn_period_status, get_valid_gl_date,

Function procedure for processing data: distribute_amount – inserts data into


pn_payment_item_dist_all, generate_accrual – calls pn_xla_accounting_events to generate xl
accounting events, CREATE_AP_ACC_R12 – sets transferred_to_ap_flag in PN_PAYMENT_ITEMS and set
transfer related details in PN_PAYMENT_SCHEDULES.
CREATE_AR_ACC_R12- sets transferred_to_ar_flag in PN_PAYMENT_ITEMS and set transfer related
details in PN_PAYMENT_SCHEDULES.

PNGENTRXS.pls and PNGENTRXB.pls

This package contains function and procedure to generation PN transactions

Function/procedure to fetch data: get_transaction_number – uses sequence pn_acct_trx_number_s to


generate transaction number, get_regime_code fetches regime code from
PN_SYSTEM_SETUP_OPTIONS, get_stream_amount- fetches stream amount for various transaction type
like Booking, Revision, Termination ,

Function procedure for processing data: reverse_accural_trx – sets transaction to Reversed for
transaction type Accural when transaction status is in Processed or Unprocessed Status,
generate_transaction- inserts data into pn_acct_trx_headers_all, pn_acct_trx_lines_all and updates
pn_stream_lines_all based on transaction type , generate_accrual_trx- inserts data into
pn_acct_trx_headers_all, pn_acct_trx_lines_all for Accrual Transaction.

PNIIHPKS.pls and PNIIHPKB.pls

This script inserts updates PN Interest. Using pn_interest_index_headers_s sequence it inserts and
updates data into PN_INTEREST_INDEX_HEADERS

PNIILPKS.pls and PNIILPKB.pls

This script inserts updates PN Interest. It inserts and updates data into PN_INTEREST_INDEX_LINES

PNIIPUBS.pls and PNIIPUBB.pls

Contains procedure CREATE_INTEREST_INDEX and UPDATE_INTEREST_INDEX to and calls


PN_INTEREST_INDEX_PVT API to create and update interest Index

PNINAMTS.pls and PNINAMTB.pls

With respect to IFRS it contains logic for ROU Asset and Liability Calculation

create_payment_term_record - rou asset, liability flag logic added to pn_payment_terms_all and calls
pnt_payment_terms_pkg to insert data when schedule and item program is run.
PNINRPRS.pls and PNINRPRB.pls

This package basically contains procedures used to maintain index rent periods. For IFRS it has included
the logic for ROU and Liability flag columns are part of Aggregation, New payment terms inherit values
thru aggregation or from payment term template .Procedure recalc_ot_payment_terms calls
pn_index_amount_pkg to create payment term and has amended the logic for calculation based on flag
ROU asset and liability flag value

PNLCHGDS.pls and PNLCHGDB.pls

This is a newly created package and it inserts data into pn_lease_chg_details table for lease changes

PNLEASETRXS.pls and PNLEASETRXB.pls

This is a newly created package and has various functions and procedures to fetch details like
get_accounting_status, get_lease_status, get_transition_date, get_lease_liability, get_change_date,
get_transaction_ledger and get_duration

PNLSPUBB.pls

For IFRS enhancement logic is added for accounting method and Discount rate index to be included as
part of lease during lease addition before calling pn_lease_pvt API to create lease. Here for
remeasurement (relinking terms) create_remeasurement_term procedure has been introduced as part
of IFRS. If remeasurement has been done using relinking then at pn_payment_terms_all and for the
newly created term via relinking source_payment_term_id filed will be populated with the
payment_term_id of enddated payment_term_id

PNLSPVTS.pls and PNLSPVTB.pls

Code added to accommodate accounting method, discount interest rate and adder rate in lease create,
edit and amend code and similarly for payment term create and update call added ROU Asset , Liability
and Report Inception Flag

PNLSUTLS.pls and PNLSUTLB.pls

This is an existing utility package for lease creation and updation in PN. It has procedure
GET_DISCOUNT_RATE_INDEX_ID added to validate discount rate index and return discount rate Index
id as part of IFRS changes

PNSTREAMS.pls and PNSTREAMB.pls


This is a newly added package for IFRS enhancement and it has code to generate streams of ROU,
Liability, Cash, Interest, Amortization and lease expense

Function/procedure to fetch data: get_last_run_date- checks last run date from pn_streams_all,
get_transition_date – checks transition date from pn_system_setup_options, get_end_bal – checks
pn_streams_all and pn_stream_lines_all for amount based on stream id and regime ,
get_period_amount checks pn_streams_all and pn_stream_lines_all for amount for a period,
get_change_commencement_date – checks pn_lease_changes_all toc ehck for any changes done via
Amend get_last_calc_balances- checks beginning balance for stream ROU and liability ,
get_cum_exp_amt checks cumulative expense for a given term and table used is
pn_stream_cash_last_ver, get_cash_items – finds the cash items generated for the eligible leases and
calculate present value for ROU , Liability amounts for each payment amount,
get_cash_items_recalc_lease- finds eligible leases for recalculation

Function procedure for calculating/processing data: calc_full_partial_amounts- Procedure to find


amounts for full periods and for partial periods, Normalization amounts calculation logic is used here,
gen_amrtzn_schdls-generate amortization schedule and calcaultes ROU Balance, Liability Balance and
amortization schedule period wise, gen_amrtzn_schdls_recalc_lease- generate amortization schedule
and calcaultes ROU Balance, Liability Balance and amortization schedule for leases selected for
recalculation, generate_termination_streams, generate_termination_streams- generates termination
stream for cases where termination date <=Sysdate, generate_streams – inserts data into
pn_pmt_item_pv_stream_all

PNTRBALS.pls and PNTRBALB.pls

This Package contains function and procedure to generates streams, transaction and events for
transition date balances. It has calls for pn_streams_calculation , pn_lease_trx_pkg and
pn_xla_accounting_events and it calculates and upload portfolio balance as on date.

PNUPGLSS.pls and PNUPGLSB.pls

This package contains the PL/SQL procedures that should be able to upgrade leases in Oracle Property
Manager to make eligible for ROU asset and liability balance calculations. This package has checks if the
lease is an expense lease, checks lease level attributes, validates accounting method , discount rate
index and updates pn_leases_all and PN_LEASES_HIST table accordingly .

PNXLACCEVENTS.pls and PNXLACCEVENTB.pls

This package contains function and procedure for creating Create Accounting Events for the transitions.
Create_Xla_Acc_Event creates SLA events for all transition which are in unprocessed status.
pnupgclc.sql

19.1 This is the upgrade script for PN IFRS ER. Calculations data will be deleted if any term/option with
payment currency different from functional currency. This script is expected to be executed only once
when the IFRS Patch is applied. It will executed as part of the patch application
5.2 Source Code to Capture Lease change events

Source code Package Description

PNTLEASE.pld Call appropriate package to insert


lease change detail.

PNTPYTRS.pls PNT_PAYMENT_TERMS_PKG Insert lease change detail for


payment term change
PNTPYTRB.pls PNT_PAYMENT_TERMS_PKG
PNTOPTNB.pls PN_OPTIONS_PKG Insert lease change detail for
payment term change(ROU,
Liability)
PNTOPTNS.pls PN_OPTIONS_PKG
PNLCHGDB.pls pn_lease_change_details_pkg Insert lease change detail for lease
header amendment
PNLCHGDS.pls pn_lease_change_details_pkg

1.PNTLEASE.pld

in PNTLEASE_AMLEASE_THR.Insert_Row, insert lease change detail to capture accounting method and


rate index change event .

changes in the above call is as below to insert accounting method, adder rate and index discount rate

x_change_accounting_method => NAME_IN('amlease_blk.change_accounting_method')

,x_change_adder_rate => NAME_IN('amlease_blk.change_adder_rate')

,x_change_rate_index_id =>
NAME_IN('amlease_blk.change_discount_rate_index_id')

in PNTLEASE_AMLSDTL_THR.UPDATE_ROW, insert lease change detail to capture event renewal,


termination before, termination after, termination current.

Here code is checking for condition for lease termination and based on that it is calling
PN_LEASE_CHANGE_DETAILS_PKG.INSERT_ROW

Below are the conditions

IF trunc(l_leaseTerminationdate) > trunc(l_old_termination_date) AND l_leaseTerminationdate >=


trunc(SYSDATE) THEN

l_change_event := 'RENEWAL';

l_change_type := 'REVISION';
ELSIF SYSDATE < trunc(l_leaseTerminationdate) AND trunc(l_old_termination_date) >
l_leaseTerminationdate THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_AFTER';

ELSIF trunc(l_leaseTerminationdate) = trunc(SYSDATE) AND trunc(l_old_termination_date) >


l_leaseTerminationdate THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_CURRENT';

ELSIF trunc(l_leaseTerminationdate) < trunc(SYSDATE) AND trunc(l_old_termination_date) >


l_leaseTerminationdate THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_BEFORE';

END IF;

1.1 IN PNTLEASE_PAYMENT_THR.UPDATE_ROW, insert lease change detail to capture event of terms


with source ML_ABS.

1.2 For Scenario rate index id change and accounting method change

Here code also checks for lease options


l_lease_option_context := pntlease_context_cpg.lease_option_context;

IF l_lease_option_context IS NULL THEN

pntlease_wblease_cpg.handle_lease_status(event);

END IF;

l_lease_option_context := pntlease_context_cpg.lease_option_context;

l_org_id := NAME_IN('WBLEASE_FDR_BLK.org_id');

IF l_lease_option_context IS NOT NULL THEN

pn_options_periods_items.options_items

p_errbuf => l_errbuf,

p_retcode => l_retcode,

p_lease_id => l_leaseId,


p_lease_context => l_lease_option_context,

p_org_id => l_org_id

);

END IF;

PNTLEASE_CPG.EVENT

On-commit trigger

Check if lease change detail only have rate index id change and accounting method change, if yes, start
the stream and transaction generation.

2. PNTPYTRS.pls and PNTPYTRB.pls

2.1 Add insert into pn_lease_chg_details for IFRS changes

2.2 Modify procedure INSERT_ROW and Update_ROW to insert record into table
PN_LEASE_CHG_DETAILS

a. For below condition check insert is done in pn_lease_chg_details


l_apprvlStatus := PNP_UTIL_FUNC.GET_LEASE_STATUS (X_LEASE_ID);

IF l_apprvlStatus = 'F' THEN

IF x_source_code = 'ML_ABS' THEN

l_change_type := 'BOOKING';

l_change_event := 'BOOKING';

ELSIF x_source_code IN ('ML_AMD','ML_EDT') THEN

l_change_type := 'REVISION';

l_change_event := 'ADD_TERM';

END IF;

For updating the pn_lease_chg_details table system checks for below condition

l_apprvlStatus := PNP_UTIL_FUNC.GET_LEASE_STATUS (X_LEASE_ID);

IF l_apprvlStatus = 'F' and x_source_code <> 'ML_ABS' THEN

IF trunc(X_END_DATE) > l_end_date AND l_end_date >= trunc(SYSDATE) THEN

l_change_event := 'RENEWAL';

l_change_type := 'REVISION';

ELSIF SYSDATE < trunc(X_END_DATE) AND trunc(X_END_DATE) < l_end_date THEN


l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_AFTER';

ELSIF trunc(X_END_DATE) = trunc(SYSDATE) AND trunc(X_END_DATE) < l_end_date THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_CURRENT';

ELSIF trunc(X_END_DATE) < trunc(SYSDATE) AND trunc(X_END_DATE) < l_end_date THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_BEFORE';

END IF;

END IF;

Here if change type is not null insert/update takes place in the table

PNTOPTNS.pls and PNTOPTNB.pls

Modified the code INSERT_ROW and Update_ROW to insert record into table PN_LEASE_CHG_DETAILS

Condition checked by system to insert row:


l_apprvlStatus := PNP_UTIL_FUNC.GET_LEASE_STATUS (X_LEASE_ID);

IF l_apprvlStatus = 'F' THEN

IF x_source_code in ('ED','AM') THEN

l_change_type := 'REVISION';

l_change_event := 'ADD_OPTION';

ELSE

l_change_type := 'BOOKING';

l_change_event := 'BOOKING';

END IF;

Condition checked by system to update the row:


if x_source_code IN ('ED','AM') THEN

IF recInfoForHist.expiration_date > x_expiration_date AND

x_expiration_date > SYSDATE THEN

l_change_type := 'TERMINATION';
l_change_event := 'TERMINATION_AFTER';

ELSIF recInfoForHist.expiration_date < x_expiration_date THEN

l_change_event := 'RENEWAL';

l_change_type := 'REVISION';

ELSIF recInfoForHist.expiration_date > x_expiration_date AND

x_expiration_date = SYSDATE THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_CURRENT';

ELSIF recInfoForHist.expiration_date > x_expiration_date AND

x_expiration_date < SYSDATE THEN

l_change_type := 'TERMINATION';

l_change_event := 'TERMINATION_BEFORE';

END IF;

ELSE

l_change_event := 'BOOKING';

l_change_type := 'BOOKING';

END IF;

Based on above condition code updates pn_options_all

Here if change type is not null insert takes place in the table PN_LEASE_CHG_DETAILS

3.PNLCHGDS.pls and PNLCHGDB.pls

3.1. This package updates and Insert Records in table pn_lease_chg_details for each lease change id
6.Reports for IFRS and its technical details

Source code Package Description

PNLSPFRS.pls Pn_Lease_Portfolio_Reports Package Spec for portfolio Summary


and detail report

PNLSPFRB.pls Pn_Lease_Portfolio_Reports Package Body for Portfolio Summary


and detail report
PNGLDR_XML.xml This is data structure file for
Generate Lease Detail Report
PNGLDR_XML.rtf This is template file for Generate
Lease Detail Report
PNGPSR_XML.xml This is data structure file for
Portfolio Summary Report
PNGPSR_XML.rtf This is template file for Generate
Portfolio Summary Report
PNGPDR_XML.xml This is data structure file for
Portfolio Detail Report
PNGPDR_XML.rtf This is template file for Generate
Portfolio Detail Report
PNLAR_XML.xml This is data structure file for Lease
Analysis Report
PNLAR_XML.rtf This is template file Lease Analysis
Report

6.1 Portfolio Summary & Portfolio Detail report

Package used PNLSPFRB.pls. This package is used in XML publisher Data Definitions to generate
Portfolio Summary and Portfolio Detail report. Function INIT_REPORT_DATA is used to populate data in
global temporary table PN_LEASE_REPORTS_DATA_GTT to be used in Portfolio Summary and Portfolio
Detail reports. Global Temporary tables used are Pn_Leases_Gtt and Pn_Lease_Details_Gtt ,
Pn_Lease_Reports_Data_Gtt and Pn_Payment_Items_Gtt. Sample Output for the report.

Portfolio Summary Report

This is a xml report where data template containing sqls is coded in xml. Here header level data is picked
from table pn_leases_all, hr_operating_units, pn_system_setup_options, gl_sets_of_books,
xle_entity_profiles , xle_registrations and pn_interest_index_lines
The body part of the report picks data from GTT tables pn_lease_reports_data_gtt which uses select
from view pn_pmt_item_amrtzn_stream_v , pn_pmt_item_amrtzn_stream_v and pn_leases_all and
pn_amendment_report_gtt which selects data from Pn_Lease_Changes_All , Pn_Leases_Gtt ,
Pn_Lease_Details_Gtt, Pn_Lease_Details_Hist, Pn_Payment_Terms_Gtt and Pn_Payment_Terms_All
where data is inserted by package pn_lease_portfolio_reports. Internally report calls
pn_lease_portfolio_reports.init_report_data for report data population

Portfolio Detail Report

This is a xml report where data template containing sqls is coded in xml. Here header level data is picked
from table pn_leases_all, hr_operating_units, pn_system_setup_options, gl_sets_of_books,
xle_entity_profiles , xle_registrations and pn_interest_index_lines

The body part of the report picks data from GTT tables pn_lease_reports_data_gtt which uses select
from view pn_pmt_item_amrtzn_stream_v , pn_pmt_item_amrtzn_stream_v and pn_leases_all and
pn_amendment_report_gtt which selects data from Pn_Lease_Changes_All , Pn_Leases_Gtt ,
Pn_Lease_Details_Gtt, Pn_Lease_Details_Hist, Pn_Payment_Terms_Gtt and Pn_Payment_Terms_All
where data is inserted by package pn_lease_portfolio_reports. Internally report calls
pn_lease_portfolio_reports.init_report_data for report data population
6.2 Lease Analysis Report

This report shows the lease liability balances both undiscounted as well as discounted amount based
on the lease / Payment term duration..It calls package pn_transaction_util various functions like
get_lease_liability, get_liability_more to generate report data based on the parameters passed

This is a xml report where data template containing sqls is coded in xml. Here header level data is picked
from table pn_leases_all, hr_operating_units, pn_system_setup_options, gl_sets_of_books,
xle_entity_profiles , xle_registrations and pn_interest_index_lines

The body part of the report picks data from pn_leases_all, pn_lease_details_all, fnd_lookups,
pn_payment_terms_all and calls pkg code pn_transaction_util. get_lease_liability and
pn_transaction_util. get_liability_more to fetch data.
6.3 Generate Lease Details Report

This report provides the balances for a particular selected lease “As of” date. This report is
complimented with detailed amortization schedules which explain the basis of calculations of these
balances. It runs based on various sql to select period wise IFRS and US GAAP liability and ROU
calculations.

This is a xml report where data template containing sqls is coded in xml .Here header level data is picked
from pn_leases_all, hr_operating_units, pn_system_setup_options, gl_sets_of_books,
xle_entity_profiles and pn_interest_index_lines

The body part of the report picks data from various tables/views like pn_options_all,
pn_pmt_item_pv_all, pn_pmt_item_amrtzn_all , pn_pmt_item_amrtzn_stream_v ,
pn_payment_terms_all , fnd_lookups ,and internally calls package pn_accnting_bal_streams

Sample Output:
7.Technical Flow for code from lease creation

PN_LEASES_PKG

Procedure: Insert_row(Added parameter x_accounting_method, x_adder_rate and


x_discount_rate_index_id) Inserts data into pn_leases_all and pn_lease_chg_details

PN_LEASE_CHANGES_PKG

Insert_Row (Added parameter x_accounting_method, x_adder_rate and x_discount_rate_index_id)


Inserts data into pn_lease_transactions_all, PN_LEASE_DETAILS_ALL and pn_lease_changes_all.

If Option Tab has values:

PN_OPTIONS_PERIODS_ITEMS

create_cash_items: Inserts data into pn_option_items_all, insert_period inserts data into


PN_OPTION_PERIODS_ALL for periods generated.

PN_SCHEDULES_ITEMS : Inserts and update data into pn_payment_terms_all,


pn_payment_schedules_all, pn_payment_items_all calls pn_streams_calculation(New objects added for
IFRS enchancement) before kicking of schedules and item concurrent program.

PN_STREAMS_CALCULATION: inserts data into pn_pmt_item_pv_gtt, pn_pmt_item_amrtzn_gtt(for


calculation purpose), pn_streams_all, pn_stream_lines_all, pn_pmt_item_pv_stream_all.

Calls PN_LEASE_TRX_PKG which create transactions and inserts data into pn_acct_trx_headers_all and
pn_acct_trx_lines_all

Creates normalize items and Calls PN_NORM_RENORM_PKG if normalization is used which insert an
updates pn_payment_items_all.

Exporting to AP

Calls package pn_exp_to_ap inserts data into ap_invoices_interface and ap_invoice_lines_interface

Transferring normalize lines to GL

Calls PN_CREATE_ACC which internally calls function procedure like get_valid_gl_date, get_period_info,
get_pn_period_status and get_valid_gl_date.

Calls Pn_Xla_Accounting_Events to create xla accounting event and calls xla_events_pub_pkg which
updates Pn_Acct_Trx_Headers_All and calls xla_events_pub_pkg to create xla events for all transition
8. ER Diagram for the Data Flow

You might also like