276: d_position := 50;
277:
278: -- Change the draft status back to 'DRAFT' (it was set to
279: -- 'PDOI PROCESSING' during header grouping)
280: PO_DRAFTS_PVT.update_draft_status
281: ( p_draft_id => l_doc_rec.draft_id,
282: p_new_status => PO_DRAFTS_PVT.g_STATUS_DRAFT
283: );
284:
278: -- Change the draft status back to 'DRAFT' (it was set to
279: -- 'PDOI PROCESSING' during header grouping)
280: PO_DRAFTS_PVT.update_draft_status
281: ( p_draft_id => l_doc_rec.draft_id,
282: p_new_status => PO_DRAFTS_PVT.g_STATUS_DRAFT
283: );
284:
285: -- If user is creating a draft without transferring, we need
286: -- to get the functional lock of the document explicitly
283: );
284:
285: -- If user is creating a draft without transferring, we need
286: -- to get the functional lock of the document explicitly
287: PO_DRAFTS_PVT.lock_document
288: ( p_po_header_id => l_doc_rec.po_header_id,
289: p_role => PO_PDOI_PARAMS.g_request.role,
290: p_role_user_id => FND_GLOBAL.user_id,
291: p_unlock_current => FND_API.G_FALSE
412: IF (l_remove_draft = FND_API.G_FALSE) THEN
413:
414: -- Change the draft status back to 'DRAFT' (it was set to
415: -- 'PDOI PROCESSING' during header grouping)
416: PO_DRAFTS_PVT.update_draft_status
417: ( p_draft_id => l_doc_rec.draft_id,
418: p_new_status => PO_DRAFTS_PVT.g_STATUS_DRAFT
419: );
420:
414: -- Change the draft status back to 'DRAFT' (it was set to
415: -- 'PDOI PROCESSING' during header grouping)
416: PO_DRAFTS_PVT.update_draft_status
417: ( p_draft_id => l_doc_rec.draft_id,
418: p_new_status => PO_DRAFTS_PVT.g_STATUS_DRAFT
419: );
420:
421: END IF;
422: END IF;
496: END IF;
497:
498: DELETE FROM po_lines_draft_all
499: WHERE draft_id = p_draft_id
500: AND change_accepted_flag = PO_DRAFTS_PVT.g_chg_accepted_flag_NOTIFY
501: RETURNING po_line_id
502: BULK COLLECT
503: INTO l_po_line_id_tbl;
504:
638: ELSE
639: d_position := 30;
640: -- Update action
641:
642: IF (PO_DRAFTS_PVT.is_draft_applicable
643: ( p_po_header_id => l_po_header_id_tbl(i),
644: p_role => PO_PDOI_PARAMS.g_request.role
645: ) = FND_API.G_FALSE ) THEN
646:
664: END LOOP;
665:
666: -- check whether the draft already contains changes
667: l_chg_exist_tbl :=
668: PO_DRAFTS_PVT.changes_exist_for_draft
669: ( p_draft_id_tbl => l_dft_exist_chg_check_tbl
670: );
671:
672: FOR i IN 1..l_dft_exist_chg_check_tbl.COUNT LOOP
1102:
1103: IF (l_new_auth_status = 'APPROVED') THEN
1104: d_position := 110;
1105: -- approved document should not have locks applied
1106: PO_DRAFTS_PVT.unlock_document
1107: ( p_po_header_id => p_doc_rec.po_header_id
1108: );
1109:
1110: IF (PO_PDOI_PARAMS.g_sys.when_to_archive_blanket = 'APPROVE') THEN
2389: END IF;
2390:
2391: d_position := 10;
2392:
2393: PO_DRAFTS_PVT.transfer_draft_to_txn
2394: ( p_api_version => 1.0,
2395: p_init_msg_list => FND_API.G_FALSE,
2396: p_draft_id => p_doc_rec.draft_id,
2397: p_po_header_id => p_doc_rec.po_header_id,
2695: x_login_id => FND_GLOBAL.login_id
2696: );
2697:
2698: -- Approved document should not have functional lock
2699: PO_DRAFTS_PVT.unlock_document
2700: ( p_po_header_id => p_doc_rec.po_header_id
2701: );
2702: END IF;
2703: