984: select app.receivable_application_id app_id,
985: app.customer_trx_id trx_id
986: from ar_receivable_applications app
987: where app.customer_trx_id = p_customer_trx_id
988: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
989: and exists (select 'x'
990: from ar_distributions ard
991: where ard.source_table = 'RA'
992: and ard.source_id = app.receivable_application_id); --delete only necessary records
986: from ar_receivable_applications app
987: where app.customer_trx_id = p_customer_trx_id
988: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
989: and exists (select 'x'
990: from ar_distributions ard
991: where ard.source_table = 'RA'
992: and ard.source_id = app.receivable_application_id); --delete only necessary records
993:
994: l_rec_del_app del_app%ROWTYPE;
1461: app.customer_trx_id trx_id
1462: from ar_receivable_applications app
1463: where app.applied_payment_schedule_id = p_control.payment_schedule_id --inv ps
1464: and app.customer_trx_id = p_control.customer_trx_id --cm trx id
1465: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
1466: and app.reversal_gl_date IS NULL
1467: and app.receivable_application_id = p_app_id
1468: and exists (select 'x'
1469: from ar_distributions ard
1465: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
1466: and app.reversal_gl_date IS NULL
1467: and app.receivable_application_id = p_app_id
1468: and exists (select 'x'
1469: from ar_distributions ard
1470: where ard.source_table = 'RA'
1471: and ard.source_id = app.receivable_application_id); --delete only necessary records
1472:
1473: --BUG#5324129
1480: and nvl(app.confirmed_flag,'Y') = 'Y'
1481: and app.reversal_gl_date IS NULL
1482: and app.receivable_application_id = p_app_id
1483: and not exists (select 'x'
1484: from ar_distributions ard
1485: where ard.source_table = 'RA'
1486: and ard.source_id = app.receivable_application_id);
1487:
1488: --BUG#5324129
2111: app.customer_trx_id trx_id
2112: from ar_receivable_applications app
2113: where app.applied_payment_schedule_id = p_control.payment_schedule_id
2114: and app.customer_trx_id = p_control.customer_trx_id
2115: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
2116: and app.status = 'APP'
2117: and exists (select 'x'
2118: from ar_distributions ard
2119: where ard.source_table = 'RA'
2114: and app.customer_trx_id = p_control.customer_trx_id
2115: and nvl(app.confirmed_flag,'Y') = 'Y' --accounting exists in ar_distributions only if confirmed
2116: and app.status = 'APP'
2117: and exists (select 'x'
2118: from ar_distributions ard
2119: where ard.source_table = 'RA'
2120: and ard.source_id = app.receivable_application_id); --delete only necessary records
2121:
2122: l_rec_del_app del_app%ROWTYPE;