21: | |
22: | SCOPE - PRIVATE |
23: | |
24: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
25: | arp_util.debug |
26: | |
27: | ARGUMENTS : IN: |
28: | OUT: |
29: | IN/ OUT: |
52: l_allow_overapp_flag varchar2(1);
53:
54: BEGIN
55:
56: arp_util.debug('arp_process_adjustment.validate_insert_adjustment()+');
57:
58: SELECT ps.amount_due_original,
59: ps.amount_due_remaining,
60: ctt.creation_sign,
68: , ar_payment_schedules ps
69: WHERE ps.payment_schedule_id = p_payment_schedule_id
70: AND ps.cust_trx_type_id = ctt.cust_trx_type_id;
71:
72: arp_util.debug( 'p_type = ' || p_type);
73: arp_util.debug('adj amount = ' || p_adj_amount);
74: arp_util.debug('amount due rem ' || l_amount_due_remaining);
75:
76: IF ( p_type = 'INVOICE'
69: WHERE ps.payment_schedule_id = p_payment_schedule_id
70: AND ps.cust_trx_type_id = ctt.cust_trx_type_id;
71:
72: arp_util.debug( 'p_type = ' || p_type);
73: arp_util.debug('adj amount = ' || p_adj_amount);
74: arp_util.debug('amount due rem ' || l_amount_due_remaining);
75:
76: IF ( p_type = 'INVOICE'
77: and p_adj_amount <> (0 - l_amount_due_remaining)) then
70: AND ps.cust_trx_type_id = ctt.cust_trx_type_id;
71:
72: arp_util.debug( 'p_type = ' || p_type);
73: arp_util.debug('adj amount = ' || p_adj_amount);
74: arp_util.debug('amount due rem ' || l_amount_due_remaining);
75:
76: IF ( p_type = 'INVOICE'
77: and p_adj_amount <> (0 - l_amount_due_remaining)) then
78:
131:
132: IF l_uns_amount <> 0
133: THEN
134: /* Raise message and halt process */
135: arp_util.debug('Unearned balance exists for this transaction');
136: fnd_message.set_name('AR', 'AR_UNEARN_PREV_ADJ');
137: app_exception.raise_exception;
138: END IF;
139: END IF;
138: END IF;
139: END IF;
140: EXCEPTION
141: WHEN OTHERS THEN
142: arp_util.debug('Exception during Unearned test: ' || SQLERRM);
143: RAISE;
144: END;
145:
146: arp_util.debug('arp_process_adjustment.validate_insert_adjustment()-');
142: arp_util.debug('Exception during Unearned test: ' || SQLERRM);
143: RAISE;
144: END;
145:
146: arp_util.debug('arp_process_adjustment.validate_insert_adjustment()-');
147:
148: EXCEPTION
149: WHEN OTHERS THEN
150: arp_util.debug(
146: arp_util.debug('arp_process_adjustment.validate_insert_adjustment()-');
147:
148: EXCEPTION
149: WHEN OTHERS THEN
150: arp_util.debug(
151: 'EXCEPTION: arp_process_adjustment.validate_insert_adjustment()');
152: RAISE;
153:
154: END;
162: | |
163: | SCOPE - PRIVATE |
164: | |
165: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
166: | arp_util.debug |
167: | |
168: | ARGUMENTS : IN: |
169: | OUT: |
170: | IN/ OUT: |
200: l_tax_original number;
201:
202: BEGIN
203:
204: arp_util.debug('arp_process_adjustment.validate_update_adjustment()+');
205:
206: IF ( p_status_changed_flag ) AND
207: ( p_status = 'A' )
208: THEN
311: END IF;
312:
313: END IF;
314:
315: arp_util.debug('arp_process_adjustment.validate_update_adjustment()-');
316:
317: EXCEPTION
318: WHEN OTHERS THEN
319: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
317: EXCEPTION
318: WHEN OTHERS THEN
319: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
320: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_non_db_pkg.check_natural_application exception: '||SQLERRM );
321: arp_util.debug(
322: 'EXCEPTION: arp_process_adjustment.validate_update_adjustment()');
323: RAISE;
324:
325: END;
333: | |
334: | SCOPE - PRIVATE |
335: | |
336: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
337: | arp_util.debug |
338: | |
339: | ARGUMENTS : IN: |
340: | p_adjustment_id |
341: | p_new_adj_rec |
362: IS
363:
364: BEGIN
365:
366: arp_util.debug('ar_process_adjustment.set_flags()+',
367: pg_msg_level_debug);
368:
369: arp_util.debug('p_old_adj_rec.status: ' || p_old_adj_rec.status );
370: arp_util.debug('p_new_adj_rec.status: ' || p_new_adj_rec.status );
365:
366: arp_util.debug('ar_process_adjustment.set_flags()+',
367: pg_msg_level_debug);
368:
369: arp_util.debug('p_old_adj_rec.status: ' || p_old_adj_rec.status );
370: arp_util.debug('p_new_adj_rec.status: ' || p_new_adj_rec.status );
371: arp_util.debug('pg_text_dummy: ' || pg_text_dummy );
372:
373: IF (
366: arp_util.debug('ar_process_adjustment.set_flags()+',
367: pg_msg_level_debug);
368:
369: arp_util.debug('p_old_adj_rec.status: ' || p_old_adj_rec.status );
370: arp_util.debug('p_new_adj_rec.status: ' || p_new_adj_rec.status );
371: arp_util.debug('pg_text_dummy: ' || pg_text_dummy );
372:
373: IF (
374: nvl(p_old_adj_rec.status, '!@#$%') <>
367: pg_msg_level_debug);
368:
369: arp_util.debug('p_old_adj_rec.status: ' || p_old_adj_rec.status );
370: arp_util.debug('p_new_adj_rec.status: ' || p_new_adj_rec.status );
371: arp_util.debug('pg_text_dummy: ' || pg_text_dummy );
372:
373: IF (
374: nvl(p_old_adj_rec.status, '!@#$%') <>
375: nvl(p_new_adj_rec.status, '!@#$%')
379: THEN p_status_changed_flag := TRUE;
380: ELSE p_status_changed_flag := FALSE;
381: END IF;
382:
383: arp_util.debug('ar_process_adjustment.set_flags()-',
384: pg_msg_level_debug);
385:
386: EXCEPTION
387: WHEN OTHERS THEN
389: /*---------------------------------------------+
390: | Display parameters and raise the exception |
391: +---------------------------------------------*/
392:
393: arp_util.debug('EXCEPTION: arp_process_adjustment.set_flags()');
394:
395: arp_util.debug('');
396: arp_util.debug('---------- parameters for set_flags() ---------');
397:
391: +---------------------------------------------*/
392:
393: arp_util.debug('EXCEPTION: arp_process_adjustment.set_flags()');
394:
395: arp_util.debug('');
396: arp_util.debug('---------- parameters for set_flags() ---------');
397:
398: arp_util.debug('p_adjustment_id = ' || p_adjustment_id);
399: arp_util.debug('');
392:
393: arp_util.debug('EXCEPTION: arp_process_adjustment.set_flags()');
394:
395: arp_util.debug('');
396: arp_util.debug('---------- parameters for set_flags() ---------');
397:
398: arp_util.debug('p_adjustment_id = ' || p_adjustment_id);
399: arp_util.debug('');
400:
394:
395: arp_util.debug('');
396: arp_util.debug('---------- parameters for set_flags() ---------');
397:
398: arp_util.debug('p_adjustment_id = ' || p_adjustment_id);
399: arp_util.debug('');
400:
401: arp_util.debug('---------- new adjustment record ----------');
402: arp_adjustments_pkg.display_adj_rec( p_new_adj_rec );
395: arp_util.debug('');
396: arp_util.debug('---------- parameters for set_flags() ---------');
397:
398: arp_util.debug('p_adjustment_id = ' || p_adjustment_id);
399: arp_util.debug('');
400:
401: arp_util.debug('---------- new adjustment record ----------');
402: arp_adjustments_pkg.display_adj_rec( p_new_adj_rec );
403: arp_util.debug('');
397:
398: arp_util.debug('p_adjustment_id = ' || p_adjustment_id);
399: arp_util.debug('');
400:
401: arp_util.debug('---------- new adjustment record ----------');
402: arp_adjustments_pkg.display_adj_rec( p_new_adj_rec );
403: arp_util.debug('');
404:
405: RAISE;
399: arp_util.debug('');
400:
401: arp_util.debug('---------- new adjustment record ----------');
402: arp_adjustments_pkg.display_adj_rec( p_new_adj_rec );
403: arp_util.debug('');
404:
405: RAISE;
406:
407: END;
416: | |
417: | SCOPE - PRIVATE |
418: | |
419: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
420: | arp_util.debug |
421: | |
422: | ARGUMENTS : IN: |
423: | p_adj_rec |
424: | p_ps_rec |
546:
547:
548: BEGIN
549:
550: arp_util.debug('arp_process_adjustment.validate_inv_line_amount()+',
551: pg_msg_level_debug);
552:
553: /*----------------------------------------------------------------+
554: | IF the line number is filled in |
570: END IF;
571:
572: FOR i IN cu_rem_amt(p_adj_rec.customer_trx_id, p_adj_rec.customer_trx_line_id) LOOP
573: IF PG_DEBUG in ('Y', 'C') THEN
574: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
575: arp_util.debug('Value of sum_orig: ' || i.sum_orig);
576: arp_util.debug('Value of REM_TYPE_LINE: ' || i.REM_TYPE_LINE);
577: arp_util.debug('Value of l_line_original: ' || l_line_original);
578: END IF;
571:
572: FOR i IN cu_rem_amt(p_adj_rec.customer_trx_id, p_adj_rec.customer_trx_line_id) LOOP
573: IF PG_DEBUG in ('Y', 'C') THEN
574: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
575: arp_util.debug('Value of sum_orig: ' || i.sum_orig);
576: arp_util.debug('Value of REM_TYPE_LINE: ' || i.REM_TYPE_LINE);
577: arp_util.debug('Value of l_line_original: ' || l_line_original);
578: END IF;
579: IF(Nvl(l_tax_code_source,'NONE') = 'NONE') THEN -- Bug 13882660
572: FOR i IN cu_rem_amt(p_adj_rec.customer_trx_id, p_adj_rec.customer_trx_line_id) LOOP
573: IF PG_DEBUG in ('Y', 'C') THEN
574: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
575: arp_util.debug('Value of sum_orig: ' || i.sum_orig);
576: arp_util.debug('Value of REM_TYPE_LINE: ' || i.REM_TYPE_LINE);
577: arp_util.debug('Value of l_line_original: ' || l_line_original);
578: END IF;
579: IF(Nvl(l_tax_code_source,'NONE') = 'NONE') THEN -- Bug 13882660
580: IF(i.line_type <> 'TAX') THEN
573: IF PG_DEBUG in ('Y', 'C') THEN
574: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
575: arp_util.debug('Value of sum_orig: ' || i.sum_orig);
576: arp_util.debug('Value of REM_TYPE_LINE: ' || i.REM_TYPE_LINE);
577: arp_util.debug('Value of l_line_original: ' || l_line_original);
578: END IF;
579: IF(Nvl(l_tax_code_source,'NONE') = 'NONE') THEN -- Bug 13882660
580: IF(i.line_type <> 'TAX') THEN
581: l_remain_amt := l_remain_amt + i.sum_orig + i.REM_TYPE_LINE;
587: END IF;
588: END LOOP;
589:
590: IF PG_DEBUG in ('Y', 'C') THEN
591: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
592: arp_util.debug('Value of l_line_original: ' || l_line_original);
593: END IF;
594:
595: /*------------------------------------------+
588: END LOOP;
589:
590: IF PG_DEBUG in ('Y', 'C') THEN
591: arp_util.debug('Value of l_remain_amt: ' || l_remain_amt);
592: arp_util.debug('Value of l_line_original: ' || l_line_original);
593: END IF;
594:
595: /*------------------------------------------+
596: | Get the amounts used to calculate the |
677: WHERE
678: ra.applied_customer_trx_id = p_adj_rec.customer_trx_id
679: AND ra.applied_customer_trx_line_id= p_adj_rec.customer_trx_line_id;
680:
681: arp_util.debug('Adj Amt: ' || p_adj_rec.amount ||
682: ' Line Orig: ' || l_line_original ||
683: ' Adj : ' || l_sum_line_adj ||' Cred: ' ||
684: l_line_credited || ' Appl: ' || l_line_applied ||
685: ' Net: ' || TO_CHAR(p_adj_rec.amount +
702: l_line_credited -
703: l_line_applied < 0
704: )
705: THEN
706: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
707: 'validate_inv_line_amount ()',
708: pg_msg_level_debug);
709: arp_util.debug( 'Adjustments cannot be more than available ' ||
710: 'invoiced line amount.',
705: THEN
706: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
707: 'validate_inv_line_amount ()',
708: pg_msg_level_debug);
709: arp_util.debug( 'Adjustments cannot be more than available ' ||
710: 'invoiced line amount.',
711: pg_msg_level_debug);
712: FND_MESSAGE.set_name('AR', 'AR_VAL_ADJ_INV_LINE_AMT');
713: APP_EXCEPTION.raise_exception;
721: l_line_credited -
722: l_line_applied > 0
723: )
724: THEN
725: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
726: 'validate_inv_line_amount ()',
727: pg_msg_level_debug);
728: arp_util.debug( 'Adjustments cannot be more than available ' ||
729: 'invoiced line amount.',
724: THEN
725: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
726: 'validate_inv_line_amount ()',
727: pg_msg_level_debug);
728: arp_util.debug( 'Adjustments cannot be more than available ' ||
729: 'invoiced line amount.',
730: pg_msg_level_debug);
731: FND_MESSAGE.set_name('AR', 'AR_VAL_ADJ_INV_LINE_AMT');
732: APP_EXCEPTION.raise_exception;
738: p_adj_rec.amount +
739: l_remain_amt < 0
740: )
741: THEN
742: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
743: 'validate_inv_line_amount ()',
744: pg_msg_level_debug);
745: arp_util.debug( 'Adjustments cannot be more than available ' ||
746: 'invoiced line amount.',
741: THEN
742: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
743: 'validate_inv_line_amount ()',
744: pg_msg_level_debug);
745: arp_util.debug( 'Adjustments cannot be more than available ' ||
746: 'invoiced line amount.',
747: pg_msg_level_debug);
748: FND_MESSAGE.set_name('AR', 'AR_VAL_ADJ_INV_LINE_AMT');
749: APP_EXCEPTION.raise_exception;
753: p_adj_rec.amount +
754: l_remain_amt > 0
755: )
756: THEN
757: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
758: 'validate_inv_line_amount ()',
759: pg_msg_level_debug);
760: arp_util.debug( 'Adjustments cannot be more than available ' ||
761: 'invoiced line amount.',
756: THEN
757: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
758: 'validate_inv_line_amount ()',
759: pg_msg_level_debug);
760: arp_util.debug( 'Adjustments cannot be more than available ' ||
761: 'invoiced line amount.',
762: pg_msg_level_debug);
763: FND_MESSAGE.set_name('AR', 'AR_VAL_ADJ_INV_LINE_AMT');
764: APP_EXCEPTION.raise_exception;
767:
768: END IF; -- end not approved or adjusted and line specified case
769:
770:
771: arp_util.debug('arp_process_adjustment.validate_inv_line_amount()-',
772: pg_msg_level_debug);
773:
774: EXCEPTION
775: WHEN OTHERS THEN
772: pg_msg_level_debug);
773:
774: EXCEPTION
775: WHEN OTHERS THEN
776: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
777: 'validate_inv_line_amount()',
778: pg_msg_level_debug);
779:
780: arp_util.debug('', pg_msg_level_debug);
776: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
777: 'validate_inv_line_amount()',
778: pg_msg_level_debug);
779:
780: arp_util.debug('', pg_msg_level_debug);
781: arp_util.debug('---------- parameters for validate_inv_line_amount()' ||
782: ' ---------',
783: pg_msg_level_debug);
784:
777: 'validate_inv_line_amount()',
778: pg_msg_level_debug);
779:
780: arp_util.debug('', pg_msg_level_debug);
781: arp_util.debug('---------- parameters for validate_inv_line_amount()' ||
782: ' ---------',
783: pg_msg_level_debug);
784:
785: arp_adjustments_pkg.display_adj_rec( p_adj_rec );
798: | |
799: | SCOPE - PRIVATE |
800: | |
801: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
802: | arp_util.debug |
803: | |
804: | ARGUMENTS : IN: |
805: | p_customer_trx_line_id |
806: | p_customer_trx_id |
830: l_ps_rec ar_payment_schedules%rowtype;
831:
832: BEGIN
833:
834: arp_util.debug('arp_process_adjustment.validate_inv_line_amount_cover()+',
835: pg_msg_level_debug);
836:
837: l_adj_rec.customer_trx_line_id := p_customer_trx_line_id;
838: l_adj_rec.customer_trx_id := p_customer_trx_id;
850: WHERE payment_schedule_id = p_payment_schedule_id;
851:
852: validate_inv_line_amount( l_adj_rec, l_ps_rec );
853:
854: arp_util.debug('arp_process_adjustment.validate_inv_line_amount_cover()-',
855: pg_msg_level_debug);
856:
857: EXCEPTION
858: WHEN OTHERS THEN
855: pg_msg_level_debug);
856:
857: EXCEPTION
858: WHEN OTHERS THEN
859: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
860: 'validate_inv_line_amount_cover()',
861: pg_msg_level_debug);
862:
863: arp_util.debug('', pg_msg_level_debug);
859: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
860: 'validate_inv_line_amount_cover()',
861: pg_msg_level_debug);
862:
863: arp_util.debug('', pg_msg_level_debug);
864: arp_util.debug('---------- parameters for ' ||
865: 'validate_inv_line_amount_cover()' ||
866: ' ---------',
867: pg_msg_level_debug);
860: 'validate_inv_line_amount_cover()',
861: pg_msg_level_debug);
862:
863: arp_util.debug('', pg_msg_level_debug);
864: arp_util.debug('---------- parameters for ' ||
865: 'validate_inv_line_amount_cover()' ||
866: ' ---------',
867: pg_msg_level_debug);
868:
865: 'validate_inv_line_amount_cover()' ||
866: ' ---------',
867: pg_msg_level_debug);
868:
869: arp_util.debug('p_customer_trx_line_id = ' ||
870: TO_CHAR(p_customer_trx_line_id), pg_msg_level_debug);
871: arp_util.debug('p_customer_trx_id = ' ||
872: TO_CHAR(p_customer_trx_id), pg_msg_level_debug);
873: arp_util.debug('p_payment_schedule_id = ' ||
867: pg_msg_level_debug);
868:
869: arp_util.debug('p_customer_trx_line_id = ' ||
870: TO_CHAR(p_customer_trx_line_id), pg_msg_level_debug);
871: arp_util.debug('p_customer_trx_id = ' ||
872: TO_CHAR(p_customer_trx_id), pg_msg_level_debug);
873: arp_util.debug('p_payment_schedule_id = ' ||
874: TO_CHAR(p_payment_schedule_id), pg_msg_level_debug);
875: arp_util.debug('p_amount = ' ||
869: arp_util.debug('p_customer_trx_line_id = ' ||
870: TO_CHAR(p_customer_trx_line_id), pg_msg_level_debug);
871: arp_util.debug('p_customer_trx_id = ' ||
872: TO_CHAR(p_customer_trx_id), pg_msg_level_debug);
873: arp_util.debug('p_payment_schedule_id = ' ||
874: TO_CHAR(p_payment_schedule_id), pg_msg_level_debug);
875: arp_util.debug('p_amount = ' ||
876: TO_CHAR(p_amount), pg_msg_level_debug);
877:
871: arp_util.debug('p_customer_trx_id = ' ||
872: TO_CHAR(p_customer_trx_id), pg_msg_level_debug);
873: arp_util.debug('p_payment_schedule_id = ' ||
874: TO_CHAR(p_payment_schedule_id), pg_msg_level_debug);
875: arp_util.debug('p_amount = ' ||
876: TO_CHAR(p_amount), pg_msg_level_debug);
877:
878: RAISE;
879:
889: | |
890: | SCOPE - PRIVATE |
891: | |
892: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
893: | arp_util.debug |
894: | |
895: | ARGUMENTS : IN: |
896: | p_adj_rec |
897: | p_ps_rec |
929: l_approval_amount_from ar_approval_user_limits.amount_from%type;
930:
931: BEGIN
932:
933: arp_util.debug('arp_process_adjustment.validate_update_approve_adj()+',
934: pg_msg_level_debug);
935:
936:
937: IF ( p_adjustment_code = 'A' )
953:
954: IF ( l_closing_status not in ('O', 'F' ) )
955: THEN
956:
957: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
958: 'validate_update_approve_adj ()',
959: pg_msg_level_debug);
960: arp_util.debug( 'Invalid date. Enter a GL date in an open or' ||
961: ' future enterable period.',
956:
957: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
958: 'validate_update_approve_adj ()',
959: pg_msg_level_debug);
960: arp_util.debug( 'Invalid date. Enter a GL date in an open or' ||
961: ' future enterable period.',
962: pg_msg_level_debug);
963: FND_MESSAGE.set_name('AR', 'AR_VAL_GL_DATE_OPEN');
964: APP_EXCEPTION.raise_exception;
970:
971: IF ( p_adj_rec.gl_date < p_ps_rec.gl_date )
972: THEN
973:
974: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
975: 'validate_update_approve_adj ()',
976: pg_msg_level_debug);
977: arp_util.debug( 'The GL date should not be prior to the ' ||
978: 'invoice''s GL date.',
973:
974: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
975: 'validate_update_approve_adj ()',
976: pg_msg_level_debug);
977: arp_util.debug( 'The GL date should not be prior to the ' ||
978: 'invoice''s GL date.',
979: pg_msg_level_debug);
980: FND_MESSAGE.set_name('AR', 'AR_VAL_GL_INV_GL');
981: APP_EXCEPTION.raise_exception;
1005: AND aul.document_type = 'ADJ';
1006:
1007: EXCEPTION
1008: WHEN NO_DATA_FOUND THEN
1009: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
1010: 'validate_update_approve_adj ()',
1011: pg_msg_level_debug);
1012: arp_util.debug( 'You do not have approval limits for currency ' ||
1013: p_ps_rec.invoice_currency_code,
1008: WHEN NO_DATA_FOUND THEN
1009: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
1010: 'validate_update_approve_adj ()',
1011: pg_msg_level_debug);
1012: arp_util.debug( 'You do not have approval limits for currency ' ||
1013: p_ps_rec.invoice_currency_code,
1014: pg_msg_level_debug);
1015: FND_MESSAGE.set_name('AR', 'AR_VAL_USER_LIMIT');
1016: FND_MESSAGE.set_token( 'CURRENCY',
1026: ( p_adj_rec.amount < l_approval_amount_from )
1027: )
1028: THEN
1029:
1030: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
1031: 'validate_update_approve_adj ()',
1032: pg_msg_level_debug);
1033: arp_util.debug( 'User ID: ' || arp_adjustments_pkg.pg_user_id ||
1034: ' Amount: ' ||
1029:
1030: arp_util.debug( 'EXCEPTION: arp_process_adjustment.' ||
1031: 'validate_update_approve_adj ()',
1032: pg_msg_level_debug);
1033: arp_util.debug( 'User ID: ' || arp_adjustments_pkg.pg_user_id ||
1034: ' Amount: ' ||
1035: p_adj_rec.amount || ' From: ' ||
1036: l_approval_amount_from || ' To: ' ||
1037: l_approval_amount_to,
1035: p_adj_rec.amount || ' From: ' ||
1036: l_approval_amount_from || ' To: ' ||
1037: l_approval_amount_to,
1038: pg_msg_level_debug);
1039: arp_util.debug( 'Amount exceeded approval limit.',
1040: pg_msg_level_debug);
1041: FND_MESSAGE.set_name('AR', 'AR_VAL_AMT_APPROVAL_LIMIT');
1042: APP_EXCEPTION.raise_exception;
1043:
1050:
1051: END IF; -- end approved case
1052:
1053:
1054: arp_util.debug('arp_process_adjustment.validate_update_approve_adj()-',
1055: pg_msg_level_debug);
1056:
1057: EXCEPTION
1058: WHEN OTHERS THEN
1055: pg_msg_level_debug);
1056:
1057: EXCEPTION
1058: WHEN OTHERS THEN
1059: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
1060: 'validate_update_approve_adj()',
1061: pg_msg_level_debug);
1062:
1063: arp_util.debug('', pg_msg_level_debug);
1059: arp_util.debug('EXCEPTION: arp_process_adjustment.' ||
1060: 'validate_update_approve_adj()',
1061: pg_msg_level_debug);
1062:
1063: arp_util.debug('', pg_msg_level_debug);
1064: arp_util.debug('---------- parameters for validate_update_approve_adj()'
1065: || ' ---------',
1066: pg_msg_level_debug);
1067:
1060: 'validate_update_approve_adj()',
1061: pg_msg_level_debug);
1062:
1063: arp_util.debug('', pg_msg_level_debug);
1064: arp_util.debug('---------- parameters for validate_update_approve_adj()'
1065: || ' ---------',
1066: pg_msg_level_debug);
1067:
1068: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
1064: arp_util.debug('---------- parameters for validate_update_approve_adj()'
1065: || ' ---------',
1066: pg_msg_level_debug);
1067:
1068: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
1069: arp_adjustments_pkg.display_adj_rec( p_adj_rec );
1070:
1071: RAISE;
1072:
1081: | |
1082: | SCOPE - PUBLIC |
1083: | |
1084: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
1085: | arp_util.debug |
1086: | |
1087: | ARGUMENTS : IN: |
1088: | p_form_name |
1089: | p_form_version |
1186: l_gl_account_source ar_receivables_trx.gl_account_source%type;
1187: l_tax_code_source ar_receivables_trx.tax_code_source%type;
1188: BEGIN
1189:
1190: arp_util.debug('ar_process_adjustment.insert_adjustment()+');
1191:
1192: p_adjustment_number := NULL;
1193: p_adjustment_id := NULL;
1194:
1211: /*--------------------+
1212: | pre-insert logic |
1213: +--------------------*/
1214:
1215: arp_util.debug( 'p_app_level = ' || p_app_level);
1216: arp_util.debug( 'p_type = ' || p_adj_rec.type);
1217: arp_util.debug('adj amount = ' || p_adj_rec.amount);
1218:
1219: /*----------------------------------------------------+
1212: | pre-insert logic |
1213: +--------------------*/
1214:
1215: arp_util.debug( 'p_app_level = ' || p_app_level);
1216: arp_util.debug( 'p_type = ' || p_adj_rec.type);
1217: arp_util.debug('adj amount = ' || p_adj_rec.amount);
1218:
1219: /*----------------------------------------------------+
1220: | BOE change |
1213: +--------------------*/
1214:
1215: arp_util.debug( 'p_app_level = ' || p_app_level);
1216: arp_util.debug( 'p_type = ' || p_adj_rec.type);
1217: arp_util.debug('adj amount = ' || p_adj_rec.amount);
1218:
1219: /*----------------------------------------------------+
1220: | BOE change |
1221: | For a reverse adjustment the validation on insert |
1311: l_ae_doc_rec.source_id_old := p_adj_rec.code_combination_id;
1312: p_adj_rec.type := 'INVOICE';
1313:
1314: ELSE
1315: arp_util.debug( 'before update_adj_related_adjustment');
1316: arp_util.debug( 'line adjusted = ' || p_adj_rec.line_adjusted);
1317: arp_util.debug( 'tax adjusted = ' || p_adj_rec.tax_adjusted);
1318: arp_util.debug( 'freight adjusted = ' || p_adj_rec.freight_adjusted);
1319:
1312: p_adj_rec.type := 'INVOICE';
1313:
1314: ELSE
1315: arp_util.debug( 'before update_adj_related_adjustment');
1316: arp_util.debug( 'line adjusted = ' || p_adj_rec.line_adjusted);
1317: arp_util.debug( 'tax adjusted = ' || p_adj_rec.tax_adjusted);
1318: arp_util.debug( 'freight adjusted = ' || p_adj_rec.freight_adjusted);
1319:
1320: /*-------------------------------------------------------------+
1313:
1314: ELSE
1315: arp_util.debug( 'before update_adj_related_adjustment');
1316: arp_util.debug( 'line adjusted = ' || p_adj_rec.line_adjusted);
1317: arp_util.debug( 'tax adjusted = ' || p_adj_rec.tax_adjusted);
1318: arp_util.debug( 'freight adjusted = ' || p_adj_rec.freight_adjusted);
1319:
1320: /*-------------------------------------------------------------+
1321: | If the flag p_check_amount has the value of 'F' ie it is |
1314: ELSE
1315: arp_util.debug( 'before update_adj_related_adjustment');
1316: arp_util.debug( 'line adjusted = ' || p_adj_rec.line_adjusted);
1317: arp_util.debug( 'tax adjusted = ' || p_adj_rec.tax_adjusted);
1318: arp_util.debug( 'freight adjusted = ' || p_adj_rec.freight_adjusted);
1319:
1320: /*-------------------------------------------------------------+
1321: | If the flag p_check_amount has the value of 'F' ie it is |
1322: | an adjustment reversal, then adjustment_type is set to |
1449: -- We store ADR (amount due remaining) values to temporary
1450: -- variables, because we do not update transaction payment
1451: -- schedule when adjustment is not approved.
1452:
1453: arp_util.calc_acctd_amount(
1454: NULL
1455: , NULL
1456: , NULL
1457: , NVL(l_ps_rec.exchange_rate,1) -- Exchange rate
1578: ELSE
1579: l_mode := p_adj_rec.type;
1580: END IF;
1581:
1582: arp_util.debug(' cust trx line id = ' || p_adj_rec.customer_trx_line_id);
1583:
1584: IF (p_app_level = 'LINE') THEN
1585: arp_etax_util.prorate_recoverable(
1586: p_adj_id => l_adjustment_id,
1614: prorated amounts can be ignored from this point
1615: on. */
1616:
1617: /* display results in debug log */
1618: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
1619: arp_util.debug(' l_gt_id = ' || l_gt_id);
1620: arp_util.debug(' l_line_amt = ' || l_line_amt);
1621: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
1622:
1615: on. */
1616:
1617: /* display results in debug log */
1618: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
1619: arp_util.debug(' l_gt_id = ' || l_gt_id);
1620: arp_util.debug(' l_line_amt = ' || l_line_amt);
1621: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
1622:
1623: IF NVL(l_gt_id,0) <> 0
1616:
1617: /* display results in debug log */
1618: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
1619: arp_util.debug(' l_gt_id = ' || l_gt_id);
1620: arp_util.debug(' l_line_amt = ' || l_line_amt);
1621: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
1622:
1623: IF NVL(l_gt_id,0) <> 0
1624: THEN
1617: /* display results in debug log */
1618: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
1619: arp_util.debug(' l_gt_id = ' || l_gt_id);
1620: arp_util.debug(' l_line_amt = ' || l_line_amt);
1621: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
1622:
1623: IF NVL(l_gt_id,0) <> 0
1624: THEN
1625: l_from_llca_call := 'Y';
1745: l_from_llca_call := 'Y';
1746:
1747: END IF;
1748:
1749: arp_util.debug('Before Calling arp_acct_main.Create_Acct_Entry');
1750: arp_util.debug('l_gt_id = ' || l_gt_id);
1751: arp_util.debug('l_from_llca_call = '||l_from_llca_call);
1752:
1753: arp_acct_main.Create_Acct_Entry(p_ae_doc_rec => l_ae_doc_rec,
1746:
1747: END IF;
1748:
1749: arp_util.debug('Before Calling arp_acct_main.Create_Acct_Entry');
1750: arp_util.debug('l_gt_id = ' || l_gt_id);
1751: arp_util.debug('l_from_llca_call = '||l_from_llca_call);
1752:
1753: arp_acct_main.Create_Acct_Entry(p_ae_doc_rec => l_ae_doc_rec,
1754: p_from_llca_call => l_from_llca_call,
1747: END IF;
1748:
1749: arp_util.debug('Before Calling arp_acct_main.Create_Acct_Entry');
1750: arp_util.debug('l_gt_id = ' || l_gt_id);
1751: arp_util.debug('l_from_llca_call = '||l_from_llca_call);
1752:
1753: arp_acct_main.Create_Acct_Entry(p_ae_doc_rec => l_ae_doc_rec,
1754: p_from_llca_call => l_from_llca_call,
1755: p_gt_id => l_gt_id);
1782: l_approval_action_history_id);
1783:
1784: END IF;
1785:
1786: arp_util.debug('ar_process_adjustment.insert_adjustment()-');
1787:
1788: EXCEPTION
1789: WHEN OTHERS THEN
1790: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
1788: EXCEPTION
1789: WHEN OTHERS THEN
1790: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
1791: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.insert_adjustment exception: '||SQLERRM );
1792: arp_util.debug(
1793: 'EXCEPTION: ar_process_adjustment.insert_adjustment()');
1794: RAISE;
1795:
1796: END;
1805: | |
1806: | SCOPE - PUBLIC |
1807: | |
1808: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
1809: | arp_util.debug |
1810: | |
1811: | ARGUMENTS : IN: |
1812: | OUT: |
1813: | IN/ OUT: |
1890: l_line_adjusted NUMBER;
1891: l_tax_adjusted NUMBER;
1892:
1893: BEGIN
1894: arp_util.debug('ar_process_adjustment.update_adjustment()+',
1895: pg_msg_level_debug);
1896:
1897: /*----------------------------------------------------------------+
1898: | check form version to determine if it is compatible with the |
1963: p_chk_approval_limits => FND_API.G_TRUE);
1964: END IF;
1965: /* End of change, manishri, Bug 9708599 */
1966:
1967: arp_util.debug(
1968: 'l_status_changed_flag: ' ||
1969: arp_trx_util.boolean_to_varchar2(l_status_changed_flag) );
1970:
1971: IF l_status_changed_flag
2109: prorated amounts can be ignored from this point
2110: on. */
2111:
2112: /* display results in debug log */
2113: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2114: arp_util.debug(' l_gt_id = ' || l_gt_id);
2115: arp_util.debug(' l_line_amt = ' || l_line_amt);
2116: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2117:
2110: on. */
2111:
2112: /* display results in debug log */
2113: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2114: arp_util.debug(' l_gt_id = ' || l_gt_id);
2115: arp_util.debug(' l_line_amt = ' || l_line_amt);
2116: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2117:
2118: IF l_gt_id <> 0 THEN
2111:
2112: /* display results in debug log */
2113: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2114: arp_util.debug(' l_gt_id = ' || l_gt_id);
2115: arp_util.debug(' l_line_amt = ' || l_line_amt);
2116: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2117:
2118: IF l_gt_id <> 0 THEN
2119: l_from_llca_call := 'Y';
2112: /* display results in debug log */
2113: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2114: arp_util.debug(' l_gt_id = ' || l_gt_id);
2115: arp_util.debug(' l_line_amt = ' || l_line_amt);
2116: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2117:
2118: IF l_gt_id <> 0 THEN
2119: l_from_llca_call := 'Y';
2120:
2164: WHERE payment_schedule_id=l_adj_rec.payment_schedule_id;
2165: EXCEPTION
2166: WHEN OTHERS THEN
2167: IF PG_DEBUG in ('Y', 'C') THEN
2168: arp_util.debug('Problem in Amount adjusted pending calculation ' ||
2169: 'EXCEPTION: arp_ps_util.update_adj_related_columns' );
2170: END IF;
2171: RAISE;
2172: END;
2180: where ct.customer_trx_id = l_adj_rec.customer_trx_id
2181: and ct.cust_trx_type_id = ctt.cust_trx_type_id ;
2182:
2183: IF PG_DEBUG in ('Y', 'C') THEN
2184: arp_util.debug('l_adj_post_to_gl : '|| l_adj_post_to_gl);
2185: END IF;
2186:
2187: EXCEPTION
2188: WHEN OTHERS THEN
2187: EXCEPTION
2188: WHEN OTHERS THEN
2189:
2190: IF PG_DEBUG in ('Y', 'C') THEN
2191: arp_util.debug('Unable to get post to gl flag for adjustment' );
2192: arp_util.debug('EXCEPTION: arp_ps_util.update_adjustment '|| SQLERRM);
2193: END IF;
2194: RAISE;
2195: END;
2188: WHEN OTHERS THEN
2189:
2190: IF PG_DEBUG in ('Y', 'C') THEN
2191: arp_util.debug('Unable to get post to gl flag for adjustment' );
2192: arp_util.debug('EXCEPTION: arp_ps_util.update_adjustment '|| SQLERRM);
2193: END IF;
2194: RAISE;
2195: END;
2196:
2233: p_security_context => l_security);
2234: EXCEPTION
2235: WHEN OTHERS THEN
2236: IF PG_DEBUG in ('Y', 'C') THEN
2237: arp_util.debug('Unable to get the XLA Entites Data ' ||
2238: 'EXCEPTION: arp_ps_util.update_adjustment' );
2239: END IF;
2240: RAISE;
2241: END;
2385: l_approval_action_history_id,
2386: l_app_ps_status);
2387: END IF;
2388:
2389: arp_util.debug('ar_process_adjustment.update_adjustment()-',
2390: pg_msg_level_debug);
2391:
2392:
2393: EXCEPTION
2393: EXCEPTION
2394: WHEN OTHERS THEN
2395: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2396: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_adjustment exception: '||SQLERRM );
2397: arp_util.debug(
2398: 'EXCEPTION: ar_process_adjustment.update_adjustment()',
2399: pg_msg_level_debug);
2400: RAISE;
2401:
2411: | |
2412: | SCOPE - PUBLIC |
2413: | |
2414: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
2415: | arp_util.debug |
2416: | |
2417: | ARGUMENTS : IN: |
2418: | p_form_name |
2419: | p_form_version |
2474:
2475: l_gt_id_temp NUMBER := 0;
2476: BEGIN
2477:
2478: arp_util.debug('ar_process_adjustment.update_approve_adj()+',
2479: pg_msg_level_debug);
2480:
2481:
2482: /*-----------------------------------------------------------------+
2582: prorated amounts can be ignored from this point
2583: on. */
2584:
2585: /* display results in debug log */
2586: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2587: arp_util.debug(' l_gt_id = ' || l_gt_id);
2588: arp_util.debug(' l_line_amt = ' || l_line_amt);
2589: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2590:
2583: on. */
2584:
2585: /* display results in debug log */
2586: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2587: arp_util.debug(' l_gt_id = ' || l_gt_id);
2588: arp_util.debug(' l_line_amt = ' || l_line_amt);
2589: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2590:
2591: IF l_gt_id <> 0
2584:
2585: /* display results in debug log */
2586: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2587: arp_util.debug(' l_gt_id = ' || l_gt_id);
2588: arp_util.debug(' l_line_amt = ' || l_line_amt);
2589: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2590:
2591: IF l_gt_id <> 0
2592: THEN
2585: /* display results in debug log */
2586: arp_util.debug('After return from arp_etax_util.prorate_recoverable');
2587: arp_util.debug(' l_gt_id = ' || l_gt_id);
2588: arp_util.debug(' l_line_amt = ' || l_line_amt);
2589: arp_util.debug(' l_tax_amt = ' || l_tax_amt);
2590:
2591: IF l_gt_id <> 0
2592: THEN
2593: l_from_llca_call := 'Y';
2748: l_aah_rec,
2749: l_approval_action_history_id
2750: );
2751:
2752: arp_util.debug('ar_process_adjustment.update_approve_adj()-',
2753: pg_msg_level_debug);
2754:
2755:
2756: EXCEPTION
2754:
2755:
2756: EXCEPTION
2757: WHEN OTHERS THEN
2758: arp_util.debug(
2759: 'EXCEPTION: ar_process_adjustment.update_approve_adj()',
2760: pg_msg_level_debug);
2761: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2762: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_approce_adjustment exception: '||SQLERRM );
2760: pg_msg_level_debug);
2761: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2762: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_approce_adjustment exception: '||SQLERRM );
2763:
2764: arp_util.debug('', pg_msg_level_debug);
2765: arp_util.debug('---------- parameters for update_approve_adj()'
2766: || ' ---------',
2767: pg_msg_level_debug);
2768:
2761: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
2762: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.update_approce_adjustment exception: '||SQLERRM );
2763:
2764: arp_util.debug('', pg_msg_level_debug);
2765: arp_util.debug('---------- parameters for update_approve_adj()'
2766: || ' ---------',
2767: pg_msg_level_debug);
2768:
2769: arp_util.debug('p_form_name = ' || p_form_name );
2765: arp_util.debug('---------- parameters for update_approve_adj()'
2766: || ' ---------',
2767: pg_msg_level_debug);
2768:
2769: arp_util.debug('p_form_name = ' || p_form_name );
2770: arp_util.debug('p_form_version = ' || p_form_version );
2771: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
2772: arp_util.debug('p_adjustment_id = ' || p_adjustment_id );
2773:
2766: || ' ---------',
2767: pg_msg_level_debug);
2768:
2769: arp_util.debug('p_form_name = ' || p_form_name );
2770: arp_util.debug('p_form_version = ' || p_form_version );
2771: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
2772: arp_util.debug('p_adjustment_id = ' || p_adjustment_id );
2773:
2774: arp_adjustments_pkg.display_adj_rec( p_adj_rec );
2767: pg_msg_level_debug);
2768:
2769: arp_util.debug('p_form_name = ' || p_form_name );
2770: arp_util.debug('p_form_version = ' || p_form_version );
2771: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
2772: arp_util.debug('p_adjustment_id = ' || p_adjustment_id );
2773:
2774: arp_adjustments_pkg.display_adj_rec( p_adj_rec );
2775:
2768:
2769: arp_util.debug('p_form_name = ' || p_form_name );
2770: arp_util.debug('p_form_version = ' || p_form_version );
2771: arp_util.debug('p_adjustment_code = ' || p_adjustment_code );
2772: arp_util.debug('p_adjustment_id = ' || p_adjustment_id );
2773:
2774: arp_adjustments_pkg.display_adj_rec( p_adj_rec );
2775:
2776: RAISE;
2789: | |
2790: | SCOPE - PUBLIC |
2791: | |
2792: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
2793: | arp_util.debug |
2794: | |
2795: | ARGUMENTS : IN: |
2796: | None |
2797: | OUT: |
2816:
2817: l_new_ps_rec ar_payment_schedules%rowtype;
2818:
2819: BEGIN
2820: arp_util.debug('test_adj()+');
2821:
2822:
2823: /*---------------------------------------------------+
2824: | Verify that the adjustment was updated properly |
2888: and acctd_amount = p_adj_rec.acctd_amount;
2889:
2890: IF ( p_result = 'A: Fail, ' )
2891: THEN
2892: arp_util.debug('----- database adjustment record -----');
2893: arp_adjustments_pkg.display_adj_p(p_adj_rec.adjustment_id);
2894: arp_util.debug('----- parameter adjustment record -----');
2895: arp_adjustments_pkg.display_adj_rec(p_adj_rec);
2896: END IF;
2890: IF ( p_result = 'A: Fail, ' )
2891: THEN
2892: arp_util.debug('----- database adjustment record -----');
2893: arp_adjustments_pkg.display_adj_p(p_adj_rec.adjustment_id);
2894: arp_util.debug('----- parameter adjustment record -----');
2895: arp_adjustments_pkg.display_adj_rec(p_adj_rec);
2896: END IF;
2897:
2898:
2980: l_new_ps_rec.amount_due_remaining = 0))
2981: );
2982:
2983:
2984: arp_util.debug('test_adj()-');
2985:
2986: EXCEPTION
2987: WHEN OTHERS THEN
2988: arp_util.debug( 'EXCEPTION: ar_process_adjustment.test_adj()',
2984: arp_util.debug('test_adj()-');
2985:
2986: EXCEPTION
2987: WHEN OTHERS THEN
2988: arp_util.debug( 'EXCEPTION: ar_process_adjustment.test_adj()',
2989: pg_msg_level_debug);
2990: RAISE;
2991: END;
2992:
3076: -- This block will update all other adjustments than Approved and
3077: -- Rejected to be Rejected.
3078:
3079: IF PG_DEBUG in ('Y', 'C') THEN
3080: arp_util.debug ( 'before update all other adjustments');
3081: END IF;
3082: BEGIN
3083: SELECT *
3084: INTO l_adj_rec
3101: where ct.customer_trx_id = l_adj_rec.customer_trx_id
3102: and ct.cust_trx_type_id = ctt.cust_trx_type_id ;
3103:
3104: IF PG_DEBUG in ('Y', 'C') THEN
3105: arp_util.debug('l_adj_post_to_gl : '|| l_adj_post_to_gl);
3106: END IF;
3107:
3108: EXCEPTION
3109: WHEN OTHERS THEN
3108: EXCEPTION
3109: WHEN OTHERS THEN
3110:
3111: IF PG_DEBUG in ('Y', 'C') THEN
3112: arp_util.debug('Unable to get post to gl flag for adjustment' );
3113: arp_util.debug('EXCEPTION: arp_process_adjustment.reverse_adjustment '|| SQLERRM);
3114: END IF;
3115: RAISE;
3116: END;
3109: WHEN OTHERS THEN
3110:
3111: IF PG_DEBUG in ('Y', 'C') THEN
3112: arp_util.debug('Unable to get post to gl flag for adjustment' );
3113: arp_util.debug('EXCEPTION: arp_process_adjustment.reverse_adjustment '|| SQLERRM);
3114: END IF;
3115: RAISE;
3116: END;
3117:
3153: p_security_context => l_security);
3154: EXCEPTION
3155: WHEN OTHERS THEN
3156: IF PG_DEBUG in ('Y', 'C') THEN
3157: arp_util.debug('Unable to get the XLA Entites Data ' ||
3158: 'EXCEPTION: arp_process_adjustment.reverse_adjustment' );
3159: END IF;
3160: RAISE;
3161: END;
3187: l_aah_rec.comments :=
3188: fnd_message.get_string ('AR','AR_ADJ_REVERSED');
3189:
3190: IF PG_DEBUG in ('Y', 'C') THEN
3191: arp_util.debug( 'before insert_p for ar_approval_action_history');
3192: END IF;
3193: arp_aa_history_pkg.insert_p( l_aah_rec, l_aah_id );
3194:
3195: -- If status of adj == R, then there is no need to create an opposing
3197: -- Otherwise, create an opposing adj with status = A
3198: -- and amount = (-1)*amount
3199:
3200: IF PG_DEBUG in ('Y', 'C') THEN
3201: arp_util.debug( 'before modify_adj_rec');
3202: END IF;
3203: modify_adj_rec(
3204: p_adj_id
3205: , p_reversal_gl_date
3618: where ct.customer_trx_id = p_adj_rec.customer_trx_id
3619: and ct.cust_trx_type_id = ctt.cust_trx_type_id ;
3620:
3621: IF PG_DEBUG in ('Y', 'C') THEN
3622: arp_util.debug('l_adj_post_to_gl : '|| l_adj_post_to_gl);
3623: END IF;
3624:
3625: EXCEPTION
3626: WHEN OTHERS THEN
3625: EXCEPTION
3626: WHEN OTHERS THEN
3627:
3628: IF PG_DEBUG in ('Y', 'C') THEN
3629: arp_util.debug('Unable to get post to gl flag for adjustment' );
3630: arp_util.debug('EXCEPTION: apr_process_adjustment.insert_reverse_actions '|| SQLERRM);
3631: END IF;
3632: RAISE;
3633: END;
3626: WHEN OTHERS THEN
3627:
3628: IF PG_DEBUG in ('Y', 'C') THEN
3629: arp_util.debug('Unable to get post to gl flag for adjustment' );
3630: arp_util.debug('EXCEPTION: apr_process_adjustment.insert_reverse_actions '|| SQLERRM);
3631: END IF;
3632: RAISE;
3633: END;
3634:
3673: p_security_context => l_security);
3674: EXCEPTION
3675: WHEN OTHERS THEN
3676: IF PG_DEBUG in ('Y', 'C') THEN
3677: arp_util.debug('Unable to get the XLA Entites Data ' ||
3678: 'EXCEPTION: arp_process_adjustment.insert_reverse_actions' );
3679: END IF;
3680: RAISE;
3681: END;
3870: l_return_status VARCHAR2(10);
3871:
3872: BEGIN
3873: IF PG_DEBUG in ('Y', 'C') THEN
3874: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()+');
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3871:
3872: BEGIN
3873: IF PG_DEBUG in ('Y', 'C') THEN
3874: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()+');
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3872: BEGIN
3873: IF PG_DEBUG in ('Y', 'C') THEN
3874: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()+');
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3880: arp_util.debug(' cust trx line id = ' || to_char(p_cust_trx_line_id));
3873: IF PG_DEBUG in ('Y', 'C') THEN
3874: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()+');
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3880: arp_util.debug(' cust trx line id = ' || to_char(p_cust_trx_line_id));
3881: END IF;
3874: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()+');
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3880: arp_util.debug(' cust trx line id = ' || to_char(p_cust_trx_line_id));
3881: END IF;
3882:
3875: arp_util.debug( 'p_adj_amount = ' || to_char(p_adj_amount));
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3880: arp_util.debug(' cust trx line id = ' || to_char(p_cust_trx_line_id));
3881: END IF;
3882:
3883: p_error_num := 0;
3876: arp_util.debug( 'p_payment_schedule_id = ' || to_char(p_payment_schedule_id));
3877: arp_util.debug( 'p_type = ' || p_type);
3878: arp_util.debug( 'p_receivables_trx_id = ' || to_char(p_receivables_trx_id));
3879: arp_util.debug( 'p_apply_date = ' || to_char(p_apply_date));
3880: arp_util.debug(' cust trx line id = ' || to_char(p_cust_trx_line_id));
3881: END IF;
3882:
3883: p_error_num := 0;
3884:
3958: AND org_id = arp_global.sysparam.org_id;
3959: EXCEPTION
3960: WHEN NO_DATA_FOUND THEN
3961: l_rounding_rule := NULL;
3962: arp_util.debug('tax_rounding_rule will be defaulted because there is no row in zx_product_options');
3963: arp_util.debug('Ideal Default Tax Rounding Rule will be : NEAREST');
3964: END;
3965: arp_util.debug('tax_rounding_rule = ' || l_rounding_rule);
3966:
3959: EXCEPTION
3960: WHEN NO_DATA_FOUND THEN
3961: l_rounding_rule := NULL;
3962: arp_util.debug('tax_rounding_rule will be defaulted because there is no row in zx_product_options');
3963: arp_util.debug('Ideal Default Tax Rounding Rule will be : NEAREST');
3964: END;
3965: arp_util.debug('tax_rounding_rule = ' || l_rounding_rule);
3966:
3967: fnd_currency.Get_info(l_invoice_currency_code,
3961: l_rounding_rule := NULL;
3962: arp_util.debug('tax_rounding_rule will be defaulted because there is no row in zx_product_options');
3963: arp_util.debug('Ideal Default Tax Rounding Rule will be : NEAREST');
3964: END;
3965: arp_util.debug('tax_rounding_rule = ' || l_rounding_rule);
3966:
3967: fnd_currency.Get_info(l_invoice_currency_code,
3968: l_precision,
3969: l_extended_precision,
4025: l_min_acct_unit,
4026: l_rounding_rule);
4027:
4028: IF PG_DEBUG in ('Y', 'C') THEN
4029: arp_util.debug( 'l_tax_rate = ' || to_char(l_tax_rate));
4030: END IF;
4031: EXCEPTION
4032: WHEN NO_DATA_FOUND THEN
4033: IF PG_DEBUG in ('Y', 'C') THEN
4030: END IF;
4031: EXCEPTION
4032: WHEN NO_DATA_FOUND THEN
4033: IF PG_DEBUG in ('Y', 'C') THEN
4034: arp_util.debug( 'EXCEPTION: Cannot find a tax rate for the receivable activity tax code');
4035: END IF;
4036: p_error_num := 1;
4037: FND_MESSAGE.SET_NAME('AR', 'AR_TW_PRORATE_ADJ_NO_TAX_RATE');
4038: END;
4067: p_prorated_tax := 0;
4068: END IF;
4069:
4070: IF PG_DEBUG in ('Y', 'C') THEN
4071: arp_util.debug( 'p_prorated_amt = ' || to_char(p_prorated_amt));
4072: arp_util.debug( 'p_prorated_tax = ' || to_char(p_prorated_tax));
4073: arp_util.debug( 'p_error_num = ' || to_char(p_error_num));
4074: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()-');
4075: END IF;
4068: END IF;
4069:
4070: IF PG_DEBUG in ('Y', 'C') THEN
4071: arp_util.debug( 'p_prorated_amt = ' || to_char(p_prorated_amt));
4072: arp_util.debug( 'p_prorated_tax = ' || to_char(p_prorated_tax));
4073: arp_util.debug( 'p_error_num = ' || to_char(p_error_num));
4074: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()-');
4075: END IF;
4076:
4069:
4070: IF PG_DEBUG in ('Y', 'C') THEN
4071: arp_util.debug( 'p_prorated_amt = ' || to_char(p_prorated_amt));
4072: arp_util.debug( 'p_prorated_tax = ' || to_char(p_prorated_tax));
4073: arp_util.debug( 'p_error_num = ' || to_char(p_error_num));
4074: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()-');
4075: END IF;
4076:
4077: EXCEPTION
4070: IF PG_DEBUG in ('Y', 'C') THEN
4071: arp_util.debug( 'p_prorated_amt = ' || to_char(p_prorated_amt));
4072: arp_util.debug( 'p_prorated_tax = ' || to_char(p_prorated_tax));
4073: arp_util.debug( 'p_error_num = ' || to_char(p_error_num));
4074: arp_util.debug('arp_process_adjustment.cal_prorated_amounts()-');
4075: END IF;
4076:
4077: EXCEPTION
4078: WHEN OTHERS THEN
4076:
4077: EXCEPTION
4078: WHEN OTHERS THEN
4079: IF PG_DEBUG in ('Y', 'C') THEN
4080: arp_util.debug(
4081: 'EXCEPTION: arp_process_adjustment.cal_prorated_amounts()');
4082: END IF;
4083: FND_MESSAGE.set_name( 'AR', 'GENERIC_MESSAGE' );
4084: FND_MESSAGE.set_token( 'GENERIC_TEXT', 'arp_process_adjustment.cal_prorated_amounts exception: '||SQLERRM );
4102: pg_base_min_acc_unit := arp_global.base_min_acc_unit;
4103:
4104: EXCEPTION
4105: WHEN OTHERS THEN
4106: arp_util.debug('EXCEPTION: arp_process_adjustment.initialization');
4107: RAISE;
4108:
4109:
4110: END ARP_PROCESS_ADJUSTMENT;