DBA Data[Home] [Help]

APPS.LNS_CUSTOM_PUB dependencies on LNS_FINANCIALS

Line 100: l_loan_details LNS_FINANCIALS.LOAN_DETAILS_REC;

96: l_msg_count NUMBER;
97: l_msg_data VARCHAR2(2000);
98: l_return_Status VARCHAR2(1);
99: l_last_installment_billed NUMBER;
100: l_loan_details LNS_FINANCIALS.LOAN_DETAILS_REC;
101: l_customized varchar2(1);
102: l_loan_header_rec LNS_LOAN_HEADER_PUB.LOAN_HEADER_REC_TYPE;
103: l_object_version number;
104: l_skip_update boolean;

Line 417: l_custom_tbl(1).installment_begin_balance := lns_financials.getRemainingBalance(p_loan_id);

413: --l_orig_fees_tbl.delete;
414: l_fee_amount := 0;
415:
416: end if;
417: l_custom_tbl(1).installment_begin_balance := lns_financials.getRemainingBalance(p_loan_id);
418:
419: for k in 1..l_custom_tbl.count
420: loop
421: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, 'custom_schedule_id: ' || l_custom_tbl(k).custom_schedule_id);

Line 694: l_custom_tbl2(1).installment_begin_balance := lns_financials.getRemainingBalance(p_loan_id);

690: RAISE FND_API.G_EXC_ERROR;
691: end if;
692:
693: -- now we've passed validation initialize loan_begin_balance to calculate balances
694: l_custom_tbl2(1).installment_begin_balance := lns_financials.getRemainingBalance(p_loan_id);
695:
696: for k in 1..l_custom_tbl.count
697: loop
698:

Line 791: l_loan_details LNS_FINANCIALS.LOAN_DETAILS_REC;

787: l_return_Status VARCHAR2(1);
788: l_date DATE;
789: l_api_name varchar2(35);
790: l_cust_tbl custom_tbl;
791: l_loan_details LNS_FINANCIALS.LOAN_DETAILS_REC;
792:
793: Begin
794: l_api_name := 'validateCustomTable';
795: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - Begin');

Line 802: l_loan_details := lns_financials.getLoanDetails(p_loan_id => p_loan_id

798: -- only if this is an UPDATE
799: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, 'validate customtbl begin');
800: l_cust_tbl := p_cust_tbl;
801:
802: l_loan_details := lns_financials.getLoanDetails(p_loan_id => p_loan_id
803: ,p_based_on_terms => 'CURRENT'
804: ,p_phase => 'TERM');
805: l_count := 0;
806: l_amount := 0;

Line 852: if l_cust_tbl(1).installment_begin_balance <> lns_financials.getRemainingBalance(p_loan_id) then

848: if i = 1 then
849: -- check that first row in custom table is = remainingBalance
850: -- CHECK THIS WITH KARTHIK
851: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, 'check balance');
852: if l_cust_tbl(1).installment_begin_balance <> lns_financials.getRemainingBalance(p_loan_id) then
853: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, 'balance incorrect');
854: FND_MESSAGE.Set_Name('LNS', 'LNS_BEGIN_BALANCE_INCORRECT');
855: FND_MSG_PUB.Add;
856: RAISE FND_API.G_EXC_ERROR;

Line 1313: procedure synchRateSchedule(p_rate_tbl IN OUT NOCOPY LNS_FINANCIALS.RATE_SCHEDULE_TBL, p_num_installments in number)

1309:
1310: /*
1311: This procedure synchs rate schedule with new number of installments in memory only, no changes to db
1312: */
1313: procedure synchRateSchedule(p_rate_tbl IN OUT NOCOPY LNS_FINANCIALS.RATE_SCHEDULE_TBL, p_num_installments in number)
1314:
1315: is
1316:
1317: /*-----------------------------------------------------------------------+

Line 1326: l_rate_tbl LNS_FINANCIALS.RATE_SCHEDULE_TBL;

1322: l_RATE number;
1323: l_BEGIN_INSTALLMENT number;
1324: l_END_INSTALLMENT number;
1325: i number;
1326: l_rate_tbl LNS_FINANCIALS.RATE_SCHEDULE_TBL;
1327:
1328: /*-----------------------------------------------------------------------+
1329: | Cursor Declarations |
1330: +-----------------------------------------------------------------------*/

Line 1441: ,lns_financials.getRemainingBalance(p_loan_id)

1437: ,t.amortization_frequency
1438: ,t.loan_payment_frequency
1439: ,trunc(h.loan_start_date)
1440: ,h.funded_amount
1441: ,lns_financials.getRemainingBalance(p_loan_id)
1442: ,trunc(h.loan_maturity_date)
1443: ,decode(p_based_on_terms, 'CURRENT', LNS_BILLING_UTIL_PUB.LAST_PAYMENT_NUMBER(p_loan_id), 0)
1444: -- ,decode(p_based_on_terms, 'CURRENT', LNS_BILLING_UTIL_PUB.LAST_PAYMENT_NUMBER_EXT(p_loan_id), -1)
1445: ,decode(nvl(t.day_count_method, 'PERIODIC30_360'), 'PERIODIC30_360', '30/360', t.day_count_method)

Line 1654: l_amort_tbl LNS_FINANCIALS.AMORTIZATION_TBL;

1650:
1651: l_loan_details LNS_CUSTOM_PUB.LOAN_DETAILS_REC;
1652: l_custom_tbl LNS_CUSTOM_PUB.CUSTOM_TBL;
1653: l_temp_row LNS_CUSTOM_PUB.custom_sched_type;
1654: l_amort_tbl LNS_FINANCIALS.AMORTIZATION_TBL;
1655: i number;
1656: j number;
1657:
1658: /*-----------------------------------------------------------------------+

Line 1732: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Calling LNS_FINANCIALS.runAmortization...');

1728: (l_loan_details.CUSTOM_SCHEDULE = 'Y' and l_loan_details.loan_status <> 'INCOMPLETE' and
1729: p_based_on_terms <> 'CURRENT' and l_loan_details.ORIG_PAY_CALC_METHOD is not null))
1730: then
1731:
1732: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Calling LNS_FINANCIALS.runAmortization...');
1733: LNS_FINANCIALS.runAmortization(
1734: P_API_VERSION => 1.0,
1735: P_INIT_MSG_LIST => FND_API.G_TRUE,
1736: P_COMMIT => FND_API.G_FALSE,

Line 1733: LNS_FINANCIALS.runAmortization(

1729: p_based_on_terms <> 'CURRENT' and l_loan_details.ORIG_PAY_CALC_METHOD is not null))
1730: then
1731:
1732: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Calling LNS_FINANCIALS.runAmortization...');
1733: LNS_FINANCIALS.runAmortization(
1734: P_API_VERSION => 1.0,
1735: P_INIT_MSG_LIST => FND_API.G_TRUE,
1736: P_COMMIT => FND_API.G_FALSE,
1737: P_LOAN_ID => P_LOAN_ID,

Line 1748: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Schedule from LNS_FINANCIALS.runAmortization:');

1744: IF l_return_status <> 'S' THEN
1745: RAISE FND_API.G_EXC_ERROR;
1746: END IF;
1747:
1748: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Schedule from LNS_FINANCIALS.runAmortization:');
1749: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'PN DD PRIN LP INT LI FEE OTH ID');
1750: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, '--- -------- ------- -- ------- -- ----- ----- ------');
1751:
1752: j := 0;

Line 1913: l_rate_tbl LNS_FINANCIALS.RATE_SCHEDULE_TBL;

1909:
1910: l_loan_details LNS_CUSTOM_PUB.LOAN_DETAILS_REC;
1911: l_custom_tbl LNS_CUSTOM_PUB.CUSTOM_TBL;
1912: l_temp_row LNS_CUSTOM_PUB.custom_sched_type;
1913: l_rate_tbl LNS_FINANCIALS.RATE_SCHEDULE_TBL;
1914: l_rate_details LNS_FINANCIALS.INTEREST_RATE_REC;
1915:
1916: l_compound_freq varchar2(30);
1917: l_remaining_balance_actual number;

Line 1914: l_rate_details LNS_FINANCIALS.INTEREST_RATE_REC;

1910: l_loan_details LNS_CUSTOM_PUB.LOAN_DETAILS_REC;
1911: l_custom_tbl LNS_CUSTOM_PUB.CUSTOM_TBL;
1912: l_temp_row LNS_CUSTOM_PUB.custom_sched_type;
1913: l_rate_tbl LNS_FINANCIALS.RATE_SCHEDULE_TBL;
1914: l_rate_details LNS_FINANCIALS.INTEREST_RATE_REC;
1915:
1916: l_compound_freq varchar2(30);
1917: l_remaining_balance_actual number;
1918: l_remaining_balance_theory number;

Line 2211: l_rate_tbl := lns_financials.getRateSchedule(p_loan_id, 'TERM');

2207: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Number of unlocked principals: ' || l_num_unlocked_prin);
2208: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Sum of locked principals: ' || l_locked_prin);
2209:
2210: -- get rate schedule
2211: l_rate_tbl := lns_financials.getRateSchedule(p_loan_id, 'TERM');
2212:
2213: -- synch rate schedule with current custom schedule
2214: l_num_installments := l_custom_tbl(l_custom_tbl.count).PAYMENT_NUMBER;
2215: synchRateSchedule(l_rate_tbl, l_num_installments);

Line 2264: l_rate_details := lns_financials.getRateDetails(p_installment => l_custom_tbl(i).PAYMENT_NUMBER

2260: l_custom_tbl(i).PERIOD_START_DATE := l_period_begin_date;
2261: l_custom_tbl(i).PERIOD_END_DATE := l_period_end_date;
2262:
2263: -- get rate
2264: l_rate_details := lns_financials.getRateDetails(p_installment => l_custom_tbl(i).PAYMENT_NUMBER
2265: ,p_rate_tbl => l_rate_tbl);
2266: if l_loan_details.rate_type = 'FIXED' OR (l_loan_details.rate_type = 'VARIABLE' and l_rate_details.floating_flag = 'N') then
2267:
2268: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'FIXED OR NOT FLOATING ');

Line 2321: l_annualized_rate := lns_financials.calculateInterestRate(

2317: l_raw_rate := l_rate_details.ANNUAL_RATE + l_rate_details.spread;
2318: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, l_api_name || ': l_raw_rate ' || l_raw_rate);
2319:
2320: -- adjust the rate as per rate rules
2321: l_annualized_rate := lns_financials.calculateInterestRate(
2322: p_initial_rate => l_loan_details.INITIAL_INTEREST_RATE
2323: ,p_rate_to_compare => l_raw_rate
2324: ,p_last_period_rate => l_loan_details.LAST_INTEREST_RATE
2325: ,p_max_first_adjustment => l_loan_details.TERM_FIRST_PERCENT_INCREASE

Line 2359: l_norm_interest := LNS_FINANCIALS.CALC_NORM_INTEREST(p_loan_id => p_loan_id,

2355:
2356: if l_custom_tbl(i).PAYMENT_NUMBER = (l_last_installment_billed + 1) then
2357:
2358: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, l_api_name || ': Calculating normal interest...');
2359: l_norm_interest := LNS_FINANCIALS.CALC_NORM_INTEREST(p_loan_id => p_loan_id,
2360: p_calc_method => l_calc_method,
2361: p_period_start_date => l_period_begin_date,
2362: p_period_end_date => l_period_end_date,
2363: p_interest_rate => l_annualized_rate,

Line 2397: LNS_FINANCIALS.CALC_ADD_INTEREST(p_loan_id => p_loan_id,

2393: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, l_api_name || ': l_prev_grace_end_date: ' || l_prev_grace_end_date);
2394:
2395: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, l_api_name || ': Calculating additional interest on unpaid principal...');
2396: -- calculate additional interest on unpaid principal
2397: LNS_FINANCIALS.CALC_ADD_INTEREST(p_loan_id => p_loan_id,
2398: p_calc_method => l_calc_method,
2399: p_period_start_date => l_add_start_date,
2400: p_period_end_date => l_add_end_date,
2401: p_interest_rate => l_annualized_rate,

Line 2418: LNS_FINANCIALS.CALC_ADD_INTEREST(p_loan_id => p_loan_id,

2414: if (l_calc_method = 'COMPOUND') then
2415:
2416: logMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, l_api_name || ': Calculating additional interest on unpaid interest...');
2417: -- calculate additional interest on unpaid interest
2418: LNS_FINANCIALS.CALC_ADD_INTEREST(p_loan_id => p_loan_id,
2419: p_calc_method => l_calc_method,
2420: p_period_start_date => l_add_start_date,
2421: p_period_end_date => l_add_end_date,
2422: p_interest_rate => l_annualized_rate,

Line 2444: l_periodic_rate := lns_financials.getPeriodicRate(

2440:
2441: if (l_calc_method = 'SIMPLE') then
2442:
2443: -- recalculate periodic rate for each period if day counting methodolgy varies
2444: l_periodic_rate := lns_financials.getPeriodicRate(
2445: p_period_start_date => l_period_begin_date
2446: ,p_period_end_date => l_period_end_date
2447: ,p_annualized_rate => l_annualized_rate
2448: ,p_days_count_method => l_day_count_method);

Line 2452: l_periodic_rate := lns_financials.getCompoundPeriodicRate(p_compound_freq => l_compound_freq

2448: ,p_days_count_method => l_day_count_method);
2449:
2450: elsif (l_calc_method = 'COMPOUND') then
2451:
2452: l_periodic_rate := lns_financials.getCompoundPeriodicRate(p_compound_freq => l_compound_freq
2453: ,p_payment_freq => l_payment_freq
2454: ,p_annualized_rate => l_annualized_rate
2455: ,p_period_start_date => l_period_begin_date
2456: ,p_period_end_date => l_period_end_date

Line 2461: l_norm_interest := lns_financials.calculateInterest(p_amount => l_remaining_balance_theory1

2457: ,p_days_count_method => l_day_count_method);
2458: end if;
2459:
2460: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'periodic_rate: ' || l_periodic_rate);
2461: l_norm_interest := lns_financials.calculateInterest(p_amount => l_remaining_balance_theory1
2462: ,p_periodic_rate => l_periodic_rate
2463: ,p_compounding_period => null);
2464: l_norm_interest := round(l_norm_interest, l_precision);
2465: end if;

Line 2489: l_periodic_principal := lns_financials.calculateEPPayment(p_loan_amount => (l_remaining_balance_theory - l_locked_prin)

2485: -- calc principal amount
2486: if i = 1 then
2487: LogMessage(FND_LOG.LEVEL_STATEMENT, G_PKG_NAME, 'Calculating periodic_principal...');
2488:
2489: l_periodic_principal := lns_financials.calculateEPPayment(p_loan_amount => (l_remaining_balance_theory - l_locked_prin)
2490: ,p_num_intervals => l_num_unlocked_prin
2491: ,p_ending_balance=> 0
2492: ,p_pay_in_arrears=> true);
2493:

Line 2539: l_rate_to_calculate := lns_financials.getCompoundPeriodicRate(p_compound_freq => l_compound_freq

2535: ,p_amortization_frequency => l_payment_freq);
2536:
2537: elsif (l_calc_method = 'COMPOUND') then
2538:
2539: l_rate_to_calculate := lns_financials.getCompoundPeriodicRate(p_compound_freq => l_compound_freq
2540: ,p_payment_freq => l_payment_freq
2541: ,p_annualized_rate => l_annualized_rate
2542: ,p_period_start_date => null
2543: ,p_period_end_date => null

Line 2549: l_periodic_payment := lns_financials.calculatePayment(p_loan_amount => l_remaining_balance_theory

2545:
2546: end if;
2547:
2548: l_amortization_intervals := l_custom_tbl.count + 1 - i;
2549: l_periodic_payment := lns_financials.calculatePayment(p_loan_amount => l_remaining_balance_theory
2550: ,p_periodic_rate => l_rate_to_calculate
2551: ,p_num_intervals => l_amortization_intervals
2552: ,p_ending_balance=> 0
2553: ,p_pay_in_arrears=> true);