1: PACKAGE BODY po_drafts_pvt AS
2: /* $Header: PO_DRAFTS_PVT.plb 120.59.12020000.8 2013/03/25 08:25:54 mabaig ship $ */
3:
4: d_pkg_name CONSTANT varchar2(50) :=
5: PO_LOG.get_package_base('PO_DRAFTS_PVT');
6:
7: --
8: -- Declare a table to store lock (F, P, S) compatibilities
9: g_entity_lock_comp_tbl po_entity_lock_comp_tbl_type;
115: d_position NUMBER;
116: d_api_name CONSTANT VARCHAR2(30) := 'update_revnum_headers_ext';
117: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
118: BEGIN
119: IF (PO_LOG.d_proc) THEN
120: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
121: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
122: END IF;
123: d_position := 0;
116: d_api_name CONSTANT VARCHAR2(30) := 'update_revnum_headers_ext';
117: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
118: BEGIN
119: IF (PO_LOG.d_proc) THEN
120: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
121: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
122: END IF;
123: d_position := 0;
124:
117: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
118: BEGIN
119: IF (PO_LOG.d_proc) THEN
120: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
121: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
122: END IF;
123: d_position := 0;
124:
125: SELECT revision_num
128: WHERE po_header_id = p_po_header_id;
129: -- bug 13633396, l_header_revision is already incremented so no need
130: -- to increment it by 1
131:
132: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
133: IF PO_LOG.d_stmt THEN
134: PO_LOG.stmt(d_module,d_position,'l_header_revision',l_header_revision);
135: END IF;
136:
129: -- bug 13633396, l_header_revision is already incremented so no need
130: -- to increment it by 1
131:
132: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
133: IF PO_LOG.d_stmt THEN
134: PO_LOG.stmt(d_module,d_position,'l_header_revision',l_header_revision);
135: END IF;
136:
137: d_position:=10;
130: -- to increment it by 1
131:
132: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
133: IF PO_LOG.d_stmt THEN
134: PO_LOG.stmt(d_module,d_position,'l_header_revision',l_header_revision);
135: END IF;
136:
137: d_position:=10;
138:
147: WHEN others THEN
148: l_is_mod_document := 'N';
149: END;
150:
151: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
152: IF PO_LOG.d_stmt THEN
153: PO_LOG.stmt(d_module,d_position,'l_is_mod_document',l_is_mod_document);
154: END IF;
155:
148: l_is_mod_document := 'N';
149: END;
150:
151: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
152: IF PO_LOG.d_stmt THEN
153: PO_LOG.stmt(d_module,d_position,'l_is_mod_document',l_is_mod_document);
154: END IF;
155:
156: IF l_is_mod_document ='Y' THEN
149: END;
150:
151: -- bug 13648412 , added the parameter d_position to PO_LOG.stmt
152: IF PO_LOG.d_stmt THEN
153: PO_LOG.stmt(d_module,d_position,'l_is_mod_document',l_is_mod_document);
154: END IF;
155:
156: IF l_is_mod_document ='Y' THEN
157: UPDATE po_headers_all_ext_b phaeb
167: AND phaeb.draft_id = -1
168: AND phaeb.c_ext_attr40 = 'PO_UDA_ADDRESS_TYPES';
169: END IF;
170:
171: IF (PO_LOG.d_proc) THEN
172: PO_LOG.proc_end(d_module, 'number of rows updated', SQL%ROWCOUNT);
173: END IF;
174:
175: END update_revnum_headers_ext;
168: AND phaeb.c_ext_attr40 = 'PO_UDA_ADDRESS_TYPES';
169: END IF;
170:
171: IF (PO_LOG.d_proc) THEN
172: PO_LOG.proc_end(d_module, 'number of rows updated', SQL%ROWCOUNT);
173: END IF;
174:
175: END update_revnum_headers_ext;
176:
268: d_position := 0;
269:
270: SAVEPOINT transfer_draft_to_txn_sp;
271:
272: IF (PO_LOG.d_proc) THEN
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
269:
270: SAVEPOINT transfer_draft_to_txn_sp;
271:
272: IF (PO_LOG.d_proc) THEN
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
270: SAVEPOINT transfer_draft_to_txn_sp;
271:
272: IF (PO_LOG.d_proc) THEN
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
278: p_delete_processed_draft);
271:
272: IF (PO_LOG.d_proc) THEN
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
278: p_delete_processed_draft);
279: PO_LOG.proc_begin(d_module, 'p_acceptance_action', p_acceptance_action);
272: IF (PO_LOG.d_proc) THEN
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
278: p_delete_processed_draft);
279: PO_LOG.proc_begin(d_module, 'p_acceptance_action', p_acceptance_action);
280: END IF;
273: PO_LOG.proc_begin(d_module);
274: PO_LOG.proc_begin(d_module, 'p_init_msg_list', p_init_msg_list);
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
278: p_delete_processed_draft);
279: PO_LOG.proc_begin(d_module, 'p_acceptance_action', p_acceptance_action);
280: END IF;
281:
275: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
276: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
277: PO_LOG.proc_begin(d_module, 'p_delete_processed_draft',
278: p_delete_processed_draft);
279: PO_LOG.proc_begin(d_module, 'p_acceptance_action', p_acceptance_action);
280: END IF;
281:
282: IF (FND_API.to_boolean(p_init_msg_list)) THEN
283: FND_MSG_PUB.initialize;
298:
299: -- if acceptance action is specified, we need to propogate the action to
300: -- all levels
301: IF (p_acceptance_action IS NOT NULL) THEN
302: IF (PO_LOG.d_stmt) THEN
303: PO_LOG.stmt(d_module, d_position, 'update acceptance action');
304: END IF;
305:
306: update_acceptance_status
299: -- if acceptance action is specified, we need to propogate the action to
300: -- all levels
301: IF (p_acceptance_action IS NOT NULL) THEN
302: IF (PO_LOG.d_stmt) THEN
303: PO_LOG.stmt(d_module, d_position, 'update acceptance action');
304: END IF;
305:
306: update_acceptance_status
307: ( p_draft_id => p_draft_id,
446: )
447: AND pex.po_header_id=p_po_header_id;
448:
449: d_position := 55;
450: IF PO_LOG.d_stmt THEN
451: PO_LOG.stmt(d_module,d_position,'Uda update handled in PO_DRAFT_MERGE_PKG.MergeReserve_Autonomous');
452: END IF;
453: --
454: ELSE
447: AND pex.po_header_id=p_po_header_id;
448:
449: d_position := 55;
450: IF PO_LOG.d_stmt THEN
451: PO_LOG.stmt(d_module,d_position,'Uda update handled in PO_DRAFT_MERGE_PKG.MergeReserve_Autonomous');
452: END IF;
453: --
454: ELSE
455: set_new_revision
464: l_type := PO_CATALOG_INDEX_PVT.TYPE_QUOTATION; --Bug#4902870
465: -- For quotations, there is no need to performa approval status or revision
466: -- checking
467:
468: IF (PO_LOG.d_stmt) THEN
469: PO_LOG.stmt(d_module, d_position, 'document is quotation');
470: END IF;
471:
472: d_position := 60;
465: -- For quotations, there is no need to performa approval status or revision
466: -- checking
467:
468: IF (PO_LOG.d_stmt) THEN
469: PO_LOG.stmt(d_module, d_position, 'document is quotation');
470: END IF;
471:
472: d_position := 60;
473: apply_changes
535: BEGIN
536: ICX_CAT_INTERMEDIA_INDEX_PVT.rebuild_index;
537: EXCEPTION
538: WHEN OTHERS THEN
539: IF (PO_LOG.d_stmt) THEN
540: PO_LOG.stmt(d_module, d_position, 'Exception while call to ICX_CAT_INTERMEDIA_INDEX_PVT.rebuild_index and erorr encountered is '
541: ||SQLCODE||' -ERROR- '||SQLERRM );
542: END IF;
543: END;
536: ICX_CAT_INTERMEDIA_INDEX_PVT.rebuild_index;
537: EXCEPTION
538: WHEN OTHERS THEN
539: IF (PO_LOG.d_stmt) THEN
540: PO_LOG.stmt(d_module, d_position, 'Exception while call to ICX_CAT_INTERMEDIA_INDEX_PVT.rebuild_index and erorr encountered is '
541: ||SQLCODE||' -ERROR- '||SQLERRM );
542: END IF;
543: END;
544: end if;
543: END;
544: end if;
545: END IF;
546:
547: IF (PO_LOG.d_proc) THEN
548: PO_LOG.proc_end(d_module);
549: END IF;
550:
551: EXCEPTION
544: end if;
545: END IF;
546:
547: IF (PO_LOG.d_proc) THEN
548: PO_LOG.proc_end(d_module);
549: END IF;
550:
551: EXCEPTION
552: WHEN OTHERS THEN
600:
601: BEGIN
602:
603: d_position := 0;
604: IF (PO_LOG.d_proc) THEN
605: PO_LOG.proc_begin(d_module);
606: END IF;
607:
608: x_return_status := FND_API.G_RET_STS_SUCCESS;
601: BEGIN
602:
603: d_position := 0;
604: IF (PO_LOG.d_proc) THEN
605: PO_LOG.proc_begin(d_module);
606: END IF;
607:
608: x_return_status := FND_API.G_RET_STS_SUCCESS;
609:
697: WHERE draft_id = p_draft_id;
698: END IF;
699:
700: d_position := 100;
701: IF (PO_LOG.d_proc) THEN
702: PO_LOG.proc_end(d_module);
703: END IF;
704: EXCEPTION
705: WHEN OTHERS THEN
698: END IF;
699:
700: d_position := 100;
701: IF (PO_LOG.d_proc) THEN
702: PO_LOG.proc_end(d_module);
703: END IF;
704: EXCEPTION
705: WHEN OTHERS THEN
706: PO_MESSAGE_S.add_exc_msg
753:
754: BEGIN
755:
756: d_position := 0;
757: IF (PO_LOG.d_proc) THEN
758: PO_LOG.proc_begin(d_module);
759: END IF;
760:
761: x_draft_info.draft_id := p_draft_id;
754: BEGIN
755:
756: d_position := 0;
757: IF (PO_LOG.d_proc) THEN
758: PO_LOG.proc_begin(d_module);
759: END IF;
760:
761: x_draft_info.draft_id := p_draft_id;
762: x_draft_info.po_header_id := p_po_header_id;
907: --
908:
909:
910: d_position := 140;
911: IF (PO_LOG.d_stmt) THEN
912: PO_LOG.stmt(d_module, d_position, 'draft_id', x_draft_info.draft_id);
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
908:
909:
910: d_position := 140;
911: IF (PO_LOG.d_stmt) THEN
912: PO_LOG.stmt(d_module, d_position, 'draft_id', x_draft_info.draft_id);
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
909:
910: d_position := 140;
911: IF (PO_LOG.d_stmt) THEN
912: PO_LOG.stmt(d_module, d_position, 'draft_id', x_draft_info.draft_id);
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
911: IF (PO_LOG.d_stmt) THEN
912: PO_LOG.stmt(d_module, d_position, 'draft_id', x_draft_info.draft_id);
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
912: PO_LOG.stmt(d_module, d_position, 'draft_id', x_draft_info.draft_id);
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
913: PO_LOG.stmt(d_module, d_position, 'po_header_id',
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
921: x_draft_info.headers_changed);
914: x_draft_info.po_header_id);
915: PO_LOG.stmt(d_module, d_position, 'doc_type', x_draft_info.doc_type);
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
921: x_draft_info.headers_changed);
922: PO_LOG.stmt(d_module, d_position, 'lines_changed',
916: PO_LOG.stmt(d_module, d_position, 'doc_subtype', x_draft_info.doc_subtype);
917: PO_LOG.stmt(d_module, d_position, 'ga_flag', x_draft_info.ga_flag);
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
921: x_draft_info.headers_changed);
922: PO_LOG.stmt(d_module, d_position, 'lines_changed',
923: x_draft_info.lines_changed);
924: PO_LOG.stmt(d_module, d_position, 'line_locations_changed',
918: PO_LOG.stmt(d_module, d_position, 'new_document',
919: x_draft_info.new_document);
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
921: x_draft_info.headers_changed);
922: PO_LOG.stmt(d_module, d_position, 'lines_changed',
923: x_draft_info.lines_changed);
924: PO_LOG.stmt(d_module, d_position, 'line_locations_changed',
925: x_draft_info.line_locations_changed);
926: PO_LOG.stmt(d_module, d_position, 'distributions_changed',
920: PO_LOG.stmt(d_module, d_position, 'headers_changed',
921: x_draft_info.headers_changed);
922: PO_LOG.stmt(d_module, d_position, 'lines_changed',
923: x_draft_info.lines_changed);
924: PO_LOG.stmt(d_module, d_position, 'line_locations_changed',
925: x_draft_info.line_locations_changed);
926: PO_LOG.stmt(d_module, d_position, 'distributions_changed',
927: x_draft_info.distributions_changed);
928: PO_LOG.stmt(d_module, d_position, 'ga_org_assign_changed',
922: PO_LOG.stmt(d_module, d_position, 'lines_changed',
923: x_draft_info.lines_changed);
924: PO_LOG.stmt(d_module, d_position, 'line_locations_changed',
925: x_draft_info.line_locations_changed);
926: PO_LOG.stmt(d_module, d_position, 'distributions_changed',
927: x_draft_info.distributions_changed);
928: PO_LOG.stmt(d_module, d_position, 'ga_org_assign_changed',
929: x_draft_info.ga_org_assign_changed);
930: PO_LOG.stmt(d_module, d_position, 'price_diff_changed',
924: PO_LOG.stmt(d_module, d_position, 'line_locations_changed',
925: x_draft_info.line_locations_changed);
926: PO_LOG.stmt(d_module, d_position, 'distributions_changed',
927: x_draft_info.distributions_changed);
928: PO_LOG.stmt(d_module, d_position, 'ga_org_assign_changed',
929: x_draft_info.ga_org_assign_changed);
930: PO_LOG.stmt(d_module, d_position, 'price_diff_changed',
931: x_draft_info.price_diff_changed);
932: PO_LOG.stmt(d_module, d_position, 'notification_ctrl_changed',
926: PO_LOG.stmt(d_module, d_position, 'distributions_changed',
927: x_draft_info.distributions_changed);
928: PO_LOG.stmt(d_module, d_position, 'ga_org_assign_changed',
929: x_draft_info.ga_org_assign_changed);
930: PO_LOG.stmt(d_module, d_position, 'price_diff_changed',
931: x_draft_info.price_diff_changed);
932: PO_LOG.stmt(d_module, d_position, 'notification_ctrl_changed',
933: x_draft_info.notification_ctrl_changed);
934: PO_LOG.stmt(d_module, d_position, 'attribute_values_changed',
928: PO_LOG.stmt(d_module, d_position, 'ga_org_assign_changed',
929: x_draft_info.ga_org_assign_changed);
930: PO_LOG.stmt(d_module, d_position, 'price_diff_changed',
931: x_draft_info.price_diff_changed);
932: PO_LOG.stmt(d_module, d_position, 'notification_ctrl_changed',
933: x_draft_info.notification_ctrl_changed);
934: PO_LOG.stmt(d_module, d_position, 'attribute_values_changed',
935: x_draft_info.attr_values_changed);
936: PO_LOG.stmt(d_module, d_position, 'attribute_values_tlp_changed',
930: PO_LOG.stmt(d_module, d_position, 'price_diff_changed',
931: x_draft_info.price_diff_changed);
932: PO_LOG.stmt(d_module, d_position, 'notification_ctrl_changed',
933: x_draft_info.notification_ctrl_changed);
934: PO_LOG.stmt(d_module, d_position, 'attribute_values_changed',
935: x_draft_info.attr_values_changed);
936: PO_LOG.stmt(d_module, d_position, 'attribute_values_tlp_changed',
937: x_draft_info.attr_values_tlp_changed);
938: --Enhanced Pricing
932: PO_LOG.stmt(d_module, d_position, 'notification_ctrl_changed',
933: x_draft_info.notification_ctrl_changed);
934: PO_LOG.stmt(d_module, d_position, 'attribute_values_changed',
935: x_draft_info.attr_values_changed);
936: PO_LOG.stmt(d_module, d_position, 'attribute_values_tlp_changed',
937: x_draft_info.attr_values_tlp_changed);
938: --Enhanced Pricing
939: PO_LOG.stmt(d_module, d_position, 'price_adjustments_changed',
940: x_draft_info.price_adj_changed);
935: x_draft_info.attr_values_changed);
936: PO_LOG.stmt(d_module, d_position, 'attribute_values_tlp_changed',
937: x_draft_info.attr_values_tlp_changed);
938: --Enhanced Pricing
939: PO_LOG.stmt(d_module, d_position, 'price_adjustments_changed',
940: x_draft_info.price_adj_changed);
941: PO_LOG.stmt(d_module, d_position, 'exhibits_changed',
942: x_draft_info.exhibits_changed);
943: END IF;
937: x_draft_info.attr_values_tlp_changed);
938: --Enhanced Pricing
939: PO_LOG.stmt(d_module, d_position, 'price_adjustments_changed',
940: x_draft_info.price_adj_changed);
941: PO_LOG.stmt(d_module, d_position, 'exhibits_changed',
942: x_draft_info.exhibits_changed);
943: END IF;
944:
945: IF (PO_LOG.d_proc) THEN
941: PO_LOG.stmt(d_module, d_position, 'exhibits_changed',
942: x_draft_info.exhibits_changed);
943: END IF;
944:
945: IF (PO_LOG.d_proc) THEN
946: PO_LOG.proc_end(d_module);
947: END IF;
948: EXCEPTION
949: WHEN OTHERS THEN
942: x_draft_info.exhibits_changed);
943: END IF;
944:
945: IF (PO_LOG.d_proc) THEN
946: PO_LOG.proc_end(d_module);
947: END IF;
948: EXCEPTION
949: WHEN OTHERS THEN
950: PO_MESSAGE_S.add_exc_msg
978: d_position NUMBER;
979:
980: BEGIN
981:
982: IF (PO_LOG.d_proc) THEN
983: PO_LOG.proc_begin(d_module);
984: END IF;
985:
986: d_position := 0;
979:
980: BEGIN
981:
982: IF (PO_LOG.d_proc) THEN
983: PO_LOG.proc_begin(d_module);
984: END IF;
985:
986: d_position := 0;
987:
995: ( p_draft_info => p_draft_info
996: );
997:
998:
999: IF (PO_LOG.d_proc) THEN
1000: PO_LOG.proc_end(d_module);
1001: END IF;
1002:
1003: EXCEPTION
996: );
997:
998:
999: IF (PO_LOG.d_proc) THEN
1000: PO_LOG.proc_end(d_module);
1001: END IF;
1002:
1003: EXCEPTION
1004: WHEN OTHERS THEN
1045: d_position NUMBER;
1046:
1047: BEGIN
1048: d_position := 0;
1049: IF (PO_LOG.d_proc) THEN
1050: PO_LOG.proc_begin(d_module);
1051: END IF;
1052:
1053: --SQL What: Search for a non-completed draft given the document id
1046:
1047: BEGIN
1048: d_position := 0;
1049: IF (PO_LOG.d_proc) THEN
1050: PO_LOG.proc_begin(d_module);
1051: END IF;
1052:
1053: --SQL What: Search for a non-completed draft given the document id
1054: --SQL Why:
1065: AND Nvl(dft.draft_type,'NULL') <> 'PAR'; --
1066:
1067: d_position := 10;
1068:
1069: IF (PO_LOG.d_proc) THEN
1070: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1071: PO_LOG.proc_end(d_module, 'draft_status', x_draft_status);
1072: PO_LOG.proc_end(d_module, 'draft_owner_role', x_draft_owner_role);
1073: PO_LOG.proc_end(d_module);
1066:
1067: d_position := 10;
1068:
1069: IF (PO_LOG.d_proc) THEN
1070: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1071: PO_LOG.proc_end(d_module, 'draft_status', x_draft_status);
1072: PO_LOG.proc_end(d_module, 'draft_owner_role', x_draft_owner_role);
1073: PO_LOG.proc_end(d_module);
1074: END IF;
1067: d_position := 10;
1068:
1069: IF (PO_LOG.d_proc) THEN
1070: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1071: PO_LOG.proc_end(d_module, 'draft_status', x_draft_status);
1072: PO_LOG.proc_end(d_module, 'draft_owner_role', x_draft_owner_role);
1073: PO_LOG.proc_end(d_module);
1074: END IF;
1075:
1068:
1069: IF (PO_LOG.d_proc) THEN
1070: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1071: PO_LOG.proc_end(d_module, 'draft_status', x_draft_status);
1072: PO_LOG.proc_end(d_module, 'draft_owner_role', x_draft_owner_role);
1073: PO_LOG.proc_end(d_module);
1074: END IF;
1075:
1076: EXCEPTION
1069: IF (PO_LOG.d_proc) THEN
1070: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1071: PO_LOG.proc_end(d_module, 'draft_status', x_draft_status);
1072: PO_LOG.proc_end(d_module, 'draft_owner_role', x_draft_owner_role);
1073: PO_LOG.proc_end(d_module);
1074: END IF;
1075:
1076: EXCEPTION
1077: WHEN NO_DATA_FOUND THEN
1112: l_draft_owner_role PO_DRAFTS.owner_role%TYPE;
1113:
1114: BEGIN
1115: d_position := 0;
1116: IF (PO_LOG.d_proc) THEN
1117: PO_LOG.proc_begin(d_module);
1118: END IF;
1119:
1120: find_draft
1113:
1114: BEGIN
1115: d_position := 0;
1116: IF (PO_LOG.d_proc) THEN
1117: PO_LOG.proc_begin(d_module);
1118: END IF;
1119:
1120: find_draft
1121: ( p_po_header_id => p_po_header_id,
1123: x_draft_status => l_draft_status,
1124: x_draft_owner_role => l_draft_owner_role
1125: );
1126:
1127: IF (PO_LOG.d_proc) THEN
1128: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1129: PO_LOG.proc_end(d_module);
1130: END IF;
1131: END find_draft;
1124: x_draft_owner_role => l_draft_owner_role
1125: );
1126:
1127: IF (PO_LOG.d_proc) THEN
1128: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1129: PO_LOG.proc_end(d_module);
1130: END IF;
1131: END find_draft;
1132:
1125: );
1126:
1127: IF (PO_LOG.d_proc) THEN
1128: PO_LOG.proc_end(d_module, 'draft_id', x_draft_id);
1129: PO_LOG.proc_end(d_module);
1130: END IF;
1131: END find_draft;
1132:
1133: -----------------------------------------------------------------------
1157:
1158: BEGIN
1159: d_position := 0;
1160:
1161: IF (PO_LOG.d_proc) THEN
1162: PO_LOG.proc_begin(d_module);
1163: END IF;
1164:
1165: SELECT request_id
1158: BEGIN
1159: d_position := 0;
1160:
1161: IF (PO_LOG.d_proc) THEN
1162: PO_LOG.proc_begin(d_module);
1163: END IF;
1164:
1165: SELECT request_id
1166: INTO x_request_id
1166: INTO x_request_id
1167: FROM po_drafts
1168: WHERE draft_id = p_draft_id;
1169:
1170: IF (PO_LOG.d_proc) THEN
1171: PO_LOG.proc_end(d_module);
1172: END IF;
1173:
1174: EXCEPTION
1167: FROM po_drafts
1168: WHERE draft_id = p_draft_id;
1169:
1170: IF (PO_LOG.d_proc) THEN
1171: PO_LOG.proc_end(d_module);
1172: END IF;
1173:
1174: EXCEPTION
1175: WHEN OTHERS THEN
1208:
1209: BEGIN
1210:
1211: d_position := 0;
1212: IF (PO_LOG.d_proc) THEN
1213: PO_LOG.proc_begin(d_module);
1214: END IF;
1215:
1216: --SQL What: get information about the user locking the document
1209: BEGIN
1210:
1211: d_position := 0;
1212: IF (PO_LOG.d_proc) THEN
1213: PO_LOG.proc_begin(d_module);
1214: END IF;
1215:
1216: --SQL What: get information about the user locking the document
1217: --SQL Why: these are the values getting returned
1221: x_lock_owner_user_id
1222: FROM po_headers_all
1223: WHERE po_header_id = p_po_header_id;
1224:
1225: IF (PO_LOG.d_proc) THEN
1226: PO_LOG.proc_end(d_module);
1227: END IF;
1228:
1229: EXCEPTION
1222: FROM po_headers_all
1223: WHERE po_header_id = p_po_header_id;
1224:
1225: IF (PO_LOG.d_proc) THEN
1226: PO_LOG.proc_end(d_module);
1227: END IF;
1228:
1229: EXCEPTION
1230: WHEN NO_DATA_FOUND THEN
1262:
1263: BEGIN
1264:
1265: d_position := 0;
1266: IF (PO_LOG.d_proc) THEN
1267: PO_LOG.proc_begin(d_module);
1268: PO_LOG.proc_begin(d_module, 'p_role', p_role);
1269: PO_LOG.proc_begin(d_module, 'p_role_user_id', p_role_user_id);
1270: END IF;
1263: BEGIN
1264:
1265: d_position := 0;
1266: IF (PO_LOG.d_proc) THEN
1267: PO_LOG.proc_begin(d_module);
1268: PO_LOG.proc_begin(d_module, 'p_role', p_role);
1269: PO_LOG.proc_begin(d_module, 'p_role_user_id', p_role_user_id);
1270: END IF;
1271:
1264:
1265: d_position := 0;
1266: IF (PO_LOG.d_proc) THEN
1267: PO_LOG.proc_begin(d_module);
1268: PO_LOG.proc_begin(d_module, 'p_role', p_role);
1269: PO_LOG.proc_begin(d_module, 'p_role_user_id', p_role_user_id);
1270: END IF;
1271:
1272: --SQL What: update lock owner role and lock owner id
1265: d_position := 0;
1266: IF (PO_LOG.d_proc) THEN
1267: PO_LOG.proc_begin(d_module);
1268: PO_LOG.proc_begin(d_module, 'p_role', p_role);
1269: PO_LOG.proc_begin(d_module, 'p_role_user_id', p_role_user_id);
1270: END IF;
1271:
1272: --SQL What: update lock owner role and lock owner id
1273: --SQL Why: This is what this procedure is doing
1275: SET lock_owner_role = p_role,
1276: lock_owner_user_id = p_role_user_id
1277: WHERE po_header_id = p_po_header_id;
1278:
1279: IF (PO_LOG.d_proc) THEN
1280: PO_LOG.proc_end(d_module);
1281: END IF;
1282: END set_lock_owner_info;
1283:
1276: lock_owner_user_id = p_role_user_id
1277: WHERE po_header_id = p_po_header_id;
1278:
1279: IF (PO_LOG.d_proc) THEN
1280: PO_LOG.proc_end(d_module);
1281: END IF;
1282: END set_lock_owner_info;
1283:
1284:
1348: l_updatable_state VARCHAR2(1); -- bug5532550
1349: BEGIN
1350:
1351: d_position := 0;
1352: IF (PO_LOG.d_proc) THEN
1353: PO_LOG.proc_begin(d_module);
1354: END IF;
1355:
1356: x_update_allowed := FND_API.G_TRUE;
1349: BEGIN
1350:
1351: d_position := 0;
1352: IF (PO_LOG.d_proc) THEN
1353: PO_LOG.proc_begin(d_module);
1354: END IF;
1355:
1356: x_update_allowed := FND_API.G_TRUE;
1357: x_locking_applicable := FND_API.G_TRUE;
1362:
1363: IF (p_po_header_id IS NULL) THEN
1364: d_position := 10;
1365:
1366: IF (PO_LOG.d_stmt) THEN
1367: PO_LOG.stmt (d_module, d_position, 'no po header id. Quitting');
1368: END IF;
1369:
1370: -- no document to check. Simply return
1363: IF (p_po_header_id IS NULL) THEN
1364: d_position := 10;
1365:
1366: IF (PO_LOG.d_stmt) THEN
1367: PO_LOG.stmt (d_module, d_position, 'no po header id. Quitting');
1368: END IF;
1369:
1370: -- no document to check. Simply return
1371: RETURN;
1382: x_lock_owner_role => l_current_lock_owner_role,
1383: x_lock_owner_user_id => l_current_lock_owner_id
1384: );
1385:
1386: IF (PO_LOG.d_stmt) THEN
1387: PO_LOG.stmt (d_module, d_position, 'lock owner role', l_current_lock_owner_role);
1388: PO_LOG.stmt (d_module, d_position, 'lock owner user id', l_current_lock_owner_id);
1389: END IF;
1390:
1383: x_lock_owner_user_id => l_current_lock_owner_id
1384: );
1385:
1386: IF (PO_LOG.d_stmt) THEN
1387: PO_LOG.stmt (d_module, d_position, 'lock owner role', l_current_lock_owner_role);
1388: PO_LOG.stmt (d_module, d_position, 'lock owner user id', l_current_lock_owner_id);
1389: END IF;
1390:
1391: -- Bug 12700941 ends
1384: );
1385:
1386: IF (PO_LOG.d_stmt) THEN
1387: PO_LOG.stmt (d_module, d_position, 'lock owner role', l_current_lock_owner_role);
1388: PO_LOG.stmt (d_module, d_position, 'lock owner user id', l_current_lock_owner_id);
1389: END IF;
1390:
1391: -- Bug 12700941 ends
1392:
1404: p_role => p_role
1405: );
1406: IF (l_draft_id IS NOT NULL) THEN
1407:
1408: IF (PO_LOG.d_stmt) THEN
1409: PO_LOG.stmt (d_module, d_position, 'has active draft');
1410: END IF;
1411:
1412: d_position := 30;
1405: );
1406: IF (l_draft_id IS NOT NULL) THEN
1407:
1408: IF (PO_LOG.d_stmt) THEN
1409: PO_LOG.stmt (d_module, d_position, 'has active draft');
1410: END IF;
1411:
1412: d_position := 30;
1413:
1491: );
1492:
1493: IF (l_upload_in_progress = FND_API.G_TRUE) THEN
1494: IF (l_upload_status_code IN (g_upload_status_PENDING, g_upload_status_RUNNING)) THEN
1495: IF (PO_LOG.d_stmt) THEN
1496: PO_LOG.stmt (d_module, d_position, 'in progress catalog upload');
1497: END IF;
1498:
1499: x_message := 'PO_UPLOAD_PENDING_RUNNING';
1492:
1493: IF (l_upload_in_progress = FND_API.G_TRUE) THEN
1494: IF (l_upload_status_code IN (g_upload_status_PENDING, g_upload_status_RUNNING)) THEN
1495: IF (PO_LOG.d_stmt) THEN
1496: PO_LOG.stmt (d_module, d_position, 'in progress catalog upload');
1497: END IF;
1498:
1499: x_message := 'PO_UPLOAD_PENDING_RUNNING';
1500: x_update_allowed := FND_API.G_FALSE;
1499: x_message := 'PO_UPLOAD_PENDING_RUNNING';
1500: x_update_allowed := FND_API.G_FALSE;
1501: RETURN;
1502: ELSIF (l_upload_status_code = g_upload_status_ERROR) THEN
1503: IF (PO_LOG.d_stmt) THEN
1504: PO_LOG.stmt (d_module, d_position, 'errored catalog upload');
1505: END IF;
1506:
1507: -- Bug 12700941 :
1500: x_update_allowed := FND_API.G_FALSE;
1501: RETURN;
1502: ELSIF (l_upload_status_code = g_upload_status_ERROR) THEN
1503: IF (PO_LOG.d_stmt) THEN
1504: PO_LOG.stmt (d_module, d_position, 'errored catalog upload');
1505: END IF;
1506:
1507: -- Bug 12700941 :
1508: -- if the lock owner is same as current role and there is error, he should face error
1532:
1533:
1534:
1535: IF (x_locking_applicable = FND_API.G_FALSE) THEN
1536: IF (PO_LOG.d_stmt) THEN
1537: PO_LOG.stmt (d_module, d_position, 'locking is not applicable');
1538: END IF;
1539:
1540: -- if locking is not applicable, then we are done with the checks.
1533:
1534:
1535: IF (x_locking_applicable = FND_API.G_FALSE) THEN
1536: IF (PO_LOG.d_stmt) THEN
1537: PO_LOG.stmt (d_module, d_position, 'locking is not applicable');
1538: END IF;
1539:
1540: -- if locking is not applicable, then we are done with the checks.
1541: -- simply return
1585: -- document is not in INCOMPLETE or APPROVED status
1586: IF ( p_role <> PO_GLOBAL.g_role_BUYER AND
1587: l_authorization_status NOT IN ('INCOMPLETE', 'APPROVED')) THEN
1588:
1589: IF (PO_LOG.d_stmt) THEN
1590: PO_LOG.stmt (d_module, d_position, 'auth status = ' ||
1591: l_authorization_status || '. This role cannot update the document ' ||
1592: 'in this status');
1593: END IF;
1586: IF ( p_role <> PO_GLOBAL.g_role_BUYER AND
1587: l_authorization_status NOT IN ('INCOMPLETE', 'APPROVED')) THEN
1588:
1589: IF (PO_LOG.d_stmt) THEN
1590: PO_LOG.stmt (d_module, d_position, 'auth status = ' ||
1591: l_authorization_status || '. This role cannot update the document ' ||
1592: 'in this status');
1593: END IF;
1594:
1673: END IF;
1674:
1675: END IF;
1676:
1677: IF (PO_LOG.d_proc) THEN
1678: PO_LOG.proc_end(d_module);
1679: END IF;
1680:
1681: EXCEPTION
1674:
1675: END IF;
1676:
1677: IF (PO_LOG.d_proc) THEN
1678: PO_LOG.proc_end(d_module);
1679: END IF;
1680:
1681: EXCEPTION
1682: WHEN OTHERS THEN
1809:
1810: BEGIN
1811:
1812: d_position := 0;
1813: IF (PO_LOG.d_proc) THEN
1814: PO_LOG.proc_begin(d_module);
1815: END IF;
1816:
1817: find_draft
1810: BEGIN
1811:
1812: d_position := 0;
1813: IF (PO_LOG.d_proc) THEN
1814: PO_LOG.proc_begin(d_module);
1815: END IF;
1816:
1817: find_draft
1818: ( p_po_header_id => p_po_header_id,
1823:
1824: IF ( l_draft_id IS NOT NULL ) THEN
1825: d_position := 10;
1826:
1827: IF (PO_LOG.d_stmt) THEN
1828: PO_LOG.stmt(d_module, d_position, 'need to remove draft changes');
1829: END IF;
1830:
1831: PO_DRAFTS_PVT.remove_draft_changes
1824: IF ( l_draft_id IS NOT NULL ) THEN
1825: d_position := 10;
1826:
1827: IF (PO_LOG.d_stmt) THEN
1828: PO_LOG.stmt(d_module, d_position, 'need to remove draft changes');
1829: END IF;
1830:
1831: PO_DRAFTS_PVT.remove_draft_changes
1832: ( p_draft_id => l_draft_id,
1845: p_role => NULL,
1846: p_role_user_id => NULL
1847: );
1848:
1849: IF (PO_LOG.d_proc) THEN
1850: PO_LOG.proc_end(d_module);
1851: END IF;
1852:
1853: END unlock_document;
1846: p_role_user_id => NULL
1847: );
1848:
1849: IF (PO_LOG.d_proc) THEN
1850: PO_LOG.proc_end(d_module);
1851: END IF;
1852:
1853: END unlock_document;
1854:
1889: l_locking_applicable VARCHAR2(1);
1890: BEGIN
1891:
1892: d_position := 0;
1893: IF (PO_LOG.d_proc) THEN
1894: PO_LOG.proc_begin(d_module);
1895: END IF;
1896:
1897: l_locking_applicable := is_locking_applicable
1890: BEGIN
1891:
1892: d_position := 0;
1893: IF (PO_LOG.d_proc) THEN
1894: PO_LOG.proc_begin(d_module);
1895: END IF;
1896:
1897: l_locking_applicable := is_locking_applicable
1898: ( p_po_header_id => p_po_header_id,
1915: p_role => p_role,
1916: p_role_user_id => p_role_user_id
1917: );
1918:
1919: IF (PO_LOG.d_proc) THEN
1920: PO_LOG.proc_end(d_module);
1921: END IF;
1922: END lock_document;
1923:
1916: p_role_user_id => p_role_user_id
1917: );
1918:
1919: IF (PO_LOG.d_proc) THEN
1920: PO_LOG.proc_end(d_module);
1921: END IF;
1922: END lock_document;
1923:
1924:
1953:
1954: BEGIN
1955:
1956: d_position := 0;
1957: IF (PO_LOG.d_proc) THEN
1958: PO_LOG.proc_begin(d_module);
1959: END IF;
1960:
1961: -- SQL What: Get several columns from PO tables
1954: BEGIN
1955:
1956: d_position := 0;
1957: IF (PO_LOG.d_proc) THEN
1958: PO_LOG.proc_begin(d_module);
1959: END IF;
1960:
1961: -- SQL What: Get several columns from PO tables
1962: -- SQL Why: Need all these columns to determine whether locking
1985:
1986: l_applicable := FND_API.G_FALSE;
1987: END IF;
1988:
1989: IF (PO_LOG.d_proc) THEN
1990: PO_LOG.proc_end(d_module, 'l_applicable', l_applicable);
1991: END IF;
1992:
1993: RETURN l_applicable;
1986: l_applicable := FND_API.G_FALSE;
1987: END IF;
1988:
1989: IF (PO_LOG.d_proc) THEN
1990: PO_LOG.proc_end(d_module, 'l_applicable', l_applicable);
1991: END IF;
1992:
1993: RETURN l_applicable;
1994:
2026: l_ga_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
2027: BEGIN
2028: d_position := 0;
2029:
2030: IF (PO_LOG.d_proc) THEN
2031: PO_LOG.proc_begin(d_module);
2032: END IF;
2033:
2034: -- SQL What: Get several columns from PO tables
2027: BEGIN
2028: d_position := 0;
2029:
2030: IF (PO_LOG.d_proc) THEN
2031: PO_LOG.proc_begin(d_module);
2032: END IF;
2033:
2034: -- SQL What: Get several columns from PO tables
2035: -- SQL Why: Need all these columns to determine whether locking
2052:
2053: l_applicable := FND_API.G_FALSE;
2054: END IF;
2055:
2056: IF (PO_LOG.d_proc) THEN
2057: PO_LOG.proc_end(d_module, 'l_applicable', l_applicable);
2058: END IF;
2059:
2060: RETURN l_applicable;
2053: l_applicable := FND_API.G_FALSE;
2054: END IF;
2055:
2056: IF (PO_LOG.d_proc) THEN
2057: PO_LOG.proc_end(d_module, 'l_applicable', l_applicable);
2058: END IF;
2059:
2060: RETURN l_applicable;
2061:
2110:
2111: BEGIN
2112:
2113: d_position := 0;
2114: IF (PO_LOG.d_proc) THEN
2115: PO_LOG.proc_begin(d_module);
2116: END IF;
2117:
2118: update_permission_check
2111: BEGIN
2112:
2113: d_position := 0;
2114: IF (PO_LOG.d_proc) THEN
2115: PO_LOG.proc_begin(d_module);
2116: END IF;
2117:
2118: update_permission_check
2119: ( p_calling_module => p_calling_module,
2142: p_role_user_id => p_role_user_id,
2143: p_unlock_current => l_unlock_required
2144: );
2145:
2146: IF (PO_LOG.d_proc) THEN
2147: PO_LOG.proc_end(d_module);
2148: END IF;
2149: END lock_document_with_validate;
2150:
2143: p_unlock_current => l_unlock_required
2144: );
2145:
2146: IF (PO_LOG.d_proc) THEN
2147: PO_LOG.proc_end(d_module);
2148: END IF;
2149: END lock_document_with_validate;
2150:
2151: -----------------------------------------------------------------------
2171: l_cur_conc_request_id NUMBER := FND_GLOBAL.conc_request_id;
2172: BEGIN
2173:
2174: d_position := 0;
2175: IF (PO_LOG.d_proc) THEN
2176: PO_LOG.proc_begin(d_module);
2177: END IF;
2178:
2179: -- for request id, populate only if the draft is being processed by PDOI
2172: BEGIN
2173:
2174: d_position := 0;
2175: IF (PO_LOG.d_proc) THEN
2176: PO_LOG.proc_begin(d_module);
2177: END IF;
2178:
2179: -- for request id, populate only if the draft is being processed by PDOI
2180: UPDATE po_drafts
2183: g_status_PDOI_PROCESSING, l_cur_conc_request_id,
2184: NULL)
2185: WHERE draft_id = p_draft_id;
2186:
2187: IF (PO_LOG.d_proc) THEN
2188: PO_LOG.proc_end(d_module);
2189: END IF;
2190:
2191: END update_draft_status;
2184: NULL)
2185: WHERE draft_id = p_draft_id;
2186:
2187: IF (PO_LOG.d_proc) THEN
2188: PO_LOG.proc_end(d_module);
2189: END IF;
2190:
2191: END update_draft_status;
2192:
2217: l_pending_changes_exist VARCHAR2(1) := FND_API.G_FALSE;
2218: BEGIN
2219:
2220: d_position := 0;
2221: IF (PO_LOG.d_proc) THEN
2222: PO_LOG.proc_begin(d_module);
2223: END IF;
2224:
2225: /*find_draft
2218: BEGIN
2219:
2220: d_position := 0;
2221: IF (PO_LOG.d_proc) THEN
2222: PO_LOG.proc_begin(d_module);
2223: END IF;
2224:
2225: /*find_draft
2226: ( p_po_header_id => p_po_header_id,
2244: WHERE document_id = p_po_header_id
2245: AND status <> g_status_COMPLETED
2246: AND NVL(draft_type,g_draft_type_DOC_CHANGE) = g_draft_type_DOC_CHANGE);
2247:
2248: IF (PO_LOG.d_proc) THEN
2249: PO_LOG.proc_end(d_module, 'l_pending_changes_exist', l_pending_changes_exist);
2250: END IF;
2251:
2252: RETURN l_pending_changes_exist;
2245: AND status <> g_status_COMPLETED
2246: AND NVL(draft_type,g_draft_type_DOC_CHANGE) = g_draft_type_DOC_CHANGE);
2247:
2248: IF (PO_LOG.d_proc) THEN
2249: PO_LOG.proc_end(d_module, 'l_pending_changes_exist', l_pending_changes_exist);
2250: END IF;
2251:
2252: RETURN l_pending_changes_exist;
2253:
2253:
2254: EXCEPTION
2255: WHEN NO_DATA_FOUND THEN
2256: l_pending_changes_exist := FND_API.G_FALSE;
2257: IF (PO_LOG.d_proc) THEN
2258: PO_LOG.proc_end(d_module, 'NO_DATA_FOUND: l_pending_changes_exist', l_pending_changes_exist);
2259: END IF;
2260: RETURN l_pending_changes_exist;
2261: END pending_changes_exist;
2254: EXCEPTION
2255: WHEN NO_DATA_FOUND THEN
2256: l_pending_changes_exist := FND_API.G_FALSE;
2257: IF (PO_LOG.d_proc) THEN
2258: PO_LOG.proc_end(d_module, 'NO_DATA_FOUND: l_pending_changes_exist', l_pending_changes_exist);
2259: END IF;
2260: RETURN l_pending_changes_exist;
2261: END pending_changes_exist;
2262:
2291: BEGIN
2292:
2293: d_position := 0;
2294:
2295: IF (PO_LOG.d_proc) THEN
2296: PO_LOG.proc_begin (d_module);
2297: END IF;
2298:
2299: l_null_id_tbl.EXTEND(p_draft_id_tbl.COUNT);
2292:
2293: d_position := 0;
2294:
2295: IF (PO_LOG.d_proc) THEN
2296: PO_LOG.proc_begin (d_module);
2297: END IF;
2298:
2299: l_null_id_tbl.EXTEND(p_draft_id_tbl.COUNT);
2300: l_master_chg_exist_tbl.EXTEND(p_draft_id_tbl.COUNT);
2436: END IF;
2437: END LOOP;
2438: --
2439:
2440: IF (PO_LOG.d_proc) THEN
2441: PO_LOG.proc_end (d_module);
2442: END IF;
2443:
2444: RETURN l_master_chg_exist_tbl;
2437: END LOOP;
2438: --
2439:
2440: IF (PO_LOG.d_proc) THEN
2441: PO_LOG.proc_end (d_module);
2442: END IF;
2443:
2444: RETURN l_master_chg_exist_tbl;
2445:
2475: l_pending_acceptance VARCHAR2(1) := FND_API.G_FALSE;
2476: BEGIN
2477:
2478: d_position := 0;
2479: IF (PO_LOG.d_proc) THEN
2480: PO_LOG.proc_begin(d_module);
2481: END IF;
2482:
2483: find_draft
2476: BEGIN
2477:
2478: d_position := 0;
2479: IF (PO_LOG.d_proc) THEN
2480: PO_LOG.proc_begin(d_module);
2481: END IF;
2482:
2483: find_draft
2484: ( p_po_header_id => p_po_header_id,
2490: IF (l_draft_status = g_status_IN_PROCESS) THEN
2491: l_pending_acceptance := FND_API.G_TRUE;
2492: END IF;
2493:
2494: IF (PO_LOG.d_proc) THEN
2495: PO_LOG.proc_end(d_module, 'l_pending_acceptance', l_pending_acceptance);
2496: END IF;
2497:
2498: RETURN l_pending_acceptance;
2491: l_pending_acceptance := FND_API.G_TRUE;
2492: END IF;
2493:
2494: IF (PO_LOG.d_proc) THEN
2495: PO_LOG.proc_end(d_module, 'l_pending_acceptance', l_pending_acceptance);
2496: END IF;
2497:
2498: RETURN l_pending_acceptance;
2499:
2538:
2539: BEGIN
2540:
2541: d_position := 0;
2542: IF (PO_LOG.d_proc) THEN
2543: PO_LOG.proc_begin(d_module);
2544: END IF;
2545:
2546: IF (p_view_name = 'PO_HEADERS_MERGE_V') THEN
2539: BEGIN
2540:
2541: d_position := 0;
2542: IF (PO_LOG.d_proc) THEN
2543: PO_LOG.proc_begin(d_module);
2544: END IF;
2545:
2546: IF (p_view_name = 'PO_HEADERS_MERGE_V') THEN
2547: d_position := 10;
2685:
2686: RAISE INVALID_VIEW_NAME_EXC;
2687: END IF;
2688:
2689: IF (PO_LOG.d_proc) THEN
2690: PO_LOG.proc_end(d_module);
2691: END IF;
2692:
2693: RETURN FND_API.G_TRUE;
2686: RAISE INVALID_VIEW_NAME_EXC;
2687: END IF;
2688:
2689: IF (PO_LOG.d_proc) THEN
2690: PO_LOG.proc_end(d_module);
2691: END IF;
2692:
2693: RETURN FND_API.G_TRUE;
2694:
2698: l_success := FND_API.G_FALSE;
2699: RETURN FND_API.G_FALSE;
2700:
2701: WHEN INVALID_VIEW_NAME_EXC THEN
2702: IF (PO_LOG.d_exc) THEN
2703: PO_LOG.exc(d_module, d_position, 'Invalid view name');
2704: END IF;
2705:
2706: l_success := FND_API.G_FALSE;
2699: RETURN FND_API.G_FALSE;
2700:
2701: WHEN INVALID_VIEW_NAME_EXC THEN
2702: IF (PO_LOG.d_exc) THEN
2703: PO_LOG.exc(d_module, d_position, 'Invalid view name');
2704: END IF;
2705:
2706: l_success := FND_API.G_FALSE;
2707: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2750:
2751: BEGIN
2752:
2753: d_position := 0;
2754: IF (PO_LOG.d_proc) THEN
2755: PO_LOG.proc_begin(d_module);
2756: END IF;
2757:
2758: SELECT supplier_auth_enabled_flag
2751: BEGIN
2752:
2753: d_position := 0;
2754: IF (PO_LOG.d_proc) THEN
2755: PO_LOG.proc_begin(d_module);
2756: END IF;
2757:
2758: SELECT supplier_auth_enabled_flag
2759: INTO l_supplier_auth_enabled_flag
2804:
2805: BEGIN
2806:
2807: d_position := 0;
2808: IF (PO_LOG.d_proc) THEN
2809: PO_LOG.proc_begin(d_module);
2810: END IF;
2811:
2812: UPDATE po_headers_all
2805: BEGIN
2806:
2807: d_position := 0;
2808: IF (PO_LOG.d_proc) THEN
2809: PO_LOG.proc_begin(d_module);
2810: END IF;
2811:
2812: UPDATE po_headers_all
2813: SET supplier_auth_enabled_flag
2856:
2857: BEGIN
2858:
2859: d_position := 0;
2860: IF (PO_LOG.d_proc) THEN
2861: PO_LOG.proc_begin(d_module);
2862: END IF;
2863:
2864: SELECT cat_admin_auth_enabled_flag
2857: BEGIN
2858:
2859: d_position := 0;
2860: IF (PO_LOG.d_proc) THEN
2861: PO_LOG.proc_begin(d_module);
2862: END IF;
2863:
2864: SELECT cat_admin_auth_enabled_flag
2865: INTO l_cat_admin_auth_enable_flag
2910:
2911: BEGIN
2912:
2913: d_position := 0;
2914: IF (PO_LOG.d_proc) THEN
2915: PO_LOG.proc_begin(d_module);
2916: END IF;
2917:
2918: UPDATE po_headers_all
2911: BEGIN
2912:
2913: d_position := 0;
2914: IF (PO_LOG.d_proc) THEN
2915: PO_LOG.proc_begin(d_module);
2916: END IF;
2917:
2918: UPDATE po_headers_all
2919: SET cat_admin_auth_enabled_flag
3077: BEGIN
3078:
3079: d_position := 0;
3080:
3081: IF (PO_LOG.d_proc) THEN
3082: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3083: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3084: END IF;
3085:
3078:
3079: d_position := 0;
3080:
3081: IF (PO_LOG.d_proc) THEN
3082: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3083: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3084: END IF;
3085:
3086: SELECT org_id,
3079: d_position := 0;
3080:
3081: IF (PO_LOG.d_proc) THEN
3082: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3083: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3084: END IF;
3085:
3086: SELECT org_id,
3087: segment1,
3099: p_segment1 => l_segment1,
3100: p_revision_num => l_revision_num
3101: );
3102:
3103: IF (PO_LOG.d_proc) THEN
3104: PO_LOG.proc_end(d_module,'p_commit',p_commit);
3105: END IF;
3106:
3107: EXCEPTION
3100: p_revision_num => l_revision_num
3101: );
3102:
3103: IF (PO_LOG.d_proc) THEN
3104: PO_LOG.proc_end(d_module,'p_commit',p_commit);
3105: END IF;
3106:
3107: EXCEPTION
3108: WHEN OTHERS THEN
3151: p_segment1 IN VARCHAR2,
3152: p_revision_num IN NUMBER)
3153: IS
3154: d_api_name CONSTANT VARCHAR2(30) := 'unlock_document_and_send_notif';
3155: d_module CONSTANT VARCHAR2(2000) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
3156: d_pos NUMBER := 0;
3157:
3158: l_agreement_info FND_NEW_MESSAGES.message_text%type := NULL;
3159: l_doc_style_name PO_DOC_STYLE_LINES_TL.display_name%type := NULL;
3164:
3165: l_agent_id PO_HEADERS_ALL.agent_id%TYPE;
3166: BEGIN
3167:
3168: IF (PO_LOG.d_proc) THEN
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3165: l_agent_id PO_HEADERS_ALL.agent_id%TYPE;
3166: BEGIN
3167:
3168: IF (PO_LOG.d_proc) THEN
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3173: PO_LOG.proc_begin(d_module,'p_revision_num',p_revision_num);
3166: BEGIN
3167:
3168: IF (PO_LOG.d_proc) THEN
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3173: PO_LOG.proc_begin(d_module,'p_revision_num',p_revision_num);
3174: END IF;
3167:
3168: IF (PO_LOG.d_proc) THEN
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3173: PO_LOG.proc_begin(d_module,'p_revision_num',p_revision_num);
3174: END IF;
3175:
3168: IF (PO_LOG.d_proc) THEN
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3173: PO_LOG.proc_begin(d_module,'p_revision_num',p_revision_num);
3174: END IF;
3175:
3176: -- bug5090429
3169: PO_LOG.proc_begin(d_module,'p_commit',p_commit);
3170: PO_LOG.proc_begin(d_module,'p_po_header_id',p_po_header_id);
3171: PO_LOG.proc_begin(d_module,'p_org_id',p_org_id);
3172: PO_LOG.proc_begin(d_module,'p_segment1',p_segment1);
3173: PO_LOG.proc_begin(d_module,'p_revision_num',p_revision_num);
3174: END IF;
3175:
3176: -- bug5090429
3177: -- Get who is locking the document
3211:
3212: d_pos := 10;
3213: --Get Operating Unit Name
3214: l_ou_name := PO_MOAC_UTILS_PVT.get_ou_name(p_org_id);
3215: IF (PO_LOG.d_stmt) THEN
3216: PO_LOG.stmt(d_module,d_pos,'l_ou_name',l_ou_name);
3217: END IF;
3218:
3219: d_pos := 20;
3212: d_pos := 10;
3213: --Get Operating Unit Name
3214: l_ou_name := PO_MOAC_UTILS_PVT.get_ou_name(p_org_id);
3215: IF (PO_LOG.d_stmt) THEN
3216: PO_LOG.stmt(d_module,d_pos,'l_ou_name',l_ou_name);
3217: END IF;
3218:
3219: d_pos := 20;
3220: --Get the Agreement's Title as we get by calling getTitle of HTML page's controller
3226: END IF;
3227:
3228: d_pos := 30;
3229: l_doc_style_name := PO_DOC_STYLE_PVT.get_style_display_name(p_po_header_id);
3230: IF (PO_LOG.d_stmt) THEN
3231: PO_LOG.stmt(d_module,d_pos,'l_doc_style_name',l_doc_style_name);
3232: END IF;
3233:
3234: d_pos := 40;
3227:
3228: d_pos := 30;
3229: l_doc_style_name := PO_DOC_STYLE_PVT.get_style_display_name(p_po_header_id);
3230: IF (PO_LOG.d_stmt) THEN
3231: PO_LOG.stmt(d_module,d_pos,'l_doc_style_name',l_doc_style_name);
3232: END IF;
3233:
3234: d_pos := 40;
3235: fnd_message.set_token('PONUM', p_segment1);
3234: d_pos := 40;
3235: fnd_message.set_token('PONUM', p_segment1);
3236: fnd_message.set_token('DOCSTYLE', l_doc_style_name);
3237: l_agreement_info := fnd_message.get;
3238: IF (PO_LOG.d_stmt) THEN
3239: PO_LOG.stmt(d_module,d_pos,'l_agreement_info',l_agreement_info);
3240: END IF;
3241:
3242: d_pos := 50;
3235: fnd_message.set_token('PONUM', p_segment1);
3236: fnd_message.set_token('DOCSTYLE', l_doc_style_name);
3237: l_agreement_info := fnd_message.get;
3238: IF (PO_LOG.d_stmt) THEN
3239: PO_LOG.stmt(d_module,d_pos,'l_agreement_info',l_agreement_info);
3240: END IF;
3241:
3242: d_pos := 50;
3243: --Send the notification
3264: IF p_commit = FND_API.G_TRUE THEN
3265: COMMIT WORK;
3266: END IF;
3267:
3268: IF (PO_LOG.d_proc) THEN
3269: PO_LOG.proc_end(d_module);
3270: END IF;
3271: EXCEPTION
3272: WHEN OTHERS THEN
3265: COMMIT WORK;
3266: END IF;
3267:
3268: IF (PO_LOG.d_proc) THEN
3269: PO_LOG.proc_end(d_module);
3270: END IF;
3271: EXCEPTION
3272: WHEN OTHERS THEN
3273: PO_MESSAGE_S.add_exc_msg
3310:
3311: BEGIN
3312:
3313: d_position := 0;
3314: IF (PO_LOG.d_proc) THEN
3315: PO_LOG.proc_begin(d_module);
3316: END IF;
3317:
3318: IF (p_role IN (PO_GLOBAL.g_role_SUPPLIER,
3311: BEGIN
3312:
3313: d_position := 0;
3314: IF (PO_LOG.d_proc) THEN
3315: PO_LOG.proc_begin(d_module);
3316: END IF;
3317:
3318: IF (p_role IN (PO_GLOBAL.g_role_SUPPLIER,
3319: PO_GLOBAL.g_role_CAT_ADMIN)) THEN
3331: ELSE
3332: RETURN FND_API.G_TRUE;
3333: END IF;
3334:
3335: IF (PO_LOG.d_proc) THEN
3336: PO_LOG.proc_end(d_module);
3337: END IF;
3338: EXCEPTION
3339: WHEN NO_DATA_FOUND THEN
3332: RETURN FND_API.G_TRUE;
3333: END IF;
3334:
3335: IF (PO_LOG.d_proc) THEN
3336: PO_LOG.proc_end(d_module);
3337: END IF;
3338: EXCEPTION
3339: WHEN NO_DATA_FOUND THEN
3340: RETURN FND_API.G_FALSE;
3371: l_is_clm_document VARCHAR2(1);
3372:
3373: BEGIN
3374: d_position := 0;
3375: IF (PO_LOG.d_proc) THEN
3376: PO_LOG.proc_begin(d_module);
3377: END IF;
3378:
3379: PO_HEADERS_DRAFT_PVT.apply_changes
3372:
3373: BEGIN
3374: d_position := 0;
3375: IF (PO_LOG.d_proc) THEN
3376: PO_LOG.proc_begin(d_module);
3377: END IF;
3378:
3379: PO_HEADERS_DRAFT_PVT.apply_changes
3380: (p_draft_info => p_draft_info
3435: --Elins End
3436:
3437: l_is_clm_document := PO_CLM_INTG_GRP.IS_CLM_DOCUMENT(p_doc_type => 'PO',p_document_id => p_draft_info.po_header_id);
3438:
3439: IF (PO_LOG.d_stmt) THEN
3440: PO_LOG.stmt(d_module, d_position, 'l_is_clm_document:'||l_is_clm_document);
3441: END IF;
3442: -- Bug: 13948625
3443: -- Re-written the logic to send the requisitions back to pool when CLM document or its lines/distributions deleted.
3436:
3437: l_is_clm_document := PO_CLM_INTG_GRP.IS_CLM_DOCUMENT(p_doc_type => 'PO',p_document_id => p_draft_info.po_header_id);
3438:
3439: IF (PO_LOG.d_stmt) THEN
3440: PO_LOG.stmt(d_module, d_position, 'l_is_clm_document:'||l_is_clm_document);
3441: END IF;
3442: -- Bug: 13948625
3443: -- Re-written the logic to send the requisitions back to pool when CLM document or its lines/distributions deleted.
3444: -- apply_changes proc of PO_XX_DRAFT_PVT above has a call to update_req_for_linked_po_count, where
3451: PO_REQ_LINES_SV.update_reqs_in_pool_flag;
3452: END IF;
3453:
3454: d_position := 100;
3455: IF (PO_LOG.d_proc) THEN
3456: PO_LOG.proc_end(d_module);
3457: END IF;
3458: EXCEPTION
3459: WHEN OTHERS THEN
3452: END IF;
3453:
3454: d_position := 100;
3455: IF (PO_LOG.d_proc) THEN
3456: PO_LOG.proc_end(d_module);
3457: END IF;
3458: EXCEPTION
3459: WHEN OTHERS THEN
3460: PO_MESSAGE_S.add_exc_msg
3505: l_ame_transaction_type PO_HEADERS_ALL.ame_transaction_type%TYPE;
3506:
3507: BEGIN
3508: d_position := 0;
3509: IF (PO_LOG.d_proc) THEN
3510: PO_LOG.proc_begin(d_module);
3511: END IF;
3512:
3513: IF (p_draft_info.new_document = FND_API.G_TRUE) THEN
3506:
3507: BEGIN
3508: d_position := 0;
3509: IF (PO_LOG.d_proc) THEN
3510: PO_LOG.proc_begin(d_module);
3511: END IF;
3512:
3513: IF (p_draft_info.new_document = FND_API.G_TRUE) THEN
3514: RETURN;
3619: END IF;
3620: END LOOP;
3621:
3622: d_position := 100;
3623: IF (PO_LOG.d_proc) THEN
3624: PO_LOG.proc_end(d_module);
3625: END IF;
3626: EXCEPTION
3627: WHEN OTHERS THEN
3620: END LOOP;
3621:
3622: d_position := 100;
3623: IF (PO_LOG.d_proc) THEN
3624: PO_LOG.proc_end(d_module);
3625: END IF;
3626: EXCEPTION
3627: WHEN OTHERS THEN
3628: PO_MESSAGE_S.add_exc_msg
3670: l_exclude_ctrl_tbl VARCHAR2(1);
3671:
3672: BEGIN
3673: d_position := 0;
3674: IF (PO_LOG.d_proc) THEN
3675: PO_LOG.proc_begin(d_module);
3676: END IF;
3677:
3678: -- delete_draft = 'X' means that the PO_DRAFTS table should be
3671:
3672: BEGIN
3673: d_position := 0;
3674: IF (PO_LOG.d_proc) THEN
3675: PO_LOG.proc_begin(d_module);
3676: END IF;
3677:
3678: -- delete_draft = 'X' means that the PO_DRAFTS table should be
3679: -- excluded from deletion. We should just mark it as 'COMPLETED'
3711: END IF;
3712: END IF;
3713:
3714: d_position := 30;
3715: IF (PO_LOG.d_proc) THEN
3716: PO_LOG.proc_end(d_module);
3717: END IF;
3718: EXCEPTION
3719: WHEN OTHERS THEN
3712: END IF;
3713:
3714: d_position := 30;
3715: IF (PO_LOG.d_proc) THEN
3716: PO_LOG.proc_end(d_module);
3717: END IF;
3718: EXCEPTION
3719: WHEN OTHERS THEN
3720: PO_MESSAGE_S.add_exc_msg
3762:
3763: BEGIN
3764:
3765: d_position := 0;
3766: IF (PO_LOG.d_proc) THEN
3767: PO_LOG.proc_begin(d_module);
3768: END IF;
3769:
3770: IF (p_acceptance_action = g_ACCEPT_ALL) THEN
3763: BEGIN
3764:
3765: d_position := 0;
3766: IF (PO_LOG.d_proc) THEN
3767: PO_LOG.proc_begin(d_module);
3768: END IF;
3769:
3770: IF (p_acceptance_action = g_ACCEPT_ALL) THEN
3771: l_change_accepted_flag := 'Y';
3839: --
3840:
3841: END IF;
3842:
3843: IF (PO_LOG.d_proc) THEN
3844: PO_LOG.proc_end(d_module);
3845: END IF;
3846:
3847: EXCEPTION
3840:
3841: END IF;
3842:
3843: IF (PO_LOG.d_proc) THEN
3844: PO_LOG.proc_end(d_module);
3845: END IF;
3846:
3847: EXCEPTION
3848: WHEN OTHERS THEN
3878:
3879: BEGIN
3880:
3881: d_position := 0;
3882: IF (PO_LOG.d_proc) THEN
3883: PO_LOG.proc_begin(d_module);
3884: END IF;
3885:
3886: SELECT Count(*)
3879: BEGIN
3880:
3881: d_position := 0;
3882: IF (PO_LOG.d_proc) THEN
3883: PO_LOG.proc_begin(d_module);
3884: END IF;
3885:
3886: SELECT Count(*)
3887: INTO l_draft_count
3892: IF (l_draft_count > 0 ) THEN
3893: l_is_draft_exist := FND_API.G_TRUE;
3894: END IF;
3895:
3896: IF (PO_LOG.d_proc) THEN
3897: PO_LOG.proc_end(d_module, 'l_is_draft_exist', l_is_draft_exist);
3898: END IF;
3899:
3900: RETURN l_is_draft_exist;
3893: l_is_draft_exist := FND_API.G_TRUE;
3894: END IF;
3895:
3896: IF (PO_LOG.d_proc) THEN
3897: PO_LOG.proc_end(d_module, 'l_is_draft_exist', l_is_draft_exist);
3898: END IF;
3899:
3900: RETURN l_is_draft_exist;
3901:
3927:
3928: BEGIN
3929:
3930: d_position := 0;
3931: IF (PO_LOG.d_proc) THEN
3932: PO_LOG.proc_begin(d_module);
3933: END IF;
3934:
3935: BEGIN
3928: BEGIN
3929:
3930: d_position := 0;
3931: IF (PO_LOG.d_proc) THEN
3932: PO_LOG.proc_begin(d_module);
3933: END IF;
3934:
3935: BEGIN
3936:
3953: l_is_mod_enabled := FND_API.G_TRUE;
3954: END IF;
3955:
3956:
3957: IF (PO_LOG.d_proc) THEN
3958: PO_LOG.proc_end(d_module, 'l_is_mod_enabled', l_is_mod_enabled);
3959: END IF;
3960:
3961: RETURN l_is_mod_enabled;
3954: END IF;
3955:
3956:
3957: IF (PO_LOG.d_proc) THEN
3958: PO_LOG.proc_end(d_module, 'l_is_mod_enabled', l_is_mod_enabled);
3959: END IF;
3960:
3961: RETURN l_is_mod_enabled;
3962:
4064: ----------------------------------------------------------
4065: -- Insert modified entities PKs into GT table
4066: -- and determine locks required for various entities
4067: ----------------------------------------------------------
4068: IF (PO_LOG.d_proc) THEN
4069: PO_LOG.proc_begin(d_module);
4070: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4071: END IF;
4072: -- Clean up the gt table
4065: -- Insert modified entities PKs into GT table
4066: -- and determine locks required for various entities
4067: ----------------------------------------------------------
4068: IF (PO_LOG.d_proc) THEN
4069: PO_LOG.proc_begin(d_module);
4070: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4071: END IF;
4072: -- Clean up the gt table
4073: DELETE FROM po_session_gt
4066: -- and determine locks required for various entities
4067: ----------------------------------------------------------
4068: IF (PO_LOG.d_proc) THEN
4069: PO_LOG.proc_begin(d_module);
4070: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4071: END IF;
4072: -- Clean up the gt table
4073: DELETE FROM po_session_gt
4074: WHERE index_char1 IN (G_CHANGED_ENTTIES_ID, G_LOCKS_REQUIRED_ID);
4096:
4097: d_position := 10;
4098:
4099:
4100: IF PO_LOG.d_stmt THEN
4101: PO_LOG.stmt(d_module,d_position,'Nmber Of rows Inserted'||SQL%ROWCOUNT);
4102: END IF;
4103:
4104: identify_header_locks(p_draft_id =>p_draft_id);
4097: d_position := 10;
4098:
4099:
4100: IF PO_LOG.d_stmt THEN
4101: PO_LOG.stmt(d_module,d_position,'Nmber Of rows Inserted'||SQL%ROWCOUNT);
4102: END IF;
4103:
4104: identify_header_locks(p_draft_id =>p_draft_id);
4105: identify_line_locks (p_draft_id =>p_draft_id);
4115: WHERE pha.PO_HEADER_ID = phd.PO_HEADER_ID
4116: AND phd.draft_id=p_draft_id ;
4117:
4118: d_position := 20;
4119: IF PO_LOG.d_stmt THEN
4120: PO_LOG.stmt(d_module,d_position,'Before Check_Uda_Enabled');
4121: END IF;
4122:
4123: PO_CLM_CLO_UTIL.Check_po_Uda_Enabled
4116: AND phd.draft_id=p_draft_id ;
4117:
4118: d_position := 20;
4119: IF PO_LOG.d_stmt THEN
4120: PO_LOG.stmt(d_module,d_position,'Before Check_Uda_Enabled');
4121: END IF;
4122:
4123: PO_CLM_CLO_UTIL.Check_po_Uda_Enabled
4124: (
4128: ,x_return_status => l_return_status_uda
4129: );
4130:
4131: d_position := 30;
4132: IF PO_LOG.d_stmt THEN
4133: PO_LOG.stmt(d_module,d_position,'After Check_Uda_Enabled with x_return_status : ' || l_return_status_uda);
4134: END IF;
4135:
4136:
4129: );
4130:
4131: d_position := 30;
4132: IF PO_LOG.d_stmt THEN
4133: PO_LOG.stmt(d_module,d_position,'After Check_Uda_Enabled with x_return_status : ' || l_return_status_uda);
4134: END IF;
4135:
4136:
4137: IF l_return_status_uda = FND_API.G_RET_STS_UNEXP_ERROR THEN
4147: create_update_locks (p_draft_id =>p_draft_id,
4148: p_return_status=> x_return_status,
4149: x_results =>x_results);
4150:
4151: IF (PO_LOG.d_proc) THEN
4152: PO_LOG.proc_end(d_module);
4153: END IF;
4154:
4155: EXCEPTION
4148: p_return_status=> x_return_status,
4149: x_results =>x_results);
4150:
4151: IF (PO_LOG.d_proc) THEN
4152: PO_LOG.proc_end(d_module);
4153: END IF;
4154:
4155: EXCEPTION
4156: WHEN OTHERS THEN
4189:
4190: BEGIN
4191:
4192: d_position:=0;
4193: IF (PO_LOG.d_proc) THEN
4194: PO_LOG.proc_begin(d_module);
4195: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4196: END IF;
4197:
4190: BEGIN
4191:
4192: d_position:=0;
4193: IF (PO_LOG.d_proc) THEN
4194: PO_LOG.proc_begin(d_module);
4195: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4196: END IF;
4197:
4198: -- Insert Header level locks required into gt table
4191:
4192: d_position:=0;
4193: IF (PO_LOG.d_proc) THEN
4194: PO_LOG.proc_begin(d_module);
4195: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4196: END IF;
4197:
4198: -- Insert Header level locks required into gt table
4199: INSERT INTO po_session_gt(
4350: WHERE base.p_lock_attrs <> draft.p_lock_attrs
4351: OR base.s_lock_attrs <> draft.s_lock_attrs;
4352:
4353: d_position:=10;
4354: IF (PO_LOG.d_stmt) THEN
4355: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4356: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
4357: END IF;
4358:
4351: OR base.s_lock_attrs <> draft.s_lock_attrs;
4352:
4353: d_position:=10;
4354: IF (PO_LOG.d_stmt) THEN
4355: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4356: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
4357: END IF;
4358:
4359: -- Identify Header level locks required because of change in po_ga_org_assignments
4352:
4353: d_position:=10;
4354: IF (PO_LOG.d_stmt) THEN
4355: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4356: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
4357: END IF;
4358:
4359: -- Identify Header level locks required because of change in po_ga_org_assignments
4360: INSERT INTO po_session_gt(
4404: WHERE base.org_assignment_id = draft.org_assignment_id
4405: AND base.p_lock_attrs <> draft.p_lock_attrs;
4406:
4407: d_position:=20;
4408: IF (PO_LOG.d_stmt) THEN
4409: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4410: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4411: END IF;
4412:
4405: AND base.p_lock_attrs <> draft.p_lock_attrs;
4406:
4407: d_position:=20;
4408: IF (PO_LOG.d_stmt) THEN
4409: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4410: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4411: END IF;
4412:
4413: -- Identify Header level locks required because of change in po_notification_controls
4406:
4407: d_position:=20;
4408: IF (PO_LOG.d_stmt) THEN
4409: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4410: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4411: END IF;
4412:
4413: -- Identify Header level locks required because of change in po_notification_controls
4414: INSERT INTO po_session_gt(
4464: WHERE base.notification_id = draft.notification_id
4465: AND base.p_lock_attrs <> draft.p_lock_attrs;
4466:
4467: d_position:=30;
4468: IF (PO_LOG.d_stmt) THEN
4469: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4470: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4471: END IF;
4472:
4465: AND base.p_lock_attrs <> draft.p_lock_attrs;
4466:
4467: d_position:=30;
4468: IF (PO_LOG.d_stmt) THEN
4469: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4470: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4471: END IF;
4472:
4473: d_position:=40;
4466:
4467: d_position:=30;
4468: IF (PO_LOG.d_stmt) THEN
4469: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4470: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4471: END IF;
4472:
4473: d_position:=40;
4474: IF (PO_LOG.d_proc) THEN
4470: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4471: END IF;
4472:
4473: d_position:=40;
4474: IF (PO_LOG.d_proc) THEN
4475: PO_LOG.proc_end(d_module);
4476: END IF;
4477: EXCEPTION
4478: WHEN OTHERS THEN
4471: END IF;
4472:
4473: d_position:=40;
4474: IF (PO_LOG.d_proc) THEN
4475: PO_LOG.proc_end(d_module);
4476: END IF;
4477: EXCEPTION
4478: WHEN OTHERS THEN
4479: IF (PO_LOG.d_exc) THEN
4475: PO_LOG.proc_end(d_module);
4476: END IF;
4477: EXCEPTION
4478: WHEN OTHERS THEN
4479: IF (PO_LOG.d_exc) THEN
4480: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
4481: END IF;
4482: RAISE;
4483: END identify_header_locks;
4476: END IF;
4477: EXCEPTION
4478: WHEN OTHERS THEN
4479: IF (PO_LOG.d_exc) THEN
4480: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
4481: END IF;
4482: RAISE;
4483: END identify_header_locks;
4484:
4512:
4513: BEGIN
4514:
4515: d_position:=0;
4516: IF (PO_LOG.d_proc) THEN
4517: PO_LOG.proc_begin(d_module);
4518: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4519: END IF;
4520:
4513: BEGIN
4514:
4515: d_position:=0;
4516: IF (PO_LOG.d_proc) THEN
4517: PO_LOG.proc_begin(d_module);
4518: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4519: END IF;
4520:
4521: -- Identify Line level locks required and insert into gt table
4514:
4515: d_position:=0;
4516: IF (PO_LOG.d_proc) THEN
4517: PO_LOG.proc_begin(d_module);
4518: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
4519: END IF;
4520:
4521: -- Identify Line level locks required and insert into gt table
4522: INSERT INTO po_session_gt(
4714: OR base.p_lock_attrs <> draft.p_lock_attrs
4715: OR base.s_lock_attrs <> draft.s_lock_attrs);
4716:
4717: d_position:=10;
4718: IF (PO_LOG.d_stmt) THEN
4719: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4720: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
4721: END IF;
4722:
4715: OR base.s_lock_attrs <> draft.s_lock_attrs);
4716:
4717: d_position:=10;
4718: IF (PO_LOG.d_stmt) THEN
4719: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4720: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
4721: END IF;
4722:
4723: -- Identify Line level locks required because of change in po_attribute_values
4716:
4717: d_position:=10;
4718: IF (PO_LOG.d_stmt) THEN
4719: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4720: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
4721: END IF;
4722:
4723: -- Identify Line level locks required because of change in po_attribute_values
4724: INSERT INTO po_session_gt(
4782: WHERE base.attribute_values_id = draft.attribute_values_id
4783: AND base.p_lock_attrs <> draft.p_lock_attrs;
4784:
4785: d_position:=20;
4786: IF (PO_LOG.d_stmt) THEN
4787: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4788: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4789: END IF;
4790:
4783: AND base.p_lock_attrs <> draft.p_lock_attrs;
4784:
4785: d_position:=20;
4786: IF (PO_LOG.d_stmt) THEN
4787: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4788: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4789: END IF;
4790:
4791: -- Identify Line level locks required because of change in po_attribute_values_tlp
4784:
4785: d_position:=20;
4786: IF (PO_LOG.d_stmt) THEN
4787: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4788: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4789: END IF;
4790:
4791: -- Identify Line level locks required because of change in po_attribute_values_tlp
4792: INSERT INTO po_session_gt(
4840: WHERE base.attribute_values_tlp_id = draft.attribute_values_tlp_id
4841: AND base.p_lock_attrs <> draft.p_lock_attrs;
4842:
4843: d_position:=30;
4844: IF (PO_LOG.d_stmt) THEN
4845: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4846: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4847: END IF;
4848: -- Identify Line level locks required because of change in price breaks
4841: AND base.p_lock_attrs <> draft.p_lock_attrs;
4842:
4843: d_position:=30;
4844: IF (PO_LOG.d_stmt) THEN
4845: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4846: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4847: END IF;
4848: -- Identify Line level locks required because of change in price breaks
4849: INSERT INTO po_session_gt(
4842:
4843: d_position:=30;
4844: IF (PO_LOG.d_stmt) THEN
4845: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4846: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4847: END IF;
4848: -- Identify Line level locks required because of change in price breaks
4849: INSERT INTO po_session_gt(
4850: key,
4907: WHERE base.line_location_id = draft.line_location_id
4908: AND base.p_lock_attrs <> draft.p_lock_attrs;
4909:
4910: d_position:=40;
4911: IF (PO_LOG.d_stmt) THEN
4912: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4913: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4914: END IF;
4915: -- Identify Line level locks required because of change in po_price_differentials
4908: AND base.p_lock_attrs <> draft.p_lock_attrs;
4909:
4910: d_position:=40;
4911: IF (PO_LOG.d_stmt) THEN
4912: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4913: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4914: END IF;
4915: -- Identify Line level locks required because of change in po_price_differentials
4916: INSERT INTO po_session_gt(
4909:
4910: d_position:=40;
4911: IF (PO_LOG.d_stmt) THEN
4912: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4913: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4914: END IF;
4915: -- Identify Line level locks required because of change in po_price_differentials
4916: INSERT INTO po_session_gt(
4917: key,
4966: WHERE base.price_differential_id = draft.price_differential_id
4967: AND base.p_lock_attrs <> draft.p_lock_attrs;
4968:
4969: d_position:=50;
4970: IF (PO_LOG.d_stmt) THEN
4971: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4972: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4973: END IF;
4974:
4967: AND base.p_lock_attrs <> draft.p_lock_attrs;
4968:
4969: d_position:=50;
4970: IF (PO_LOG.d_stmt) THEN
4971: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4972: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4973: END IF;
4974:
4975: -- if new shipment is added via Mod, then lock the line as S so that another
4968:
4969: d_position:=50;
4970: IF (PO_LOG.d_stmt) THEN
4971: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
4972: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
4973: END IF;
4974:
4975: -- if new shipment is added via Mod, then lock the line as S so that another
4976: -- Mod can not take a full lock on the line.
5032: AND pol.po_header_id = dft.document_id
5033: AND dft.draft_id = p_draft_id;
5034:
5035:
5036: IF (PO_LOG.d_proc) THEN
5037: PO_LOG.proc_end(d_module);
5038: END IF;
5039:
5040: EXCEPTION
5033: AND dft.draft_id = p_draft_id;
5034:
5035:
5036: IF (PO_LOG.d_proc) THEN
5037: PO_LOG.proc_end(d_module);
5038: END IF;
5039:
5040: EXCEPTION
5041: WHEN OTHERS THEN
5038: END IF;
5039:
5040: EXCEPTION
5041: WHEN OTHERS THEN
5042: IF (PO_LOG.d_exc) THEN
5043: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5044: END IF;
5045: RAISE;
5046: END identify_line_locks;
5039:
5040: EXCEPTION
5041: WHEN OTHERS THEN
5042: IF (PO_LOG.d_exc) THEN
5043: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5044: END IF;
5045: RAISE;
5046: END identify_line_locks;
5047:
5075: d_position NUMBER;
5076:
5077: BEGIN
5078: d_position:=0;
5079: IF (PO_LOG.d_proc) THEN
5080: PO_LOG.proc_begin(d_module);
5081: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5082: END IF;
5083:
5076:
5077: BEGIN
5078: d_position:=0;
5079: IF (PO_LOG.d_proc) THEN
5080: PO_LOG.proc_begin(d_module);
5081: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5082: END IF;
5083:
5084: -- Identify Shipment level locks required and insert into gt table
5077: BEGIN
5078: d_position:=0;
5079: IF (PO_LOG.d_proc) THEN
5080: PO_LOG.proc_begin(d_module);
5081: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5082: END IF;
5083:
5084: -- Identify Shipment level locks required and insert into gt table
5085: INSERT INTO po_session_gt(
5239: OR base.p_lock_attrs <> draft.p_lock_attrs
5240: OR base.s_lock_attrs <> draft.s_lock_attrs);
5241:
5242: d_position:=10;
5243: IF (PO_LOG.d_stmt) THEN
5244: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5245: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5246: END IF;
5247:
5240: OR base.s_lock_attrs <> draft.s_lock_attrs);
5241:
5242: d_position:=10;
5243: IF (PO_LOG.d_stmt) THEN
5244: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5245: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5246: END IF;
5247:
5248: -- If the Line is F locked, then lock the shipment as F
5241:
5242: d_position:=10;
5243: IF (PO_LOG.d_stmt) THEN
5244: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5245: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5246: END IF;
5247:
5248: -- If the Line is F locked, then lock the shipment as F
5249: -- Here we need to consider two cases:
5291: )
5292: );
5293:
5294: d_position:=20;
5295: IF (PO_LOG.d_stmt) THEN
5296: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5297: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5298: END IF;
5299:
5292: );
5293:
5294: d_position:=20;
5295: IF (PO_LOG.d_stmt) THEN
5296: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5297: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5298: END IF;
5299:
5300: d_position:=30;
5293:
5294: d_position:=20;
5295: IF (PO_LOG.d_stmt) THEN
5296: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5297: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5298: END IF;
5299:
5300: d_position:=30;
5301: IF (PO_LOG.d_proc) THEN
5297: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5298: END IF;
5299:
5300: d_position:=30;
5301: IF (PO_LOG.d_proc) THEN
5302: PO_LOG.proc_end(d_module);
5303: END IF;
5304:
5305: EXCEPTION
5298: END IF;
5299:
5300: d_position:=30;
5301: IF (PO_LOG.d_proc) THEN
5302: PO_LOG.proc_end(d_module);
5303: END IF;
5304:
5305: EXCEPTION
5306: WHEN OTHERS THEN
5303: END IF;
5304:
5305: EXCEPTION
5306: WHEN OTHERS THEN
5307: IF (PO_LOG.d_exc) THEN
5308: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5309: END IF;
5310: RAISE;
5311:
5304:
5305: EXCEPTION
5306: WHEN OTHERS THEN
5307: IF (PO_LOG.d_exc) THEN
5308: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5309: END IF;
5310: RAISE;
5311:
5312: END identify_shipment_locks;
5341: d_position NUMBER;
5342:
5343: BEGIN
5344: d_position:=0;
5345: IF (PO_LOG.d_proc) THEN
5346: PO_LOG.proc_begin(d_module);
5347: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5348: END IF;
5349:
5342:
5343: BEGIN
5344: d_position:=0;
5345: IF (PO_LOG.d_proc) THEN
5346: PO_LOG.proc_begin(d_module);
5347: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5348: END IF;
5349:
5350: -- Identify Distribution level locks required and insert into gt table
5343: BEGIN
5344: d_position:=0;
5345: IF (PO_LOG.d_proc) THEN
5346: PO_LOG.proc_begin(d_module);
5347: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5348: END IF;
5349:
5350: -- Identify Distribution level locks required and insert into gt table
5351: INSERT INTO po_session_gt(
5494: OR base.s_lock_attrs <> draft.s_lock_attrs);
5495:
5496:
5497: d_position:=10;
5498: IF (PO_LOG.d_stmt) THEN
5499: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5500: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5501: END IF;
5502:
5495:
5496:
5497: d_position:=10;
5498: IF (PO_LOG.d_stmt) THEN
5499: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5500: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5501: END IF;
5502:
5503: -- If the Line is F locked, then lock the Distribution as F
5496:
5497: d_position:=10;
5498: IF (PO_LOG.d_stmt) THEN
5499: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5500: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5501: END IF;
5502:
5503: -- If the Line is F locked, then lock the Distribution as F
5504: -- Here we need to consider four cases:
5571: );
5572:
5573:
5574: d_position:=20;
5575: IF (PO_LOG.d_stmt) THEN
5576: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5577: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5578: END IF;
5579: d_position:=30;
5572:
5573:
5574: d_position:=20;
5575: IF (PO_LOG.d_stmt) THEN
5576: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5577: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5578: END IF;
5579: d_position:=30;
5580: IF (PO_LOG.d_proc) THEN
5573:
5574: d_position:=20;
5575: IF (PO_LOG.d_stmt) THEN
5576: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5577: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5578: END IF;
5579: d_position:=30;
5580: IF (PO_LOG.d_proc) THEN
5581: PO_LOG.proc_end(d_module);
5576: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5577: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5578: END IF;
5579: d_position:=30;
5580: IF (PO_LOG.d_proc) THEN
5581: PO_LOG.proc_end(d_module);
5582: END IF;
5583:
5584: EXCEPTION
5577: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5578: END IF;
5579: d_position:=30;
5580: IF (PO_LOG.d_proc) THEN
5581: PO_LOG.proc_end(d_module);
5582: END IF;
5583:
5584: EXCEPTION
5585: WHEN OTHERS THEN
5582: END IF;
5583:
5584: EXCEPTION
5585: WHEN OTHERS THEN
5586: IF (PO_LOG.d_exc) THEN
5587: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5588: END IF;
5589: RAISE;
5590: END identify_dist_locks;
5583:
5584: EXCEPTION
5585: WHEN OTHERS THEN
5586: IF (PO_LOG.d_exc) THEN
5587: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
5588: END IF;
5589: RAISE;
5590: END identify_dist_locks;
5591:
5620: l_po_header_id NUMBER;
5621: BEGIN
5622:
5623: d_position:=0;
5624: IF (PO_LOG.d_proc) THEN
5625: PO_LOG.proc_begin(d_module);
5626: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5627: END IF;
5628:
5621: BEGIN
5622:
5623: d_position:=0;
5624: IF (PO_LOG.d_proc) THEN
5625: PO_LOG.proc_begin(d_module);
5626: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5627: END IF;
5628:
5629: -- Identify Header level locks required because of change in po_headers_all_ext_b
5622:
5623: d_position:=0;
5624: IF (PO_LOG.d_proc) THEN
5625: PO_LOG.proc_begin(d_module);
5626: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
5627: END IF;
5628:
5629: -- Identify Header level locks required because of change in po_headers_all_ext_b
5630: INSERT INTO po_session_gt(
5857: WHERE base.attr_group_id = draft.attr_group_id
5858: AND base.p_lock_attrs <> draft.p_lock_attrs;
5859:
5860: d_position:=10;
5861: IF (PO_LOG.d_stmt) THEN
5862: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5863: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5864: END IF;
5865:
5858: AND base.p_lock_attrs <> draft.p_lock_attrs;
5859:
5860: d_position:=10;
5861: IF (PO_LOG.d_stmt) THEN
5862: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5863: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5864: END IF;
5865:
5866: SELECT document_id
5859:
5860: d_position:=10;
5861: IF (PO_LOG.d_stmt) THEN
5862: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5863: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
5864: END IF;
5865:
5866: SELECT document_id
5867: INTO l_po_header_id
5919: AND ag.multi_row = 'N'
5920: );
5921:
5922: d_position:=15;
5923: IF (PO_LOG.d_stmt) THEN
5924: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5925: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5926: END IF;
5927:
5920: );
5921:
5922: d_position:=15;
5923: IF (PO_LOG.d_stmt) THEN
5924: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5925: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5926: END IF;
5927:
5928: -- Identify Header level locks required because of change in multi-row
5921:
5922: d_position:=15;
5923: IF (PO_LOG.d_stmt) THEN
5924: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
5925: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
5926: END IF;
5927:
5928: -- Identify Header level locks required because of change in multi-row
5929: -- attribute groups in po_headers_all_ext_b.
6346: AND (pohextb.c_ext_attr40 <> 'PO_UDA_ADDRESS_TYPES'
6347: OR pohextb.c_ext_attr40 IS NULL)
6348: );
6349: d_position:=20;
6350: IF (PO_LOG.d_stmt) THEN
6351: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6352: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6353: END IF;
6354:
6347: OR pohextb.c_ext_attr40 IS NULL)
6348: );
6349: d_position:=20;
6350: IF (PO_LOG.d_stmt) THEN
6351: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6352: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6353: END IF;
6354:
6355: -- Identify Header level locks required because of change in po_headers_all_ext_tl
6348: );
6349: d_position:=20;
6350: IF (PO_LOG.d_stmt) THEN
6351: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6352: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6353: END IF;
6354:
6355: -- Identify Header level locks required because of change in po_headers_all_ext_tl
6356: INSERT INTO po_session_gt(
6479: where base.attr_group_id = draft.attr_group_id
6480: AND base.language = draft.language
6481: AND base.p_lock_attrs <> draft.p_lock_attrs;
6482: d_position:=30;
6483: IF (PO_LOG.d_stmt) THEN
6484: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6485: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6486: END IF;
6487:
6480: AND base.language = draft.language
6481: AND base.p_lock_attrs <> draft.p_lock_attrs;
6482: d_position:=30;
6483: IF (PO_LOG.d_stmt) THEN
6484: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6485: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6486: END IF;
6487:
6488: -- Identify UDA Addresses level locks required and insert into gt table
6481: AND base.p_lock_attrs <> draft.p_lock_attrs;
6482: d_position:=30;
6483: IF (PO_LOG.d_stmt) THEN
6484: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6485: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6486: END IF;
6487:
6488: -- Identify UDA Addresses level locks required and insert into gt table
6489: INSERT INTO po_session_gt(
6717: AND BASE.c_ext_attr39 = DRAFT.c_ext_attr39
6718: AND base.p_lock_attrs <> draft.p_lock_attrs;
6719:
6720: d_position:=40;
6721: IF (PO_LOG.d_stmt) THEN
6722: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6723: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6724: END IF;
6725:
6718: AND base.p_lock_attrs <> draft.p_lock_attrs;
6719:
6720: d_position:=40;
6721: IF (PO_LOG.d_stmt) THEN
6722: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6723: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6724: END IF;
6725:
6726: d_position:=50;
6719:
6720: d_position:=40;
6721: IF (PO_LOG.d_stmt) THEN
6722: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
6723: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6724: END IF;
6725:
6726: d_position:=50;
6727: IF (PO_LOG.d_proc) THEN
6723: PO_LOG.stmt(d_module,d_position ,'number of rows Updated ',SQL%ROWCOUNT);
6724: END IF;
6725:
6726: d_position:=50;
6727: IF (PO_LOG.d_proc) THEN
6728: PO_LOG.proc_end(d_module);
6729: END IF;
6730:
6731: EXCEPTION
6724: END IF;
6725:
6726: d_position:=50;
6727: IF (PO_LOG.d_proc) THEN
6728: PO_LOG.proc_end(d_module);
6729: END IF;
6730:
6731: EXCEPTION
6732: WHEN OTHERS THEN
6729: END IF;
6730:
6731: EXCEPTION
6732: WHEN OTHERS THEN
6733: IF (PO_LOG.d_exc) THEN
6734: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
6735: END IF;
6736: RAISE;
6737: END identify_uda_header_locks;
6730:
6731: EXCEPTION
6732: WHEN OTHERS THEN
6733: IF (PO_LOG.d_exc) THEN
6734: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
6735: END IF;
6736: RAISE;
6737: END identify_uda_header_locks;
6738:
6769:
6770: BEGIN
6771: -- Identify Line level locks required because of change in po_lines_all_ext_b
6772: d_position:=0;
6773: IF (PO_LOG.d_proc) THEN
6774: PO_LOG.proc_begin(d_module);
6775: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
6776: END IF;
6777:
6770: BEGIN
6771: -- Identify Line level locks required because of change in po_lines_all_ext_b
6772: d_position:=0;
6773: IF (PO_LOG.d_proc) THEN
6774: PO_LOG.proc_begin(d_module);
6775: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
6776: END IF;
6777:
6778: INSERT INTO po_session_gt(
6771: -- Identify Line level locks required because of change in po_lines_all_ext_b
6772: d_position:=0;
6773: IF (PO_LOG.d_proc) THEN
6774: PO_LOG.proc_begin(d_module);
6775: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
6776: END IF;
6777:
6778: INSERT INTO po_session_gt(
6779: key,
7015: WHERE base.attr_group_id = draft.attr_group_id
7016: AND base.p_lock_attrs <> draft.p_lock_attrs;
7017:
7018: d_position:=10;
7019: IF (PO_LOG.d_stmt) THEN
7020: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7021: PO_LOG.stmt(d_module,d_position ,'number of rows INserted ',SQL%ROWCOUNT);
7022: END IF;
7023:
7016: AND base.p_lock_attrs <> draft.p_lock_attrs;
7017:
7018: d_position:=10;
7019: IF (PO_LOG.d_stmt) THEN
7020: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7021: PO_LOG.stmt(d_module,d_position ,'number of rows INserted ',SQL%ROWCOUNT);
7022: END IF;
7023:
7024: -- When a UDA attribute group does not have any attribute which has default
7017:
7018: d_position:=10;
7019: IF (PO_LOG.d_stmt) THEN
7020: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7021: PO_LOG.stmt(d_module,d_position ,'number of rows INserted ',SQL%ROWCOUNT);
7022: END IF;
7023:
7024: -- When a UDA attribute group does not have any attribute which has default
7025: -- value and user also does not enter any attribute value, then records
7066: AND uda_usg.attribute_category <> 'PRICING'
7067: );
7068:
7069: d_position:=15;
7070: IF (PO_LOG.d_stmt) THEN
7071: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7072: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7073: END IF;
7074:
7067: );
7068:
7069: d_position:=15;
7070: IF (PO_LOG.d_stmt) THEN
7071: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7072: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7073: END IF;
7074:
7075: -- Identify Line level locks required because of change in po_lines_all_ext_tl
7068:
7069: d_position:=15;
7070: IF (PO_LOG.d_stmt) THEN
7071: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7072: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7073: END IF;
7074:
7075: -- Identify Line level locks required because of change in po_lines_all_ext_tl
7076: INSERT INTO po_session_gt(
7200: AND base.language = draft.language
7201: AND base.p_lock_attrs <> draft.p_lock_attrs;
7202:
7203: d_position:=20;
7204: IF (PO_LOG.d_stmt) THEN
7205: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7206: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7207: END IF;
7208:
7201: AND base.p_lock_attrs <> draft.p_lock_attrs;
7202:
7203: d_position:=20;
7204: IF (PO_LOG.d_stmt) THEN
7205: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7206: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7207: END IF;
7208:
7209: -- Identify Line level Complex Pricing Attribtues changes and corresponding
7202:
7203: d_position:=20;
7204: IF (PO_LOG.d_stmt) THEN
7205: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7206: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7207: END IF;
7208:
7209: -- Identify Line level Complex Pricing Attribtues changes and corresponding
7210: -- lock required and insert into gt table
7257: OR NVL(polext_base.n_ext_attr2, G_NULL_NUM) <> NVL(polext_draft.n_ext_attr2, G_NULL_NUM)
7258: );
7259:
7260: d_position:=30;
7261: IF (PO_LOG.d_stmt) THEN
7262: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7263: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7264: END IF;
7265:
7258: );
7259:
7260: d_position:=30;
7261: IF (PO_LOG.d_stmt) THEN
7262: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7263: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7264: END IF;
7265:
7266: -- Identify F type of locks required, i.e. if UOM or UNIT_PRICE have changed
7259:
7260: d_position:=30;
7261: IF (PO_LOG.d_stmt) THEN
7262: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7263: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7264: END IF;
7265:
7266: -- Identify F type of locks required, i.e. if UOM or UNIT_PRICE have changed
7267: INSERT INTO po_session_gt(
7317: AND agtu.attribute_category = 'PRICING')
7318: );
7319:
7320: d_position:=40;
7321: IF (PO_LOG.d_stmt) THEN
7322: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7323: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7324: END IF;
7325:
7318: );
7319:
7320: d_position:=40;
7321: IF (PO_LOG.d_stmt) THEN
7322: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7323: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7324: END IF;
7325:
7326: d_position:=50;
7319:
7320: d_position:=40;
7321: IF (PO_LOG.d_stmt) THEN
7322: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7323: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7324: END IF;
7325:
7326: d_position:=50;
7327: IF (PO_LOG.d_proc) THEN
7323: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7324: END IF;
7325:
7326: d_position:=50;
7327: IF (PO_LOG.d_proc) THEN
7328: PO_LOG.proc_end(d_module);
7329: END IF;
7330:
7331: EXCEPTION
7324: END IF;
7325:
7326: d_position:=50;
7327: IF (PO_LOG.d_proc) THEN
7328: PO_LOG.proc_end(d_module);
7329: END IF;
7330:
7331: EXCEPTION
7332: WHEN OTHERS THEN
7329: END IF;
7330:
7331: EXCEPTION
7332: WHEN OTHERS THEN
7333: IF (PO_LOG.d_exc) THEN
7334: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7335: END IF;
7336: RAISE;
7337: END identify_uda_line_locks;
7330:
7331: EXCEPTION
7332: WHEN OTHERS THEN
7333: IF (PO_LOG.d_exc) THEN
7334: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7335: END IF;
7336: RAISE;
7337: END identify_uda_line_locks;
7338:
7367:
7368: BEGIN
7369:
7370: d_position:=0;
7371: IF (PO_LOG.d_proc) THEN
7372: PO_LOG.proc_begin(d_module);
7373: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7374: END IF;
7375: -- Identify Shipment level locks required because of change in po_line_locations_all_ext_b
7368: BEGIN
7369:
7370: d_position:=0;
7371: IF (PO_LOG.d_proc) THEN
7372: PO_LOG.proc_begin(d_module);
7373: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7374: END IF;
7375: -- Identify Shipment level locks required because of change in po_line_locations_all_ext_b
7376: INSERT INTO po_session_gt(
7369:
7370: d_position:=0;
7371: IF (PO_LOG.d_proc) THEN
7372: PO_LOG.proc_begin(d_module);
7373: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7374: END IF;
7375: -- Identify Shipment level locks required because of change in po_line_locations_all_ext_b
7376: INSERT INTO po_session_gt(
7377: key,
7597: WHERE base.attr_group_id = draft.attr_group_id
7598: AND base.p_lock_attrs <> draft.p_lock_attrs;
7599:
7600: d_position:=10;
7601: IF (PO_LOG.d_stmt) THEN
7602: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7603: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7604: END IF;
7605:
7598: AND base.p_lock_attrs <> draft.p_lock_attrs;
7599:
7600: d_position:=10;
7601: IF (PO_LOG.d_stmt) THEN
7602: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7603: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7604: END IF;
7605:
7606: -- When a UDA attribute group does not have any attribute which has default
7599:
7600: d_position:=10;
7601: IF (PO_LOG.d_stmt) THEN
7602: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7603: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7604: END IF;
7605:
7606: -- When a UDA attribute group does not have any attribute which has default
7607: -- value and user also does not enter any attribute value, then records
7639: WHERE base.line_location_id = pllbd.line_location_id
7640: AND base.draft_id = -1
7641: );
7642:
7643: IF (PO_LOG.d_stmt) THEN
7644: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7645: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7646: END IF;
7647:
7640: AND base.draft_id = -1
7641: );
7642:
7643: IF (PO_LOG.d_stmt) THEN
7644: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7645: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7646: END IF;
7647:
7648: -- Identify Shipment level locks required because of change in po_line_locations_all_ext_tl
7641: );
7642:
7643: IF (PO_LOG.d_stmt) THEN
7644: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7645: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7646: END IF;
7647:
7648: -- Identify Shipment level locks required because of change in po_line_locations_all_ext_tl
7649: INSERT INTO po_session_gt(
7773: AND base.language = draft.language
7774: AND base.p_lock_attrs <> draft.p_lock_attrs;
7775:
7776: d_position:=20;
7777: IF (PO_LOG.d_stmt) THEN
7778: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7779: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7780: END IF;
7781: d_position:=30;
7774: AND base.p_lock_attrs <> draft.p_lock_attrs;
7775:
7776: d_position:=20;
7777: IF (PO_LOG.d_stmt) THEN
7778: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7779: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7780: END IF;
7781: d_position:=30;
7782: IF (PO_LOG.d_proc) THEN
7775:
7776: d_position:=20;
7777: IF (PO_LOG.d_stmt) THEN
7778: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7779: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7780: END IF;
7781: d_position:=30;
7782: IF (PO_LOG.d_proc) THEN
7783: PO_LOG.proc_end(d_module);
7778: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
7779: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7780: END IF;
7781: d_position:=30;
7782: IF (PO_LOG.d_proc) THEN
7783: PO_LOG.proc_end(d_module);
7784: END IF;
7785:
7786: EXCEPTION
7779: PO_LOG.stmt(d_module,d_position ,'number of rows Inserted ',SQL%ROWCOUNT);
7780: END IF;
7781: d_position:=30;
7782: IF (PO_LOG.d_proc) THEN
7783: PO_LOG.proc_end(d_module);
7784: END IF;
7785:
7786: EXCEPTION
7787: WHEN OTHERS THEN
7784: END IF;
7785:
7786: EXCEPTION
7787: WHEN OTHERS THEN
7788: IF (PO_LOG.d_exc) THEN
7789: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7790: END IF;
7791: RAISE;
7792: END identify_uda_shipment_locks;
7785:
7786: EXCEPTION
7787: WHEN OTHERS THEN
7788: IF (PO_LOG.d_exc) THEN
7789: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7790: END IF;
7791: RAISE;
7792: END identify_uda_shipment_locks;
7793:
7824: -- Create/Update/Delete locks
7825: -- This is a generic code for all entities
7826: ---------------------------------------------------------------
7827: d_position:=0;
7828: IF (PO_LOG.d_proc) THEN
7829: PO_LOG.proc_begin(d_module);
7830: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7831: END IF;
7832: -- Delete locks for enties being updated for which lock is not required
7825: -- This is a generic code for all entities
7826: ---------------------------------------------------------------
7827: d_position:=0;
7828: IF (PO_LOG.d_proc) THEN
7829: PO_LOG.proc_begin(d_module);
7830: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7831: END IF;
7832: -- Delete locks for enties being updated for which lock is not required
7833: DELETE
7826: ---------------------------------------------------------------
7827: d_position:=0;
7828: IF (PO_LOG.d_proc) THEN
7829: PO_LOG.proc_begin(d_module);
7830: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
7831: END IF;
7832: -- Delete locks for enties being updated for which lock is not required
7833: DELETE
7834: FROM po_entity_locks poel
7854: AND NVL(pogt.char3, G_NULL_CHAR) = NVL(poel.entity_pk3, G_NULL_CHAR)
7855: AND NVL(pogt.char4, G_NULL_CHAR) = NVL(poel.entity_pk4, G_NULL_CHAR)
7856: );
7857: d_position:=10;
7858: IF (PO_LOG.d_stmt) THEN
7859: PO_LOG.stmt(d_module, d_position, 'Number of Rows Deleted',SQL%ROWCOUNT);
7860: END IF;
7861: -- Create/Update lock entries in po_entity_locks
7862: MERGE INTO po_entity_locks lck_tbl
7855: AND NVL(pogt.char4, G_NULL_CHAR) = NVL(poel.entity_pk4, G_NULL_CHAR)
7856: );
7857: d_position:=10;
7858: IF (PO_LOG.d_stmt) THEN
7859: PO_LOG.stmt(d_module, d_position, 'Number of Rows Deleted',SQL%ROWCOUNT);
7860: END IF;
7861: -- Create/Update lock entries in po_entity_locks
7862: MERGE INTO po_entity_locks lck_tbl
7863: USING (
7926: SYSDATE,
7927: fnd_global.user_id);
7928:
7929: d_position:=10;
7930: IF (PO_LOG.d_stmt) THEN
7931: PO_LOG.stmt(d_module, d_position,'Number Of rows Merged',SQL%ROWCOUNT);
7932: END IF;
7933: -- lock the transaction tables records and check for lock compatibilities
7934:
7927: fnd_global.user_id);
7928:
7929: d_position:=10;
7930: IF (PO_LOG.d_stmt) THEN
7931: PO_LOG.stmt(d_module, d_position,'Number Of rows Merged',SQL%ROWCOUNT);
7932: END IF;
7933: -- lock the transaction tables records and check for lock compatibilities
7934:
7935: lock_and_check_compatibility(
7938: x_results =>x_results
7939: );
7940:
7941: d_position:=40;
7942: IF (PO_LOG.d_proc) THEN
7943: PO_LOG.proc_end(d_module);
7944: END IF;
7945: EXCEPTION
7946: WHEN OTHERS THEN
7939: );
7940:
7941: d_position:=40;
7942: IF (PO_LOG.d_proc) THEN
7943: PO_LOG.proc_end(d_module);
7944: END IF;
7945: EXCEPTION
7946: WHEN OTHERS THEN
7947: IF (PO_LOG.d_exc) THEN
7943: PO_LOG.proc_end(d_module);
7944: END IF;
7945: EXCEPTION
7946: WHEN OTHERS THEN
7947: IF (PO_LOG.d_exc) THEN
7948: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7949: END IF;
7950: RAISE;
7951: END create_update_locks;
7944: END IF;
7945: EXCEPTION
7946: WHEN OTHERS THEN
7947: IF (PO_LOG.d_exc) THEN
7948: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
7949: END IF;
7950: RAISE;
7951: END create_update_locks;
7952: --------------------------------------------------------------------------------
7996: x_results := PO_VALIDATION_RESULTS_TYPE.new_instance();
7997: l_lock_by_mod_num_tbl:=PO_TBL_VARCHAR100();
7998:
7999: d_position:=0;
8000: IF (PO_LOG.d_proc) THEN
8001: PO_LOG.proc_begin(d_module);
8002: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8003: END IF;
8004: --------------------------------------------------------------------
7997: l_lock_by_mod_num_tbl:=PO_TBL_VARCHAR100();
7998:
7999: d_position:=0;
8000: IF (PO_LOG.d_proc) THEN
8001: PO_LOG.proc_begin(d_module);
8002: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8003: END IF;
8004: --------------------------------------------------------------------
8005: -- Lock the transaction table entity rows which have been modified
7998:
7999: d_position:=0;
8000: IF (PO_LOG.d_proc) THEN
8001: PO_LOG.proc_begin(d_module);
8002: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8003: END IF;
8004: --------------------------------------------------------------------
8005: -- Lock the transaction table entity rows which have been modified
8006: -- in the current transaction, and rows exists in po_entity_locks
8019: FOR UPDATE;
8020:
8021: d_position:=10;
8022: FOR i in 1..l_entity_id_tbl.COUNT LOOP
8023: IF (PO_LOG.d_stmt) THEN
8024: PO_LOG.stmt(d_module, d_position, 'po_header_id',l_entity_id_tbl(i));
8025: END IF;
8026: END LOOP;
8027:
8020:
8021: d_position:=10;
8022: FOR i in 1..l_entity_id_tbl.COUNT LOOP
8023: IF (PO_LOG.d_stmt) THEN
8024: PO_LOG.stmt(d_module, d_position, 'po_header_id',l_entity_id_tbl(i));
8025: END IF;
8026: END LOOP;
8027:
8028: -- Lock line rows
8038: FOR UPDATE;
8039:
8040: d_position:=20;
8041: FOR i in 1..l_entity_id_tbl.COUNT LOOP
8042: IF (PO_LOG.d_stmt) THEN
8043: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_LINE_ENTITY',l_entity_id_tbl(i));
8044: END IF;
8045: END LOOP;
8046:
8039:
8040: d_position:=20;
8041: FOR i in 1..l_entity_id_tbl.COUNT LOOP
8042: IF (PO_LOG.d_stmt) THEN
8043: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_LINE_ENTITY',l_entity_id_tbl(i));
8044: END IF;
8045: END LOOP;
8046:
8047: -- Lock shipment rows
8056: AND poel.entity_pk1 = poll.line_location_id)
8057: FOR UPDATE;
8058: d_position:=30;
8059: FOR i in 1.. l_entity_id_tbl.COUNT LOOP
8060: IF (PO_LOG.d_stmt) THEN
8061: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_SHIPMENT_ENTITY',l_entity_id_tbl(i));
8062: END IF;
8063: END LOOP;
8064: -- Lock distribution rows
8057: FOR UPDATE;
8058: d_position:=30;
8059: FOR i in 1.. l_entity_id_tbl.COUNT LOOP
8060: IF (PO_LOG.d_stmt) THEN
8061: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_SHIPMENT_ENTITY',l_entity_id_tbl(i));
8062: END IF;
8063: END LOOP;
8064: -- Lock distribution rows
8065: SELECT pod.po_line_id
8073: AND poel.entity_pk1 = pod.po_distribution_id)
8074: FOR UPDATE;
8075: d_position:=40;
8076: FOR i in 1.. l_entity_id_tbl.COUNT LOOP
8077: IF (PO_LOG.d_stmt) THEN
8078: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_DIST_ENTITY',l_entity_id_tbl(i));
8079: END IF;
8080: END LOOP;
8081: ----------------------------------------------------------
8074: FOR UPDATE;
8075: d_position:=40;
8076: FOR i in 1.. l_entity_id_tbl.COUNT LOOP
8077: IF (PO_LOG.d_stmt) THEN
8078: PO_LOG.stmt(d_module, d_position, 'po_line_id and G_LOCK_DIST_ENTITY',l_entity_id_tbl(i));
8079: END IF;
8080: END LOOP;
8081: ----------------------------------------------------------
8082: -- Check for lock incompatibilities and raise exceptions.
8106: AND comp.is_compatible = 'I'
8107: AND poel_oth.lock_by_draft_id = pod.draft_id;
8108:
8109: d_position:=50;
8110: IF (PO_LOG.d_stmt) THEN
8111: FOR i in 1..l_err_entity_tbl.COUNT LOOP
8112: PO_LOG.stmt(d_module, d_position, 'entity_name',l_err_entity_tbl(i));
8113: PO_LOG.stmt(d_module, d_position, 'entity_pk1',l_err_pk1_tbl(i));
8114: PO_LOG.stmt(d_module, d_position, 'modification_number',l_lock_by_mod_num_tbl(i));
8108:
8109: d_position:=50;
8110: IF (PO_LOG.d_stmt) THEN
8111: FOR i in 1..l_err_entity_tbl.COUNT LOOP
8112: PO_LOG.stmt(d_module, d_position, 'entity_name',l_err_entity_tbl(i));
8113: PO_LOG.stmt(d_module, d_position, 'entity_pk1',l_err_pk1_tbl(i));
8114: PO_LOG.stmt(d_module, d_position, 'modification_number',l_lock_by_mod_num_tbl(i));
8115: END LOOP;
8116: END IF;
8109: d_position:=50;
8110: IF (PO_LOG.d_stmt) THEN
8111: FOR i in 1..l_err_entity_tbl.COUNT LOOP
8112: PO_LOG.stmt(d_module, d_position, 'entity_name',l_err_entity_tbl(i));
8113: PO_LOG.stmt(d_module, d_position, 'entity_pk1',l_err_pk1_tbl(i));
8114: PO_LOG.stmt(d_module, d_position, 'modification_number',l_lock_by_mod_num_tbl(i));
8115: END LOOP;
8116: END IF;
8117:
8110: IF (PO_LOG.d_stmt) THEN
8111: FOR i in 1..l_err_entity_tbl.COUNT LOOP
8112: PO_LOG.stmt(d_module, d_position, 'entity_name',l_err_entity_tbl(i));
8113: PO_LOG.stmt(d_module, d_position, 'entity_pk1',l_err_pk1_tbl(i));
8114: PO_LOG.stmt(d_module, d_position, 'modification_number',l_lock_by_mod_num_tbl(i));
8115: END LOOP;
8116: END IF;
8117:
8118: -- For each incompatible lock, add an error message to the fnd message stack
8154: x_return_status := FND_API.G_RET_STS_ERROR;
8155: END LOOP;
8156:
8157: d_position:=60;
8158: IF (PO_LOG.d_proc) THEN
8159: PO_LOG.proc_end(d_module);
8160: END IF;
8161: EXCEPTION
8162: WHEN OTHERS THEN
8155: END LOOP;
8156:
8157: d_position:=60;
8158: IF (PO_LOG.d_proc) THEN
8159: PO_LOG.proc_end(d_module);
8160: END IF;
8161: EXCEPTION
8162: WHEN OTHERS THEN
8163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8160: END IF;
8161: EXCEPTION
8162: WHEN OTHERS THEN
8163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8164: IF (PO_LOG.d_exc) THEN
8165: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
8166: END IF;
8167: RAISE;
8168: END lock_and_check_compatibility;
8161: EXCEPTION
8162: WHEN OTHERS THEN
8163: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8164: IF (PO_LOG.d_exc) THEN
8165: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
8166: END IF;
8167: RAISE;
8168: END lock_and_check_compatibility;
8169:
8216: FROM fnd_document_categories
8217: WHERE application_id = 201 AND name = 'CUSTOM5340'
8218: );
8219: BEGIN
8220: IF (PO_LOG.d_proc) THEN
8221: PO_LOG.proc_begin(d_module);
8222: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8223: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
8224: END IF;
8217: WHERE application_id = 201 AND name = 'CUSTOM5340'
8218: );
8219: BEGIN
8220: IF (PO_LOG.d_proc) THEN
8221: PO_LOG.proc_begin(d_module);
8222: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8223: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
8224: END IF;
8225:
8218: );
8219: BEGIN
8220: IF (PO_LOG.d_proc) THEN
8221: PO_LOG.proc_begin(d_module);
8222: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8223: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
8224: END IF;
8225:
8226: d_position := 10;
8219: BEGIN
8220: IF (PO_LOG.d_proc) THEN
8221: PO_LOG.proc_begin(d_module);
8222: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
8223: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
8224: END IF;
8225:
8226: d_position := 10;
8227:
8239: );
8240:
8241: d_position := 20;
8242:
8243: IF (PO_LOG.d_stmt) THEN
8244: PO_LOG.stmt(d_module,d_position ,'Check Uda enabled returned ',l_enabled_flag);
8245: END IF;
8246:
8247: PO_MOD_SYNC_PROCESS_PVT.sync_headers
8240:
8241: d_position := 20;
8242:
8243: IF (PO_LOG.d_stmt) THEN
8244: PO_LOG.stmt(d_module,d_position ,'Check Uda enabled returned ',l_enabled_flag);
8245: END IF;
8246:
8247: PO_MOD_SYNC_PROCESS_PVT.sync_headers
8248: (
8259: WHERE pel.entity_pk1 = p_po_header_id
8260: AND pel.lock_by_draft_id = p_draft_id
8261: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY, PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY,G_LOCK_HEADER_ATTACH_ENTITY);
8262:
8263: IF (PO_LOG.d_stmt) THEN
8264: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8265: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8266: END IF;
8267:
8260: AND pel.lock_by_draft_id = p_draft_id
8261: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY, PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY,G_LOCK_HEADER_ATTACH_ENTITY);
8262:
8263: IF (PO_LOG.d_stmt) THEN
8264: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8265: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8266: END IF;
8267:
8268:
8261: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_ADDRESS_ENTITY, PO_DRAFTS_PVT.G_LOCK_HEADER_ENTITY,G_LOCK_HEADER_ATTACH_ENTITY);
8262:
8263: IF (PO_LOG.d_stmt) THEN
8264: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8265: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8266: END IF;
8267:
8268:
8269: -- Bug 13938456
8292: x_return_status := FND_API.G_RET_STS_SUCCESS;
8293: EXCEPTION
8294: WHEN OTHERS THEN
8295: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8296: IF (PO_LOG.d_exc) THEN
8297: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8298: END IF;
8299: RAISE;
8300: END revert_header_action;
8293: EXCEPTION
8294: WHEN OTHERS THEN
8295: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8296: IF (PO_LOG.d_exc) THEN
8297: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8298: END IF;
8299: RAISE;
8300: END revert_header_action;
8301:
8330: d_position NUMBER;
8331: l_par_dist_tbl PO_TBL_NUMBER;
8332: BEGIN
8333:
8334: IF (PO_LOG.d_proc) THEN
8335: PO_LOG.proc_begin(d_module);
8336: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8337: PO_LOG.proc_begin(d_module, 'po_dest_line_ids_tbl', po_dest_line_ids_tbl);
8338: END IF;
8331: l_par_dist_tbl PO_TBL_NUMBER;
8332: BEGIN
8333:
8334: IF (PO_LOG.d_proc) THEN
8335: PO_LOG.proc_begin(d_module);
8336: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8337: PO_LOG.proc_begin(d_module, 'po_dest_line_ids_tbl', po_dest_line_ids_tbl);
8338: END IF;
8339:
8332: BEGIN
8333:
8334: IF (PO_LOG.d_proc) THEN
8335: PO_LOG.proc_begin(d_module);
8336: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8337: PO_LOG.proc_begin(d_module, 'po_dest_line_ids_tbl', po_dest_line_ids_tbl);
8338: END IF;
8339:
8340: d_position := 10;
8333:
8334: IF (PO_LOG.d_proc) THEN
8335: PO_LOG.proc_begin(d_module);
8336: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8337: PO_LOG.proc_begin(d_module, 'po_dest_line_ids_tbl', po_dest_line_ids_tbl);
8338: END IF;
8339:
8340: d_position := 10;
8341:
8360: WHERE pel.entity_pk1 = po_dest_line_ids_tbl(itr)
8361: AND pel.lock_by_draft_id = p_po_draft_id
8362: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY;
8363:
8364: IF (PO_LOG.d_stmt) THEN
8365: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8366: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8367: END IF;
8368: x_return_status := FND_API.G_RET_STS_SUCCESS;
8361: AND pel.lock_by_draft_id = p_po_draft_id
8362: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY;
8363:
8364: IF (PO_LOG.d_stmt) THEN
8365: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8366: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8367: END IF;
8368: x_return_status := FND_API.G_RET_STS_SUCCESS;
8369:
8362: AND pel.entity_name = PO_DRAFTS_PVT.G_LOCK_DIST_ENTITY;
8363:
8364: IF (PO_LOG.d_stmt) THEN
8365: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8366: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8367: END IF;
8368: x_return_status := FND_API.G_RET_STS_SUCCESS;
8369:
8370: EXCEPTION
8369:
8370: EXCEPTION
8371: WHEN OTHERS THEN
8372: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8373: IF (PO_LOG.d_exc) THEN
8374: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8375: END IF;
8376: RAISE;
8377: END revert_dist_action;
8370: EXCEPTION
8371: WHEN OTHERS THEN
8372: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8373: IF (PO_LOG.d_exc) THEN
8374: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8375: END IF;
8376: RAISE;
8377: END revert_dist_action;
8378:
8402: BEGIN
8403:
8404: d_position := 10;
8405:
8406: IF (PO_LOG.d_proc) THEN
8407: PO_LOG.proc_begin(d_module);
8408: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8409: PO_LOG.proc_begin(d_module, 'po_ship_ids_tbl', po_ship_ids_tbl);
8410: END IF;
8403:
8404: d_position := 10;
8405:
8406: IF (PO_LOG.d_proc) THEN
8407: PO_LOG.proc_begin(d_module);
8408: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8409: PO_LOG.proc_begin(d_module, 'po_ship_ids_tbl', po_ship_ids_tbl);
8410: END IF;
8411:
8404: d_position := 10;
8405:
8406: IF (PO_LOG.d_proc) THEN
8407: PO_LOG.proc_begin(d_module);
8408: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8409: PO_LOG.proc_begin(d_module, 'po_ship_ids_tbl', po_ship_ids_tbl);
8410: END IF;
8411:
8412: SELECT po_distribution_id
8405:
8406: IF (PO_LOG.d_proc) THEN
8407: PO_LOG.proc_begin(d_module);
8408: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8409: PO_LOG.proc_begin(d_module, 'po_ship_ids_tbl', po_ship_ids_tbl);
8410: END IF;
8411:
8412: SELECT po_distribution_id
8413: BULK COLLECT INTO po_distribution_id_tbl
8426: WHERE pel.entity_pk1 = po_ship_ids_tbl(itr)
8427: AND pel.lock_by_draft_id = p_po_draft_id
8428: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY,PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ATTACH_ENTITY);
8429:
8430: IF (PO_LOG.d_stmt) THEN
8431: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8432: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8433: END IF;
8434:
8427: AND pel.lock_by_draft_id = p_po_draft_id
8428: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY,PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ATTACH_ENTITY);
8429:
8430: IF (PO_LOG.d_stmt) THEN
8431: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8432: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8433: END IF;
8434:
8435: FORALL itr IN 1..po_ship_ids_tbl.Count
8428: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ENTITY,PO_DRAFTS_PVT.G_LOCK_SHIPMENT_ATTACH_ENTITY);
8429:
8430: IF (PO_LOG.d_stmt) THEN
8431: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8432: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8433: END IF;
8434:
8435: FORALL itr IN 1..po_ship_ids_tbl.Count
8436: DELETE
8470:
8471: EXCEPTION
8472: WHEN OTHERS THEN
8473: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8474: IF (PO_LOG.d_exc) THEN
8475: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8476: END IF;
8477: RAISE;
8478: END revert_shipment_action;
8471: EXCEPTION
8472: WHEN OTHERS THEN
8473: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8474: IF (PO_LOG.d_exc) THEN
8475: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8476: END IF;
8477: RAISE;
8478: END revert_shipment_action;
8479:
8504:
8505: BEGIN
8506:
8507: d_position := 10;
8508: IF (PO_LOG.d_proc) THEN
8509: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8510: PO_LOG.proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
8511: END IF;
8512:
8505: BEGIN
8506:
8507: d_position := 10;
8508: IF (PO_LOG.d_proc) THEN
8509: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8510: PO_LOG.proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
8511: END IF;
8512:
8513: SELECT line_location_id
8506:
8507: d_position := 10;
8508: IF (PO_LOG.d_proc) THEN
8509: PO_LOG.proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
8510: PO_LOG.proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
8511: END IF;
8512:
8513: SELECT line_location_id
8514: BULK COLLECT INTO po_line_location_id_tbl
8541: WHERE pel.entity_pk1 = po_line_ids_tbl(i)
8542: AND pel.lock_by_draft_id = p_po_draft_id
8543: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY,PO_DRAFTS_PVT.G_LOCK_LINE_ATTACH_ENTITY);
8544:
8545: IF (PO_LOG.d_stmt) THEN
8546: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8547: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8548: END IF;
8549:
8542: AND pel.lock_by_draft_id = p_po_draft_id
8543: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY,PO_DRAFTS_PVT.G_LOCK_LINE_ATTACH_ENTITY);
8544:
8545: IF (PO_LOG.d_stmt) THEN
8546: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8547: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8548: END IF;
8549:
8550: FORALL i IN 1..po_line_ids_tbl.Count()
8543: AND pel.entity_name IN (PO_DRAFTS_PVT.G_LOCK_LINE_ENTITY,PO_DRAFTS_PVT.G_LOCK_LINE_ATTACH_ENTITY);
8544:
8545: IF (PO_LOG.d_stmt) THEN
8546: PO_LOG.stmt(d_module,d_position ,'Deleted po_entity_locks');
8547: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8548: END IF;
8549:
8550: FORALL i IN 1..po_line_ids_tbl.Count()
8551: DELETE
8601:
8602: EXCEPTION
8603: WHEN OTHERS THEN
8604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8605: IF (PO_LOG.d_exc) THEN
8606: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8607: END IF;
8608: RAISE;
8609: END revert_line_action;
8602: EXCEPTION
8603: WHEN OTHERS THEN
8604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8605: IF (PO_LOG.d_exc) THEN
8606: PO_LOG.exc(d_module,SQLCODE || SQLERRM);
8607: END IF;
8608: RAISE;
8609: END revert_line_action;
8610:
8627: d_position NUMBER :=0;
8628:
8629: BEGIN
8630:
8631: IF (PO_LOG.d_stmt) THEN
8632: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8633: END IF;
8634:
8635: --delete line data
8628:
8629: BEGIN
8630:
8631: IF (PO_LOG.d_stmt) THEN
8632: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8633: END IF;
8634:
8635: --delete line data
8636: SELECT po_line_id
8656: -- If any deleted Mod lines found, send the linked requisitions back to pool
8657: -- if entire Clin-Slin structure eligible.
8658: IF (l_line_id_tbl.Count > 0) THEN
8659:
8660: IF (PO_LOG.d_stmt) THEN
8661: PO_LOG.stmt(d_module, d_position, 'Deleted Lines Found');
8662: END IF;
8663: -- This will update the linked_po_count of the linked requisitions to these deleted
8664: -- Info and Option lines.
8657: -- if entire Clin-Slin structure eligible.
8658: IF (l_line_id_tbl.Count > 0) THEN
8659:
8660: IF (PO_LOG.d_stmt) THEN
8661: PO_LOG.stmt(d_module, d_position, 'Deleted Lines Found');
8662: END IF;
8663: -- This will update the linked_po_count of the linked requisitions to these deleted
8664: -- Info and Option lines.
8665: PO_REQ_LINES_SV.update_req_for_linked_po_count (l_line_id_tbl, 'LINE');
8699: l_line_id_tbl(i)||'-'||p_draft_id,
8700: '', '', '', '', '');
8701: END LOOP;
8702:
8703: IF (PO_LOG.d_stmt) THEN
8704: PO_LOG.proc_end(d_module, 'Deleted line id(s): ', l_line_id_tbl);
8705: END IF;
8706:
8707: END delete_marked_lines;
8700: '', '', '', '', '');
8701: END LOOP;
8702:
8703: IF (PO_LOG.d_stmt) THEN
8704: PO_LOG.proc_end(d_module, 'Deleted line id(s): ', l_line_id_tbl);
8705: END IF;
8706:
8707: END delete_marked_lines;
8708:
8722: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
8723:
8724: BEGIN
8725:
8726: IF (PO_LOG.d_stmt) THEN
8727: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8728: END IF;
8729:
8730: --delete line location data
8723:
8724: BEGIN
8725:
8726: IF (PO_LOG.d_stmt) THEN
8727: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8728: END IF;
8729:
8730: --delete line location data
8731: SELECT line_location_id
8763: '', '', '', '', '');
8764: END LOOP;
8765:
8766:
8767: IF (PO_LOG.d_stmt) THEN
8768: PO_LOG.proc_end(d_module, 'Deleted shipment id(s): ', l_line_loc_id_tbl);
8769: END IF;
8770: END delete_marked_shipments;
8771:
8764: END LOOP;
8765:
8766:
8767: IF (PO_LOG.d_stmt) THEN
8768: PO_LOG.proc_end(d_module, 'Deleted shipment id(s): ', l_line_loc_id_tbl);
8769: END IF;
8770: END delete_marked_shipments;
8771:
8772:
8781: d_api_name CONSTANT VARCHAR2(30) := 'delete_marked_distributions';
8782: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
8783: BEGIN
8784:
8785: IF (PO_LOG.d_stmt) THEN
8786: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8787: END IF;
8788:
8789: -- delete distributions data
8782: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
8783: BEGIN
8784:
8785: IF (PO_LOG.d_stmt) THEN
8786: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8787: END IF;
8788:
8789: -- delete distributions data
8790: SELECT po_distribution_id
8809: DELETE FROM po_distributions_draft_all
8810: WHERE po_distribution_id = l_distribution_id_tbl(i)
8811: AND draft_id = p_draft_id;
8812:
8813: IF (PO_LOG.d_stmt) THEN
8814: PO_LOG.proc_end(d_module, 'Deleted distribution id(s): ', l_distribution_id_tbl);
8815: END IF;
8816: END delete_marked_distributions;
8817:
8810: WHERE po_distribution_id = l_distribution_id_tbl(i)
8811: AND draft_id = p_draft_id;
8812:
8813: IF (PO_LOG.d_stmt) THEN
8814: PO_LOG.proc_end(d_module, 'Deleted distribution id(s): ', l_distribution_id_tbl);
8815: END IF;
8816: END delete_marked_distributions;
8817:
8818:
8889: d_position NUMBER :=0;
8890:
8891: BEGIN
8892:
8893: IF (PO_LOG.d_stmt) THEN
8894: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8895: END IF;
8896:
8897: --Delete extra PRICING attribute record from po_lines_all_ext_b
8890:
8891: BEGIN
8892:
8893: IF (PO_LOG.d_stmt) THEN
8894: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
8895: END IF;
8896:
8897: --Delete extra PRICING attribute record from po_lines_all_ext_b
8898: DELETE FROM po_lines_all_ext_b ple
8915: )
8916: AND ple.attr_group_id = ptu.attribute_group_id
8917: );
8918:
8919: IF (PO_LOG.d_stmt) THEN
8920: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_b');
8921: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8922: END IF;
8923:
8916: AND ple.attr_group_id = ptu.attribute_group_id
8917: );
8918:
8919: IF (PO_LOG.d_stmt) THEN
8920: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_b');
8921: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8922: END IF;
8923:
8924: d_position := 10;
8917: );
8918:
8919: IF (PO_LOG.d_stmt) THEN
8920: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_b');
8921: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8922: END IF;
8923:
8924: d_position := 10;
8925: --Delete extra PRICING attribute record from po_lines_all_ext_tl
8943: Nvl(ptu.attribute2, '*') <> Nvl(plm.contract_type, '*')
8944: )
8945: AND ple.attr_group_id = ptu.attribute_group_id
8946: );
8947: IF (PO_LOG.d_stmt) THEN
8948: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_tl');
8949: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8950: END IF;
8951:
8944: )
8945: AND ple.attr_group_id = ptu.attribute_group_id
8946: );
8947: IF (PO_LOG.d_stmt) THEN
8948: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_tl');
8949: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8950: END IF;
8951:
8952: d_position := 20;
8945: AND ple.attr_group_id = ptu.attribute_group_id
8946: );
8947: IF (PO_LOG.d_stmt) THEN
8948: PO_LOG.stmt(d_module,d_position ,'Deleted extra prcing uda records from po_lines_all_ext_tl');
8949: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8950: END IF;
8951:
8952: d_position := 20;
8953: --Delete extra FORMS attribute record from po_headers_all_ext_b
8963: AND ptu.template_id = phm.uda_template_id
8964: AND Nvl(ptu.attribute1, '*') <> Nvl(phm.clm_standard_form, '*')
8965: AND phe.attr_group_id = ptu.attribute_group_id
8966: );
8967: IF (PO_LOG.d_stmt) THEN
8968: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_b');
8969: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8970: END IF;
8971:
8964: AND Nvl(ptu.attribute1, '*') <> Nvl(phm.clm_standard_form, '*')
8965: AND phe.attr_group_id = ptu.attribute_group_id
8966: );
8967: IF (PO_LOG.d_stmt) THEN
8968: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_b');
8969: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8970: END IF;
8971:
8972: d_position := 30;
8965: AND phe.attr_group_id = ptu.attribute_group_id
8966: );
8967: IF (PO_LOG.d_stmt) THEN
8968: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_b');
8969: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8970: END IF;
8971:
8972: d_position := 30;
8973: --Delete extra FORMS attribute record from po_headers_all_ext_tl
8983: AND ptu.template_id = phm.uda_template_id
8984: AND Nvl(ptu.attribute1, '*') <> Nvl(phm.clm_standard_form, '*')
8985: AND phe.attr_group_id = ptu.attribute_group_id
8986: );
8987: IF (PO_LOG.d_stmt) THEN
8988: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_tl');
8989: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8990: END IF;
8991:
8984: AND Nvl(ptu.attribute1, '*') <> Nvl(phm.clm_standard_form, '*')
8985: AND phe.attr_group_id = ptu.attribute_group_id
8986: );
8987: IF (PO_LOG.d_stmt) THEN
8988: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_tl');
8989: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8990: END IF;
8991:
8992: d_position := 40;
8985: AND phe.attr_group_id = ptu.attribute_group_id
8986: );
8987: IF (PO_LOG.d_stmt) THEN
8988: PO_LOG.stmt(d_module,d_position ,'Deleted extra forms uda records from po_headers_all_ext_tl');
8989: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8990: END IF;
8991:
8992: d_position := 40;
8993: IF (PO_LOG.d_stmt) THEN
8989: PO_LOG.stmt(d_module,d_position ,'number of rows deleted ',SQL%ROWCOUNT);
8990: END IF;
8991:
8992: d_position := 40;
8993: IF (PO_LOG.d_stmt) THEN
8994: PO_LOG.proc_end(d_module);
8995: END IF;
8996:
8997: END clean_up_extra_uda;
8990: END IF;
8991:
8992: d_position := 40;
8993: IF (PO_LOG.d_stmt) THEN
8994: PO_LOG.proc_end(d_module);
8995: END IF;
8996:
8997: END clean_up_extra_uda;
8998:
9070: d_module CONSTANT VARCHAR2(100) := d_pkg_name || d_api_name || '.';
9071: d_position NUMBER :=0;
9072: BEGIN
9073:
9074: IF (PO_LOG.d_stmt) THEN
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9071: d_position NUMBER :=0;
9072: BEGIN
9073:
9074: IF (PO_LOG.d_stmt) THEN
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9072: BEGIN
9073:
9074: IF (PO_LOG.d_stmt) THEN
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9073:
9074: IF (PO_LOG.d_stmt) THEN
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9074: IF (PO_LOG.d_stmt) THEN
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9075: PO_LOG.proc_begin(d_module, 'p_lock_entity_name: ', p_lock_entity_name);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9083: PO_LOG.proc_begin(d_module, 'p_orig_attach_doc_id: ', p_orig_attach_doc_id);
9076: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk1: ', p_lock_entity_pk1);
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9083: PO_LOG.proc_begin(d_module, 'p_orig_attach_doc_id: ', p_orig_attach_doc_id);
9084: END IF;
9077: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk3: ', p_lock_entity_pk3);
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9083: PO_LOG.proc_begin(d_module, 'p_orig_attach_doc_id: ', p_orig_attach_doc_id);
9084: END IF;
9085:
9078: PO_LOG.proc_begin(d_module, 'p_lock_entity_pk4: ', p_lock_entity_pk4);
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9083: PO_LOG.proc_begin(d_module, 'p_orig_attach_doc_id: ', p_orig_attach_doc_id);
9084: END IF;
9085:
9086: INSERT INTO po_entity_locks(
9079: PO_LOG.proc_begin(d_module, 'p_lock_by_draft_id: ', p_lock_by_draft_id);
9080: PO_LOG.proc_begin(d_module, 'p_lock_type: ', p_lock_type);
9081: PO_LOG.proc_begin(d_module, 'p_from_entity_name: ', p_from_entity_name);
9082: PO_LOG.proc_begin(d_module, 'p_to_entity_name: ', p_to_entity_name);
9083: PO_LOG.proc_begin(d_module, 'p_orig_attach_doc_id: ', p_orig_attach_doc_id);
9084: END IF;
9085:
9086: INSERT INTO po_entity_locks(
9087: po_entity_lock_id,
9113: SYSDATE,
9114: fnd_global.user_id
9115: );
9116:
9117: IF (PO_LOG.d_proc) THEN
9118: PO_LOG.proc_end(d_module, 'number of rows updated', SQL%ROWCOUNT);
9119: END IF;
9120:
9121: fnd_attached_documents2_pkg.copy_attachments
9114: fnd_global.user_id
9115: );
9116:
9117: IF (PO_LOG.d_proc) THEN
9118: PO_LOG.proc_end(d_module, 'number of rows updated', SQL%ROWCOUNT);
9119: END IF;
9120:
9121: fnd_attached_documents2_pkg.copy_attachments
9122: ( X_from_entity_name => p_from_entity_name,
9125: X_to_pk1_value => p_lock_entity_pk1 || '-' || TO_CHAR(p_lock_by_draft_id),
9126: X_orig_attach_doc_id =>p_orig_attach_doc_id
9127: );
9128:
9129: IF (PO_LOG.d_stmt) THEN
9130: PO_LOG.proc_end(d_module);
9131: END IF;
9132:
9133: END;
9126: X_orig_attach_doc_id =>p_orig_attach_doc_id
9127: );
9128:
9129: IF (PO_LOG.d_stmt) THEN
9130: PO_LOG.proc_end(d_module);
9131: END IF;
9132:
9133: END;
9134:
9168:
9169:
9170: BEGIN
9171:
9172: IF (PO_LOG.d_stmt) THEN
9173: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
9174: PO_LOG.proc_begin(d_module, 'p_po_header_id: ', p_po_header_id);
9175: PO_LOG.proc_begin(d_module, 'p_revision_num: ', p_revision_num);
9176: END IF;
9169:
9170: BEGIN
9171:
9172: IF (PO_LOG.d_stmt) THEN
9173: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
9174: PO_LOG.proc_begin(d_module, 'p_po_header_id: ', p_po_header_id);
9175: PO_LOG.proc_begin(d_module, 'p_revision_num: ', p_revision_num);
9176: END IF;
9177:
9170: BEGIN
9171:
9172: IF (PO_LOG.d_stmt) THEN
9173: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
9174: PO_LOG.proc_begin(d_module, 'p_po_header_id: ', p_po_header_id);
9175: PO_LOG.proc_begin(d_module, 'p_revision_num: ', p_revision_num);
9176: END IF;
9177:
9178: -- Fecth all the newly created elins of Mod and Award, that does not already exists in our exhibit table
9171:
9172: IF (PO_LOG.d_stmt) THEN
9173: PO_LOG.proc_begin(d_module, 'p_draft_id: ', p_draft_id);
9174: PO_LOG.proc_begin(d_module, 'p_po_header_id: ', p_po_header_id);
9175: PO_LOG.proc_begin(d_module, 'p_revision_num: ', p_revision_num);
9176: END IF;
9177:
9178: -- Fecth all the newly created elins of Mod and Award, that does not already exists in our exhibit table
9179: SELECT DISTINCT
9198:
9199:
9200: d_position := 5;
9201:
9202: IF (PO_LOG.d_stmt) THEN
9203: PO_LOG.stmt(d_module,d_position ,'Fetched the new exhibit details',clm_exhibit_name_tbl.count);
9204: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9205: END IF;
9206:
9199:
9200: d_position := 5;
9201:
9202: IF (PO_LOG.d_stmt) THEN
9203: PO_LOG.stmt(d_module,d_position ,'Fetched the new exhibit details',clm_exhibit_name_tbl.count);
9204: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9205: END IF;
9206:
9207: -- Insert the exhibits that are created in document but does not exist in the PO_EXHIBIT_DETAILS
9200: d_position := 5;
9201:
9202: IF (PO_LOG.d_stmt) THEN
9203: PO_LOG.stmt(d_module,d_position ,'Fetched the new exhibit details',clm_exhibit_name_tbl.count);
9204: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9205: END IF;
9206:
9207: -- Insert the exhibits that are created in document but does not exist in the PO_EXHIBIT_DETAILS
9208: FORALL idx IN 1..clm_exhibit_name_tbl.Count
9243:
9244:
9245: d_position := 10;
9246:
9247: IF (PO_LOG.d_stmt) THEN
9248: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9249: END IF;
9250:
9251: SELECT DISTINCT
9244:
9245: d_position := 10;
9246:
9247: IF (PO_LOG.d_stmt) THEN
9248: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9249: END IF;
9250:
9251: SELECT DISTINCT
9252: po_exhibit_details_id,
9274: WHERE pl.po_line_id = pd.po_line_id
9275: AND NVL(pd.delete_flag, 'N') = 'Y')
9276: );
9277:
9278: IF (PO_LOG.d_stmt) THEN
9279: PO_LOG.stmt(d_module,d_position ,'Fetched the exhibit details for deletion',po_exhibit_details_id_tbl.count);
9280: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9281: END IF;
9282:
9275: AND NVL(pd.delete_flag, 'N') = 'Y')
9276: );
9277:
9278: IF (PO_LOG.d_stmt) THEN
9279: PO_LOG.stmt(d_module,d_position ,'Fetched the exhibit details for deletion',po_exhibit_details_id_tbl.count);
9280: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9281: END IF;
9282:
9283: -- Delete the exhibits that does not exists in document but exist in the PO_EXHIBIT_DETAILS
9276: );
9277:
9278: IF (PO_LOG.d_stmt) THEN
9279: PO_LOG.stmt(d_module,d_position ,'Fetched the exhibit details for deletion',po_exhibit_details_id_tbl.count);
9280: PO_LOG.stmt(d_module,d_position ,'number of rows selected ',SQL%ROWCOUNT);
9281: END IF;
9282:
9283: -- Delete the exhibits that does not exists in document but exist in the PO_EXHIBIT_DETAILS
9284: FORALL idx IN 1..po_exhibit_details_id_tbl.Count
9319: );
9320:
9321: d_position := 20;
9322:
9323: IF (PO_LOG.d_stmt) THEN
9324: PO_LOG.stmt(d_module,d_position ,'number of rows inserted for deletion ',SQL%ROWCOUNT);
9325: END IF;
9326:
9327: UPDATE po_exhibit_details_draft ex
9320:
9321: d_position := 20;
9322:
9323: IF (PO_LOG.d_stmt) THEN
9324: PO_LOG.stmt(d_module,d_position ,'number of rows inserted for deletion ',SQL%ROWCOUNT);
9325: END IF;
9326:
9327: UPDATE po_exhibit_details_draft ex
9328: SET ex.delete_flag = 'Y'
9327: UPDATE po_exhibit_details_draft ex
9328: SET ex.delete_flag = 'Y'
9329: WHERE ex.po_exhibit_details_id IN (SELECT column_value FROM TABLE(po_exhibit_details_id_tbl));
9330:
9331: IF (PO_LOG.d_stmt) THEN
9332: PO_LOG.stmt(d_module,d_position ,'number of rows set for deletion ',SQL%ROWCOUNT);
9333: END IF;
9334:
9335: d_position := 30;
9328: SET ex.delete_flag = 'Y'
9329: WHERE ex.po_exhibit_details_id IN (SELECT column_value FROM TABLE(po_exhibit_details_id_tbl));
9330:
9331: IF (PO_LOG.d_stmt) THEN
9332: PO_LOG.stmt(d_module,d_position ,'number of rows set for deletion ',SQL%ROWCOUNT);
9333: END IF;
9334:
9335: d_position := 30;
9336: IF (PO_LOG.d_stmt) THEN
9332: PO_LOG.stmt(d_module,d_position ,'number of rows set for deletion ',SQL%ROWCOUNT);
9333: END IF;
9334:
9335: d_position := 30;
9336: IF (PO_LOG.d_stmt) THEN
9337: PO_LOG.proc_end(d_module);
9338: END IF;
9339:
9340: END modify_exhibit_details;
9333: END IF;
9334:
9335: d_position := 30;
9336: IF (PO_LOG.d_stmt) THEN
9337: PO_LOG.proc_end(d_module);
9338: END IF;
9339:
9340: END modify_exhibit_details;
9341:
9406: l_isucaenabled VARCHAR2(1) := 'N';
9407: BEGIN
9408: d_position := 10;
9409:
9410: IF ( po_log.d_proc ) THEN
9411: po_log.Proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
9412:
9413: po_log.Proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
9414: END IF;
9407: BEGIN
9408: d_position := 10;
9409:
9410: IF ( po_log.d_proc ) THEN
9411: po_log.Proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
9412:
9413: po_log.Proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
9414: END IF;
9415: IF po_line_ids_tbl IS NOT NULL AND po_line_ids_tbl.count() > 0 THEN
9409:
9410: IF ( po_log.d_proc ) THEN
9411: po_log.Proc_begin(d_module, 'p_po_draft_id', p_po_draft_id);
9412:
9413: po_log.Proc_begin(d_module, 'po_line_ids_tbl', po_line_ids_tbl);
9414: END IF;
9415: IF po_line_ids_tbl IS NOT NULL AND po_line_ids_tbl.count() > 0 THEN
9416: SELECT
9417: Nvl(po_core_s.Retrieveoptionvalue(org_id, po_core_s.g_undef_cont_act_col),
9438: WHERE po_line_id = Po_line_ids_tbl(ucaindex)
9439: AND ( def_draft_id = p_po_draft_id
9440: OR def_par_draft_id = p_po_draft_id );
9441: END IF;
9442: IF (PO_LOG.d_stmt) THEN
9443: PO_LOG.proc_end(d_module);
9444: END IF;
9445: d_position := 20;
9446: EXCEPTION
9439: AND ( def_draft_id = p_po_draft_id
9440: OR def_par_draft_id = p_po_draft_id );
9441: END IF;
9442: IF (PO_LOG.d_stmt) THEN
9443: PO_LOG.proc_end(d_module);
9444: END IF;
9445: d_position := 20;
9446: EXCEPTION
9447: WHEN OTHERS THEN
9444: END IF;
9445: d_position := 20;
9446: EXCEPTION
9447: WHEN OTHERS THEN
9448: IF (PO_LOG.d_stmt) THEN
9449: PO_LOG.stmt(d_module, d_position, 'Exception While deleting Line ucas'
9450: ||SQLCODE||' -ERROR- '||SQLERRM );
9451: END IF;
9452: END delete_line_ucas;
9445: d_position := 20;
9446: EXCEPTION
9447: WHEN OTHERS THEN
9448: IF (PO_LOG.d_stmt) THEN
9449: PO_LOG.stmt(d_module, d_position, 'Exception While deleting Line ucas'
9450: ||SQLCODE||' -ERROR- '||SQLERRM );
9451: END IF;
9452: END delete_line_ucas;
9453:
9486:
9487: BEGIN
9488:
9489: d_position:=0;
9490: IF (PO_LOG.d_proc) THEN
9491: PO_LOG.proc_begin(d_module);
9492: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
9493: END IF;
9494:
9487: BEGIN
9488:
9489: d_position:=0;
9490: IF (PO_LOG.d_proc) THEN
9491: PO_LOG.proc_begin(d_module);
9492: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
9493: END IF;
9494:
9495: -- Insert Exhibit level locks required into gt table
9488:
9489: d_position:=0;
9490: IF (PO_LOG.d_proc) THEN
9491: PO_LOG.proc_begin(d_module);
9492: PO_LOG.proc_begin(d_module, 'p_draft_id', p_draft_id);
9493: END IF;
9494:
9495: -- Insert Exhibit level locks required into gt table
9496: INSERT INTO po_session_gt(
9539: AND base.p_lock_attrs <> draft.p_lock_attrs;
9540:
9541:
9542: d_position:=10;
9543: IF (PO_LOG.d_stmt) THEN
9544: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
9545: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
9546: END IF;
9547:
9540:
9541:
9542: d_position:=10;
9543: IF (PO_LOG.d_stmt) THEN
9544: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
9545: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
9546: END IF;
9547:
9548: d_position:=40;
9541:
9542: d_position:=10;
9543: IF (PO_LOG.d_stmt) THEN
9544: PO_LOG.stmt_all_session_gt(d_module, d_position, G_LOCKS_REQUIRED_ID);
9545: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
9546: END IF;
9547:
9548: d_position:=40;
9549: IF (PO_LOG.d_proc) THEN
9545: PO_LOG.stmt(d_module, d_position, 'Number of Records Inserted',SQL%ROWCOUNT);
9546: END IF;
9547:
9548: d_position:=40;
9549: IF (PO_LOG.d_proc) THEN
9550: PO_LOG.proc_end(d_module);
9551: END IF;
9552: EXCEPTION
9553: WHEN OTHERS THEN
9546: END IF;
9547:
9548: d_position:=40;
9549: IF (PO_LOG.d_proc) THEN
9550: PO_LOG.proc_end(d_module);
9551: END IF;
9552: EXCEPTION
9553: WHEN OTHERS THEN
9554: IF (PO_LOG.d_exc) THEN
9550: PO_LOG.proc_end(d_module);
9551: END IF;
9552: EXCEPTION
9553: WHEN OTHERS THEN
9554: IF (PO_LOG.d_exc) THEN
9555: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
9556: END IF;
9557: RAISE;
9558: END identify_exhibit_locks;
9551: END IF;
9552: EXCEPTION
9553: WHEN OTHERS THEN
9554: IF (PO_LOG.d_exc) THEN
9555: PO_LOG.exc(d_module,d_position,SQLCODE || SQLERRM);
9556: END IF;
9557: RAISE;
9558: END identify_exhibit_locks;
9559: