DBA Data[Home] [Help]

APPS.AP_INVOICES_UTILITY_PKG dependencies on AP_INVOICES

Line 1: PACKAGE BODY AP_INVOICES_UTILITY_PKG AS

1: PACKAGE BODY AP_INVOICES_UTILITY_PKG AS
2: /* $Header: apinvutb.pls 120.79.12020000.6 2013/03/11 05:52:40 harsanan ship $ */
3:
4: /* bug 10425573 start*/
5: G_CURRENT_RUNTIME_LEVEL NUMBER := FND_LOG.G_CURRENT_RUNTIME_LEVEL;

Line 7: G_MODULE_NAME CONSTANT VARCHAR2(50) :='AP.PLSQL.AP_INVOICES_UTILITIES_PKG';

3:
4: /* bug 10425573 start*/
5: G_CURRENT_RUNTIME_LEVEL NUMBER := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
6: G_LEVEL_STATEMENT CONSTANT NUMBER := FND_LOG.LEVEL_STATEMENT;
7: G_MODULE_NAME CONSTANT VARCHAR2(50) :='AP.PLSQL.AP_INVOICES_UTILITIES_PKG';
8: /* bug 10425573 end */
9:
10: /*=============================================================================
11: | FUNCTION - get_prepay_number

Line 32: FROM ap_invoices

28: l_prepay_number VARCHAR2(50);
29:
30: CURSOR c_prepay_number IS
31: SELECT invoice_num
32: FROM ap_invoices
33: WHERE invoice_id =
34: (SELECT invoice_id
35: FROM ap_invoice_distributions
36: WHERE invoice_distribution_id = l_prepay_dist_id);

Line 309: FROM ap_invoices_all ai,

305: SELECT nvl(sob.sla_ledger_cash_basis_flag, 'N'),
306: asp.org_id
307: INTO l_cash_basis_flag,
308: l_org_id
309: FROM ap_invoices_all ai,
310: ap_system_parameters_all asp,
311: gl_sets_of_books sob
312: WHERE ai.invoice_id = l_invoice_id
313: AND ai.org_id = asp.org_id

Line 400: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG.CHECK_UNIQUE<-'||

396: debug_info VARCHAR2(100);
397:
398: BEGIN
399:
400: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG.CHECK_UNIQUE<-'||
401: X_calling_sequence;
402:
403: debug_info := 'Count for same vendor_id,party_site_id and invoice_num'; /*Bug9105666*/
404:

Line 407: from ap_invoices_all

403: debug_info := 'Count for same vendor_id,party_site_id and invoice_num'; /*Bug9105666*/
404:
405: select count(1)
406: into dummy_a
407: from ap_invoices_all
408: where invoice_num = X_INVOICE_NUM
409: and vendor_id = X_VENDOR_ID
410: and org_id = X_ORG_ID -- Bug 5407785
411: AND (party_site_id = X_PARTY_SITE_ID /*Bug9105666*/

Line 482: current_calling_sequence := 'AP_INVOICES_PKG.CHECK_UNIQUE_VOUCHER_NUM<-'

478: debug_info VARCHAR2(100);
479:
480: BEGIN
481:
482: current_calling_sequence := 'AP_INVOICES_PKG.CHECK_UNIQUE_VOUCHER_NUM<-'
483: || X_calling_sequence;
484:
485: debug_info := 'Count other invoices with same voucher num';
486:

Line 489: from ap_invoices

485: debug_info := 'Count other invoices with same voucher num';
486:
487: select count(1)
488: into dummy
489: from ap_invoices
490: where voucher_num = X_VOUCHER_NUM
491: and ((X_ROWID is null) or (rowid <> X_ROWID));
492:
493: IF (dummy >= 1) THEN

Line 610: -- MOAC. Included select from ap_invoices_all to get the org_id from

606: BEGIN
607:
608: ---------------------------------------------------------------------
609: -- Get the encumbrance flag
610: -- MOAC. Included select from ap_invoices_all to get the org_id from
611: -- the invoice_id since it is unique
612:
613:
614:

Line 623: FROM ap_invoices_all ai,

619: INTO encumbrance_flag,
620: l_org_id,
621: l_force_revalidation_flag,
622: l_net_of_retainage_flag --9503673
623: FROM ap_invoices_all ai,
624: financials_system_params_all fsp
625: WHERE ai.invoice_id = l_invoice_id
626: AND ai.set_of_books_id = fsp.set_of_books_id
627: AND ai.org_id = fsp.org_id;

Line 657: FROM ap_invoices_all ai

653: -- If invoice is cancelled, return 'CANCELLED'.
654: --
655: SELECT ai.cancelled_date
656: INTO cancelled_date
657: FROM ap_invoices_all ai
658: WHERE ai.invoice_id = l_invoice_id;
659:
660: IF (cancelled_date IS NOT NULL) THEN
661: RETURN('CANCELLED');

Line 811: FROM ap_invoice_lines_all AIL, ap_invoices_all A

807: BEGIN
808:
809: SELECT 'N'
810: INTO invoice_approval_flag
811: FROM ap_invoice_lines_all AIL, ap_invoices_all A
812: WHERE AIL.invoice_id = A.invoice_id
813: AND AIL.invoice_id = l_invoice_id
814: AND ((AIL.line_type_lookup_code <> 'TAX'
815: and (AIL.line_type_lookup_code NOT IN ('AWT','PREPAY')

Line 870: l_retained_amt := ABS(AP_INVOICES_UTILITY_PKG.Get_retained_Total(

866: OR NVL(ail.invoice_includes_prepay_flag,'N') = 'Y');
867:
868: --Start 9503673
869: IF l_net_of_retainage_flag = 'Y' THEN
870: l_retained_amt := ABS(AP_INVOICES_UTILITY_PKG.Get_retained_Total(
871: l_invoice_id,l_org_id));
872: END IF;
873: --End 9503673
874:

Line 934: if (AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(l_invoice_id) = 0) then

930: if (NVL(l_payment_status_flag , 'N') <> 'Y') then --bug6598052
931: invoice_approval_status := 'UNPAID';
932: else
933: -- This prepayment is paid
934: if (AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(l_invoice_id) = 0) then
935: invoice_approval_status := 'FULL';
936: elsif (AP_INVOICES_UTILITY_PKG.get_prepayment_type(l_invoice_id) = 'PERMANENT') THEN
937: invoice_approval_status := 'PERMANENT';
938: else

Line 936: elsif (AP_INVOICES_UTILITY_PKG.get_prepayment_type(l_invoice_id) = 'PERMANENT') THEN

932: else
933: -- This prepayment is paid
934: if (AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(l_invoice_id) = 0) then
935: invoice_approval_status := 'FULL';
936: elsif (AP_INVOICES_UTILITY_PKG.get_prepayment_type(l_invoice_id) = 'PERMANENT') THEN
937: invoice_approval_status := 'PERMANENT';
938: else
939: invoice_approval_status := 'AVAILABLE';
940: end if; -- end of check AP_INVOICES_UTILITY_PKG call

Line 940: end if; -- end of check AP_INVOICES_UTILITY_PKG call

936: elsif (AP_INVOICES_UTILITY_PKG.get_prepayment_type(l_invoice_id) = 'PERMANENT') THEN
937: invoice_approval_status := 'PERMANENT';
938: else
939: invoice_approval_status := 'AVAILABLE';
940: end if; -- end of check AP_INVOICES_UTILITY_PKG call
941: end if; -- end of check l_payment_status_flag
942: elsif (invoice_approval_status = 'NEVER APPROVED') then
943: -- This prepayment in unapproved
944: invoice_approval_status := 'UNAPPROVED';

Line 983: l_invoice_type ap_invoices_all.invoice_type_lookup_code%TYPE; --7550789

979: po_number VARCHAR2(50) := 'UNMATCHED'; -- for CLM Bug 9503239
980: l_line_matched_amount NUMBER;
981: l_po_header_id NUMBER;
982: l_corrected_amount NUMBER;
983: l_invoice_type ap_invoices_all.invoice_type_lookup_code%TYPE; --7550789
984:
985: /* Bug 4669905. Modified the Cursor */
986: CURSOR po_number_cursor IS
987: SELECT DISTINCT NVL(ph.CLM_DOCUMENT_NUMBER , ph.segment1), ph.po_header_id, -- for CLM Bug 9503239

Line 1016: FROM ap_invoices_all

1012: --Added below Select for bug 7550789
1013:
1014: SELECT invoice_type_lookup_code
1015: INTO l_invoice_type
1016: FROM ap_invoices_all
1017: WHERE invoice_id=l_invoice_id;
1018:
1019: IF (po_number_cursor%ROWCOUNT > 1) THEN
1020: po_number := 'ANY MULTIPLE';

Line 1364: WHERE table_name = 'AP_INVOICES'

1360:
1361: SELECT COUNT(*)
1362: INTO notes_count
1363: FROM po_note_references
1364: WHERE table_name = 'AP_INVOICES'
1365: AND foreign_id = l_invoice_id;
1366:
1367: return(notes_count);
1368:

Line 1461: FROM ap_invoices ai

1457: BEGIN
1458:
1459: SELECT COUNT(*)
1460: INTO prepay_count
1461: FROM ap_invoices ai
1462: WHERE vendor_id = l_vendor_id
1463: AND (( l_org_id IS NOT NULL AND
1464: ai.org_id = l_org_id)
1465: OR l_org_id IS NULL)

Line 1468: AND AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(ai.invoice_id) > 0;

1464: ai.org_id = l_org_id)
1465: OR l_org_id IS NULL)
1466: AND invoice_type_lookup_code = 'PREPAYMENT'
1467: AND earliest_settlement_date IS NOT NULL
1468: AND AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(ai.invoice_id) > 0;
1469:
1470: RETURN(prepay_count);
1471:
1472: END get_total_prepays;

Line 1509: ap_invoices

1505: as a filter is removed and logic is implemented here as this would reduce the wait time*/
1506: CURSOR prepayment_invoices IS
1507: SELECT earliest_settlement_date,invoice_id
1508: from
1509: ap_invoices
1510: where vendor_id=l_vendor_id
1511: and invoice_type_lookup_code='PREPAYMENT'
1512: /*7015402*/
1513: and payment_status_flag = 'Y'

Line 1526: AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(i.invoice_id);

1522: loop
1523: if(i.earliest_settlement_date<=(sysdate)) then
1524: l_prepay_amount_remaining:=0;
1525: l_prepay_amount_remaining:=
1526: AP_INVOICES_UTILITY_PKG.get_prepay_amount_remaining(i.invoice_id);
1527: if(l_prepay_amount_remaining>0) then
1528: prepay_count:=prepay_count+1;
1529: end if;
1530: end if;

Line 1599: FROM ap_invoices_all ai,

1595: BEGIN
1596:
1597: SELECT NVL(fsp.purch_encumbrance_flag,'N'), ai.org_id
1598: INTO l_purch_encumbrance_flag, l_org_id
1599: FROM ap_invoices_all ai,
1600: financials_system_params_all fsp
1601: WHERE ai.invoice_id = l_invoice_id
1602: AND ai.org_id = fsp.org_id;
1603:

Line 1760: FROM ap_invoices

1756: P_calling_sequence IN varchar2) RETURN varchar2
1757: IS
1758: CURSOR similar_memo_cursor IS
1759: SELECT invoice_num
1760: FROM ap_invoices
1761: WHERE vendor_id = P_vendor_id
1762: AND vendor_site_id = P_vendor_site_id
1763: AND invoice_amount = P_invoice_amount
1764: AND invoice_currency_code = P_invoice_currency_code

Line 1770: l_invoice_num ap_invoices.invoice_num%TYPE;

1766: DECODE(P_invoice_type_lookup_code,
1767: 'CREDIT','DEBIT',
1768: 'DEBIT','CREDIT');
1769:
1770: l_invoice_num ap_invoices.invoice_num%TYPE;
1771: current_calling_sequence VARCHAR2(2000);
1772: debug_info VARCHAR2(100);
1773:
1774: BEGIN

Line 1776: current_calling_sequence := 'AP_INVOICES_PKG.get_similar_drcr_memo<-'||

1772: debug_info VARCHAR2(100);
1773:
1774: BEGIN
1775:
1776: current_calling_sequence := 'AP_INVOICES_PKG.get_similar_drcr_memo<-'||
1777: P_calling_sequence;
1778:
1779: debug_info := 'Open cursor similar_memo_cursor';
1780:

Line 1838: current_calling_sequence := 'AP_INVOICES_Utility_PKG.eft_bank_details_exist<-'||

1834: debug_info VARCHAR2(100);
1835:
1836: BEGIN
1837:
1838: current_calling_sequence := 'AP_INVOICES_Utility_PKG.eft_bank_details_exist<-'||
1839: P_calling_sequence;
1840:
1841: debug_info := 'Call AP IBY API';
1842:

Line 1854: x_calling_sequence => 'Ap_Invoices_Utility_Pkg');

1850: x_vendor_site_id => p_vendor_site_id,
1851: x_payment_function => NULL,
1852: x_org_id => NULL,
1853: x_currency_code => NULL,
1854: x_calling_sequence => 'Ap_Invoices_Utility_Pkg');
1855:
1856: IF l_ext_bank_acct_id IS NOT NULL THEN
1857: RETURN True;
1858: ELSE

Line 1905: current_calling_sequence := 'AP_INVOICES_Utility_PKG.eft_bank_details_exist<-'||

1901: debug_info VARCHAR2(100);
1902:
1903: BEGIN
1904:
1905: current_calling_sequence := 'AP_INVOICES_Utility_PKG.eft_bank_details_exist<-'||
1906: P_calling_sequence;
1907:
1908: debug_info := 'Call AP IBY API';
1909:

Line 1921: x_calling_sequence => 'Ap_Invoices_Utility_Pkg');

1917: x_vendor_site_id => p_vendor_site_id,
1918: x_payment_function => NULL,
1919: x_org_id => NULL,
1920: x_currency_code => NULL,
1921: x_calling_sequence => 'Ap_Invoices_Utility_Pkg');
1922:
1923: IF l_ext_bank_acct_id IS NOT NULL THEN
1924: RETURN True;
1925: ELSE

Line 2093: IF ( sign (AP_INVOICES_UTILITY_PKG.get_prepay_amount_applied(

2089: IS
2090: l_flag varchar2(1) := 'N';
2091: BEGIN
2092:
2093: IF ( sign (AP_INVOICES_UTILITY_PKG.get_prepay_amount_applied(
2094: P_invoice_id)) = 1 ) THEN
2095: l_flag := 'Y';
2096: ELSE
2097: l_flag := null;

Line 2217: FROM ap_invoice_distributions_all aid,ap_invoices_all ai

2213: IS
2214: l_prepay_amount_remaining number:=0;
2215: cursor c_prepay_amount_remaining IS
2216: SELECT SUM(nvl(prepay_amount_remaining,amount))
2217: FROM ap_invoice_distributions_all aid,ap_invoices_all ai
2218: WHERE aid.invoice_id = P_invoice_id
2219: AND aid.line_type_lookup_code IN ('ITEM','TAX')
2220: AND nvl(aid.reversal_flag,'N') <> 'Y'
2221: AND ai.invoice_id = P_invoice_id

Line 2256: FROM ap_invoices_all ai

2252: l_prepayment_type VARCHAR2(9);
2253:
2254: CURSOR c_prepayment_type IS
2255: SELECT decode(AI.EARLIEST_SETTLEMENT_DATE,null,'PERMANENT','TEMPORARY')
2256: FROM ap_invoices_all ai
2257: WHERE ai.invoice_id = P_invoice_id;
2258: BEGIN
2259:
2260: OPEN c_prepayment_type;

Line 2628: | reports table as well as in ap invoices or only in ap invoices

2624: | FUNCTION - get_expense_type
2625: |
2626: | DESCRIPTION
2627: | added to decide whether the information is available in in expense
2628: | reports table as well as in ap invoices or only in ap invoices
2629: |
2630: | KNOWN ISSUES:
2631: |
2632: | NOTES

Line 2635: | information from ap invoices. This was added based on the requirement

2631: |
2632: | NOTES
2633: | If the information is available in both the table we should get the
2634: | information from ap expense report headers, if not we should get the
2635: | information from ap invoices. This was added based on the requirement
2636: | from GSI and confirmed by lauren
2637: |
2638: | MODIFICATION HISTORY
2639: | Date Author Description of Change

Line 2791: l_base_amount ap_invoices.base_amount%TYPE;

2787: RETURN BOOLEAN IS
2788: l_rounded_amt NUMBER := 0;
2789: l_rounded_line_numbers inv_line_num_tab_type;
2790: l_base_currency_code ap_system_parameters.base_currency_code%TYPE;
2791: l_base_amount ap_invoices.base_amount%TYPE;
2792: l_invoice_amount ap_invoices.invoice_amount%TYPE;
2793: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
2794: l_reporting_currency_code ap_invoices.invoice_currency_code%TYPE;
2795: l_sum_base_amt NUMBER;

Line 2792: l_invoice_amount ap_invoices.invoice_amount%TYPE;

2788: l_rounded_amt NUMBER := 0;
2789: l_rounded_line_numbers inv_line_num_tab_type;
2790: l_base_currency_code ap_system_parameters.base_currency_code%TYPE;
2791: l_base_amount ap_invoices.base_amount%TYPE;
2792: l_invoice_amount ap_invoices.invoice_amount%TYPE;
2793: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
2794: l_reporting_currency_code ap_invoices.invoice_currency_code%TYPE;
2795: l_sum_base_amt NUMBER;
2796: l_sum_amt NUMBER;

Line 2793: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;

2789: l_rounded_line_numbers inv_line_num_tab_type;
2790: l_base_currency_code ap_system_parameters.base_currency_code%TYPE;
2791: l_base_amount ap_invoices.base_amount%TYPE;
2792: l_invoice_amount ap_invoices.invoice_amount%TYPE;
2793: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
2794: l_reporting_currency_code ap_invoices.invoice_currency_code%TYPE;
2795: l_sum_base_amt NUMBER;
2796: l_sum_amt NUMBER;
2797: l_sum_rpt_base_amt NUMBER;

Line 2794: l_reporting_currency_code ap_invoices.invoice_currency_code%TYPE;

2790: l_base_currency_code ap_system_parameters.base_currency_code%TYPE;
2791: l_base_amount ap_invoices.base_amount%TYPE;
2792: l_invoice_amount ap_invoices.invoice_amount%TYPE;
2793: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
2794: l_reporting_currency_code ap_invoices.invoice_currency_code%TYPE;
2795: l_sum_base_amt NUMBER;
2796: l_sum_amt NUMBER;
2797: l_sum_rpt_base_amt NUMBER;
2798:

Line 2808: FROM ap_invoices AI, ap_system_parameters ASP

2804: SELECT decode(x_reporting_ledger_id, null, AI.base_amount, null),
2805: AI.invoice_amount, -- invoice amount
2806: AI.invoice_currency_code, -- invoice_currency_code
2807: ASP.base_currency_code -- base_currency_code
2808: FROM ap_invoices AI, ap_system_parameters ASP
2809: WHERE AI.invoice_id = X_invoice_id
2810: AND ASP.org_id = AI.org_id;
2811:
2812: BEGIN

Line 2814: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Round_Base_Amt ' ||

2810: AND ASP.org_id = AI.org_id;
2811:
2812: BEGIN
2813:
2814: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Round_Base_Amt ' ||
2815: X_calling_sequence;
2816:
2817: -------------------------------------------------------------
2818: debug_info := 'Round_Base_Amt - Open cursor invoice_cursor';

Line 2978: FROM ap_invoices AI

2974: --bug 5475668
2975: if (P_invoice_id is not null) then
2976: SELECT 1
2977: INTO l_quick_credit_count
2978: FROM ap_invoices AI
2979: WHERE AI.credited_invoice_id = P_invoice_id
2980: AND NVL(AI.quick_credit, 'N') = 'Y'
2981: AND AI.cancelled_date is null
2982: AND ROWNUM = 1 ;

Line 3027: FROM ap_invoices_all i

3023:
3024: IS
3025: CURSOR Invoice_Validation IS
3026: SELECT i.invoice_id
3027: FROM ap_invoices_all i
3028: WHERE i.invoice_id = P_Invoice_Id
3029: AND EXISTS
3030: (SELECT il.invoice_id
3031: FROM ap_invoice_lines_all il

Line 3038: l_invoice_id ap_invoices_all.invoice_id%TYPE;

3034: AND NVL(il.cancelled_flag, 'N') <> 'Y'
3035: AND il.match_type IN ('PRICE_CORRECTION',
3036: 'QTY_CORRECTION'));
3037:
3038: l_invoice_id ap_invoices_all.invoice_id%TYPE;
3039: current_calling_sequence VARCHAR2(4000);
3040: debug_info VARCHAR2(240);
3041: l_return_var BOOLEAN := FALSE;
3042:

Line 3044: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_With_PQ_Corrections';

3040: debug_info VARCHAR2(240);
3041: l_return_var BOOLEAN := FALSE;
3042:
3043: BEGIN
3044: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_With_PQ_Corrections';
3045:
3046: -------------------------------------------------------------
3047: debug_info := 'Inv_With_PQ_Corrections - Open cursor';
3048: -------------------------------------------------------------

Line 3115: FROM ap_invoices_all i

3111:
3112: IS
3113: CURSOR Invoice_Validation IS
3114: SELECT i.invoice_id
3115: FROM ap_invoices_all i
3116: WHERE i.invoice_id = P_Invoice_Id
3117: AND EXISTS
3118: (SELECT il.invoice_id
3119: FROM ap_invoice_lines_all il

Line 3125: l_invoice_id ap_invoices_all.invoice_id%TYPE;

3121: AND il.line_type_lookup_code = 'PREPAY'
3122: AND NVL(il.discarded_flag, 'N') <> 'Y'
3123: AND NVL(il.cancelled_flag, 'N') <> 'Y');
3124:
3125: l_invoice_id ap_invoices_all.invoice_id%TYPE;
3126: current_calling_sequence VARCHAR2(4000);
3127: debug_info VARCHAR2(240);
3128: l_return_var BOOLEAN := FALSE;
3129:

Line 3131: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_With_Prepayments';

3127: debug_info VARCHAR2(240);
3128: l_return_var BOOLEAN := FALSE;
3129:
3130: BEGIN
3131: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_With_Prepayments';
3132:
3133: -------------------------------------------------------------
3134: debug_info := 'Inv_With_Prepayments - Open cursor';
3135: -------------------------------------------------------------

Line 3202: FROM ap_invoices_all i

3198:
3199: IS
3200: CURSOR Invoice_Validation IS
3201: SELECT i.invoice_id
3202: FROM ap_invoices_all i
3203: WHERE i.invoice_id = P_Invoice_Id
3204: AND EXISTS
3205: (SELECT il.invoice_id
3206: FROM ap_invoice_lines_all il

Line 3212: l_invoice_id ap_invoices_all.invoice_id%TYPE;

3208: AND il.line_type_lookup_code = 'AWT'
3209: AND NVL(il.discarded_flag, 'N') <> 'Y'
3210: AND NVL(il.cancelled_flag, 'N') <> 'Y');
3211:
3212: l_invoice_id ap_invoices_all.invoice_id%TYPE;
3213: current_calling_sequence VARCHAR2(4000);
3214: debug_info VARCHAR2(240);
3215: l_return_var BOOLEAN := FALSE;
3216:

Line 3218: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Invoice_Includes_Awt';

3214: debug_info VARCHAR2(240);
3215: l_return_var BOOLEAN := FALSE;
3216:
3217: BEGIN
3218: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Invoice_Includes_Awt';
3219:
3220: -------------------------------------------------------------
3221: debug_info := 'Invoice_Includes_Awt - Open cursor';
3222: -------------------------------------------------------------

Line 3288: FROM ap_invoices_all i

3284:
3285: IS
3286: CURSOR Invoice_Validation IS
3287: SELECT i.invoice_id
3288: FROM ap_invoices_all i
3289: WHERE i.invoice_id = P_Invoice_Id
3290: AND EXISTS
3291: (SELECT ail.invoice_id
3292: FROM ap_invoice_lines_all ail,

Line 3299: l_invoice_id ap_invoices_all.invoice_id%TYPE;

3295: AND ail.po_line_location_id = pll.line_location_id
3296: AND ail.org_id = pll.org_id
3297: AND pll.closed_code = 'FINALLY CLOSED');
3298:
3299: l_invoice_id ap_invoices_all.invoice_id%TYPE;
3300: current_calling_sequence VARCHAR2(4000);
3301: debug_info VARCHAR2(240);
3302: l_return_var BOOLEAN := FALSE;
3303:

Line 3305: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_Matched_Finally_Closed_Po';

3301: debug_info VARCHAR2(240);
3302: l_return_var BOOLEAN := FALSE;
3303:
3304: BEGIN
3305: current_calling_sequence := 'AP_INVOICES_UTILITY_PKG - Inv_Matched_Finally_Closed_Po';
3306:
3307: ------------------------------------------------------------
3308: debug_info := 'Open cursor to verify if the invoice is '||
3309: 'matched to a finally closed PO';

Line 3384: FROM ap_invoices

3380: BEGIN
3381:
3382: SELECT invoice_num
3383: INTO l_invoice_num
3384: FROM ap_invoices
3385: WHERE invoice_id = p_invoice_id;
3386:
3387: RETURN(l_invoice_num);
3388:

Line 3613: FROM ap_invoices_all ai

3609: l_approval_ready_flag,
3610: l_invoice_type_lookup_code,
3611: l_invoice_source,
3612: l_wfapproval_status
3613: FROM ap_invoices_all ai
3614: WHERE ai.invoice_id = p_invoice_id
3615: AND ai.source = 'ISP';
3616:
3617: -- If cancelled date is not null, return 'CANCELLED'

Line 3624: -- Temporarily approval_ready_flag = 'S' in ap_invoices_all handles the

3620: RETURN('CANCELLED');
3621: END IF;
3622:
3623: -- If invoice is saved for later in ISP, return 'UNSUBMITTED'.
3624: -- Temporarily approval_ready_flag = 'S' in ap_invoices_all handles the
3625: -- the unsubmitted invoices.
3626: IF ( l_approval_ready_flag = 'S' ) THEN
3627: RETURN('UNSUBMITTED');
3628: END IF;

Line 3820: l_invoice_type AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CODE%TYPE;

3816: IS
3817: l_current_calling_sequence VARCHAR2(2000);
3818: l_debug_info VARCHAR2(500);
3819: l_success BOOLEAN := FALSE;
3820: l_invoice_type AP_INVOICES_ALL.INVOICE_TYPE_LOOKUP_CODE%TYPE;
3821: l_api_name CONSTANT VARCHAR2(200) := 'Update_Invoice_Description';
3822: BEGIN
3823:
3824: l_current_calling_sequence := 'AP_UTILITIES_PKG.Update_Description <- '||p_calling_sequence;

Line 3832: FROM ap_invoices_all

3828: END IF;
3829:
3830: SELECT Invoice_type_lookup_code
3831: INTO l_invoice_type
3832: FROM ap_invoices_all
3833: WHERE invoice_id=p_invoice_id;
3834:
3835: l_debug_info := 'Updating Invoice';
3836: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN

Line 3842: UPDATE ap_invoices_all

3838: END IF;
3839:
3840: IF (l_invoice_type = 'CREDIT') THEN
3841:
3842: UPDATE ap_invoices_all
3843: SET description = p_description
3844: WHERE invoice_id = p_invoice_id;
3845:
3846: l_debug_info := 'Update Invoice Description Successfully';

Line 3899: L_INVOICE_TYPE_LOOKUP_CODE AP_INVOICES.INVOICE_TYPE_LOOKUP_CODE%TYPE;

3895:
3896: current_calling_sequence VARCHAR2(2000);
3897: debug_info VARCHAR2(100);
3898: l_return_status BOOLEAN;
3899: L_INVOICE_TYPE_LOOKUP_CODE AP_INVOICES.INVOICE_TYPE_LOOKUP_CODE%TYPE;
3900: l_api_name CONSTANT VARCHAR2(200) := 'CHECK_GDF_VALID';
3901: l_debug_info VARCHAR2(1000);
3902:
3903: BEGIN

Line 3904: current_calling_sequence := 'AP_INVOICES_Utility_PKG.CHECK_GDF_VALID<-'||

3900: l_api_name CONSTANT VARCHAR2(200) := 'CHECK_GDF_VALID';
3901: l_debug_info VARCHAR2(1000);
3902:
3903: BEGIN
3904: current_calling_sequence := 'AP_INVOICES_Utility_PKG.CHECK_GDF_VALID<-'||
3905: P_calling_sequence;
3906:
3907: P_hold_reject_exists_flag := 'N';
3908: P_return_code := NULL;

Line 3915: IF (AP_INVOICES_UTILITY_PKG.FV_ENABLED) THEN

3911: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3912: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
3913: END IF;
3914:
3915: IF (AP_INVOICES_UTILITY_PKG.FV_ENABLED) THEN
3916:
3917: IF(P_calling_mode = 'INV_IMP')THEN
3918: SELECT
3919: (CASE

Line 3929: FROM AP_INVOICES_INTERFACE

3925: 'CREDIT'
3926: ELSE INVOICE_TYPE_LOOKUP_CODE
3927: END)
3928: INTO L_INVOICE_TYPE_LOOKUP_CODE
3929: FROM AP_INVOICES_INTERFACE
3930: /* Modified for bug#15906783 */
3931: WHERE INVOICE_ID in (SELECT INVOICE_ID
3932: FROM ap_invoice_lines_interface
3933: WHERE invoice_line_id = P_ID);

Line 3939: FROM AP_INVOICES

3935:
3936: ELSIF(P_calling_mode = 'INV_VLD')THEN
3937: SELECT INVOICE_TYPE_LOOKUP_CODE
3938: INTO L_INVOICE_TYPE_LOOKUP_CODE
3939: FROM AP_INVOICES
3940: WHERE INVOICE_ID = P_ID;
3941: END IF;
3942:
3943: l_debug_info := 'CALL FV api for few types of invoices';

Line 3986: END AP_INVOICES_UTILITY_PKG;

3982: END CHECK_GDF_VALID;
3983:
3984: --End Bug#13464635
3985:
3986: END AP_INVOICES_UTILITY_PKG;
3987: