DBA Data[Home] [Help]

APPS.AP_IMPORT_INVOICES_PKG dependencies on AP_INVOICES_INTERFACE

Line 22: where entity_name = 'AP_INVOICES_INTERFACE'

18: BEGIN
19: select count(1)
20: into l_attachments_count
21: from fnd_attached_documents
22: where entity_name = 'AP_INVOICES_INTERFACE'
23: and pk1_value = p_invoice_id;
24:
25: -- only delete if there is an attachment
26: if ( l_attachments_count > 0 ) then

Line 30: X_entity_name => 'AP_INVOICES_INTERFACE',

26: if ( l_attachments_count > 0 ) then
27: -- assuming deleting only the association with related documents
28: -- need to see if that's always the case
29: fnd_attached_documents2_pkg.delete_attachments(
30: X_entity_name => 'AP_INVOICES_INTERFACE',
31: X_pk1_value => p_invoice_id,
32: X_delete_document_flag => 'N' );
33: end if;
34: return l_attachments_count;

Line 271: FROM ap_invoices_interface

267: ,null
268: ,null
269: ,null
270: --bug 16092065 ends
271: FROM ap_invoices_interface
272: WHERE ((status is NULL) OR (status = 'REJECTED'))
273: AND source = p_source
274: AND ((p_invoice_interface_id IS NULL AND
275: NVL(invoice_type_lookup_code, 'STANDARD') <> 'PAYMENT REQUEST')

Line 475: FROM ap_invoices_interface

471: ,null
472: ,null
473: ,null
474: --bug 16092065 ends
475: FROM ap_invoices_interface
476: WHERE ((status is NULL) OR (status = 'REJECTED'))
477: AND source = p_source
478: AND group_id = p_group_id
479: AND ((p_invoice_interface_id IS NULL AND

Line 693: AP_IMPORT_INVOICES_PKG.g_invoices_table := 'AP_INVOICES_INTERFACE';

689: AP_IMPORT_INVOICES_PKG.g_invoices_table := 'AP_PPA_INVOICES_GT';
690: AP_IMPORT_INVOICES_PKG.g_invoice_lines_table := 'AP_PPA_INVOICE_LINES_GT';
691: AP_IMPORT_INVOICES_PKG.g_instructions_table := 'AP_PPA_INSTRUCTIONS_GT';
692: ELSE
693: AP_IMPORT_INVOICES_PKG.g_invoices_table := 'AP_INVOICES_INTERFACE';
694: AP_IMPORT_INVOICES_PKG.g_invoice_lines_table := 'AP_INVOICE_LINES_INTERFACE';
695: AP_IMPORT_INVOICES_PKG.g_instructions_table := NULL;
696: END IF;
697:

Line 882: ||' FROM ap_invoices_interface WHERE source = ''' ||p_source || ''' '

878:
879: /* BUG 8237318 - Begin modified the existing query to dynamic sql to skip the null checks
880: for passing parameters in the query. */
881: l_stmt := 'SELECT invoice_id '
882: ||' FROM ap_invoices_interface WHERE source = ''' ||p_source || ''' '
883: ||' AND ((status is NULL) or (status = ''REJECTED'')) ';
884:
885:
886:

Line 910: FROM ap_invoices_interface

906:
907: /* IF (p_group_id IS NULL) THEN
908: SELECT invoice_id
909: BULK COLLECT INTO enums
910: FROM ap_invoices_interface
911: WHERE ((status is NULL) or (status = 'REJECTED'))
912: AND source = p_source
913: AND ((p_invoice_interface_id IS NULL AND
914: NVL(invoice_type_lookup_code, 'STANDARD') <> 'PAYMENT REQUEST')

Line 930: FROM ap_invoices_interface

926: org_id is NULL));
927: ELSE
928: SELECT invoice_id
929: BULK COLLECT INTO enums
930: FROM ap_invoices_interface
931: WHERE ((status is NULL) or (status = 'REJECTED'))
932: AND source = p_source
933: AND group_id = p_group_id
934: AND ((p_invoice_interface_id IS NULL AND

Line 966: WHERE parent_table = 'AP_INVOICES_INTERFACE'

962: IF enums.COUNT > 0 THEN
963:
964: ForALL i IN enums.FIRST .. enums.LAST
965: DELETE FROM ap_interface_rejections
966: WHERE parent_table = 'AP_INVOICES_INTERFACE'
967: AND parent_id = enums(i);
968:
969: ForALL i IN enums.FIRST .. enums.LAST
970: DELETE FROM ap_interface_rejections

Line 986: UPDATE AP_INVOICES_INTERFACE

982: END IF;
983:
984: IF enums.COUNT > 0 THEN
985: ForALL i IN enums.FIRST .. enums.LAST
986: UPDATE AP_INVOICES_INTERFACE
987: SET request_id = AP_IMPORT_INVOICES_PKG.g_conc_request_id
988: WHERE invoice_id = enums(i);
989: END IF;
990: --End of Bug 6801046

Line 1014: l_stmt := 'UPDATE ap_invoices_interface i '

1010: -- Coding 2 different update stmts based on p_group_id to improve performance
1011: /* BUG 8237318 - begin modified the existing query to dynamic sql to skip the null checks
1012: for passing parameters in the query. */
1013:
1014: l_stmt := 'UPDATE ap_invoices_interface i '
1015: ||' SET org_id = (SELECT hr.organization_id org_id '
1016: ||' FROM hr_operating_units hr,per_business_groups per '
1017: ||' WHERE hr.business_group_id = per.business_group_id '
1018: /* Commented for bug 11871938 */

Line 1040: UPDATE ap_invoices_interface i

1036:
1037: EXECUTE IMMEDIATE l_stmt;
1038:
1039: /* IF (p_group_id IS NULL) THEN
1040: UPDATE ap_invoices_interface i
1041: SET org_id = (SELECT hr.organization_id org_id
1042: FROM hr_operating_units hr,
1043: per_business_groups per
1044: WHERE hr.business_group_id = per.business_group_id

Line 1059: UPDATE ap_invoices_interface i

1055:
1056: --Bug 6839034 Added ELSE part
1057: ELSE
1058:
1059: UPDATE ap_invoices_interface i
1060: SET org_id = (SELECT hr.organization_id org_id
1061: FROM hr_operating_units hr,
1062: per_business_groups per
1063: WHERE hr.business_group_id = per.business_group_id

Line 1109: l_stmt := 'SELECT count(*) FROM ap_invoices_interface '

1105: -- different select stmts based on the parameter p_group_id
1106: /* BUG 8237318 - Begin modified the existing query to dynamic sql to skip the null checks
1107: for passing parameters in the query. */
1108:
1109: l_stmt := 'SELECT count(*) FROM ap_invoices_interface '
1110: ||' WHERE source = ''' || p_source || ''' '
1111: ||' AND ((status is NULL) or (status = ''REJECTED'')) ';
1112:
1113:

Line 1174: FROM ap_invoices_interface

1170: /* IF (p_group_id IS NULL) THEN
1171: BEGIN
1172: SELECT count(*)
1173: INTO l_total_count
1174: FROM ap_invoices_interface
1175: WHERE ((status is NULL) or (status = 'REJECTED'))
1176: AND source = p_source
1177: AND ((p_invoice_interface_id IS NULL AND
1178: NVL(invoice_type_lookup_code, 'STANDARD') <> 'PAYMENT REQUEST')

Line 1206: FROM ap_invoices_interface

1202: ELSE
1203: BEGIN
1204: SELECT count(*)
1205: INTO l_total_count
1206: FROM ap_invoices_interface
1207: WHERE ((status is NULL) or (status = 'REJECTED'))
1208: AND source = p_source
1209: AND group_id = p_group_id
1210: AND ((p_invoice_interface_id IS NULL AND

Line 1490: UPDATE ap_invoices_interface

1486: l_null_org_id := TRUE;
1487:
1488: ELSIF (l_ou_count = 1 AND p_org_id is NULL) THEN
1489:
1490: UPDATE ap_invoices_interface
1491: SET org_id = l_default_org_id
1492: WHERE invoice_id = l_invoice_rec.invoice_id ;
1493:
1494: l_invoice_rec.org_id := l_default_org_id;

Line 1500: UPDATE ap_invoices_interface

1496: l_null_org_id := TRUE;
1497:
1498: ELSIF (p_org_id is NOT NULL) THEN
1499:
1500: UPDATE ap_invoices_interface
1501: SET org_id = p_org_id
1502: WHERE invoice_id = l_invoice_rec.invoice_id ;
1503:
1504: l_invoice_rec.org_id := p_org_id;

Line 4150: -- Update temporary status in ap_invoices_interface for all invoices

4146: END IF;
4147:
4148: ----------------------------------------------------------------------
4149: -- Step 21
4150: -- Update temporary status in ap_invoices_interface for all invoices
4151: -- FROM 'PROCESSING' to 'PROCESSED' AND,
4152: -- 'REJECTING' to 'REJECTED'
4153: ----------------------------------------------------------------------
4154:

Line 4294: FROM ap_invoices_interface

4290: -- Removed the p_group_id where clause and added it to the cursor
4291: -- purge_invoices_group
4292: CURSOR purge_invoices IS
4293: SELECT invoice_id
4294: FROM ap_invoices_interface
4295: WHERE source = p_source
4296: AND status = 'PROCESSED'
4297: AND ((p_commit_cycles IS NULL) OR
4298: (ROWNUM <= p_commit_cycles))

Line 4314: FROM ap_invoices_interface

4310: invoice_num;
4311:
4312: CURSOR purge_invoices_group IS
4313: SELECT invoice_id
4314: FROM ap_invoices_interface
4315: WHERE source = p_source
4316: AND group_id = p_group_id
4317: AND status = 'PROCESSED'
4318: AND ((p_commit_cycles IS NULL) OR

Line 4361: FROM ap_invoices_interface

4357: IF p_group_id IS NULL THEN
4358: BEGIN
4359: SELECT count(*)
4360: INTO l_total_count
4361: FROM ap_invoices_interface
4362: WHERE source = p_source
4363: AND status = 'PROCESSED'
4364: AND ( (org_id IS NOT NULL AND
4365: p_org_id IS NOT NULL AND

Line 4380: FROM ap_invoices_interface

4376: ELSE
4377: BEGIN
4378: SELECT count(*)
4379: INTO l_total_count
4380: FROM ap_invoices_interface
4381: WHERE source = p_source
4382: AND group_id = p_group_id
4383: AND status = 'PROCESSED'
4384: AND ( (org_id IS NOT NULL AND

Line 4467: -- Step 4, Delete records for ap_invoices_interface

4463: DELETE FROM AP_INVOICE_LINES_INTERFACE
4464: WHERE invoice_id = l_invoice_id;
4465:
4466: ------------------------------------------------------------------------
4467: -- Step 4, Delete records for ap_invoices_interface
4468: -- Only one line
4469: ------------------------------------------------------------------------
4470: -- also delete attachments if any
4471: debug_info := '(Import_purge 4.1) Delete attachments if any...';

Line 4496: 'ap_invoices_interface...';

4492: END IF;
4493:
4494: -- delete the invoice_interface record now
4495: debug_info := '(Import_purge 4) Delete records in ' ||
4496: 'ap_invoices_interface...';
4497: IF AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y' THEN
4498: AP_IMPORT_UTILITIES_PKG.Print(
4499: AP_IMPORT_INVOICES_PKG.g_debug_switch,debug_info);
4500: END IF;

Line 4502: DELETE FROM AP_INVOICES_INTERFACE

4498: AP_IMPORT_UTILITIES_PKG.Print(
4499: AP_IMPORT_INVOICES_PKG.g_debug_switch,debug_info);
4500: END IF;
4501:
4502: DELETE FROM AP_INVOICES_INTERFACE
4503: WHERE invoice_id = l_invoice_id
4504: AND ( (org_id IS NOT NULL AND
4505: p_org_id IS NOT NULL AND
4506: org_id = p_org_id)

Line 4597: TYPE headerlist IS TABLE OF ap_invoices_interface.invoice_id%TYPE;

4593: FUNCTION XML_IMPORT_PURGE(
4594: p_group_id IN VARCHAR2,
4595: p_calling_sequence IN VARCHAR2) RETURN BOOLEAN IS
4596:
4597: TYPE headerlist IS TABLE OF ap_invoices_interface.invoice_id%TYPE;
4598:
4599: h_list HEADERLIST;
4600: current_calling_sequence VARCHAR2(2000);
4601: debug_info VARCHAR2(500); /* Bug 4166583 */

Line 4621: FROM ap_invoices_interface h,

4617: -- different select stmts based on the parameter p_group_id
4618: IF (p_group_id IS NULL) THEN
4619: SELECT h.invoice_id BULK COLLECT
4620: INTO h_list
4621: FROM ap_invoices_interface h,
4622: ap_invoice_lines_interface l,
4623: ap_interface_rejections r
4624: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',
4625: h.invoice_id,

Line 4624: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',

4620: INTO h_list
4621: FROM ap_invoices_interface h,
4622: ap_invoice_lines_interface l,
4623: ap_interface_rejections r
4624: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',
4625: h.invoice_id,
4626: 'AP_INVOICE_LINES_INTERFACE', l.invoice_line_id)
4627: = r.parent_id
4628: AND h.invoice_id = l.invoice_id

Line 4641: FROM ap_invoices_interface h,

4637: GROUP BY h.invoice_id;
4638: ELSE
4639: SELECT h.invoice_id BULK COLLECT
4640: INTO h_list
4641: FROM ap_invoices_interface h,
4642: ap_invoice_lines_interface l,
4643: ap_interface_rejections r
4644: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',
4645: h.invoice_id,

Line 4644: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',

4640: INTO h_list
4641: FROM ap_invoices_interface h,
4642: ap_invoice_lines_interface l,
4643: ap_interface_rejections r
4644: WHERE DECODE(r.parent_table, 'AP_INVOICES_INTERFACE',
4645: h.invoice_id,
4646: 'AP_INVOICE_LINES_INTERFACE', l.invoice_line_id)
4647: = r.parent_id
4648: AND h.invoice_id = l.invoice_id

Line 4678: AND r.parent_table = 'AP_INVOICES_INTERFACE';

4674:
4675: FORALL i IN nvl(h_list.FIRST,0) .. nvl(h_list.LAST,-1)
4676: DELETE FROM ap_interface_rejections r
4677: WHERE r.parent_id = h_list(i)
4678: AND r.parent_table = 'AP_INVOICES_INTERFACE';
4679:
4680: debug_info := '(XML Import Purge 3) before deleting line rejections';
4681: IF AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y' THEN
4682: AP_IMPORT_UTILITIES_PKG.Print(

Line 4710: -- Delete from ap_invoices_interface table

4706: AP_IMPORT_UTILITIES_PKG.Print(
4707: AP_IMPORT_INVOICES_PKG.g_debug_switch,debug_info);
4708: END IF;
4709:
4710: -- Delete from ap_invoices_interface table
4711: FORALL i IN nvl(h_list.FIRST,0) .. nvl(h_list.LAST,-1)
4712: DELETE FROM ap_invoices_interface h
4713: WHERE h.invoice_id = h_list(i);
4714:

Line 4712: DELETE FROM ap_invoices_interface h

4708: END IF;
4709:
4710: -- Delete from ap_invoices_interface table
4711: FORALL i IN nvl(h_list.FIRST,0) .. nvl(h_list.LAST,-1)
4712: DELETE FROM ap_invoices_interface h
4713: WHERE h.invoice_id = h_list(i);
4714:
4715: debug_info := '(XML Import Purge 6) COMMIT';
4716: IF AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y' THEN

Line 4777: WHERE parent_table = 'AP_INVOICES_INTERFACE'

4773: SELECT parent_table,
4774: parent_id,
4775: reject_lookup_code
4776: FROM ap_interface_rejections
4777: WHERE parent_table = 'AP_INVOICES_INTERFACE'
4778: AND parent_id = p_invoice_interface_id
4779: UNION
4780: SELECT parent_table,
4781: parent_id,

Line 4818: FROM ap_invoices_interface

4814: ELSE
4815:
4816: SELECT source
4817: INTO l_source
4818: FROM ap_invoices_interface
4819: WHERE invoice_id = p_invoice_interface_id;
4820:
4821:
4822: IF (AP_IMPORT_INVOICES_PKG.g_debug_switch = 'Y') THEN