216: x_return_status := FND_API.G_RET_STS_SUCCESS;
217:
218: l_progress := '010';
219:
220: IF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_REQ) THEN
221:
222: l_progress := '020';
223:
224: seed_simple_req
226: p_purge_name => p_purge_name,
227: p_last_activity_date => p_last_activity_date
228: );
229:
230: ELSIF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
231: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
232:
233: l_progress := '030';
234:
227: p_last_activity_date => p_last_activity_date
228: );
229:
230: ELSIF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
231: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
232:
233: l_progress := '030';
234:
235: seed_po
416: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
417: END IF;
418: END IF; -- not g_set_product_inst_status
419:
420: IF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_REQ) THEN
421: l_progress := '030';
422:
423: filter_referenced_req (x_return_status => l_return_status );
424:
421: l_progress := '030';
422:
423: filter_referenced_req (x_return_status => l_return_status );
424:
425: ELSIF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO) THEN
426: l_progress := '040';
427:
428: filter_referenced_req (x_return_status => l_return_status);
429:
438: ( x_return_status => l_return_status,
439: x_po_records_filtered => x_po_records_filtered);
440: END IF;
441:
442: ELSIF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV) THEN
443: l_progress := '050';
444:
445: IF (p_action = PO_AP_PURGE_GRP.G_FILTER_ACT_REF_PO_REQ) THEN
446: l_progress := '060';
441:
442: ELSIF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV) THEN
443: l_progress := '050';
444:
445: IF (p_action = PO_AP_PURGE_GRP.G_FILTER_ACT_REF_PO_REQ) THEN
446: l_progress := '060';
447:
448: filter_referenced_req
449: ( x_return_status => l_return_status );
454: filter_referenced_po
455: ( x_return_status => l_return_status );
456: END IF;
457:
458: ELSIF (p_action = PO_AP_PURGE_GRP.G_FILTER_ACT_DEP_PO_REQ) THEN
459: l_progress := '080';
460:
461: filter_dependent_po_req_list
462: ( x_return_status => l_return_status,
461: filter_dependent_po_req_list
462: ( x_return_status => l_return_status,
463: x_po_records_filtered => x_po_records_filtered );
464:
465: ELSIF (p_action = PO_AP_PURGE_GRP.G_FILTER_ACT_DEP_PO_AP) THEN
466: l_progress := '090';
467:
468: filter_dependent_po_ap_list
469: ( x_return_status => l_return_status,
632: x_return_status := FND_API.G_RET_STS_SUCCESS;
633:
634: l_progress := '010';
635:
636: IF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_REQ) THEN
637: l_progress := '020';
638:
639: confirm_simple_req
640: ( x_return_status => l_return_status,
639: confirm_simple_req
640: ( x_return_status => l_return_status,
641: p_last_activity_date => p_last_activity_date );
642:
643: ELSIF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
644: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
645: l_progress := '030';
646:
647: confirm_po
640: ( x_return_status => l_return_status,
641: p_last_activity_date => p_last_activity_date );
642:
643: ELSIF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
644: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
645: l_progress := '030';
646:
647: confirm_po
648: ( x_return_status => l_return_status,
840: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
841: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
842: END IF;
843:
844: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
845: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
846:
847: l_progress := '030';
848:
841: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
842: END IF;
843:
844: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
845: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
846:
847: l_progress := '030';
848:
849: get_purge_list_range
1077: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1078: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1079: END IF;
1080:
1081: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
1082: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
1083:
1084: l_progress := '030';
1085:
1078: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1079: END IF;
1080:
1081: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
1082: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
1083:
1084: l_progress := '030';
1085:
1086: get_purge_list_range
1778: );
1779: END IF;
1780: END IF;
1781:
1782: IF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO) THEN
1783:
1784: l_progress := '010';
1785:
1786: -- The subquery on po_distributions is to make sure that no invoice
1836: (SELECT NULL
1837: FROM rcv_transactions RT
1838: WHERE RT.po_header_id = PH.po_header_id
1839: AND RT.last_update_date > p_last_activity_date)
1840: AND PO_AP_PURGE_GRP.validate_purge(PH.po_header_id) = 'T';
1841:
1842:
1843: ELSIF (p_purge_category =PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV) THEN
1844:
1839: AND RT.last_update_date > p_last_activity_date)
1840: AND PO_AP_PURGE_GRP.validate_purge(PH.po_header_id) = 'T';
1841:
1842:
1843: ELSIF (p_purge_category =PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV) THEN
1844:
1845: l_progress := '020';
1846:
1847: -- POs that have invoices are still candidates for purging when
1891: (SELECT NULL
1892: FROM rcv_transactions RT
1893: WHERE RT.po_header_id = PH.po_header_id
1894: AND RT.last_update_date > p_last_activity_date)
1895: AND PO_AP_PURGE_GRP.validate_purge(PH.po_header_id) = 'T';
1896:
1897: END IF; -- p_purge_category = ...
1898:
1899: IF (g_fnd_debug = 'Y') THEN
3118: END IF;
3119:
3120: l_progress := '010';
3121:
3122: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
3123: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
3124: l_progress := '020';
3125:
3126: DELETE FROM po_purge_po_list
3119:
3120: l_progress := '010';
3121:
3122: IF (p_purge_category IN (PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO,
3123: PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV)) THEN
3124: l_progress := '020';
3125:
3126: DELETE FROM po_purge_po_list
3127: WHERE double_check_flag = 'N';
3347: END IF;
3348:
3349: x_return_status := FND_API.G_RET_STS_SUCCESS;
3350:
3351: IF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_SIMPLE_PO) THEN
3352:
3353: l_progress := '010';
3354:
3355: -- SQL What: Exclude POs that are no longer eligible for purging. The
3416: FROM ap_invoice_distributions AD
3417: WHERE AD.po_distribution_id =
3418: PD.po_distribution_id))));
3419:
3420: ELSIF (p_purge_category = PO_AP_PURGE_GRP.G_PUR_CAT_MATCHED_PO_INV) THEN
3421:
3422: l_progress := '020';
3423:
3424: -- SQL What: Exclude POs that are no longer eligible for purging. The
5220: --The check for Code Level below will be unnecessary in 11iX.
5221: --Plan is to only remove the if-else condition and only call
5222: --POX_SUP_PROF_PRG_GRP.handle_purge instead
5223:
5224: -- PO_AP_PURGE_GRP.purge does two things: Delete from org assignments
5225: -- and call a POS purge api.
5226: -- If PO FP level is larger than 11i FPJ, then we should have taken
5227: -- care of deleting org assignments somewhere else. Hence we only
5228: -- need to call POS purge api.
5231: PO_CODE_RELEASE_GRP.PRC_11i_Family_Pack_J) THEN
5232:
5233: l_progress := '160';
5234:
5235: PO_AP_PURGE_GRP.purge
5236: ( p_api_version => 1.0,
5237: x_return_status => l_return_status
5238: );
5239: