DBA Data[Home] [Help]

APPS.AP_IMPORT_UTILITIES_PKG dependencies on AP_INVOICES

Line 24: where entity_name = 'AP_INVOICES_INTERFACE'

20: BEGIN
21: select count(1)
22: into l_attachments_count
23: from fnd_attached_documents
24: where entity_name = 'AP_INVOICES_INTERFACE'
25: and pk1_value = p_from_invoice_id;
26:
27: -- we only need to copy attachments if there is one
28: if ( l_attachments_count > 0 )

Line 31: x_from_entity_name => 'AP_INVOICES_INTERFACE',

27: -- we only need to copy attachments if there is one
28: if ( l_attachments_count > 0 )
29: then
30: fnd_attached_documents2_pkg.copy_attachments(
31: x_from_entity_name => 'AP_INVOICES_INTERFACE',
32: x_from_pk1_value => p_from_invoice_id,
33: x_to_entity_name => 'AP_INVOICES',
34: x_to_pk1_value => p_to_invoice_id);
35: end if;

Line 33: x_to_entity_name => 'AP_INVOICES',

29: then
30: fnd_attached_documents2_pkg.copy_attachments(
31: x_from_entity_name => 'AP_INVOICES_INTERFACE',
32: x_from_pk1_value => p_from_invoice_id,
33: x_to_entity_name => 'AP_INVOICES',
34: x_to_pk1_value => p_to_invoice_id);
35: end if;
36:
37: return l_attachments_count;

Line 2057: AP_INVOICES_INTERFACE.VOUCHER_NUM will be inserted in AP_INVOICES.

2053: Sequential Numbering in Invoice Open Interface (R11 only)
2054:
2055: The two modes for numbering can be:
2056: - Simple Manual Entry without Audit: Any value entered in the column
2057: AP_INVOICES_INTERFACE.VOUCHER_NUM will be inserted in AP_INVOICES.
2058: VOUCHER_NUM without validation.
2059:
2060: - Auto Voucher Numbering with Audit: A value will be obtained
2061: automatically for the record being imported and will be populated in

Line 2062: AP_INVOICES. DOC_SEQUENCE_VALUE. Also audit information would be inserted

2058: VOUCHER_NUM without validation.
2059:
2060: - Auto Voucher Numbering with Audit: A value will be obtained
2061: automatically for the record being imported and will be populated in
2062: AP_INVOICES. DOC_SEQUENCE_VALUE. Also audit information would be inserted
2063: into the audit table.
2064:
2065: The latter mode will always override the first one.
2066:

Line 2085: AP_INVOICES_INTERFACE.DOC_CATEGORY_CODE (and override is "No").

2081: If the profile value is "Partial" or "Always" and
2082: the payables option of Invoice Document Category override is
2083: "Yes" then the user can specify the document category, else the
2084: invoice will be rejected for 'Override Disabled', if the user populates
2085: AP_INVOICES_INTERFACE.DOC_CATEGORY_CODE (and override is "No").
2086:
2087: If the profile value is "Always" and no document category is specified
2088: by the user, then "Standard Invoices" category will be used for
2089: standard invoices and "Credit Memo Invoices" category will be used

Line 2116: FND_DOC_SEQUENCE_CATEGORIES for AP_INVOICES or AP_INVOICES_ALL

2112: and the invoice amount is greated than zero then the invoice will be
2113: rejected for 'Invalid Category'.
2114:
2115: The document category specified should be valid in
2116: FND_DOC_SEQUENCE_CATEGORIES for AP_INVOICES or AP_INVOICES_ALL
2117: table. If not then the invoice will be rejected for 'Invalid Category'.
2118:
2119: If the document category is valid then Check the status of the
2120: sequence assigned to this category.The sequence should be automatic

Line 2146: ap_invoices.doc_category_code%TYPE := p_invoice_rec.doc_category_code;

2142: IS
2143: get_doc_seq_failure EXCEPTION;
2144: l_name VARCHAR2(80);
2145: l_doc_category_code
2146: ap_invoices.doc_category_code%TYPE := p_invoice_rec.doc_category_code;
2147: l_application_id NUMBER;
2148: l_doc_seq_ass_id NUMBER;
2149: l_current_invoice_status VARCHAR2(1) := 'Y';
2150: current_calling_sequence VARCHAR2(2000);

Line 2290: AND table_name IN ('AP_INVOICES','AP_INVOICES_ALL');

2286: SELECT name, application_id
2287: INTO l_name, l_application_id
2288: FROM fnd_doc_sequence_categories
2289: WHERE code = p_invoice_rec.doc_category_code
2290: AND table_name IN ('AP_INVOICES','AP_INVOICES_ALL');
2291: EXCEPTION
2292: WHEN NO_DATA_FOUND THEN
2293: debug_info := debug_info || 'Reject->Doc cat does not exist';
2294: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN

Line 2783: Function Insert_Ap_Invoices

2779: END get_invoice_info;
2780:
2781: /*=========================================================================
2782:
2783: Function Insert_Ap_Invoices
2784: Program Flow:
2785:
2786: =========================================================================*/
2787: -- Payment Request: Added p_needs_invoice_approval for payment request invoices

Line 2788: FUNCTION insert_ap_invoices(

2784: Program Flow:
2785:
2786: =========================================================================*/
2787: -- Payment Request: Added p_needs_invoice_approval for payment request invoices
2788: FUNCTION insert_ap_invoices(
2789: p_invoice_rec IN OUT
2790: AP_IMPORT_INVOICES_PKG.r_invoice_info_rec,
2791: p_base_invoice_id OUT NOCOPY NUMBER,
2792: p_set_of_books_id IN NUMBER,

Line 2794: AP_INVOICES.doc_sequence_id%TYPE,

2790: AP_IMPORT_INVOICES_PKG.r_invoice_info_rec,
2791: p_base_invoice_id OUT NOCOPY NUMBER,
2792: p_set_of_books_id IN NUMBER,
2793: p_doc_sequence_id IN
2794: AP_INVOICES.doc_sequence_id%TYPE,
2795: p_doc_sequence_value IN
2796: AP_INVOICES.doc_sequence_value%TYPE,
2797: p_batch_id IN AP_INVOICES.batch_id%TYPE,
2798: p_pay_curr_invoice_amount IN NUMBER,

Line 2796: AP_INVOICES.doc_sequence_value%TYPE,

2792: p_set_of_books_id IN NUMBER,
2793: p_doc_sequence_id IN
2794: AP_INVOICES.doc_sequence_id%TYPE,
2795: p_doc_sequence_value IN
2796: AP_INVOICES.doc_sequence_value%TYPE,
2797: p_batch_id IN AP_INVOICES.batch_id%TYPE,
2798: p_pay_curr_invoice_amount IN NUMBER,
2799: p_approval_workflow_flag IN VARCHAR2,
2800: p_needs_invoice_approval IN VARCHAR2,

Line 2797: p_batch_id IN AP_INVOICES.batch_id%TYPE,

2793: p_doc_sequence_id IN
2794: AP_INVOICES.doc_sequence_id%TYPE,
2795: p_doc_sequence_value IN
2796: AP_INVOICES.doc_sequence_value%TYPE,
2797: p_batch_id IN AP_INVOICES.batch_id%TYPE,
2798: p_pay_curr_invoice_amount IN NUMBER,
2799: p_approval_workflow_flag IN VARCHAR2,
2800: p_needs_invoice_approval IN VARCHAR2,
2801: p_add_days_settlement_date IN NUMBER, --bug 493011

Line 2819: current_calling_sequence := 'insert_ap_invoices<-'||P_calling_sequence;

2815:
2816: BEGIN
2817: -- Update the calling sequence
2818:
2819: current_calling_sequence := 'insert_ap_invoices<-'||P_calling_sequence;
2820:
2821: -----------------------------------------------------------------------------
2822: -- Step 1
2823: -- get new invoice_id for base table ap_invoices

Line 2823: -- get new invoice_id for base table ap_invoices

2819: current_calling_sequence := 'insert_ap_invoices<-'||P_calling_sequence;
2820:
2821: -----------------------------------------------------------------------------
2822: -- Step 1
2823: -- get new invoice_id for base table ap_invoices
2824: -----------------------------------------------------------------------------
2825:
2826: debug_info := '(Insert ap invoices step 1) Get new invoice_id for base ' ||
2827: 'table ap_invoices';

Line 2826: debug_info := '(Insert ap invoices step 1) Get new invoice_id for base ' ||

2822: -- Step 1
2823: -- get new invoice_id for base table ap_invoices
2824: -----------------------------------------------------------------------------
2825:
2826: debug_info := '(Insert ap invoices step 1) Get new invoice_id for base ' ||
2827: 'table ap_invoices';
2828: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2829: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2830: END IF;

Line 2827: 'table ap_invoices';

2823: -- get new invoice_id for base table ap_invoices
2824: -----------------------------------------------------------------------------
2825:
2826: debug_info := '(Insert ap invoices step 1) Get new invoice_id for base ' ||
2827: 'table ap_invoices';
2828: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2829: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2830: END IF;
2831: -- Bug 5448579

Line 2833: SELECT ap_invoices_s.nextval

2829: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2830: END IF;
2831: -- Bug 5448579
2832: /*
2833: SELECT ap_invoices_s.nextval
2834: INTO l_invoice_id
2835: FROM sys.dual;
2836: */
2837: -----------------------------------------------------------------------------

Line 2842: debug_info := '(Insert ap invoices step 2)-Get wfapproval_status ' ||

2838: -- Step 2
2839: -- get wfapproval_status from profile value - ASP.approval_workflow_flag
2840: -----------------------------------------------------------------------------
2841:
2842: debug_info := '(Insert ap invoices step 2)-Get wfapproval_status ' ||
2843: 'depends on profile value';
2844: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2845: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2846: END IF;

Line 2876: debug_info := '(Insert ap invoices step 3) - Call ' ||

2872: -----------------------------------------------------------------------------
2873: -- Step 3
2874: -- Insert jg_zz_invoice_info
2875: -----------------------------------------------------------------------------
2876: debug_info := '(Insert ap invoices step 3) - Call ' ||
2877: 'jg_globe_flex_val.insert_jg_zz_invoice_info';
2878: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2879: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2880: END IF;

Line 2915: debug_info := '(Insert ap invoices step 3) Calculate earliest settlement date for Prepayment type invoices';

2911:
2912: */
2913:
2914:
2915: debug_info := '(Insert ap invoices step 3) Calculate earliest settlement date for Prepayment type invoices';
2916: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2917: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2918: END IF;
2919:

Line 2927: -- Insert into ap_invoices table

2923:
2924:
2925: -----------------------------------------------------------------------------
2926: -- Step 4
2927: -- Insert into ap_invoices table
2928: -----------------------------------------------------------------------------
2929:
2930: debug_info := '(Insert ap invoices step 4) - Insert into ap_invoices';
2931: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN

Line 2930: debug_info := '(Insert ap invoices step 4) - Insert into ap_invoices';

2926: -- Step 4
2927: -- Insert into ap_invoices table
2928: -----------------------------------------------------------------------------
2929:
2930: debug_info := '(Insert ap invoices step 4) - Insert into ap_invoices';
2931: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
2932: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
2933: END IF;
2934:

Line 2937: INSERT INTO ap_invoices_all(

2933: END IF;
2934:
2935: -- Payment Requests: Added party_id, party_site_id,
2936: -- pay_proc_trxn_type_code, payment_function to the insert stmt
2937: INSERT INTO ap_invoices_all(
2938: invoice_id,
2939: org_id,
2940: last_update_date,
2941: last_updated_by,

Line 3085: VALUES (ap_invoices_s.nextval, -- l_invoice_id, Bug 5448579

3081: REMIT_TO_SUPPLIER_SITE,
3082: REMIT_TO_SUPPLIER_SITE_ID,
3083: RELATIONSHIP_ID
3084: )
3085: VALUES (ap_invoices_s.nextval, -- l_invoice_id, Bug 5448579
3086: p_invoice_rec.org_id,
3087: p_invoice_rec.last_update_date,
3088: --bug 6951863 fix -start
3089: --p_invoice_rec.last_update_login,

Line 3248: debug_info := '(Insert ap invoices step 5) before copy attachments: '||

3244: -----------------------------------------------------------------------------
3245: -- Step 5
3246: -- copy attachment for the invoice
3247: -----------------------------------------------------------------------------
3248: debug_info := '(Insert ap invoices step 5) before copy attachments: '||
3249: 'source = ' || p_invoice_rec.source || ', from_invoice_id = ' ||
3250: p_invoice_rec.invoice_id || ', to_invoice_id = ' || l_invoice_id;
3251: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
3252: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);

Line 3257: debug_info := '(Insert ap invoices step 5) copy attachments done: ' ||

3253: END IF;
3254:
3255: l_attachments_count :=
3256: copy_attachments(p_invoice_rec.invoice_id, l_invoice_id);
3257: debug_info := '(Insert ap invoices step 5) copy attachments done: ' ||
3258: l_attachments_count;
3259: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
3260: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
3261: END IF;

Line 3267: debug_info := '(Insert ap invoices step 6) - Return the new invoice_id-> ' ||

3263: -----------------------------------------------------------------------------
3264: -- Step 6
3265: -- Assign the out parameter for new invoice_id
3266: -----------------------------------------------------------------------------
3267: debug_info := '(Insert ap invoices step 6) - Return the new invoice_id-> ' ||
3268: to_char(l_invoice_id);
3269: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN
3270: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch, debug_info);
3271: END IF;

Line 3294: END insert_ap_invoices;

3290: END IF;
3291: END IF;
3292: RETURN (FALSE);
3293:
3294: END insert_ap_invoices;
3295:
3296: /*======================================================================
3297: Function: Change_invoice_status
3298:

Line 3336: UPDATE AP_INVOICES_INTERFACE

3332: IF AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y' THEN
3333: Print(AP_IMPORT_INVOICES_PKG.g_debug_switch,debug_info);
3334: END IF;
3335:
3336: UPDATE AP_INVOICES_INTERFACE
3337: SET status = p_status
3338: WHERE invoice_id = p_import_invoice_id;
3339:
3340: RETURN(TRUE);

Line 3418: UPDATE AP_INVOICES_INTERFACE

3414: --pertaining to the current request. Modified the below 4 update stmts.
3415:
3416: IF p_group_id IS NULL THEN
3417:
3418: UPDATE AP_INVOICES_INTERFACE
3419: SET status = l_processed
3420: WHERE source = p_source
3421: AND p_group_id is NULL
3422: AND status = l_processing

Line 3425: UPDATE AP_INVOICES_INTERFACE

3421: AND p_group_id is NULL
3422: AND status = l_processing
3423: AND request_id = AP_IMPORT_INVOICES_PKG.g_conc_request_id;
3424:
3425: UPDATE AP_INVOICES_INTERFACE
3426: SET status = l_rejected
3427: WHERE source = p_source
3428: AND p_group_id is NULL
3429: AND status = l_rejecting

Line 3434: UPDATE AP_INVOICES_INTERFACE

3430: AND request_id = AP_IMPORT_INVOICES_PKG.g_conc_request_id;
3431:
3432: ELSE
3433:
3434: UPDATE AP_INVOICES_INTERFACE
3435: SET status = l_processed
3436: WHERE source = p_source
3437: AND group_id = p_group_id
3438: AND status = l_processing

Line 3441: UPDATE AP_INVOICES_INTERFACE

3437: AND group_id = p_group_id
3438: AND status = l_processing
3439: ANd request_id = AP_IMPORT_INVOICES_PKG.g_conc_request_id;
3440:
3441: UPDATE AP_INVOICES_INTERFACE
3442: SET status = l_rejected
3443: WHERE source = p_source
3444: AND group_id = p_group_id
3445: AND status = l_rejecting

Line 3608: /* Function Insert_Ap_Invoices_lines */

3604: END Update_ap_Batches;
3605:
3606: /*=========================================================================*/
3607: /* */
3608: /* Function Insert_Ap_Invoices_lines */
3609: /* Program Flow: */
3610: /* 1. Insert into ap_invoice_lines with the validated interface lines */
3611: /* data */
3612: /* 2. Bulk select primary key of lines */

Line 3655: From ap_invoices_all ai,

3651: -- bug# 6989166 ends
3652:
3653: Cursor c_ship_to (c_invoice_id NUMBER) Is
3654: Select aps.ship_to_location_id
3655: From ap_invoices_all ai,
3656: ap_supplier_sites_all aps
3657: Where ai.invoice_id = c_invoice_id
3658: And ai.vendor_site_id = aps.vendor_site_id;
3659:

Line 3691: from ap_invoices_all

3687:
3688: -- BUG 6785691. START
3689: select INVOICE_TYPE_LOOKUP_CODE
3690: into l_inv_code
3691: from ap_invoices_all
3692: where invoice_id = p_base_invoice_id;
3693:
3694: IF l_inv_code = 'EXPENSE REPORT' THEN
3695: l_wfapproval_status := 'NOT REQUIRED';

Line 4371: l_round_inv_line_numbers AP_INVOICES_UTILITY_PKG.inv_line_num_tab_type; --6892789

4367: l_amt_already_billed NUMBER;
4368:
4369: l_modified_line_rounding_amt NUMBER; --6892789
4370: l_base_amt NUMBER; --6892789
4371: l_round_inv_line_numbers AP_INVOICES_UTILITY_PKG.inv_line_num_tab_type; --6892789
4372:
4373: BEGIN
4374: -- Update the calling sequence
4375:

Line 4424: l_round_amt_exist := AP_INVOICES_UTILITY_PKG.round_base_amts(

4420: case, adjust line base amount upto zero and adjust the remaing amount in
4421: another line having next max amount */
4422:
4423: -- get the lines which can be adjusted
4424: l_round_amt_exist := AP_INVOICES_UTILITY_PKG.round_base_amts(
4425: X_Invoice_Id => p_base_invoice_id,
4426: X_Reporting_Ledger_Id => NULL,
4427: X_Rounded_Line_Numbers => l_round_inv_line_numbers,
4428: X_Rounded_Amt => l_rounded_amt,