DBA Data[Home] [Help]

APPS.ARP_CALCULATE_DISCOUNT dependencies on ARP_CALCULATE_DISCOUNT

Line 1: PACKAGE BODY ARP_CALCULATE_DISCOUNT AS

1: PACKAGE BODY ARP_CALCULATE_DISCOUNT AS
2: /* $Header: ARRUDISB.pls 120.33 2011/11/11 15:45:27 mraymond ship $ */
3: --
4: error_code NUMBER;
5:

Line 165: arp_standard.debug( 'arp_calculate_discount.calculate_discounts() +' );

161: --
162: BEGIN
163: --
164: IF PG_DEBUG in ('Y', 'C') THEN
165: arp_standard.debug( 'arp_calculate_discount.calculate_discounts() +' );
166: END IF;
167: -- ARTA Changes, calles TA version of calculate discount for TA
168: -- installation
169: IF nvl(arp_global.sysparam.ta_installed_flag,'N') = 'Y' THEN

Line 500: arp_standard.debug( 'arp_calculate_discount.calculate_discounts() -' );

496: arp_standard.debug( 'p_error_code := '||p_error_code );
497: END IF;
498: END IF;
499: IF PG_DEBUG in ('Y', 'C') THEN
500: arp_standard.debug( 'arp_calculate_discount.calculate_discounts() -' );
501: END IF;
502: --
503: EXCEPTION
504: WHEN OTHERS THEN

Line 506: arp_standard.debug( 'Exception: arp_calculate_discount.calculate_discounts()' );

502: --
503: EXCEPTION
504: WHEN OTHERS THEN
505: IF PG_DEBUG in ('Y', 'C') THEN
506: arp_standard.debug( 'Exception: arp_calculate_discount.calculate_discounts()' );
507: END IF;
508: --IF (error_code IS NOT NULL) THEN
509: --p_error_code := error_code;
510: --RETURN;

Line 547: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,

543: | out NOCOPY look. Removed obsolete parameter
544: | P_SELECT_FLAG.
545: +===========================================================================*/
546: PROCEDURE get_discount_percentages(
547: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,
548: p_ps_rec IN OUT NOCOPY ar_payment_schedules%ROWTYPE
549: ) IS
550: BEGIN
551: IF PG_DEBUG in ('Y', 'C') THEN

Line 552: arp_standard.debug( 'arp_calculate_discount.'||

548: p_ps_rec IN OUT NOCOPY ar_payment_schedules%ROWTYPE
549: ) IS
550: BEGIN
551: IF PG_DEBUG in ('Y', 'C') THEN
552: arp_standard.debug( 'arp_calculate_discount.'||
553: 'get_discount_percentages()+' );
554: END IF;
555:
556: -- ----------------------------------------------------------------

Line 573: arp_standard.debug( 'arp_calculate_discount.get_discount_percentages()-');

569: get_current_discount_percent (p_disc_rec, p_ps_rec);
570: END IF;
571:
572: IF PG_DEBUG in ('Y', 'C') THEN
573: arp_standard.debug( 'arp_calculate_discount.get_discount_percentages()-');
574: END IF;
575: EXCEPTION
576: WHEN OTHERS THEN
577: IF PG_DEBUG in ('Y', 'C') THEN

Line 578: arp_standard.debug( 'Exception: arp_calculate_discount.'||

574: END IF;
575: EXCEPTION
576: WHEN OTHERS THEN
577: IF PG_DEBUG in ('Y', 'C') THEN
578: arp_standard.debug( 'Exception: arp_calculate_discount.'||
579: 'get_discount_percentages()' );
580: END IF;
581: RAISE;
582: END get_discount_percentages;

Line 615: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,

611: | MODIFICATION HISTORY - Created by Shiv Ragunat - 05/24/95 |
612: | |
613: +===========================================================================*/
614: PROCEDURE get_payment_schedule_info(
615: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,
616: p_ps_rec IN OUT NOCOPY ar_payment_schedules%ROWTYPE
617: ) IS
618: l_payment_schedule_id NUMBER;
619: BEGIN

Line 621: arp_standard.debug( 'arp_calculate_discount.get_payment_schedule_info() +' );

617: ) IS
618: l_payment_schedule_id NUMBER;
619: BEGIN
620: IF PG_DEBUG in ('Y', 'C') THEN
621: arp_standard.debug( 'arp_calculate_discount.get_payment_schedule_info() +' );
622: END IF;
623: --
624: -- Select Payment Schedule info and populate ps record type and two disc record
625: -- values (calc_disc_on_lines and disc_partial_pmt_flag)

Line 667: 'EXCEPTION: arp_calculate_discount.get_payment_schedule_info' );

663: RAISE ar_m_no_rec;
664: WHEN OTHERS THEN
665: IF PG_DEBUG in ('Y', 'C') THEN
666: arp_standard.debug('get_payment_schedule_info: ' ||
667: 'EXCEPTION: arp_calculate_discount.get_payment_schedule_info' );
668: END IF;
669: RAISE;
670: END;
671:

Line 681: arp_standard.debug( 'arp_calculate_discount.get_payment_schedule_info()-');

677: p_ps_rec.terms_sequence_number := AR_NO_TERM;
678: END IF;
679:
680: IF PG_DEBUG in ('Y', 'C') THEN
681: arp_standard.debug( 'arp_calculate_discount.get_payment_schedule_info()-');
682: END IF;
683:
684: EXCEPTION
685: WHEN OTHERS THEN

Line 687: arp_standard.debug('get_payment_schedule_info: ' || 'Exception: arp_calculate_discount.'||

683:
684: EXCEPTION
685: WHEN OTHERS THEN
686: IF PG_DEBUG in ('Y', 'C') THEN
687: arp_standard.debug('get_payment_schedule_info: ' || 'Exception: arp_calculate_discount.'||
688: 'get_payment_schedule_info()' );
689: END IF;
690: RAISE;
691: END get_payment_schedule_info;

Line 728: arp_standard.debug( 'arp_calculate_discount.'||

724: p_ps_rec IN ar_payment_schedules%ROWTYPE
725: ) IS
726: BEGIN
727: IF PG_DEBUG in ('Y', 'C') THEN
728: arp_standard.debug( 'arp_calculate_discount.'||
729: 'get_best_discount_percentage()+' );
730: END IF;
731: --
732: -- Get best discount percentage

Line 745: arp_standard.debug( 'arp_calculate_discount.'||

741:
742: IF PG_DEBUG in ('Y', 'C') THEN
743: arp_standard.debug( '-- best_discount_percentage:'||
744: TO_CHAR( p_disc_rec.best_disc_pct ) );
745: arp_standard.debug( 'arp_calculate_discount.'||
746: 'get_best_discount_percentage()-' );
747: END IF;
748:
749: EXCEPTION

Line 752: arp_standard.debug( 'Exception: arp_calculate_discount.'||

748:
749: EXCEPTION
750: WHEN OTHERS THEN
751: IF PG_DEBUG in ('Y', 'C') THEN
752: arp_standard.debug( 'Exception: arp_calculate_discount.'||
753: 'get_best_discount_percentage()' );
754: END IF;
755: RAISE;
756: END get_best_discount_percentage;

Line 821: 'arp_calculate_discount.get_current_discount_percent()+' );

817:
818: BEGIN
819: IF PG_DEBUG in ('Y', 'C') THEN
820: arp_standard.debug(
821: 'arp_calculate_discount.get_current_discount_percent()+' );
822: END IF;
823: --
824: -- Get current discount percentage
825: --

Line 850: arp_standard.debug( 'arp_calculate_discount.'||

846:
847: IF PG_DEBUG in ('Y', 'C') THEN
848: arp_standard.debug( '--p_disc_rec.earned_disc_pct:'||
849: TO_CHAR(p_disc_rec.earned_disc_pct));
850: arp_standard.debug( 'arp_calculate_discount.'||
851: 'get_current_discount_percent()-' );
852: END IF;
853:
854: EXCEPTION

Line 857: arp_standard.debug( 'EXCEPTION: arp_calculate_discount.'||

853:
854: EXCEPTION
855: WHEN OTHERS THEN
856: IF PG_DEBUG in ('Y', 'C') THEN
857: arp_standard.debug( 'EXCEPTION: arp_calculate_discount.'||
858: 'get_current_discount_percent()' );
859: END IF;
860: RAISE;
861:

Line 901: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,

897: | V Ahluwalia 05/18/98 Bug #592696, if amount due original is 0 then|
898: | discount percent is 0, prevent division by 0 |
899: +===========================================================================*/
900: PROCEDURE correct_lines_only_discounts(
901: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,
902: p_ps_rec IN ar_payment_schedules%ROWTYPE ) IS
903: l_line_adjusted NUMBER;
904: l_line_applied NUMBER;
905: l_amount_adjusted NUMBER;

Line 926: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts() +' );

922:
923: --
924: BEGIN
925: IF PG_DEBUG in ('Y', 'C') THEN
926: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts() +' );
927: END IF;
928: --
929: --Correct discount percentages for LINEs only discounts.
930: --

Line 946: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts : No adjustments for payment schedule' );

942: END;
943: --
944: IF ( l_amount_adjusted IS NULL ) THEN
945: IF PG_DEBUG in ('Y', 'C') THEN
946: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts : No adjustments for payment schedule' );
947: END IF;
948: l_adjustments := FALSE;
949: l_tax_adjustments := FALSE;
950: END IF;

Line 965: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts : No credit memos for payment schedule' );

961: END;
962: --
963: IF ( l_amount_applied IS NULL ) THEN
964: IF PG_DEBUG in ('Y', 'C') THEN
965: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts : No credit memos for payment schedule' );
966: END IF;
967: l_credit_memos := FALSE;
968: l_tax_credit_memos := FALSE;
969: END IF;

Line 1118: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts() -' );

1114: IF PG_DEBUG in ('Y', 'C') THEN
1115: arp_standard.debug( ' p_disc_rec.adjusted_ado:'||TO_CHAR(p_disc_rec.adjusted_ado));
1116: arp_standard.debug( ' p_disc_rec.earned_disc_pct:'||TO_CHAR(p_disc_rec.earned_disc_pct));
1117: arp_standard.debug( ' p_disc_rec.best_disc_pct:'||TO_CHAR(p_disc_rec.best_disc_pct));
1118: arp_standard.debug( 'arp_calculate_discount.correct_lines_only_discounts() -' );
1119: END IF;
1120: --
1121: EXCEPTION
1122: WHEN OTHERS THEN

Line 1124: arp_standard.debug( 'Exception: arp_calculate_discount.correct_lines_only_discounts()' );

1120: --
1121: EXCEPTION
1122: WHEN OTHERS THEN
1123: IF PG_DEBUG in ('Y', 'C') THEN
1124: arp_standard.debug( 'Exception: arp_calculate_discount.correct_lines_only_discounts()' );
1125: END IF;
1126: RAISE;
1127: END correct_lines_only_discounts;
1128: --

Line 1168: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_adr() +' );

1164: l_amt NUMBER;
1165: l_new_amt_due_remaining NUMBER;
1166: BEGIN
1167: IF PG_DEBUG in ('Y', 'C') THEN
1168: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_adr() +' );
1169: END IF;
1170: --
1171: l_amt_due_remaining := p_ps_rec.amount_due_remaining;
1172: l_amt := p_disc_rec.input_amt;

Line 1205: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_adr() +' );

1201: RETURN;
1202: END IF;
1203: --
1204: IF PG_DEBUG in ('Y', 'C') THEN
1205: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_adr() +' );
1206: END IF;
1207: --
1208: EXCEPTION
1209: WHEN OTHERS THEN

Line 1211: arp_standard.debug( 'Exception: arp_calculate_discount.decrease_discounts_to_adr()');

1207: --
1208: EXCEPTION
1209: WHEN OTHERS THEN
1210: IF PG_DEBUG in ('Y', 'C') THEN
1211: arp_standard.debug( 'Exception: arp_calculate_discount.decrease_discounts_to_adr()');
1212: END IF;
1213: RAISE;
1214: END decrease_discounts_to_adr;
1215: --

Line 1245: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,

1241: | |
1242: +===========================================================================*/
1243: PROCEDURE determine_max_allowed_disc(
1244: p_mode IN NUMBER,
1245: p_disc_rec IN OUT NOCOPY arp_calculate_discount.discount_record_type,
1246: p_ps_rec IN ar_payment_schedules%ROWTYPE ) IS
1247: l_amount_adjusted NUMBER;
1248: l_amount_applied NUMBER;
1249: l_adjustments BOOLEAN;

Line 1255: arp_standard.debug( 'arp_calculate_discount.determine_max_allowed_disc() +' );

1251: l_max_allowed_discount NUMBER;
1252: l_amt_due_original NUMBER;
1253: BEGIN
1254: IF PG_DEBUG in ('Y', 'C') THEN
1255: arp_standard.debug( 'arp_calculate_discount.determine_max_allowed_disc() +' );
1256: END IF;
1257: --
1258: l_adjustments := TRUE;
1259: l_credit_memos := TRUE;

Line 1376: arp_standard.debug( 'arp_calculate_discount.determine_max_allowed_disc() -' );

1372: -- Populate max allowable discount and exit.
1373: --
1374: p_disc_rec.max_disc := l_max_allowed_discount;
1375: IF PG_DEBUG in ('Y', 'C') THEN
1376: arp_standard.debug( 'arp_calculate_discount.determine_max_allowed_disc() -' );
1377: END IF;
1378: --
1379: EXCEPTION
1380: WHEN OTHERS THEN

Line 1382: arp_standard.debug( 'Exception: arp_calculate_discount.determine_max_allowed_disc()');

1378: --
1379: EXCEPTION
1380: WHEN OTHERS THEN
1381: IF PG_DEBUG in ('Y', 'C') THEN
1382: arp_standard.debug( 'Exception: arp_calculate_discount.determine_max_allowed_disc()');
1383: END IF;
1384: RAISE;
1385: END determine_max_allowed_disc;
1386: --

Line 1454: arp_standard.debug( 'arp_calculate_discount.calculate_direct_discount() +' );

1450: l_ps_disc_partial_pay_flag VARCHAR2(1) := 'N' ;
1451:
1452: BEGIN
1453: IF PG_DEBUG in ('Y', 'C') THEN
1454: arp_standard.debug( 'arp_calculate_discount.calculate_direct_discount() +' );
1455: END IF;
1456: --
1457: l_ado := p_disc_rec.adjusted_ado;
1458: l_earned_disc_pct := p_disc_rec.earned_disc_pct;

Line 1751: arp_standard.debug( 'arp_calculate_discount.calculate_direct_discount()-');

1747: IF PG_DEBUG in ('Y', 'C') THEN
1748: arp_standard.debug( '-- p_earned_disc: '||TO_CHAR(p_earned_disc));
1749: arp_standard.debug( '-- max_disc:' ||TO_CHAR(p_disc_rec.max_disc));
1750: arp_standard.debug( '-- p_unearned_disc:'||TO_CHAR(p_unearned_disc));
1751: arp_standard.debug( 'arp_calculate_discount.calculate_direct_discount()-');
1752: END IF;
1753:
1754: EXCEPTION
1755: WHEN OTHERS THEN

Line 1757: arp_standard.debug( 'Exception: arp_calculate_discount.'||

1753:
1754: EXCEPTION
1755: WHEN OTHERS THEN
1756: IF PG_DEBUG in ('Y', 'C') THEN
1757: arp_standard.debug( 'Exception: arp_calculate_discount.'||
1758: 'calculate_direct_discount()');
1759: END IF;
1760: RAISE;
1761: END calculate_direct_discount;

Line 1812: arp_standard.debug( 'arp_calculate_discount.calculate_default_discount() +' );

1808: l_disc_to_take NUMBER;
1809: l_OIR_AR BOOLEAN;
1810: BEGIN
1811: IF PG_DEBUG in ('Y', 'C') THEN
1812: arp_standard.debug( 'arp_calculate_discount.calculate_default_discount() +' );
1813: END IF;
1814: --
1815: /*FP bug 5335376 for Bug 5223829 Leftover changes of bug for case of system option partial discount unchecked
1816: Set variable based on parameter p_called_from*/

Line 2017: arp_standard.debug( 'arp_calculate_discount.calculate_default_discount() -' );

2013: --else
2014: --set discount to 0.
2015: --
2016: IF PG_DEBUG in ('Y', 'C') THEN
2017: arp_standard.debug( 'arp_calculate_discount.calculate_default_discount() -' );
2018: END IF;
2019: --
2020: EXCEPTION
2021: WHEN OTHERS THEN

Line 2023: arp_standard.debug( 'Exception: arp_calculate_discount.calculate_default_discount()');

2019: --
2020: EXCEPTION
2021: WHEN OTHERS THEN
2022: IF PG_DEBUG in ('Y', 'C') THEN
2023: arp_standard.debug( 'Exception: arp_calculate_discount.calculate_default_discount()');
2024: END IF;
2025: RAISE;
2026: END calculate_default_discount;
2027: --

Line 2064: arp_standard.debug( 'arp_calculate_discount.check_input() +' );

2060: p_select_flag IN BOOLEAN,
2061: p_ps_rec IN OUT NOCOPY ar_payment_schedules%ROWTYPE ) IS
2062: BEGIN
2063: IF PG_DEBUG in ('Y', 'C') THEN
2064: arp_standard.debug( 'arp_calculate_discount.check_input() +' );
2065: END IF;
2066: --
2067: -- If Input Amount equals NULL
2068: -- exit with error

Line 2072: arp_standard.debug( 'arp_calculate_discount.check_input : Input amount is NULL. Must have a value.' );

2068: -- exit with error
2069: IF p_disc_rec.input_amt IS NULL
2070: THEN
2071: IF PG_DEBUG in ('Y', 'C') THEN
2072: arp_standard.debug( 'arp_calculate_discount.check_input : Input amount is NULL. Must have a value.' );
2073: END IF;
2074: --error_code := AR_M_FAILURE ;
2075: IF PG_DEBUG in ('Y', 'C') THEN
2076: arp_standard.debug( 'Check input Failed' );

Line 2086: arp_standard.debug( 'arp_calculate_discount.check_input : Apply date is NULL. Must have a value.' );

2082: -- exit with error
2083: IF p_disc_rec.apply_date IS NULL
2084: THEN
2085: IF PG_DEBUG in ('Y', 'C') THEN
2086: arp_standard.debug( 'arp_calculate_discount.check_input : Apply date is NULL. Must have a value.' );
2087: END IF;
2088: --error_code := AR_M_FAILURE ;
2089: IF PG_DEBUG in ('Y', 'C') THEN
2090: arp_standard.debug( 'Check input Failed' );

Line 2107: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.disc_partial_pmt_flag' );

2103: IF p_disc_rec.disc_partial_pmt_flag <> 'Y' AND
2104: p_disc_rec.disc_partial_pmt_flag <> 'N'
2105: THEN
2106: IF PG_DEBUG in ('Y', 'C') THEN
2107: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.disc_partial_pmt_flag' );
2108: END IF;
2109: RAISE ar_m_fail;
2110: END IF;
2111: -- If calc_disc_on_lines not in ('Y', 'N', 'I', 'L', 'T', 'F')

Line 2121: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.calc_disc_on_lines' );

2117: p_disc_rec.calc_disc_on_lines <> 'T' AND
2118: p_disc_rec.calc_disc_on_lines <> 'F'
2119: THEN
2120: IF PG_DEBUG in ('Y', 'C') THEN
2121: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.calc_disc_on_lines' );
2122: END IF;
2123: RAISE ar_m_fail;
2124: END IF;
2125: END IF;

Line 2132: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.earned_both_flag' );

2128: -- exit with error
2129: IF ( p_disc_rec.earned_both_flag <> AR_EARNED_INDICATOR AND
2130: p_disc_rec.earned_both_flag <> AR_BOTH_INDICATOR ) THEN
2131: IF PG_DEBUG in ('Y', 'C') THEN
2132: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_disc_rec.earned_both_flag' );
2133: END IF;
2134: RAISE ar_m_fail;
2135: END IF;
2136: -- If Select_flag <> TRUE AND <> FALSE

Line 2140: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_select_flag. Must be TRUE or FALSE.' );

2136: -- If Select_flag <> TRUE AND <> FALSE
2137: -- exit with error
2138: IF ( p_select_flag <> TRUE AND p_select_flag <> FALSE ) THEN
2139: IF PG_DEBUG in ('Y', 'C') THEN
2140: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_select_flag. Must be TRUE or FALSE.' );
2141: END IF;
2142: RAISE ar_m_fail;
2143: END IF;
2144: -- If payment_schedule_id <= 0

Line 2148: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for

2144: -- If payment_schedule_id <= 0
2145: -- exit with error
2146: IF ( p_ps_rec.payment_schedule_id <= 0 ) THEN
2147: IF PG_DEBUG in ('Y', 'C') THEN
2148: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for
2149: p_ps_rec.payment_schedule_id. Must be greater than zero.' );
2150: END IF;
2151: RAISE ar_m_fail;
2152: END IF;

Line 2161: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_ps_rec.term_id. Must be greater than zero. ' );

2157: p_ps_rec.term_id := AR_NO_TERM;
2158: ELSIF p_ps_rec.term_id < 0
2159: THEN
2160: IF PG_DEBUG in ('Y', 'C') THEN
2161: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for p_ps_rec.term_id. Must be greater than zero. ' );
2162: END IF;
2163: RAISE ar_m_fail;
2164: END IF;
2165: IF p_ps_rec.terms_sequence_number IS NULL

Line 2171: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for

2167: p_ps_rec.terms_sequence_number := AR_NO_TERM;
2168: ELSIF ( p_ps_rec.terms_sequence_number < 0 )
2169: THEN
2170: IF PG_DEBUG in ('Y', 'C') THEN
2171: arp_standard.debug( 'arp_calculate_discount.check_input : Invalid value for
2172: p_ps_rec.terms_sequence_number. Must be greater than zero. ' );
2173: END IF;
2174: RAISE ar_m_fail;
2175: END IF;

Line 2178: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.trx_date is NULL. Must have a value. ');

2174: RAISE ar_m_fail;
2175: END IF;
2176: IF ( p_ps_rec.trx_date IS NULL ) THEN
2177: IF PG_DEBUG in ('Y', 'C') THEN
2178: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.trx_date is NULL. Must have a value. ');
2179: END IF;
2180: RAISE ar_m_fail;
2181: END IF;
2182: IF ( p_ps_rec.amount_due_original IS NULL )

Line 2185: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.amount_due_original is NULL . Must have a value. ');

2181: END IF;
2182: IF ( p_ps_rec.amount_due_original IS NULL )
2183: THEN
2184: IF PG_DEBUG in ('Y', 'C') THEN
2185: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.amount_due_original is NULL . Must have a value. ');
2186: END IF;
2187: RAISE ar_m_fail;
2188: END IF;
2189: IF ( p_ps_rec.invoice_currency_code IS NULL ) THEN

Line 2191: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.invoice_currency_code is NULL . Must have a value. ');

2187: RAISE ar_m_fail;
2188: END IF;
2189: IF ( p_ps_rec.invoice_currency_code IS NULL ) THEN
2190: IF PG_DEBUG in ('Y', 'C') THEN
2191: arp_standard.debug( 'arp_calculate_discount.check_input : p_ps_rec.invoice_currency_code is NULL . Must have a value. ');
2192: END IF;
2193: RAISE ar_m_fail;
2194: END IF;
2195: IF ( p_ps_rec.discount_taken_earned IS NULL ) THEN

Line 2236: arp_standard.debug( 'arp_calculate_discount.check_input() -' );

2232: -- If lines_original = NULL
2233: -- Set lines_original = 0
2234: --
2235: IF PG_DEBUG in ('Y', 'C') THEN
2236: arp_standard.debug( 'arp_calculate_discount.check_input() -' );
2237: END IF;
2238: --
2239: EXCEPTION
2240: WHEN OTHERS THEN

Line 2242: arp_standard.debug( 'Exception: arp_calculate_discount.check_input()' );

2238: --
2239: EXCEPTION
2240: WHEN OTHERS THEN
2241: IF PG_DEBUG in ('Y', 'C') THEN
2242: arp_standard.debug( 'Exception: arp_calculate_discount.check_input()' );
2243: END IF;
2244: RAISE;
2245: END check_input;
2246: --

Line 2287: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_maxd() +' );

2283: p_unearned_disc IN OUT NOCOPY NUMBER) IS
2284: l_max_disc NUMBER;
2285: BEGIN
2286: IF PG_DEBUG in ('Y', 'C') THEN
2287: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_maxd() +' );
2288: END IF;
2289: --
2290: IF ( ABS(p_disc_rec.max_disc) < ABS(p_earned_disc) ) THEN
2291: p_earned_disc := p_disc_rec.max_disc;

Line 2306: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_maxd() -' );

2302: -- If max-earned < full unearned discount
2303: -- set unearned discount = max-earned
2304: --
2305: IF PG_DEBUG in ('Y', 'C') THEN
2306: arp_standard.debug( 'arp_calculate_discount.decrease_discounts_to_maxd() -' );
2307: END IF;
2308: --
2309: EXCEPTION
2310: WHEN OTHERS THEN

Line 2312: arp_standard.debug( 'Exception: arp_calculate_discount.decrease_discounts_to_maxd()');

2308: --
2309: EXCEPTION
2310: WHEN OTHERS THEN
2311: IF PG_DEBUG in ('Y', 'C') THEN
2312: arp_standard.debug( 'Exception: arp_calculate_discount.decrease_discounts_to_maxd()');
2313: END IF;
2314: RAISE;
2315: END decrease_discounts_to_maxd;
2316: --

Line 2329: | ARP_CALCULATE_DISCOUNT.calculate_discounts |

2325: | |
2326: | SCOPE - PUBLIC |
2327: | |
2328: | EXETERNAL PROCEDURES/FUNCTIONS ACCESSED |
2329: | ARP_CALCULATE_DISCOUNT.calculate_discounts |
2330: | |
2331: | ARGUMENTS : IN: |
2332: | OUT: |
2333: | |

Line 2391: arp_standard.debug( 'arp_calculate_discount.discounts_cover()+' );

2387: l_close_invoice_flag VARCHAR2(10);
2388: --
2389: BEGIN
2390: IF PG_DEBUG in ('Y', 'C') THEN
2391: arp_standard.debug( 'arp_calculate_discount.discounts_cover()+' );
2392: END IF;
2393:
2394: /* 12987134 - set called_from based on p_module_name */
2395: IF p_module_name = 'ARXRWAPP'

Line 2512: arp_standard.debug('discounts_cover: ' || 'arp_calculate_discount.calc_discount()-' );

2508: l_earned_both_flag := 'B';
2509: END IF;
2510: --
2511: IF PG_DEBUG in ('Y', 'C') THEN
2512: arp_standard.debug('discounts_cover: ' || 'arp_calculate_discount.calc_discount()-' );
2513: END IF;
2514: --
2515: arp_calculate_discount.calculate_discounts( p_input_amount,
2516: p_grace_days,

Line 2515: arp_calculate_discount.calculate_discounts( p_input_amount,

2511: IF PG_DEBUG in ('Y', 'C') THEN
2512: arp_standard.debug('discounts_cover: ' || 'arp_calculate_discount.calc_discount()-' );
2513: END IF;
2514: --
2515: arp_calculate_discount.calculate_discounts( p_input_amount,
2516: p_grace_days,
2517: p_apply_date,
2518: p_partial_discount_flag,
2519: p_calc_discount_on_lines_flag,

Line 2578: arp_standard.debug( 'arp_calculate_discount.discounts_cover()-' );

2574: END IF; /* discount on partial payments not allowed */
2575: --
2576: END IF;
2577: IF PG_DEBUG in ('Y', 'C') THEN
2578: arp_standard.debug( 'arp_calculate_discount.discounts_cover()-' );
2579: END IF;
2580: --
2581: EXCEPTION
2582: WHEN OTHERS THEN

Line 2584: arp_standard.debug( 'EXCEPTION: arp_calculate_discount.discounts_cover'

2580: --
2581: EXCEPTION
2582: WHEN OTHERS THEN
2583: IF PG_DEBUG in ('Y', 'C') THEN
2584: arp_standard.debug( 'EXCEPTION: arp_calculate_discount.discounts_cover'
2585: );
2586: END IF;
2587: RAISE;
2588: END discounts_cover;

Line 2640: ARP_CALCULATE_DISCOUNT.discounts_cover( p_mode,

2636: IF nvl(arp_global.sysparam.ta_installed_flag,'N') = 'Y' THEN
2637: NULL; -- Do Nothing
2638: -- Removed ARTA logic for Bug 4936298
2639: ELSE
2640: ARP_CALCULATE_DISCOUNT.discounts_cover( p_mode,
2641: p_invoice_currency_code,
2642: p_ps_id,
2643: p_term_id,
2644: p_terms_sequence_number,

Line 2710: arp_standard.debug( 'arp_calculate_discount.validate_args_discounts_cover()+' );

2706: p_trx_date IN ar_payment_schedules.trx_date%TYPE,
2707: p_apply_date IN ar_cash_receipts.receipt_date%TYPE ) IS
2708: BEGIN
2709: IF PG_DEBUG in ('Y', 'C') THEN
2710: arp_standard.debug( 'arp_calculate_discount.validate_args_discounts_cover()+' );
2711: END IF;
2712: --
2713: IF ( p_mode is NULL OR p_invoice_currency_code IS NULL OR
2714: p_ps_id IS NULL OR p_trx_date IS NULL OR

Line 2721: arp_standard.debug( 'arp_calculate_discount.validate_args_discounts_cover()-' );

2717: APP_EXCEPTION.raise_exception;
2718: END IF;
2719: --
2720: IF PG_DEBUG in ('Y', 'C') THEN
2721: arp_standard.debug( 'arp_calculate_discount.validate_args_discounts_cover()-' );
2722: END IF;
2723: --
2724: EXCEPTION
2725: WHEN OTHERS THEN

Line 2728: 'EXCEPTION: arp_calculate_discount.validate_args_calc_discoun

2724: EXCEPTION
2725: WHEN OTHERS THEN
2726: IF PG_DEBUG in ('Y', 'C') THEN
2727: arp_standard.debug('validate_args_discounts_cover: ' ||
2728: 'EXCEPTION: arp_calculate_discount.validate_args_calc_discoun
2729: ts' );
2730: END IF;
2731: RAISE;
2732: END validate_args_discounts_cover;

Line 2739: arp_calculate_discount.g_called_from := 'MANUAL' ;

2735: PROCEDURE set_g_called_from (p_called_from IN varchar2) IS
2736:
2737: BEGIN
2738: IF ( p_called_from = 'MANUAL') THEN
2739: arp_calculate_discount.g_called_from := 'MANUAL' ;
2740: END IF ;
2741:
2742: EXCEPTION
2743: WHEN OTHERS THEN

Line 2748: END arp_calculate_discount;

2744: NULL ;
2745: END SET_G_CALLED_FROM ;
2746: --
2747: --
2748: END arp_calculate_discount;