234:
235: -- count_vendors
236: select count(1)
237: into vendor_count
238: from po_purge_vendor_list
239: where double_check_flag = 'Y';
240:
241: if (vendor_count = 0) then
242:
242:
243: null;
244: else
245:
246: debug_info := 'The PO_PURGE_VENDOR_LIST table contains records. ';
247: Print('(Check_no_purge_in_process)' || debug_info);
248: Print(' Please make sure no purges are running and clear');
249: Print(' this table. Process terminating.');
250:
1716: Print('(Seed_Vendors)' ||debug_info);
1717: END IF;
1718:
1719: --
1720: insert into po_purge_vendor_list
1721: (vendor_id,
1722: purge_name,
1723: double_check_flag)
1724: select vnd.vendor_id,
1744: END IF;
1745:
1746:
1747: -- test fa vendors
1748: delete from po_purge_vendor_list pvl
1749: where exists
1750: (select null
1751: from fa_mass_additions fma
1752: where fma.po_vendor_id = pvl.vendor_id)
1762: END IF;
1763:
1764:
1765: -- test ap vendors
1766: delete from po_purge_vendor_list pvl
1767: where exists
1768: (select null
1769: from ap_invoices_all ai
1770: where ai.vendor_id = pvl.vendor_id)
1789: END IF;
1790:
1791:
1792: -- test_po_vendors
1793: delete from po_purge_vendor_list pvl
1794: where exists (select null
1795: from po_headers_all ph
1796: where ph.vendor_id =
1797: pvl.vendor_id)
1855: Print('(Test_Vendors)' ||debug_info);
1856: END IF;
1857:
1858: -- test_fa_vendors
1859: delete from po_purge_vendor_list pvl
1860: where exists (select null
1861: from fa_mass_additions fma
1862: where fma.po_vendor_id =
1863: pvl.vendor_id)
1869:
1870: -- test_ap_vendors
1871:
1872:
1873: delete from po_purge_vendor_list pvl
1874: where exists (select null
1875: from ap_invoices_all ai
1876: where ai.vendor_id = pvl.vendor_id)
1877: or exists (select null
1893: IF g_debug_switch in ('y','Y') THEN
1894: Print('(Test_Vendors)' ||debug_info);
1895: END IF;
1896:
1897: delete from po_purge_vendor_list pvl
1898: where exists (select null
1899: from po_headers_all ph
1900: where ph.vendor_id = pvl.vendor_id)
1901: or exists (select null
1921: IF g_debug_switch in ('y','Y') THEN
1922: Print('(Test_Vendors)' ||debug_info);
1923: END IF;
1924:
1925: delete from po_purge_vendor_list pvl
1926: where exists (select null
1927: from chv_schedule_headers csh
1928: where csh.vendor_id = pvl.vendor_id);
1929: end if;
1935: IF g_debug_switch in ('y','Y') THEN
1936: Print('(Test_Vendors)' ||debug_info);
1937: END IF;
1938:
1939: delete from po_purge_vendor_list pvl
1940: where exists (select null
1941: from ece_tp_details etd,
1942: ap_supplier_sites_all pvs
1943: where etd.tp_header_id = pvs.tp_header_id
1961: --1700943, removing the code below that checks for activity
1962: --dates of the sourcing rules. we should not purge the
1963: --vendor if it is tied to an inactive rule
1964:
1965: delete from po_purge_vendor_list pvl
1966: where exists (select null
1967: from mrp_sr_source_org msso
1968: where msso.vendor_id = pvl.vendor_id);
1969:
2541: vnd.vendor_name,
2542: vnd.segment1,
2543: vnd.vendor_type_lookup_code,
2544: p_purge_name
2545: from po_purge_vendor_list pvl,
2546: ap_suppliers vnd
2547: where pvl.vendor_id = vnd.vendor_id
2548: and pvl.double_check_flag = 'Y';
2549:
3935: IF g_debug_switch in ('y','Y') THEN
3936: Print('(Retest_Seeded_Vendors)'||debug_info);
3937: END IF;
3938:
3939: update po_purge_vendor_list pvl
3940: set double_check_flag = 'N'
3941: where pvl.double_check_flag = 'Y'
3942: and not exists (select null
3943: from ap_suppliers vnd
3993: Print('(Retest_Vendors)'||debug_info);
3994: END IF;
3995:
3996: -- retest_fa_vendors
3997: update po_purge_vendor_list pvl
3998: set double_check_flag = 'N'
3999: where pvl.double_check_flag = 'Y'
4000: and (exists (select null
4001: from fa_mass_additions fma
4011: Print('(Retest_Vendors)'||debug_info);
4012: END IF;
4013:
4014: -- retest_ap_vendors
4015: update po_purge_vendor_list pvl
4016: set double_check_flag = 'N'
4017: where pvl.double_check_flag = 'Y'
4018: and (exists (select null
4019: from ap_invoices_all ai
4038: END IF;
4039:
4040:
4041: -- retest_po_vendors
4042: update po_purge_vendor_list pvl
4043: set double_check_flag = 'N'
4044: where pvl.double_check_flag = 'Y'
4045: and (exists (select null
4046: from po_headers_all ph
4072:
4073:
4074: -- retest_chv_vendors
4075:
4076: update po_purge_vendor_list pvl
4077: set double_check_flag = 'N'
4078: where pvl.double_check_flag = 'Y'
4079: and (exists (select null
4080: from chv_schedule_headers csh
4093: -- retest_mrp_vendors
4094:
4095: --1796376, removed check for inactivity dates on sql below
4096:
4097: update po_purge_vendor_list pvl
4098: set double_check_flag = 'N'
4099: where pvl.double_check_flag = 'Y'
4100: and (exists (select null
4101: from mrp_sr_source_org msso
4113:
4114:
4115: -- retest_edi_vendors
4116:
4117: update po_purge_vendor_list pvl
4118: set double_check_flag = 'N'
4119: where pvl.double_check_flag = 'Y'
4120: and (exists (select null
4121: from ece_tp_details etd,
6522: l_po_return_status VARCHAR2(1);
6523:
6524: cursor c_purge_vendors IS
6525: select vendor_id
6526: from po_purge_vendor_list pvl
6527: where pvl.double_check_flag = 'Y';
6528:
6529: cursor c_purge_vendor_sites IS
6530: select vendor_id,
6530: select vendor_id,
6531: vendor_site_id
6532: from po_vendor_sites_all
6533: where vendor_id in (select vendor_id
6534: from po_purge_vendor_list pvl
6535: where pvl.double_check_flag = 'Y');
6536:
6537: BEGIN
6538:
6551: -- delete_ap_suppliers
6552: delete from ap_suppliers vnd
6553: where exists
6554: (select null
6555: from po_purge_vendor_list pvl
6556: where pvl.vendor_id = vnd.vendor_id
6557: and pvl.double_check_flag = 'Y');
6558:
6559: /* Bug 4602105: Commented out the call to etax preupgrade control packages
6590: FROM ap_supplier_contacts pc
6591: WHERE pc.org_party_site_id IN
6592: ( SELECT vnd.party_site_id
6593: FROM ap_supplier_sites_all vnd
6594: , po_purge_vendor_list pvl
6595: WHERE pvl.vendor_id = vnd.vendor_id
6596: AND pvl.double_check_flag = 'Y'
6597: );
6598: /* Commented for bug#9645593 End */
6600: -- delete_ap_supplier_sites
6601: delete from ap_supplier_sites_all vnd
6602: where exists
6603: (select null
6604: from po_purge_vendor_list pvl
6605: where pvl.vendor_id = vnd.vendor_id
6606: and pvl.double_check_flag = 'Y');
6607:
6608: debug_info := 'ap_supplier_contacts';
6629:
6630: delete from ap_bank_account_uses_all abau
6631: where exists
6632: (select null
6633: from po_purge_vendor_list pvl
6634: where pvl.vendor_id = abau.vendor_id
6635: and pvl.double_check_flag = 'Y');
6636: */
6637: COMMIT;
6669: -- delete po_asl_docments
6670:
6671: delete from po_asl_documents pad where
6672: exists (select null from po_asl_attributes paa,
6673: po_purge_vendor_list pvl
6674: where pvl.vendor_id = paa.vendor_id
6675: and pvl.double_check_flag = 'Y'
6676: and paa.using_organization_id = pad.using_organization_id
6677: and paa.asl_id = pad.asl_id);
6680:
6681: delete from po_asl_attributes paa
6682: where exists
6683: (select null
6684: from po_purge_vendor_list pvl
6685: where pvl.vendor_id = paa.vendor_id
6686: and pvl.double_check_flag = 'Y');
6687:
6688: debug_info := 'po_approved_supplier_list';
6694:
6695: delete from po_approved_supplier_list pasl
6696: where exists
6697: (select null
6698: from po_purge_vendor_list pvl
6699: where pvl.vendor_id = pasl.vendor_id
6700: and pvl.double_check_flag = 'Y');
6701:
6702:
6739: IF g_mrp_status = 'Y' THEN
6740: update mrp_sourcing_rules msr
6741: set planning_active = 2
6742: where exists (select null
6743: from po_purge_vendor_list pvl,
6744: mrp_sr_source_org msso,
6745: mrp_sr_receipt_org msro
6746: where pvl.vendor_id = msso.vendor_id
6747: and msso.sr_receipt_id = msro.sr_receipt_id
6750:
6751: update mrp_recommendations mr
6752: set source_vendor_id = null, source_vendor_site_id = null
6753: where exists (select null
6754: from po_purge_vendor_list pvl
6755: where pvl.vendor_id = mr.source_vendor_id
6756: and pvl.double_check_flag = 'Y');
6757:
6758: delete from mrp_sr_source_org msso
6756: and pvl.double_check_flag = 'Y');
6757:
6758: delete from mrp_sr_source_org msso
6759: where exists (select null
6760: from po_purge_vendor_list pvl
6761: where pvl.vendor_id = msso.vendor_id
6762: and pvl.double_check_flag = 'Y');
6763:
6764: delete from mrp_item_sourcing mis
6762: and pvl.double_check_flag = 'Y');
6763:
6764: delete from mrp_item_sourcing mis
6765: where exists (select null
6766: from po_purge_vendor_list pvl
6767: where pvl.vendor_id = mis.vendor_id
6768: and pvl.double_check_flag = 'Y');
6769:
6770: COMMIT;
7263: x_msg_data => l_po_msg,
7264: p_purge_name => p_purge_name);
7265:
7266: -- clear_vendor_purge_list
7267: delete from po_purge_vendor_list;
7268:
7269: -- clear_schedule_list
7270: delete from chv_purge_schedule_list;
7271:
7491: FUNCTION clear_vendor_purge_list RETURN BOOLEAN IS
7492:
7493: BEGIN
7494:
7495: delete from po_purge_vendor_list;
7496:
7497: RETURN (TRUE);
7498:
7499: RETURN NULL; EXCEPTION