DBA Data[Home] [Help]

APPS.LNS_DISTRIBUTIONS_PUB dependencies on LNS_LOAN_LINES

Line 3114: from lns_loan_lines

3110: and dist.distribution_type = 'BILLING'
3111: and dist.distribution_percent > 0
3112: and nvl(dist.loan_line_id, -1) =
3113: nvl((select max(loan_line_id)
3114: from lns_loan_lines
3115: where status = 'APPROVED'
3116: and LOAN_ID = C_LOAN_ID
3117: and original_flag = 'N'
3118: and trunc(adjustment_date) <= trunc(sysdate)), -1)

Line 3587: from lns_loan_lines

3583:
3584: --find out if there is more than one line
3585: cursor c_loan_lines(p_loan_id number) is
3586: select count(1)
3587: from lns_loan_lines
3588: where loan_id = p_loan_id
3589: and reference_type = 'RECEIVABLE'
3590: and end_date is null;
3591:

Line 3595: from lns_loan_lines lines

3591:
3592: -- for loans with more than one line
3593: cursor c_validate_MFAR (p_loan_id number) is
3594: select ra.cust_trx_type_id, nvl(psa.psa_trx_type_id,-1)
3595: from lns_loan_lines lines
3596: ,ra_customer_trx ra
3597: ,psa_trx_types_all psa
3598: where ra.customer_trx_id = lines.reference_id
3599: and psa.psa_trx_type_id (+)= ra.cust_trx_type_id

Line 3612: ,lns_loan_lines lines

3608: is
3609: select nvl(1,0)
3610: from ra_customer_trx ra
3611: ,psa_trx_types_all psa
3612: ,lns_loan_lines lines
3613: where ra.CUST_TRX_TYPE_ID = psa.psa_trx_type_id
3614: and ra.customer_trx_id = lines.reference_id
3615: and lines.end_date is null
3616: and lines.reference_type = 'RECEIVABLE'

Line 4065: || 12-18-2004 raverma look at lns_loan_lines

4061: || 03-16-2004 raverma added in default for multi-fund loans inherit from receivables
4062: || 06-16-2004 raverma changed rules on inheritance for MFAR transactions
4063: || get amounts for MFAR from PSA_MF_BALANCES_VIEW
4064: || 07-26-2004 raverma delete rows before each call to accounting
4065: || 12-18-2004 raverma look at lns_loan_lines
4066: || 12-18-2004 raverma need to get loan class code
4067: || 04-19-2005 raverma establish loan clearing as per bug #4313925
4068: *=======================================================================*/
4069: procedure defaultDistributions(p_api_version IN NUMBER

Line 4167: ,lns_loan_lines lline

4163: from ra_customer_trx_all inv
4164: ,xla_transaction_entities ent
4165: ,xla_ae_headers aeh
4166: ,xla_ae_lines ael
4167: ,lns_loan_lines lline
4168: where ent.application_id = 222
4169: and lline.reference_id = ent.source_id_int_1
4170: and lline.loan_id = p_loan_id
4171: -- and lline.status = 'APPROVED'

Line 4191: from lns_loan_lines lines

4187: and xad.assignment_code = xaa.assignment_code
4188: and xad.enabled_flag = 'Y')
4189: and inv.customer_trx_id in
4190: (select reference_id
4191: from lns_loan_lines lines
4192: where reference_type = 'RECEIVABLE'
4193: and end_date is null
4194: and loan_id = p_loan_id)
4195: group by ael.code_combination_id;

Line 4226: from lns_loan_lines lines

4222: and xad.assignment_code = xaa.assignment_code
4223: and xad.enabled_flag = 'Y')
4224: and adj.adjustment_id in
4225: (select rec_adjustment_id
4226: from lns_loan_lines lines
4227: where reference_type = 'RECEIVABLE'
4228: and end_date is null
4229: and loan_id = p_loan_id)
4230: group by ael.code_combination_id;

Line 4251: ,lns_loan_lines lines

4247: cursor c_adj_ids (p_loan_id number) is
4248: select adj.adjustment_id
4249: ,adj.adjustment_number
4250: from ar_adjustments adj
4251: ,lns_loan_lines lines
4252: where lines.rec_adjustment_number = adj.adjustment_number
4253: and lines.end_date is null
4254: and lines.reference_type = 'RECEIVABLE'
4255: and lines.loan_id = p_loan_id;

Line 4261: from lns_loan_lines lines

4257: -- use this to get all receivables to be processed for the loan
4258: cursor c_inv_ids(p_loan_id number) is
4259: select lines.reference_id
4260: ,lines.reference_number
4261: from lns_loan_lines lines
4262: where lines.end_date is null
4263: and lines.reference_type = 'RECEIVABLE'
4264: and lines.loan_id = p_loan_id;
4265:

Line 4275: from lns_loan_lines lines

4271:
4272: -- cursor to get documents and check upgrade status
4273: cursor c_get_loan_documents(p_loan_id number) is
4274: select lines.reference_id, trx.trx_number
4275: from lns_loan_lines lines
4276: ,ra_customer_trx trx
4277: where lines.reference_type = 'RECEIVABLE'
4278: and lines.end_date is null
4279: and lines.loan_id = p_loan_id

Line 4293: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))

4289: and xlt.entity_id = err.entity_id
4290: and xlt.entity_id in (select entity_id from xla_transaction_entities
4291: where application_id = 222
4292: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
4293: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))
4294: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));
4295: -- -----------------------------------------------------------------
4296: cursor c_entities(p_loan_id number) is
4297: select entity_id, entity_code, source_id_int_1, transaction_number

Line 4294: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));

4290: and xlt.entity_id in (select entity_id from xla_transaction_entities
4291: where application_id = 222
4292: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
4293: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))
4294: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));
4295: -- -----------------------------------------------------------------
4296: cursor c_entities(p_loan_id number) is
4297: select entity_id, entity_code, source_id_int_1, transaction_number
4298: from xla_transaction_entities

Line 4301: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id)

4297: select entity_id, entity_code, source_id_int_1, transaction_number
4298: from xla_transaction_entities
4299: where application_id = 222
4300: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
4301: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id)
4302: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));
4303:
4304: CURSOR cur_bill_dist_count(c_loan_id NUMBER) IS
4305: SELECT count(1)

Line 4302: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));

4298: from xla_transaction_entities
4299: where application_id = 222
4300: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
4301: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id)
4302: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_id = p_loan_id))));
4303:
4304: CURSOR cur_bill_dist_count(c_loan_id NUMBER) IS
4305: SELECT count(1)
4306: FROM lns_distributions

Line 6560: from lns_loan_lines lines

6556:
6557: -- cursor to get documents and check upgrade status
6558: cursor c_get_line_documents(p_loan_line_id number) is
6559: select lines.reference_id, trx.trx_number
6560: from lns_loan_lines lines
6561: ,ra_customer_trx trx
6562: where lines.reference_type = 'RECEIVABLE'
6563: and lines.end_date is null
6564: and lines.loan_line_id = p_loan_line_id

Line 6572: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id)

6568: select entity_id, entity_code, source_id_int_1, transaction_number
6569: from xla_transaction_entities
6570: where application_id = 222
6571: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
6572: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id)
6573: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));
6574:
6575: -- cursor to get accounting errors
6576: cursor c_acc_errors (p_loan_line_id number, p_accounting_batch_id number) is

Line 6573: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));

6569: from xla_transaction_entities
6570: where application_id = 222
6571: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
6572: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id)
6573: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));
6574:
6575: -- cursor to get accounting errors
6576: cursor c_acc_errors (p_loan_line_id number, p_accounting_batch_id number) is
6577: select xlt.transaction_number, xlt.entity_code, err.encoded_msg

Line 6586: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))

6582: and xlt.entity_id = err.entity_id
6583: and xlt.entity_id in (select entity_id from xla_transaction_entities
6584: where application_id = 222
6585: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
6586: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))
6587: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));
6588:
6589: -- cursor to establish the loan clearing accounts
6590: cursor C_ERS_LOAN_CLEARING(p_loan_line_id number) is

Line 6587: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));

6583: and xlt.entity_id in (select entity_id from xla_transaction_entities
6584: where application_id = 222
6585: and entity_code IN ('TRANSACTIONS', 'ADJUSTMENTS')
6586: and ((source_id_int_1 in (select reference_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))
6587: OR (source_id_int_1 in (select rec_adjustment_id from lns_loan_lines where end_date is null and reference_type = 'RECEIVABLE' and loan_line_id = p_loan_line_id))));
6588:
6589: -- cursor to establish the loan clearing accounts
6590: cursor C_ERS_LOAN_CLEARING(p_loan_line_id number) is
6591: select sum(ael.entered_dr)

Line 6616: from lns_loan_lines

6612: and xad.assignment_code = xaa.assignment_code
6613: and xad.enabled_flag = 'Y')
6614: and adj.adjustment_id in
6615: (select rec_adjustment_id
6616: from lns_loan_lines
6617: where reference_type = 'RECEIVABLE'
6618: and end_date is null
6619: and loan_line_id = p_loan_line_id)
6620: group by ael.code_combination_id;

Line 6648: from lns_loan_lines

6644: and xad.assignment_code = xaa.assignment_code
6645: and xad.enabled_flag = 'Y')
6646: and inv.customer_trx_id in
6647: (select reference_id
6648: from lns_loan_lines
6649: where reference_type = 'RECEIVABLE'
6650: and end_date is null
6651: and loan_line_id = p_loan_line_id)
6652: group by ael.code_combination_id;

Line 6657: lns_loan_lines lines

6653:
6654: cursor c_get_funded_amount(p_loan_id number, p_code_combination_id number, p_adj_date date) is
6655: select nvl(sum(dist.distribution_amount), 0)
6656: from lns_distributions dist,
6657: lns_loan_lines lines
6658: where dist.distribution_type = 'ORIGINATION'
6659: and dist.line_type = 'ORIG'
6660: and dist.account_name = 'LOAN_RECEIVABLE'
6661: and dist.account_type = 'DR'

Line 6686: from lns_loan_lines lines, ar_adjustments_all adj

6682: and trunc(am.due_date) <= trunc(p_adj_date);
6683:
6684: cursor c_adj_date(p_loan_line_id number) is
6685: select ADJUSTMENT_DATE, adj.gl_date
6686: from lns_loan_lines lines, ar_adjustments_all adj
6687: where lines.LOAN_LINE_ID = p_loan_line_id
6688: and lines.REC_ADJUSTMENT_ID = adj.ADJUSTMENT_ID;
6689:
6690: CURSOR c_get_prin_distr(C_LOAN_ID number, C_ADJ_DATE date, C_LOAN_LINE_ID number) IS

Line 6709: from lns_loan_lines

6705: and dist.distribution_type = 'BILLING'
6706: and dist.distribution_percent > 0
6707: and nvl(dist.loan_line_id, -1) =
6708: nvl((select max(loan_line_id)
6709: from lns_loan_lines
6710: where status = 'APPROVED'
6711: and LOAN_ID = C_LOAN_ID
6712: -- Added below one line condition b'coz we want the last loan_line_id distributions
6713: -- but here this code executes after the current loan_line_id is approved so it returns