DBA Data[Home] [Help]

APPS.ARP_MAINTAIN_PS dependencies on AR_ADJUSTMENTS

Line 318: FROM ar_adjustments

314: IF p_control_rec.process_mode = 'I' THEN
315:
316: SELECT 1
317: INTO l_adj_exists
318: FROM ar_adjustments
319: WHERE customer_trx_id = p_control_rec.previous_customer_trx_id
320: AND adjustment_type = 'C'
321: AND receivables_trx_id = -1
322: AND rownum = 1

Line 325: FROM ar_adjustments

321: AND receivables_trx_id = -1
322: AND rownum = 1
323: UNION ALL
324: SELECT 1
325: FROM ar_adjustments
326: WHERE subsequent_trx_id = p_control_rec.previous_customer_trx_id
327: AND adjustment_type = 'C'
328: AND receivables_trx_id = -1
329: AND rownum = 1;

Line 337: FROM ar_adjustments

333: /* IF p_control_rec.process_mode = 'I' THEN
334: IF p_control_rec.initial_trx_type = 'DEP' THEN
335: SELECT 1
336: INTO l_adj_exists
337: FROM ar_adjustments
338: WHERE customer_trx_id = p_control_rec.previous_customer_trx_id
339: AND adjustment_type = 'C'
340: AND receivables_trx_id = -1
341: AND rownum = 1;

Line 345: FROM ar_adjustments

341: AND rownum = 1;
342: ELSIF p_control_rec.initial_trx_type = 'GUAR' THEN
343: SELECT 1
344: INTO l_adj_exists
345: FROM ar_adjustments
346: WHERE subsequent_trx_id = p_control_rec.previous_customer_trx_id
347: AND adjustment_type = 'C'
348: AND receivables_trx_id = -1
349: AND rownum = 1;

Line 357: FROM ar_adjustments

353:
354: IF p_control_rec.initial_trx_type = 'DEP' THEN
355: SELECT 1
356: INTO l_adj_exists
357: FROM ar_adjustments
358: WHERE customer_trx_id = p_control_rec.previous_customer_trx_id
359: AND subsequent_trx_id = p_control_rec.customer_trx_id
360: AND adjustment_type = 'C'
361: AND receivables_trx_id = -1

Line 366: FROM ar_adjustments

362: AND rownum = 1;
363: ELSIF p_control_rec.initial_trx_type = 'GUAR' THEN
364: SELECT 1
365: INTO l_adj_exists
366: FROM ar_adjustments
367: WHERE customer_trx_id = p_control_rec.initial_customer_trx_id
368: AND subsequent_trx_id = p_control_rec.customer_trx_id
369: AND adjustment_type = 'C'
370: AND receivables_trx_id = -1

Line 493: FROM AR_ADJUSTMENTS'||CRLF||p_where_clause;

489: :sequence_assignment_id,
490: doc_sequence_value,
491: creation_date,
492: created_by
493: FROM AR_ADJUSTMENTS'||CRLF||p_where_clause;
494:
495:
496: ------------------------------------------------
497: -- Parse sql stmts

Line 550: 'UPDATE ar_adjustments adj

546: --did not work for gaples sequence.
547: --p_sequence_name contains the sequence value now.
548:
549: l_update_adj_sql :=
550: 'UPDATE ar_adjustments adj
551: SET
552: doc_sequence_value = ' || p_sequence_name || ',' || CRLF ||
553: 'doc_sequence_id = ' || p_sequence_id || CRLF || p_where_clause;
554:

Line 616: cursor c_ar_adjustments(cust_trx_id BINARY_INTEGER) is

612: v_profVal varchar2(40);--Bug 1796816
613: --BugFix 2095183 Added the Following 2 Statements.
614: l_update_where_clause varchar2(2000) default NULL;
615: /* bugfix 2454787 */
616: cursor c_ar_adjustments(cust_trx_id BINARY_INTEGER) is
617: select adjustment_id from ar_adjustments where customer_trx_id=cust_trx_id
618: UNION
619: select adjustment_id from ar_adjustments where subsequent_trx_id = cust_trx_id;
620:

Line 617: select adjustment_id from ar_adjustments where customer_trx_id=cust_trx_id

613: --BugFix 2095183 Added the Following 2 Statements.
614: l_update_where_clause varchar2(2000) default NULL;
615: /* bugfix 2454787 */
616: cursor c_ar_adjustments(cust_trx_id BINARY_INTEGER) is
617: select adjustment_id from ar_adjustments where customer_trx_id=cust_trx_id
618: UNION
619: select adjustment_id from ar_adjustments where subsequent_trx_id = cust_trx_id;
620:
621: BEGIN

Line 619: select adjustment_id from ar_adjustments where subsequent_trx_id = cust_trx_id;

615: /* bugfix 2454787 */
616: cursor c_ar_adjustments(cust_trx_id BINARY_INTEGER) is
617: select adjustment_id from ar_adjustments where customer_trx_id=cust_trx_id
618: UNION
619: select adjustment_id from ar_adjustments where subsequent_trx_id = cust_trx_id;
620:
621: BEGIN
622:
623: print_fcn_label( 'arp_maintain_ps.update_adj_document_number()+' );

Line 803: --AR_ADJUSTMENTS Records for the Corresponding customer_trx_id.

799: debug(' sequence_value='||
800: l_sequence_value, MSG_LEVEL_DEVELOP );
801: */
802: --BugFix 2095183 Added the Following For Loop For Fetching
803: --AR_ADJUSTMENTS Records for the Corresponding customer_trx_id.
804:
805: For adj_rec in c_ar_adjustments(p_customer_trx_id) loop
806:
807: --Bug 1508981 - Added the call to get the next sequence number

Line 805: For adj_rec in c_ar_adjustments(p_customer_trx_id) loop

801: */
802: --BugFix 2095183 Added the Following For Loop For Fetching
803: --AR_ADJUSTMENTS Records for the Corresponding customer_trx_id.
804:
805: For adj_rec in c_ar_adjustments(p_customer_trx_id) loop
806:
807: --Bug 1508981 - Added the call to get the next sequence number
808:
809: l_sequence_value := FND_SEQNUM.get_next_sequence (222,

Line 818: -- Update the ar_adjustments table

814: l_db_sequence_name,
815: l_sequence_assignment_id);
816:
817: -----------------------------------------------------------
818: -- Update the ar_adjustments table
819: -----------------------------------------------------------
820: BEGIN
821:
822: -------------------------------------------------------

Line 864: debug( 'EXCEPTION: Error updating ar_adjustments',

860: MSG_LEVEL_DEBUG );
861:
862: EXCEPTION
863: WHEN OTHERS THEN
864: debug( 'EXCEPTION: Error updating ar_adjustments',
865: MSG_LEVEL_BASIC );
866: RAISE;
867:
868: END;

Line 870: END LOOP; /* For c_ar_adjustments Cursor */

866: RAISE;
867:
868: END;
869: --BugFix 2095183 Added the following Statement.
870: END LOOP; /* For c_ar_adjustments Cursor */
871:
872:
873: -----------------------------------------------------------
874: -- Insert into the audit table: ar_doc_sequence_audit

Line 1075: ar_adjustments adj

1071: CURSOR get_adj_event_id(pc_customer_trx_id IN NUMBER,pc_subsequent_trx_id IN NUMBER) IS
1072: SELECT
1073: DISTINCT adj.event_id ,adj.ADJUSTMENT_ID
1074: FROM
1075: ar_adjustments adj
1076: WHERE
1077: adj.customer_trx_id = pc_customer_trx_id
1078: and (adj.subsequent_trx_id = p_subsequent_trx_id OR -1=Nvl(p_subsequent_trx_id,-1) )
1079: and adj.receivables_trx_id = -1

Line 1143: FROM ar_adjustments adj

1139:
1140:
1141:
1142: DELETE
1143: FROM ar_adjustments adj
1144: WHERE adj.customer_trx_id = p_customer_trx_id
1145: and (adj.subsequent_trx_id = p_subsequent_trx_id OR -1=Nvl(p_subsequent_trx_id,-1) )
1146: and adj.receivables_trx_id = -1
1147: RETURNING adjustment_id

Line 1157: p_table_name => 'AR_ADJUSTMENTS',

1153: +---------------------------------*/
1154: /* commenting mrc engine call as per Suren
1155: ar_mrc_engine.maintain_mrc_data(
1156: p_event_mode => 'DELETE',
1157: p_table_name => 'AR_ADJUSTMENTS',
1158: p_mode => 'BULK',
1159: p_key_value_list => l_adj_key_value_list); */
1160:
1161:

Line 1191: l_adjustment_id ar_adjustments.adjustment_id%type;

1187: p_subsequent_trx_id IN BINARY_INTEGER
1188: ) IS
1189: /* VAT changes */
1190: l_ae_doc_rec ae_doc_rec_type;
1191: l_adjustment_id ar_adjustments.adjustment_id%type;
1192:
1193: l_ar_ps_key_value_list gl_ca_utility_pkg.r_key_value_arr;
1194:
1195: BEGIN

Line 1271: ar_adjustments adj,

1267: p_profile_info.user_id,
1268: trunc(sysdate),
1269: p_profile_info.conc_login_id
1270: FROM
1271: ar_adjustments adj,
1272: ar_payment_schedules ps2,
1273: ar_adjustments adj2,
1274: ar_receivable_applications ra2
1275: WHERE adj.receivables_trx_id =-1

Line 1273: ar_adjustments adj2,

1269: p_profile_info.conc_login_id
1270: FROM
1271: ar_adjustments adj,
1272: ar_payment_schedules ps2,
1273: ar_adjustments adj2,
1274: ar_receivable_applications ra2
1275: WHERE adj.receivables_trx_id =-1
1276: and adj.customer_trx_id = p_customer_trx_id
1277: and adj.subsequent_trx_id = p_subsequent_trx_id

Line 1307: FROM ar_adjustments adj3

1303: WHERE ps.payment_schedule_id in
1304: (
1305: SELECT
1306: adj3.payment_schedule_id
1307: FROM ar_adjustments adj3
1308: WHERE adj3.customer_trx_id = p_customer_trx_id
1309: and adj3.subsequent_trx_id = p_subsequent_trx_id
1310: and adj3.receivables_trx_id = -1
1311: )

Line 1343: FROM ar_adjustments adj

1339:
1340: /* anjprasa bug 13574852 : added extra where clause to filter correct no of loop */
1341: DECLARE
1342: CURSOR c1 IS SELECT adj.adjustment_id
1343: FROM ar_adjustments adj
1344: WHERE adj.customer_trx_id = p_customer_trx_id
1345: AND adj.receivables_trx_id = -1
1346: AND (adj.subsequent_trx_id = p_subsequent_trx_id OR -1=Nvl(p_subsequent_trx_id,-1) );
1347: BEGIN

Line 1428: ar_adjustments adj2,

1424: p_profile_info.conc_login_id
1425: FROM
1426: ar_receivable_applications ra,
1427: ar_payment_schedules ps2,
1428: ar_adjustments adj2,
1429: ar_receivable_applications ra2
1430: WHERE ra.customer_trx_id = p_customer_trx_id
1431: and ra.status||'' = 'APP'
1432: and ra.applied_payment_schedule_id = ps2.payment_schedule_id

Line 1761: ar_adjustments adj2

1757: FROM
1758: ar_receivable_applications ra,
1759: ar_payment_schedules ps2,
1760: ar_receivable_applications ra2,
1761: ar_adjustments adj2
1762: WHERE ra.customer_trx_id = p_control.customer_trx_id
1763: and ra.status||'' = 'APP'
1764: and ra.reversal_gl_date IS NULL
1765: and ra.applied_payment_schedule_id = ps2.payment_schedule_id

Line 2200: l_adjustment_id ar_adjustments.adjustment_id%type;

2196:
2197: l_doc_where_clause VARCHAR2(1000);
2198: /* VAT changes */
2199: l_ae_doc_rec ae_doc_rec_type;
2200: l_adjustment_id ar_adjustments.adjustment_id%type;
2201: l_ccid ar_adjustments.code_combination_id%type;
2202:
2203: BEGIN
2204:

Line 2201: l_ccid ar_adjustments.code_combination_id%type;

2197: l_doc_where_clause VARCHAR2(1000);
2198: /* VAT changes */
2199: l_ae_doc_rec ae_doc_rec_type;
2200: l_adjustment_id ar_adjustments.adjustment_id%type;
2201: l_ccid ar_adjustments.code_combination_id%type;
2202:
2203: BEGIN
2204:
2205: print_fcn_label( 'arp_maintain_ps.update_adjustments()+' );

Line 2214: FROM ar_adjustments adj

2210: -- Determine if adjustments exist on child invoice
2211: --
2212: SELECT adj.adjustment_id
2213: INTO l_dummy
2214: FROM ar_adjustments adj
2215: WHERE adj.receivables_trx_id = -1
2216: and adj.customer_trx_id = p_control.previous_customer_trx_id
2217: and adj.subsequent_trx_id = p_control.customer_trx_id
2218: and rownum = 1;

Line 2354: FROM ar_adjustments adj

2350: INTO
2351: l_update_inv_adr,
2352: l_update_inv_acctd_adr,
2353: l_update_new_adj_amount
2354: FROM ar_adjustments adj
2355: WHERE adj.customer_trx_id = p_control.previous_customer_trx_id
2356: and adj.subsequent_trx_id = p_control.customer_trx_id
2357: and adj.receivables_trx_id = -1
2358: and adj.payment_schedule_id = p_control.payment_schedule_id;

Line 2403: select ar_adjustments_s.nextval into l_adjustment_id

2399:
2400: -- do the insert
2401: BEGIN
2402:
2403: select ar_adjustments_s.nextval into l_adjustment_id
2404: from dual;
2405:
2406: INSERT INTO ar_adjustments
2407: (

Line 2406: INSERT INTO ar_adjustments

2402:
2403: select ar_adjustments_s.nextval into l_adjustment_id
2404: from dual;
2405:
2406: INSERT INTO ar_adjustments
2407: (
2408: created_by,
2409: creation_date,
2410: last_updated_by,

Line 2463: ar_adjustments adj2,

2459: 'ARAPSI',
2460: -3
2461: ,arp_standard.sysparm.org_id /* SSA changes anuj */
2462: FROM
2463: ar_adjustments adj2,
2464: ar_receivable_applications ra,
2465: ra_customer_trx ct
2466: WHERE adj2.receivables_trx_id= -1
2467: and adj2.customer_trx_id = p_control.previous_customer_trx_id

Line 2476: FROM ar_adjustments adj3

2472: and adj2.payment_schedule_id =
2473: (
2474: /* find an adjustment against the invoice by the CM */
2475: SELECT max(payment_schedule_id)
2476: FROM ar_adjustments adj3
2477: WHERE adj3.receivables_trx_id=-1
2478: and adj3.customer_trx_id = p_control.previous_customer_trx_id
2479: and adj3.subsequent_trx_id = p_control.customer_trx_id
2480: );

Line 2491: p_table_name => 'AR_ADJUSTMENTS',

2487: +---------------------------------*/
2488:
2489: ar_mrc_engine.maintain_mrc_data(
2490: p_event_mode => 'INSERT',
2491: p_table_name => 'AR_ADJUSTMENTS',
2492: p_mode => 'SINGLE',
2493: p_key_value => l_adjustment_id
2494: );
2495:

Line 2519: -- Fill in document number in the ar_adjustments table

2515:
2516: END;
2517:
2518: ------------------------------------------------------------------
2519: -- Fill in document number in the ar_adjustments table
2520: ------------------------------------------------------------------
2521:
2522: l_doc_where_clause :=
2523: 'WHERE customer_trx_id = :bind1 '|| CRLF ||

Line 2572: UPDATE ar_adjustments adj

2568: DECLARE
2569: l_adj_key_value_list gl_ca_utility_pkg.r_key_value_arr;
2570: BEGIN
2571:
2572: UPDATE ar_adjustments adj
2573: SET
2574: (
2575: amount,
2576: acctd_amount,

Line 2617: p_table_name => 'AR_ADJUSTMENTS',

2613: +---------------------------------*/
2614:
2615: ar_mrc_engine.maintain_mrc_data(
2616: p_event_mode => 'UPDATE',
2617: p_table_name => 'AR_ADJUSTMENTS',
2618: p_mode => 'BATCH',
2619: p_key_value_list => l_adj_key_value_list);
2620:
2621: EXCEPTION

Line 2632: FROM ar_adjustments adj

2628:
2629: /* VAT changes: update accounting entry */
2630: SELECT adjustment_id
2631: INTO l_adjustment_id
2632: FROM ar_adjustments adj
2633: WHERE adj.customer_trx_id = p_control.previous_customer_trx_id
2634: and adj.subsequent_trx_id = p_control.customer_trx_id
2635: and adj.receivables_trx_id = -1
2636: and adj.payment_schedule_id = p_control.payment_schedule_id;

Line 2742: ar_adjustments adj2

2738: FROM
2739: ar_receivable_applications ra,
2740: ar_payment_schedules ps2,
2741: ar_receivable_applications ra2,
2742: ar_adjustments adj2
2743: WHERE ra.customer_trx_id = p_control.customer_trx_id
2744: and ra.status||'' = 'APP'
2745: and ra.applied_payment_schedule_id = ps2.payment_schedule_id
2746: and ps.payment_schedule_id = ps2.payment_schedule_id

Line 2996: FROM ar_adjustments adj

2992:
2993: SELECT
2994: nvl( sum( nvl(-adj.amount, 0) ), 0 )
2995: INTO l_temp
2996: FROM ar_adjustments adj
2997: WHERE adj.customer_trx_id =
2998: decode( p_control.initial_trx_type,
2999: 'DEP', p_control.customer_trx_id,
3000: 'GUAR', p_control.initial_customer_trx_id )

Line 3119: l_adjustment_id ar_adjustments.adjustment_id%type;

3115: l_doc_where_clause VARCHAR2(1000);
3116: l_control_rec control_rec_type;
3117: /* VAT changes */
3118: l_ae_doc_rec ae_doc_rec_type;
3119: l_adjustment_id ar_adjustments.adjustment_id%type;
3120: l_llca_count NUMBER;
3121: l_customer_trx ra_customer_trx%ROWTYPE;
3122: BEGIN
3123:

Line 3205: FROM ar_adjustments adj

3201: debug( ' DEP case', MSG_LEVEL_DEBUG );
3202:
3203: /* VAT changes: delete accounting entry for adjustment */
3204: SELECT adj.adjustment_id into l_adjustment_id
3205: FROM ar_adjustments adj
3206: WHERE adj.customer_trx_id = l_control_rec.customer_trx_id
3207: and adj.receivables_trx_id = -1;
3208:
3209: l_ae_doc_rec.document_type := 'ADJUSTMENT';