[Home] [Help]
37: | There are no table-handler apis for loan lines table since it uses java-based EO
38: |
39: | MODIFICATION HISTORY
40: | Date Author Description of Changes
41: | 10-Jan-2006 karamach Added payment_schedule_id and installment_number for lns_loan_lines per bug#4887994
42: | 20-Dec-2004 karamach Created
43: |
44: *=======================================================================*/
45: PROCEDURE UPDATE_LINE_ADJUSTMENT_NUMBER(
79: --Call to record history
80: LNS_LOAN_HISTORY_PUB.log_record_pre(
81: p_id => p_loan_line_id,
82: p_primary_key_name => 'LOAN_LINE_ID',
83: p_table_name => 'LNS_LOAN_LINES'
84: );
85:
86: -- update loan line
87: UPDATE LNS_LOAN_LINES
83: p_table_name => 'LNS_LOAN_LINES'
84: );
85:
86: -- update loan line
87: UPDATE LNS_LOAN_LINES
88: SET REC_ADJUSTMENT_NUMBER = p_rec_adjustment_number,
89: REC_ADJUSTMENT_ID = p_rec_adjustment_id,
90: PAYMENT_SCHEDULE_ID = p_payment_schedule_id,
91: INSTALLMENT_NUMBER = p_installment_number,
104: --Call to record history
105: LNS_LOAN_HISTORY_PUB.log_record_post(
106: p_id => p_loan_line_id,
107: p_primary_key_name => 'LOAN_LINE_ID',
108: p_table_name => 'LNS_LOAN_LINES',
109: p_loan_id => p_loan_id
110: );
111:
112:
204: | for ERS loan receivables derivation and inserts into loan lines table.
205: | If NO rules have been defined for the loan product, calling this api retrieves
206: | ALL OPEN Receivables for the customer and inserts them into loan lines.
207: | The function returns the total requested amount for updating loan header
208: | after inserting the receivables into lns_loan_lines table.
209: |
210: | NOTES
211: | This api does a bulk select if max_requested_amount is NOT specified on the product.
212: | This api does bulk insert into lns_loan_lines after retrieving the matching receivables into table types.
208: | after inserting the receivables into lns_loan_lines table.
209: |
210: | NOTES
211: | This api does a bulk select if max_requested_amount is NOT specified on the product.
212: | This api does bulk insert into lns_loan_lines after retrieving the matching receivables into table types.
213: | Incase an error is encountered during processing the api returns zero with error message in the stack.
214: | The api also returns zero if no receivables found for inserting into loan lines.
215: |
216: | MODIFICATION HISTORY
248: CURSOR c_check_existing_line(pLoanId Number) IS
249: select 'Y' line_exists
250: from dual
251: where exists
252: (select null from lns_loan_lines where loan_id = pLoanId and end_date is null);
253:
254: CURSOR c_loan_product(pLoanProductId Number, pOrgId Number) IS
255: select loan_product_name,MAX_REQUESTED_AMOUNT
256: from lns_loan_products_all_vl
257: where loan_product_id = pLoanProductId
258: and org_id = pOrgId;
259:
260: --Need to define separate table types for each column for bulk insert since table type with all columns is not supported for bulk processing
261: TYPE lns_pmt_sch_id_type IS TABLE OF LNS_LOAN_LINES.PAYMENT_SCHEDULE_ID%TYPE INDEX BY PLS_INTEGER;
262: l_pmt_sch_id_tbl lns_pmt_sch_id_type;
263:
264: TYPE lns_reference_id_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_ID%TYPE INDEX BY PLS_INTEGER;
265: l_reference_id_tbl lns_reference_id_type;
260: --Need to define separate table types for each column for bulk insert since table type with all columns is not supported for bulk processing
261: TYPE lns_pmt_sch_id_type IS TABLE OF LNS_LOAN_LINES.PAYMENT_SCHEDULE_ID%TYPE INDEX BY PLS_INTEGER;
262: l_pmt_sch_id_tbl lns_pmt_sch_id_type;
263:
264: TYPE lns_reference_id_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_ID%TYPE INDEX BY PLS_INTEGER;
265: l_reference_id_tbl lns_reference_id_type;
266:
267: TYPE lns_reference_number_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_NUMBER%TYPE INDEX BY PLS_INTEGER;
268: l_reference_number_tbl lns_reference_number_type;
263:
264: TYPE lns_reference_id_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_ID%TYPE INDEX BY PLS_INTEGER;
265: l_reference_id_tbl lns_reference_id_type;
266:
267: TYPE lns_reference_number_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_NUMBER%TYPE INDEX BY PLS_INTEGER;
268: l_reference_number_tbl lns_reference_number_type;
269:
270: TYPE lns_reference_amount_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_AMOUNT%TYPE INDEX BY PLS_INTEGER;
271: l_reference_amount_tbl lns_reference_amount_type;
266:
267: TYPE lns_reference_number_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_NUMBER%TYPE INDEX BY PLS_INTEGER;
268: l_reference_number_tbl lns_reference_number_type;
269:
270: TYPE lns_reference_amount_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_AMOUNT%TYPE INDEX BY PLS_INTEGER;
271: l_reference_amount_tbl lns_reference_amount_type;
272:
273: TYPE lns_requested_amount_type IS TABLE OF LNS_LOAN_LINES.REQUESTED_AMOUNT%TYPE INDEX BY PLS_INTEGER;
274: l_requested_amount_tbl lns_requested_amount_type;
269:
270: TYPE lns_reference_amount_type IS TABLE OF LNS_LOAN_LINES.REFERENCE_AMOUNT%TYPE INDEX BY PLS_INTEGER;
271: l_reference_amount_tbl lns_reference_amount_type;
272:
273: TYPE lns_requested_amount_type IS TABLE OF LNS_LOAN_LINES.REQUESTED_AMOUNT%TYPE INDEX BY PLS_INTEGER;
274: l_requested_amount_tbl lns_requested_amount_type;
275:
276: TYPE lns_installment_number_type IS TABLE OF LNS_LOAN_LINES.INSTALLMENT_NUMBER%TYPE INDEX BY PLS_INTEGER;
277: l_installment_number_tbl lns_installment_number_type;
272:
273: TYPE lns_requested_amount_type IS TABLE OF LNS_LOAN_LINES.REQUESTED_AMOUNT%TYPE INDEX BY PLS_INTEGER;
274: l_requested_amount_tbl lns_requested_amount_type;
275:
276: TYPE lns_installment_number_type IS TABLE OF LNS_LOAN_LINES.INSTALLMENT_NUMBER%TYPE INDEX BY PLS_INTEGER;
277: l_installment_number_tbl lns_installment_number_type;
278:
279: CURSOR c_get_rule_object(pRuleObjectName VARCHAR2, pApplicationId NUMBER, pLoanProductId NUMBER, pOrgId NUMBER) IS
280: select 'Y' rule_exists, attr.DEFAULT_VALUE sort_attribute
337: AND inv.invoice_currency_code = pCurrencyCode;
338:
339: CURSOR c_get_bulk_total(pLoanId NUMBER) IS
340: select sum(requested_amount) total_amount, count(loan_line_id) record_count
341: from lns_loan_lines
342: where loan_id = pLoanId
343: and end_date is null;
344:
345: BEGIN
384:
385: logMessage(FND_LOG.LEVEL_ERROR, G_PKG_NAME, l_api_name || ': ' || ' - loan lines already exist for this loan_id');
386:
387: --throw exception
388: FND_MESSAGE.SET_NAME('LNS', 'LNS_LOAN_LINES_EXIST');
389: FND_MSG_PUB.Add;
390: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
391: RAISE FND_API.G_EXC_ERROR;
392:
577: LogMessage(FND_LOG.LEVEL_UNEXPECTED, G_PKG_NAME, l_api_name || ': ' || FND_MSG_PUB.Get(p_encoded => 'F'));
578: RAISE FND_API.G_EXC_ERROR;
579: END IF;
580:
581: l_last_api_called := 'Bulk insert into lns_loan_lines';
582: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ': ' || ' - BEGIN: ' || l_last_api_called);
583:
584: forall i in l_pmt_sch_id_tbl.first..l_pmt_sch_id_tbl.last
585: insert into lns_loan_lines(
581: l_last_api_called := 'Bulk insert into lns_loan_lines';
582: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ': ' || ' - BEGIN: ' || l_last_api_called);
583:
584: forall i in l_pmt_sch_id_tbl.first..l_pmt_sch_id_tbl.last
585: insert into lns_loan_lines(
586: LOAN_LINE_ID
587: ,LOAN_ID
588: ,LAST_UPDATE_DATE
589: ,LAST_UPDATED_BY
628: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ': ' || ' - END: ' || l_last_api_called);
629:
630: IF (l_bulk_process = 'Y') THEN
631: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - Record fetch was performed as a bulk operation since maximum loan amount is NOT specified in loan product');
632: /* --open cursor to get number of records and total requested amount from lns_loan_lines
633: OPEN c_get_bulk_total(l_loan_id);
634: FETCH c_get_bulk_total INTO l_loan_amount, l_record_count;
635: CLOSE c_get_bulk_total;
636: --the return value should not be null
645: l_record_count := l_record_count + 1;
646: l_loan_amount := l_loan_amount + l_requested_amount_tbl(j);
647: end loop;
648: END IF;
649: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - Inserted '|| l_record_count || ' rows into lns_loan_lines successfully!');
650: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - The total loan amount processed is ' || l_loan_amount);
651:
652: logMessage(FND_LOG.LEVEL_PROCEDURE, G_PKG_NAME, l_api_name || ' - END');
653: