DBA Data[Home] [Help]

APPS.AP_INVOICES_UTILITY_PKG dependencies on AP_INVOICES_ALL

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 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 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 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 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 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 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 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 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 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 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';