DBA Data[Home] [Help]

APPS.AP_INVOICE_LINES_UTILITY_PKG dependencies on AP_INVOICE_LINES

Line 1: PACKAGE BODY AP_INVOICE_LINES_UTILITY_PKG AS

1: PACKAGE BODY AP_INVOICE_LINES_UTILITY_PKG AS
2: /* $Header: apilnutb.pls 120.48.12020000.3 2013/02/13 23:28:37 tjbhatt ship $ */
3:
4: /*=============================================================================
5: | FUNCTION - get_encumbered_flag()

Line 332: FROM ap_invoice_lines

328: -- If invoice is cancelled, return 'CANCELLED'.
329: --
330: SELECT count(*)
331: INTO l_cancelled_count
332: FROM ap_invoice_lines
333: WHERE invoice_id = p_invoice_id
334: AND line_number = p_line_number
335: AND NVL(cancelled_flag, 'N' ) = 'Y';
336:

Line 486: P_line_rec IN ap_invoice_lines%ROWTYPE,

482: |
483: *============================================================================*/
484:
485: Function Is_Line_Discardable(
486: P_line_rec IN ap_invoice_lines%ROWTYPE,
487: P_error_code OUT NOCOPY VARCHAR2,
488: P_calling_sequence IN VARCHAR2) RETURN BOOLEAN
489:
490: IS

Line 608: FROM ap_invoice_lines AIL,

604: ||' closed PO shipment';
605:
606: SELECT count(*)
607: INTO l_final_close_count
608: FROM ap_invoice_lines AIL,
609: po_line_locations PLL
610: WHERE AIL.invoice_id = p_line_rec.invoice_id
611: AND AIL.line_number = p_line_rec.line_number
612: AND AIL.po_line_location_id = PLL.line_location_id

Line 682: FROM ap_invoice_lines AIL

678: l_debug_info := 'Check if this line is refrenced by a correction';
679:
680: SELECT count(*)
681: INTO l_active_count
682: FROM ap_invoice_lines AIL
683: WHERE NVL( AIL.discarded_flag, 'N' ) <> 'Y'
684: AND NVL( AIL.cancelled_flag, 'N' ) <> 'Y'
685: AND AIL.corrected_inv_id = p_line_rec.invoice_id
686: AND AIL.corrected_line_number = p_line_rec.line_number;

Line 968: FROM ap_invoice_lines AIL,

964: +-----------------------------------------------------------------*/
965:
966: SELECT count(*)
967: INTO l_count
968: FROM ap_invoice_lines AIL,
969: ap_invoices AI
970: WHERE AIL.invoice_id = P_line_rec.invoice_id
971: AND AIL.line_number = P_line_rec.line_number
972: AND AIL.line_type_lookup_code = 'AWT'

Line 995: FROM ap_invoice_lines AIL

991: +--------------------------------------------------------------------*/
992:
993: SELECT count(*)
994: INTO l_count
995: FROM ap_invoice_lines AIL
996: WHERE AIL.invoice_id = P_line_rec.invoice_id
997: AND AIL.line_number = P_line_rec.line_number
998: AND (ail.retained_amount IS NOT NULL AND
999: ail.retained_amount_remaining IS NOT NULL AND

Line 1093: 'AP_INVOICE_LINES_UTILITY_PKG.ALLOCATION_EXISTS<-'||p_Calling_Sequence;

1089: Begin
1090: -- Update the calling sequence
1091: --
1092: current_calling_sequence :=
1093: 'AP_INVOICE_LINES_UTILITY_PKG.ALLOCATION_EXISTS<-'||p_Calling_Sequence;
1094:
1095: debug_info := 'Select from ap_allocation_rules';
1096:
1097: Select count(*)

Line 1150: 'AP_INVOICE_LINES_UTILITY_PKG.Inv_Reverse_Via_Qc<-'||p_Calling_Sequence;

1146: Begin
1147: -- Update the calling sequence
1148: --
1149: current_calling_sequence :=
1150: 'AP_INVOICE_LINES_UTILITY_PKG.Inv_Reverse_Via_Qc<-'||p_Calling_Sequence;
1151:
1152: debug_info := 'Select from ap_invoics_all';
1153:
1154: -- Bug 5261908. Added rownum condition to improve performance

Line 1215: 'AP_INVOICE_LINES_UTILITY_PKG.IS_LINE_DISTS_TRANS_FA<-'

1211: Begin
1212: -- Update the calling sequence
1213: --
1214: current_calling_sequence :=
1215: 'AP_INVOICE_LINES_UTILITY_PKG.IS_LINE_DISTS_TRANS_FA<-'
1216: ||p_Calling_Sequence;
1217:
1218: debug_info := 'Select from ap_invoice_distributions_all';
1219:

Line 1272: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_DISTS_ACCT_EVENT_CREATED<-'

1268: Begin
1269: -- Update the calling sequence
1270: --
1271: current_calling_sequence :=
1272: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_DISTS_ACCT_EVENT_CREATED<-'
1273: ||p_Calling_Sequence;
1274:
1275: debug_info := 'Select from ap_invoice_distributions_all';
1276:

Line 1329: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'

1325: Begin
1326: -- Update the calling sequence
1327: --
1328: current_calling_sequence :=
1329: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'
1330: ||p_Calling_Sequence;
1331:
1332: debug_info := 'Select from ap_invoice_lines_all';
1333:

Line 1332: debug_info := 'Select from ap_invoice_lines_all';

1328: current_calling_sequence :=
1329: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'
1330: ||p_Calling_Sequence;
1331:
1332: debug_info := 'Select from ap_invoice_lines_all';
1333:
1334: Select count(*)
1335: Into dummy
1336: From ap_invoice_lines_all AIL

Line 1336: From ap_invoice_lines_all AIL

1332: debug_info := 'Select from ap_invoice_lines_all';
1333:
1334: Select count(*)
1335: Into dummy
1336: From ap_invoice_lines_all AIL
1337: Where NVL(AIL.discarded_flag, 'N' ) <> 'Y'
1338: And NVL( AIL.cancelled_flag, 'N' ) <> 'Y'
1339: And AIL.corrected_inv_id = p_Invoice_Id
1340: And AIL.corrected_line_number = p_Line_Number;

Line 1388: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Referred_By_Other <-'||

1384: Begin
1385: -- Update the calling sequence
1386: --
1387: current_calling_sequence :=
1388: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Referred_By_Other <-'||
1389: p_Calling_Sequence;
1390: debug_info := 'Select from ap_invoic_distributions_all';
1391:
1392: Select count(*)

Line 1455: 'AP_INVOICE_LINES_UTILITY_PKG.Outstanding_Alloc_Exists <-'||

1451: Begin
1452: -- Update the calling sequence
1453: --
1454: current_calling_sequence :=
1455: 'AP_INVOICE_LINES_UTILITY_PKG.Outstanding_Alloc_Exists <-'||
1456: p_Calling_Sequence;
1457: debug_info := 'Select from ap_allocatin_rules';
1458:
1459: Select count(*)

Line 1516: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Trans_PA <-'||

1512: Begin
1513: -- Update the calling sequence
1514: --
1515: current_calling_sequence :=
1516: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Trans_PA <-'||
1517: p_Calling_Sequence;
1518: debug_info := 'Select from ap_invoic_distributions_all';
1519:
1520: Select count(*)

Line 1561: FUNCTION Can_Line_Be_Deleted (p_line_rec IN ap_invoice_lines%ROWTYPE,

1557: | Date Author Description of Change
1558: | 03/10/13 bghose Created
1559: *============================================================================*/
1560:
1561: FUNCTION Can_Line_Be_Deleted (p_line_rec IN ap_invoice_lines%ROWTYPE,
1562: p_error_code OUT NOCOPY Varchar2,
1563: p_Calling_Sequence Varchar2) Return Boolean Is
1564: current_calling_sequence Varchar2(2000);
1565:

Line 1570: 'AP_INVOICE_LINES_UTILITY_PKG.Can_Line_Be_Deleted <-'||

1566: Begin
1567: -- Update the calling sequence
1568: --
1569: current_calling_sequence :=
1570: 'AP_INVOICE_LINES_UTILITY_PKG.Can_Line_Be_Deleted <-'||
1571: p_Calling_Sequence;
1572:
1573: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created
1574: (p_Line_Rec.Invoice_Id,

Line 1573: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created

1569: current_calling_sequence :=
1570: 'AP_INVOICE_LINES_UTILITY_PKG.Can_Line_Be_Deleted <-'||
1571: p_Calling_Sequence;
1572:
1573: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created
1574: (p_Line_Rec.Invoice_Id,
1575: p_Line_Rec.Line_Number,
1576: Current_calling_sequence) = TRUE) Then
1577: p_error_code := 'AP_INV_LINE_DELETE_VALIDATED';

Line 1579: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Referred_By_Corr

1575: p_Line_Rec.Line_Number,
1576: Current_calling_sequence) = TRUE) Then
1577: p_error_code := 'AP_INV_LINE_DELETE_VALIDATED';
1578: return False;
1579: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Referred_By_Corr
1580: (p_Line_Rec.Invoice_Id,
1581: p_Line_Rec.Line_Number,
1582: Current_calling_sequence) = TRUE) Then
1583: p_error_code := 'AP_INV_LINE_DELETE_CORR';

Line 1585: ElsIf (NVL(Ap_Invoice_Lines_Utility_Pkg.Get_Encumbered_Flag

1581: p_Line_Rec.Line_Number,
1582: Current_calling_sequence) = TRUE) Then
1583: p_error_code := 'AP_INV_LINE_DELETE_CORR';
1584: return False;
1585: ElsIf (NVL(Ap_Invoice_Lines_Utility_Pkg.Get_Encumbered_Flag
1586: (p_Line_Rec.Invoice_Id,
1587: p_Line_Rec.Line_Number), 'N')
1588: In ('Y', 'P')) Then
1589: p_error_code := 'AP_INV_LINE_DELETE_ENCUMBERED';

Line 1591: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Get_Posting_Status

1587: p_Line_Rec.Line_Number), 'N')
1588: In ('Y', 'P')) Then
1589: p_error_code := 'AP_INV_LINE_DELETE_ENCUMBERED';
1590: return False;
1591: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Get_Posting_Status
1592: (p_Line_Rec.Invoice_Id,
1593: p_Line_Rec.Line_Number)
1594: In ('Y', 'P', 'S')) Then
1595: p_error_code := 'AP_INV_LINE_DELETE_ACCOUNTED';

Line 1597: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Trans_PA

1593: p_Line_Rec.Line_Number)
1594: In ('Y', 'P', 'S')) Then
1595: p_error_code := 'AP_INV_LINE_DELETE_ACCOUNTED';
1596: return False;
1597: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Trans_PA
1598: (p_Line_Rec.Invoice_Id,
1599: p_Line_Rec.Line_Number,
1600: Current_calling_sequence) = TRUE) Then
1601: p_error_code := 'AP_INV_LINE_DELETE_PA';

Line 1603: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Referred_By_Other

1599: p_Line_Rec.Line_Number,
1600: Current_calling_sequence) = TRUE) Then
1601: p_error_code := 'AP_INV_LINE_DELETE_PA';
1602: return False;
1603: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Referred_By_Other
1604: (p_Line_Rec.Invoice_Id,
1605: p_Line_Rec.Line_Number,
1606: Current_calling_sequence) = TRUE) Then
1607: p_error_code := 'AP_INV_LINE_REF_BY_DISTS';

Line 1609: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Outstanding_Alloc_Exists

1605: p_Line_Rec.Line_Number,
1606: Current_calling_sequence) = TRUE) Then
1607: p_error_code := 'AP_INV_LINE_REF_BY_DISTS';
1608: return False;
1609: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Outstanding_Alloc_Exists
1610: (p_Line_Rec.Invoice_Id,
1611: p_Line_Rec.Line_Number,
1612: Current_calling_sequence) = TRUE) Then
1613: p_error_code := 'AP_INV_LINE_HAS_ALLOC_RULE';

Line 1697: FROM ap_invoice_lines AIL, ap_invoice_distributions D

1693: IS
1694:
1695: CURSOR Dist_Var_Cur IS
1696: SELECT 'Dist Total <> Invoice Line Amount'
1697: FROM ap_invoice_lines AIL, ap_invoice_distributions D
1698: WHERE AIL.invoice_id = D.invoice_id
1699: AND AIL.line_number = p_line_number
1700: AND AIL.invoice_id = p_invoice_id
1701: AND AIL.line_number = D.invoice_line_number

Line 1719: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_Line_Fully_Distributed';

1715: l_test_var VARCHAR2(50);
1716:
1717: BEGIN
1718: -------------------------------------------------------------
1719: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_Line_Fully_Distributed';
1720: debug_info := 'Is_Line_Fully_Distributed - Open cursor';
1721: -------------------------------------------------------------
1722:
1723: OPEN Dist_Var_Cur;

Line 1804: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_PO_RCV_Amount_Exceeded';

1800: l_return_var BOOLEAN := FALSE;
1801:
1802:
1803: BEGIN
1804: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_PO_RCV_Amount_Exceeded';
1805: -------------------------------------------------------------
1806: debug_info := 'Is_PO_RCV_Amount_Exceeded - Open cursor';
1807: -------------------------------------------------------------
1808:

Line 1872: FROM ap_invoice_lines

1868: -- then the invoice is not fully distributed.
1869:
1870: SELECT COUNT(*)
1871: INTO l_count
1872: FROM ap_invoice_lines
1873: WHERE invoice_id = p_invoice_id
1874: AND generate_dists <> 'D'
1875: AND ROWNUM = 1;
1876:

Line 1913: 'AP_INVOICE_LINES_UTILITY_PKG.Pending_Alloc_Exists_Chrg_Line <-'||

1909: Begin
1910: -- Update the calling sequence
1911: --
1912: current_calling_sequence :=
1913: 'AP_INVOICE_LINES_UTILITY_PKG.Pending_Alloc_Exists_Chrg_Line <-'||
1914: p_Calling_Sequence;
1915: debug_info := 'Select from ap_allocatin_rules';
1916:
1917: Select count(*)

Line 1967: FROM ap_invoice_lines

1963: BEGIN
1964:
1965: SELECT 'Y'
1966: INTO is_correction
1967: FROM ap_invoice_lines
1968: WHERE invoice_id = p_invoice_id
1969: AND line_number = p_line_number
1970: AND corrected_inv_id IS NOT NULL
1971: AND corrected_line_number IS NOT NULL;

Line 2010: FROM ap_invoice_lines_all

2006: BEGIN
2007:
2008: SELECT count(*)
2009: INTO l_count
2010: FROM ap_invoice_lines_all
2011: WHERE corrected_inv_id = p_invoice_id
2012: AND corrected_line_number = p_line_number
2013: AND line_type_lookup_code IN ('RETROITEM')
2014: AND line_source = 'PO PRICE ADJUSTMENT'

Line 2051: FROM ap_invoice_lines_all

2047: BEGIN
2048:
2049: SELECT 'Y'
2050: INTO is_po_price_adjustment
2051: FROM ap_invoice_lines_all
2052: WHERE invoice_id = p_invoice_id
2053: AND line_number = p_line_number
2054: AND line_type_lookup_code = 'RETROITEM'
2055: AND line_source = 'PO PRICE ADJUSTMENT'

Line 2096: FROM ap_invoice_lines

2092: BEGIN
2093:
2094: SELECT 'Y'
2095: INTO is_prepayment
2096: FROM ap_invoice_lines
2097: WHERE invoice_id = p_invoice_id
2098: AND line_number = p_line_number
2099: AND line_type_lookup_code = 'PREPAY';
2100:

Line 2206: l_curr_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG.'||l_debug_loc;

2202:
2203:
2204: BEGIN
2205:
2206: l_curr_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG.'||l_debug_loc;
2207:
2208: SELECT nvl(payment_cross_rate,0), payment_currency_code
2209: INTO l_payment_cross_rate, l_payment_currency_code
2210: FROM ap_invoices_all

Line 2299: END AP_INVOICE_LINES_UTILITY_PKG;

2295: WHEN Others THEN
2296: RETURN ('Z');
2297: END get_awt_flag;
2298:
2299: END AP_INVOICE_LINES_UTILITY_PKG;