DBA Data[Home] [Help]

APPS.AP_ALLOCATION_RULES_PKG dependencies on AP_ALLOCATION_RULES

Line 1: PACKAGE BODY AP_ALLOCATION_RULES_PKG as

1: PACKAGE BODY AP_ALLOCATION_RULES_PKG as
2: /* $Header: apalocrb.pls 120.14.12020000.2 2012/07/13 06:42:05 pgayen ship $ */
3:
4: -----------------------------------------------------------------------
5: -- FUNCTION insert_fully_prorated creates an PRORATION type allocation

Line 23: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||

19: BEGIN
20:
21: -- Update the calling sequence
22:
23: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||
24: 'insert_fully_prorated_rule';
25: --------------------------------------------------------------
26: -- Step 1 - Verify line exists, has generate_dists flag
27: -- set to Y

Line 65: FROM ap_allocation_rules

61: BEGIN
62: l_other_alloc_rules := 0;
63: SELECT COUNT(*)
64: INTO l_other_alloc_rules
65: FROM ap_allocation_rules
66: WHERE invoice_id = X_invoice_id
67: AND chrg_invoice_line_number = X_line_number;
68:
69: IF (l_other_alloc_rules <> 0) THEN

Line 80: INSERT INTO ap_allocation_rules(

76: NULL;
77: END;
78:
79: BEGIN
80: INSERT INTO ap_allocation_rules(
81: invoice_id,
82: chrg_invoice_line_number,
83: rule_type,
84: rule_generation_type,

Line 155: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||

151: debug_info VARCHAR2(200);
152: BEGIN
153:
154: -- Update the calling sequence
155: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||
156: 'insert_from_prorated_rule';
157: --------------------------------------------------------------
158: -- Step 1 - Verify line exists, has generate_dists flag
159: -- set to Y

Line 251: FROM ap_allocation_rules

247: BEGIN
248: l_other_alloc_rules := 0;
249: SELECT COUNT(*)
250: INTO l_other_alloc_rules
251: FROM ap_allocation_rules
252: WHERE invoice_id = X_invoice_id
253: AND chrg_invoice_line_number = X_line_number;
254:
255: IF (l_other_alloc_rules <> 0) THEN

Line 270: INSERT INTO ap_allocation_rules(

266: --------------------------------------------------------------
267: -- Step 5 - Insert Allocation Rule
268: --------------------------------------------------------------
269: BEGIN
270: INSERT INTO ap_allocation_rules(
271: invoice_id,
272: chrg_invoice_line_number,
273: rule_type,
274: rule_generation_type,

Line 439: l_debug_info := 'Insert record into AP_ALLOCATION_RULES';

435: BEGIN
436:
437: current_calling_sequence := 'Insert_Percentage_Alloc_Rule<-'||X_Calling_Sequence;
438:
439: l_debug_info := 'Insert record into AP_ALLOCATION_RULES';
440:
441: Insert into AP_ALLOCATION_RULES
442: (Invoice_id,
443: Chrg_Invoice_Line_Number,

Line 441: Insert into AP_ALLOCATION_RULES

437: current_calling_sequence := 'Insert_Percentage_Alloc_Rule<-'||X_Calling_Sequence;
438:
439: l_debug_info := 'Insert record into AP_ALLOCATION_RULES';
440:
441: Insert into AP_ALLOCATION_RULES
442: (Invoice_id,
443: Chrg_Invoice_Line_Number,
444: Rule_Type,
445: Rule_Generation_Type,

Line 572: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||

568:
569: BEGIN
570:
571: -- Update the calling sequence
572: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||
573: 'Create_Allocations';
574:
575: --------------------------------------------------------------
576: debug_info := ' Step 1 - Verify IF any chrg line exists for '

Line 613: IF (NOT (Ap_Allocation_Rules_Pkg.Create_Proration_Rule(

609: l_chrg_line_number;
610:
611: EXIT WHEN chrg_lines_cur%NOTFOUND;
612:
613: IF (NOT (Ap_Allocation_Rules_Pkg.Create_Proration_Rule(
614: l_invoice_id,
615: l_chrg_line_number,
616: NULL, -- rule_type
617: X_Window_context, --

Line 675: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;

671: l_alloc_rule_lines NUMBER;
672: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
673: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
674: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
675: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
676: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
677: l_prorating_total NUMBER := 0;
678: l_create_alloc_rule VARCHAR2(1) := 'Y';
679: l_create_alloc_rule_lines VARCHAR2(1) := 'Y';

Line 676: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;

672: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
673: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
674: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
675: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
676: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
677: l_prorating_total NUMBER := 0;
678: l_create_alloc_rule VARCHAR2(1) := 'Y';
679: l_create_alloc_rule_lines VARCHAR2(1) := 'Y';
680:

Line 689: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||

685: BEGIN
686:
687: -- Update the calling sequence
688:
689: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||
690: 'Create_Proration_Rule';
691: --------------------------------------------------------------
692: debug_info := ' Step 1 - Verify IF any chrg line exists for '
693: ||'this Invoice';

Line 743: FROM ap_allocation_rules

739: l_create_alloc_rule := 'Y';
740: l_alloc_rule := 0;
741: SELECT COUNT(*)
742: INTO l_alloc_rule
743: FROM ap_allocation_rules
744: WHERE invoice_id = X_invoice_id
745: AND chrg_invoice_line_number = X_chrg_line_number;
746:
747: IF (l_alloc_rule <> 0) THEN

Line 768: FROM ap_allocation_rules

764: SELECT rule_type,
765: status
766: INTO l_rule_type,
767: l_rule_status
768: FROM ap_allocation_rules
769: WHERE invoice_id = X_invoice_id
770: AND chrg_invoice_line_number = X_chrg_line_number;
771:
772: EXCEPTION

Line 817: Ap_Allocation_Rules_Pkg.delete_allocation_lines(

813:
814: IF (l_rule_type ='PRORATION') THEN
815: l_create_alloc_rule_lines := 'Y';
816: IF l_alloc_rule_lines <> 0 then
817: Ap_Allocation_Rules_Pkg.delete_allocation_lines(
818: X_invoice_id,
819: X_chrg_Line_number,
820: 'Insert_fully_prorated_rule');
821: END IF;

Line 866: INSERT INTO ap_allocation_rules(

862: --------------------------------------------------------------
863: IF l_create_alloc_rule = 'Y' AND
864: X_window_context <> 'ALLOCATIONS' THEN
865: BEGIN
866: INSERT INTO ap_allocation_rules(
867: invoice_id,
868: chrg_invoice_line_number,
869: rule_type,
870: rule_generation_type,

Line 1161: 'Ap_Allocation_Rules_Pkg.select_Item_summary<-'||X_Calling_Sequence;

1157: BEGIN
1158: -- Update the calling sequence
1159: --
1160: current_calling_sequence :=
1161: 'Ap_Allocation_Rules_Pkg.select_Item_summary<-'||X_Calling_Sequence;
1162: ----------------------------------------------------------
1163: debug_info := 'Get allocated total';
1164: ----------------------------------------------------------
1165:

Line 1229: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||

1225:
1226: BEGIN
1227:
1228: -- Update the calling sequence
1229: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||
1230: 'Allocation_Rule_Lines';
1231:
1232: --------------------------------------------------------------
1233: debug_info := ' Step 1 - Verify IF allocation rule line exists';

Line 1408: 'Ap_Allocation_Rules_Pkg.form_startup<-'||X_Calling_Sequence;

1404: BEGIN
1405: -- Update the calling sequence
1406: --
1407: current_calling_sequence :=
1408: 'Ap_Allocation_Rules_Pkg.form_startup<-'||X_Calling_Sequence;
1409:
1410: --------------------------------------------------------------
1411: debug_info := 'Get invoice information';
1412: --------------------------------------------------------------

Line 1456: -- Table Handler for the AP_ALLOCATION RULES Table for the update of

1452: END form_startup;
1453:
1454:
1455: ------------------------------------------------------------------------
1456: -- Table Handler for the AP_ALLOCATION RULES Table for the update of
1457: -- Rule Type.
1458: ------------------------------------------------------------------------
1459: Procedure Update_row(
1460: X_rowid IN OUT NOCOPY VARCHAR2,

Line 1476: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.Update_Row<-'

1472: debug_info VARCHAR2(100);
1473:
1474: BEGIN
1475:
1476: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.Update_Row<-'
1477: ||X_Calling_Sequence;
1478:
1479: -- Check for uniqueness of the lineine number
1480:

Line 1483: debug_info := 'Update ap_allocation_rules';

1479: -- Check for uniqueness of the lineine number
1480:
1481:
1482: --------------------------------------------------------------
1483: debug_info := 'Update ap_allocation_rules';
1484: --------------------------------------------------------------
1485:
1486: UPDATE ap_allocation_rules
1487: SET invoice_id = X_invoice_id,

Line 1486: UPDATE ap_allocation_rules

1482: --------------------------------------------------------------
1483: debug_info := 'Update ap_allocation_rules';
1484: --------------------------------------------------------------
1485:
1486: UPDATE ap_allocation_rules
1487: SET invoice_id = X_invoice_id,
1488: chrg_invoice_line_number = X_chrg_invoice_line_number,
1489: rule_type = X_rule_type,
1490: rule_generation_type = X_rule_generation_type,

Line 1516: -- Table Handler for the AP_ALLOCATION RULES Table for the Locking of

1512:
1513:
1514:
1515: ------------------------------------------------------------------------
1516: -- Table Handler for the AP_ALLOCATION RULES Table for the Locking of
1517: -- Allocation Rule associated with the Charge Line.
1518: ------------------------------------------------------------------------
1519: Procedure Lock_row(
1520: X_rowid IN OUT NOCOPY VARCHAR2,

Line 1531: FROM AP_ALLOCATION_RULES

1527: IS
1528:
1529: CURSOR C IS
1530: SELECT *
1531: FROM AP_ALLOCATION_RULES
1532: WHERE rowid = X_Rowid
1533: FOR UPDATE of Invoice_Id NOWAIT;
1534: Recinfo C%ROWTYPE;
1535: current_calling_sequence VARCHAR2(2000);

Line 1542: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.Lock_Row<-'

1538:
1539: BEGIN
1540: -- Update the calling sequence
1541: --
1542: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.Lock_Row<-'
1543: ||X_Calling_Sequence;
1544:
1545: --------------------------------------------------------------
1546: debug_info := 'Select from ap_allocation_rules';

Line 1546: debug_info := 'Select from ap_allocation_rules';

1542: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.Lock_Row<-'
1543: ||X_Calling_Sequence;
1544:
1545: --------------------------------------------------------------
1546: debug_info := 'Select from ap_allocation_rules';
1547: --------------------------------------------------------------
1548:
1549: OPEN C;
1550:

Line 1645: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;

1641: l_alloc_rule NUMBER;
1642: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
1643: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
1644: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
1645: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
1646: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
1647: l_prorating_total NUMBER := 0;
1648: l_prorated_total NUMBER := 0;
1649:

Line 1646: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;

1642: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
1643: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
1644: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
1645: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
1646: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
1647: l_prorating_total NUMBER := 0;
1648: l_prorated_total NUMBER := 0;
1649:
1650: debug_info VARCHAR2(100);

Line 1657: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||

1653:
1654: BEGIN
1655:
1656: -- Update the calling sequence
1657: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||
1658: 'Prorate_allocated_lines';
1659: --------------------------------------------------------------
1660: debug_info := 'Step 1 - Verify chrg line exists, has '
1661: ||' generate_dists flag set to Y';

Line 1711: FROM ap_allocation_rules

1707:
1708: l_alloc_rule := 0;
1709: SELECT COUNT(*)
1710: INTO l_alloc_rule
1711: FROM ap_allocation_rules
1712: WHERE invoice_id = X_invoice_id
1713: AND chrg_invoice_line_number = X_chrg_line_number;
1714:
1715: IF (l_alloc_rule = 0) THEN

Line 1735: FROM ap_allocation_rules

1731: SELECT rule_type,
1732: status
1733: INTO l_rule_type,
1734: l_rule_status
1735: FROM ap_allocation_rules
1736: WHERE invoice_id = X_invoice_id
1737: AND chrg_invoice_line_number = X_chrg_line_number;
1738:
1739: EXCEPTION

Line 1902: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;

1898: l_alloc_rule NUMBER;
1899: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
1900: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
1901: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
1902: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
1903: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
1904: l_prorating_total NUMBER := 0;
1905: l_prorated_total NUMBER := 0;
1906:

Line 1903: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;

1899: l_amount_to_prorate AP_INVOICE_LINES.AMOUNT%TYPE;
1900: l_total_prorated AP_INVOICE_LINES.AMOUNT%TYPE;
1901: l_inv_curr_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
1902: l_rule_type AP_ALLOCATION_RULES.RULE_TYPE%TYPE;
1903: l_rule_status AP_ALLOCATION_RULES.STATUS%TYPE;
1904: l_prorating_total NUMBER := 0;
1905: l_prorated_total NUMBER := 0;
1906:
1907: debug_info VARCHAR2(100);

Line 1914: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||

1910:
1911: BEGIN
1912:
1913: -- Update the calling sequence
1914: current_calling_sequence := 'Ap_Allocation_Rules_Pkg.'||
1915: 'Delete_Allocations';
1916: --------------------------------------------------------------
1917: debug_info := 'Step 1 - Verify chrg line exists, has '
1918: ||' generate_dists flag set to Y';

Line 1967: FROM ap_allocation_rules

1963:
1964: l_alloc_rule := 0;
1965: SELECT COUNT(*)
1966: INTO l_alloc_rule
1967: FROM ap_allocation_rules
1968: WHERE invoice_id = X_invoice_id
1969: AND chrg_invoice_line_number = X_chrg_line_number;
1970:
1971: IF (l_alloc_rule = 0) THEN

Line 1991: FROM ap_allocation_rules

1987: SELECT rule_type,
1988: status
1989: INTO l_rule_type,
1990: l_rule_status
1991: FROM ap_allocation_rules
1992: WHERE invoice_id = X_invoice_id
1993: AND chrg_invoice_line_number = X_chrg_line_number;
1994:
1995: EXCEPTION

Line 2015: DELETE FROM ap_allocation_rules

2011: ||'pending allocation rules will be deleted.';
2012: -------------------------------------------------------
2013: IF X_new_chrg_line_amt = 0 THEN
2014:
2015: DELETE FROM ap_allocation_rules
2016: WHERE invoice_id = X_Invoice_Id
2017: AND chrg_invoice_line_number = X_chrg_line_number;
2018:
2019: IF l_rule_type <> 'PRORATION' THEN

Line 2020: Ap_Allocation_Rules_Pkg.Delete_Allocation_Lines(

2016: WHERE invoice_id = X_Invoice_Id
2017: AND chrg_invoice_line_number = X_chrg_line_number;
2018:
2019: IF l_rule_type <> 'PRORATION' THEN
2020: Ap_Allocation_Rules_Pkg.Delete_Allocation_Lines(
2021: X_invoice_id => X_Invoice_Id,
2022: X_chrg_line_number => X_chrg_line_number,
2023: X_calling_sequence => current_calling_sequence);
2024: END IF;

Line 2050: 'Ap_Allocation_Rules_Pkg.Delete_allocations_lines<-'||X_Calling_Sequence;

2046: debug_info VARCHAR2(100);
2047:
2048: BEGIN
2049: current_calling_sequence :=
2050: 'Ap_Allocation_Rules_Pkg.Delete_allocations_lines<-'||X_Calling_Sequence;
2051: -----------------------------------------------------------
2052: debug_info := 'Deleting any existing allocation rows ';
2053: ----------------------------------------------------------
2054: DELETE FROM ap_allocation_rule_lines

Line 2099: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||

2095:
2096: BEGIN
2097:
2098: -- Update the calling sequence
2099: current_calling_sequence := 'AP_ALLOCATION_RULES_PKG.'||
2100: 'insert_tax_allocations';
2101:
2102: --------------------------------------------------------------
2103: -- Step 1 - Verify line exists, has generate_dists flag

Line 2149: FROM ap_allocation_rules

2145: BEGIN
2146: l_other_alloc_rules := 0;
2147: SELECT COUNT(*)
2148: INTO l_other_alloc_rules
2149: FROM ap_allocation_rules
2150: WHERE invoice_id = X_invoice_id
2151: AND chrg_invoice_line_number = X_chrg_line_number;
2152:
2153: SELECT COUNT(*)

Line 2162: DELETE FROM ap_allocation_rules

2158:
2159:
2160: IF (l_other_alloc_rules <> 0) THEN
2161:
2162: DELETE FROM ap_allocation_rules
2163: WHERE invoice_id = X_invoice_id
2164: AND chrg_invoice_line_number = X_chrg_line_number;
2165:
2166: END IF;

Line 2185: INSERT INTO ap_allocation_rules(

2181: --------------------------------------------------------------
2182: -- Step 5 - Insert Allocation Rule
2183: --------------------------------------------------------------
2184: BEGIN
2185: INSERT INTO ap_allocation_rules(
2186: invoice_id,
2187: chrg_invoice_line_number,
2188: rule_type,
2189: rule_generation_type,

Line 2293: END AP_ALLOCATION_RULES_PKG;

2289: RETURN(TRUE);
2290:
2291: END insert_tax_allocations;
2292:
2293: END AP_ALLOCATION_RULES_PKG;