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.31.12010000.3 2009/02/11 12:02:20 asansari ship $ */
3:
4: /*=============================================================================
5: | FUNCTION - get_encumbered_flag()

Line 314: FROM ap_invoice_lines

310: -- If invoice is cancelled, return 'CANCELLED'.
311: --
312: SELECT count(*)
313: INTO l_cancelled_count
314: FROM ap_invoice_lines
315: WHERE invoice_id = p_invoice_id
316: AND line_number = p_line_number
317: AND NVL(cancelled_flag, 'N' ) = 'Y';
318:

Line 463: P_line_rec IN ap_invoice_lines%ROWTYPE,

459: |
460: *============================================================================*/
461:
462: Function Is_Line_Discardable(
463: P_line_rec IN ap_invoice_lines%ROWTYPE,
464: P_error_code OUT NOCOPY VARCHAR2,
465: P_calling_sequence IN VARCHAR2) RETURN BOOLEAN
466:
467: IS

Line 700: FROM ap_invoice_lines AIL,

696: ||' closed PO shipment';
697:
698: SELECT count(*)
699: INTO l_final_close_count
700: FROM ap_invoice_lines AIL,
701: po_line_locations PLL
702: WHERE AIL.invoice_id = p_line_rec.invoice_id
703: AND AIL.line_number = p_line_rec.line_number
704: AND AIL.po_line_location_id = PLL.line_location_id

Line 774: FROM ap_invoice_lines AIL

770: l_debug_info := 'Check if this line is refrenced by a correction';
771:
772: SELECT count(*)
773: INTO l_active_count
774: FROM ap_invoice_lines AIL
775: WHERE NVL( AIL.discarded_flag, 'N' ) <> 'Y'
776: AND NVL( AIL.cancelled_flag, 'N' ) <> 'Y'
777: AND AIL.corrected_inv_id = p_line_rec.invoice_id
778: AND AIL.corrected_line_number = p_line_rec.line_number;

Line 914: FROM ap_invoice_lines AIL,

910: +-----------------------------------------------------------------*/
911:
912: SELECT count(*)
913: INTO l_count
914: FROM ap_invoice_lines AIL,
915: ap_invoices AI
916: WHERE AIL.invoice_id = P_line_rec.invoice_id
917: AND AIL.line_number = P_line_rec.line_number
918: AND AIL.line_type_lookup_code = 'AWT'

Line 939: FROM ap_invoice_lines AIL

935: +--------------------------------------------------------------------*/
936:
937: SELECT count(*)
938: INTO l_count
939: FROM ap_invoice_lines AIL
940: WHERE AIL.invoice_id = P_line_rec.invoice_id
941: AND AIL.line_number = P_line_rec.line_number
942: AND (ail.retained_amount IS NOT NULL AND
943: ail.retained_amount_remaining IS NOT NULL AND

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

1017: Begin
1018: -- Update the calling sequence
1019: --
1020: current_calling_sequence :=
1021: 'AP_INVOICE_LINES_UTILITY_PKG.ALLOCATION_EXISTS<-'||p_Calling_Sequence;
1022:
1023: debug_info := 'Select from ap_allocation_rules';
1024:
1025: Select count(*)

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

1074: Begin
1075: -- Update the calling sequence
1076: --
1077: current_calling_sequence :=
1078: 'AP_INVOICE_LINES_UTILITY_PKG.Inv_Reverse_Via_Qc<-'||p_Calling_Sequence;
1079:
1080: debug_info := 'Select from ap_invoics_all';
1081:
1082: -- Bug 5261908. Added rownum condition to improve performance

Line 1143: 'AP_INVOICE_LINES_UTILITY_PKG.IS_LINE_DISTS_TRANS_FA<-'

1139: Begin
1140: -- Update the calling sequence
1141: --
1142: current_calling_sequence :=
1143: 'AP_INVOICE_LINES_UTILITY_PKG.IS_LINE_DISTS_TRANS_FA<-'
1144: ||p_Calling_Sequence;
1145:
1146: debug_info := 'Select from ap_invoice_distributions_all';
1147:

Line 1200: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_DISTS_ACCT_EVENT_CREATED<-'

1196: Begin
1197: -- Update the calling sequence
1198: --
1199: current_calling_sequence :=
1200: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_DISTS_ACCT_EVENT_CREATED<-'
1201: ||p_Calling_Sequence;
1202:
1203: debug_info := 'Select from ap_invoice_distributions_all';
1204:

Line 1257: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'

1253: Begin
1254: -- Update the calling sequence
1255: --
1256: current_calling_sequence :=
1257: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'
1258: ||p_Calling_Sequence;
1259:
1260: debug_info := 'Select from ap_invoice_lines_all';
1261:

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

1256: current_calling_sequence :=
1257: 'AP_INVOICE_LINES_UTILITY_PKG.LINE_REFERRED_BY_CORR<-'
1258: ||p_Calling_Sequence;
1259:
1260: debug_info := 'Select from ap_invoice_lines_all';
1261:
1262: Select count(*)
1263: Into dummy
1264: From ap_invoice_lines_all AIL

Line 1264: From ap_invoice_lines_all AIL

1260: debug_info := 'Select from ap_invoice_lines_all';
1261:
1262: Select count(*)
1263: Into dummy
1264: From ap_invoice_lines_all AIL
1265: Where NVL(AIL.discarded_flag, 'N' ) <> 'Y'
1266: And NVL( AIL.cancelled_flag, 'N' ) <> 'Y'
1267: And AIL.corrected_inv_id = p_Invoice_Id
1268: And AIL.corrected_line_number = p_Line_Number;

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

1312: Begin
1313: -- Update the calling sequence
1314: --
1315: current_calling_sequence :=
1316: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Referred_By_Other <-'||
1317: p_Calling_Sequence;
1318: debug_info := 'Select from ap_invoic_distributions_all';
1319:
1320: Select count(*)

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

1378: Begin
1379: -- Update the calling sequence
1380: --
1381: current_calling_sequence :=
1382: 'AP_INVOICE_LINES_UTILITY_PKG.Outstanding_Alloc_Exists <-'||
1383: p_Calling_Sequence;
1384: debug_info := 'Select from ap_allocatin_rules';
1385:
1386: Select count(*)

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

1437: Begin
1438: -- Update the calling sequence
1439: --
1440: current_calling_sequence :=
1441: 'AP_INVOICE_LINES_UTILITY_PKG.Line_Dists_Trans_PA <-'||
1442: p_Calling_Sequence;
1443: debug_info := 'Select from ap_invoic_distributions_all';
1444:
1445: Select count(*)

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

1482: | Date Author Description of Change
1483: | 03/10/13 bghose Created
1484: *============================================================================*/
1485:
1486: FUNCTION Can_Line_Be_Deleted (p_line_rec IN ap_invoice_lines%ROWTYPE,
1487: p_error_code OUT NOCOPY Varchar2,
1488: p_Calling_Sequence Varchar2) Return Boolean Is
1489: current_calling_sequence Varchar2(2000);
1490:

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

1491: Begin
1492: -- Update the calling sequence
1493: --
1494: current_calling_sequence :=
1495: 'AP_INVOICE_LINES_UTILITY_PKG.Can_Line_Be_Deleted <-'||
1496: p_Calling_Sequence;
1497:
1498: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created
1499: (p_Line_Rec.Invoice_Id,

Line 1498: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created

1494: current_calling_sequence :=
1495: 'AP_INVOICE_LINES_UTILITY_PKG.Can_Line_Be_Deleted <-'||
1496: p_Calling_Sequence;
1497:
1498: If (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Acct_Event_Created
1499: (p_Line_Rec.Invoice_Id,
1500: p_Line_Rec.Line_Number,
1501: Current_calling_sequence) = TRUE) Then
1502: p_error_code := 'AP_INV_LINE_DELETE_VALIDATED';

Line 1504: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Referred_By_Corr

1500: p_Line_Rec.Line_Number,
1501: Current_calling_sequence) = TRUE) Then
1502: p_error_code := 'AP_INV_LINE_DELETE_VALIDATED';
1503: return False;
1504: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Referred_By_Corr
1505: (p_Line_Rec.Invoice_Id,
1506: p_Line_Rec.Line_Number,
1507: Current_calling_sequence) = TRUE) Then
1508: p_error_code := 'AP_INV_LINE_DELETE_CORR';

Line 1510: ElsIf (NVL(Ap_Invoice_Lines_Utility_Pkg.Get_Encumbered_Flag

1506: p_Line_Rec.Line_Number,
1507: Current_calling_sequence) = TRUE) Then
1508: p_error_code := 'AP_INV_LINE_DELETE_CORR';
1509: return False;
1510: ElsIf (NVL(Ap_Invoice_Lines_Utility_Pkg.Get_Encumbered_Flag
1511: (p_Line_Rec.Invoice_Id,
1512: p_Line_Rec.Line_Number), 'N')
1513: In ('Y', 'P')) Then
1514: p_error_code := 'AP_INV_LINE_DELETE_ENCUMBERED';

Line 1516: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Get_Posting_Status

1512: p_Line_Rec.Line_Number), 'N')
1513: In ('Y', 'P')) Then
1514: p_error_code := 'AP_INV_LINE_DELETE_ENCUMBERED';
1515: return False;
1516: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Get_Posting_Status
1517: (p_Line_Rec.Invoice_Id,
1518: p_Line_Rec.Line_Number)
1519: In ('Y', 'P', 'S')) Then
1520: p_error_code := 'AP_INV_LINE_DELETE_ACCOUNTED';

Line 1522: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Trans_PA

1518: p_Line_Rec.Line_Number)
1519: In ('Y', 'P', 'S')) Then
1520: p_error_code := 'AP_INV_LINE_DELETE_ACCOUNTED';
1521: return False;
1522: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Trans_PA
1523: (p_Line_Rec.Invoice_Id,
1524: p_Line_Rec.Line_Number,
1525: Current_calling_sequence) = TRUE) Then
1526: p_error_code := 'AP_INV_LINE_DELETE_PA';

Line 1528: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Referred_By_Other

1524: p_Line_Rec.Line_Number,
1525: Current_calling_sequence) = TRUE) Then
1526: p_error_code := 'AP_INV_LINE_DELETE_PA';
1527: return False;
1528: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Line_Dists_Referred_By_Other
1529: (p_Line_Rec.Invoice_Id,
1530: p_Line_Rec.Line_Number,
1531: Current_calling_sequence) = TRUE) Then
1532: p_error_code := 'AP_INV_LINE_REF_BY_DISTS';

Line 1534: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Outstanding_Alloc_Exists

1530: p_Line_Rec.Line_Number,
1531: Current_calling_sequence) = TRUE) Then
1532: p_error_code := 'AP_INV_LINE_REF_BY_DISTS';
1533: return False;
1534: ElsIf (Ap_Invoice_Lines_Utility_Pkg.Outstanding_Alloc_Exists
1535: (p_Line_Rec.Invoice_Id,
1536: p_Line_Rec.Line_Number,
1537: Current_calling_sequence) = TRUE) Then
1538: p_error_code := 'AP_INV_LINE_HAS_ALLOC_RULE';

Line 1622: FROM ap_invoice_lines AIL, ap_invoice_distributions D

1618: IS
1619:
1620: CURSOR Dist_Var_Cur IS
1621: SELECT 'Dist Total <> Invoice Line Amount'
1622: FROM ap_invoice_lines AIL, ap_invoice_distributions D
1623: WHERE AIL.invoice_id = D.invoice_id
1624: AND AIL.line_number = p_line_number
1625: AND AIL.invoice_id = p_invoice_id
1626: AND AIL.line_number = D.invoice_line_number

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

1640: l_test_var VARCHAR2(50);
1641:
1642: BEGIN
1643: -------------------------------------------------------------
1644: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_Line_Fully_Distributed';
1645: debug_info := 'Is_Line_Fully_Distributed - Open cursor';
1646: -------------------------------------------------------------
1647:
1648: OPEN Dist_Var_Cur;

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

1725: l_return_var BOOLEAN := FALSE;
1726:
1727:
1728: BEGIN
1729: current_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG - Is_PO_RCV_Amount_Exceeded';
1730: -------------------------------------------------------------
1731: debug_info := 'Is_PO_RCV_Amount_Exceeded - Open cursor';
1732: -------------------------------------------------------------
1733:

Line 1797: FROM ap_invoice_lines

1793: -- then the invoice is not fully distributed.
1794:
1795: SELECT COUNT(*)
1796: INTO l_count
1797: FROM ap_invoice_lines
1798: WHERE invoice_id = p_invoice_id
1799: AND generate_dists <> 'D'
1800: AND ROWNUM = 1;
1801:

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

1834: Begin
1835: -- Update the calling sequence
1836: --
1837: current_calling_sequence :=
1838: 'AP_INVOICE_LINES_UTILITY_PKG.Pending_Alloc_Exists_Chrg_Line <-'||
1839: p_Calling_Sequence;
1840: debug_info := 'Select from ap_allocatin_rules';
1841:
1842: Select count(*)

Line 1892: FROM ap_invoice_lines

1888: BEGIN
1889:
1890: SELECT 'Y'
1891: INTO is_correction
1892: FROM ap_invoice_lines
1893: WHERE invoice_id = p_invoice_id
1894: AND line_number = p_line_number
1895: AND corrected_inv_id IS NOT NULL
1896: AND corrected_line_number IS NOT NULL;

Line 1935: FROM ap_invoice_lines_all

1931: BEGIN
1932:
1933: SELECT count(*)
1934: INTO l_count
1935: FROM ap_invoice_lines_all
1936: WHERE corrected_inv_id = p_invoice_id
1937: AND corrected_line_number = p_line_number
1938: AND line_type_lookup_code IN ('RETROITEM')
1939: AND line_source = 'PO PRICE ADJUSTMENT'

Line 1976: FROM ap_invoice_lines_all

1972: BEGIN
1973:
1974: SELECT 'Y'
1975: INTO is_po_price_adjustment
1976: FROM ap_invoice_lines_all
1977: WHERE invoice_id = p_invoice_id
1978: AND line_number = p_line_number
1979: AND line_type_lookup_code = 'RETROITEM'
1980: AND line_source = 'PO PRICE ADJUSTMENT'

Line 2021: FROM ap_invoice_lines

2017: BEGIN
2018:
2019: SELECT 'Y'
2020: INTO is_prepayment
2021: FROM ap_invoice_lines
2022: WHERE invoice_id = p_invoice_id
2023: AND line_number = p_line_number
2024: AND line_type_lookup_code = 'PREPAY';
2025:

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

2127:
2128:
2129: BEGIN
2130:
2131: l_curr_calling_sequence := 'AP_INVOICE_LINES_UTILITY_PKG.'||l_debug_loc;
2132:
2133: SELECT nvl(payment_cross_rate,0), payment_currency_code
2134: INTO l_payment_cross_rate, l_payment_currency_code
2135: FROM ap_invoices_all

Line 2224: END AP_INVOICE_LINES_UTILITY_PKG;

2220: WHEN Others THEN
2221: RETURN ('Z');
2222: END get_awt_flag;
2223:
2224: END AP_INVOICE_LINES_UTILITY_PKG;