1: PACKAGE BODY PO_PDOI_PRICE_TOLERANCE_PVT AS
2: /* $Header: PO_PDOI_PRICE_TOLERANCE_PVT.plb 120.3 2005/12/06 13:13 jinwang noship $ */
3:
4: d_pkg_name CONSTANT VARCHAR2(50) :=
5: PO_LOG.get_package_base('PO_PDOI_PRICE_TOLERANCE_PVT');
6:
7: --------------------------------------------------------------------------
8: ---------------------- PRIVATE PROCEDURES PROTOTYPE ----------------------
9: --------------------------------------------------------------------------
85: l_open_form VARCHAR2(240);
86: BEGIN
87: d_position := 0;
88:
89: IF (PO_LOG.d_proc) THEN
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
86: BEGIN
87: d_position := 0;
88:
89: IF (PO_LOG.d_proc) THEN
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
87: d_position := 0;
88:
89: IF (PO_LOG.d_proc) THEN
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
88:
89: IF (PO_LOG.d_proc) THEN
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
89: IF (PO_LOG.d_proc) THEN
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
90: PO_LOG.proc_begin(d_module, 'p_intf_header_id', p_intf_header_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
91: PO_LOG.proc_begin(d_module, 'p_po_header_id', p_po_header_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
92: PO_LOG.proc_begin(d_module, 'p_document_num', p_document_num);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
93: PO_LOG.proc_begin(d_module, 'p_batch_id', p_batch_id);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
101: PO_LOG.proc_begin(d_module, 'p_vendor_name', p_vendor_name);
94: PO_LOG.proc_begin(d_module, 'p_document_type', p_document_type);
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
101: PO_LOG.proc_begin(d_module, 'p_vendor_name', p_vendor_name);
102: END IF;
95: PO_LOG.proc_begin(d_module, 'p_document_subtype', p_document_subtype);
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
101: PO_LOG.proc_begin(d_module, 'p_vendor_name', p_vendor_name);
102: END IF;
103:
96: PO_LOG.proc_begin(d_module, 'p_commit_interval', p_commit_interval);
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
101: PO_LOG.proc_begin(d_module, 'p_vendor_name', p_vendor_name);
102: END IF;
103:
104: l_wf_item_key := 'POI-PRICAT-' || to_char(p_intf_header_id) ||
97: PO_LOG.proc_begin(d_module, 'p_any_line_updated', p_any_line_updated);
98: PO_LOG.proc_begin(d_module, 'p_buyer_id', p_buyer_id);
99: PO_LOG.proc_begin(d_module, 'p_agent_id', p_agent_id);
100: PO_LOG.proc_begin(d_module, 'p_vendor_id', p_vendor_id);
101: PO_LOG.proc_begin(d_module, 'p_vendor_name', p_vendor_name);
102: END IF;
103:
104: l_wf_item_key := 'POI-PRICAT-' || to_char(p_intf_header_id) ||
105: '-' || to_char(p_batch_id);
122: );
123: RAISE;
124: END;
125:
126: IF (PO_LOG.d_stmt) THEN
127: PO_LOG.stmt(d_module, d_position, 'l_wf_item_key', l_wf_item_key);
128: PO_LOG.stmt(d_module, d_position, 'l_wf_item_exists', l_wf_item_exists);
129: PO_LOG.stmt(d_module, d_position, 'l_wf_item_end_date', l_wf_item_end_date);
130: END IF;
123: RAISE;
124: END;
125:
126: IF (PO_LOG.d_stmt) THEN
127: PO_LOG.stmt(d_module, d_position, 'l_wf_item_key', l_wf_item_key);
128: PO_LOG.stmt(d_module, d_position, 'l_wf_item_exists', l_wf_item_exists);
129: PO_LOG.stmt(d_module, d_position, 'l_wf_item_end_date', l_wf_item_end_date);
130: END IF;
131:
124: END;
125:
126: IF (PO_LOG.d_stmt) THEN
127: PO_LOG.stmt(d_module, d_position, 'l_wf_item_key', l_wf_item_key);
128: PO_LOG.stmt(d_module, d_position, 'l_wf_item_exists', l_wf_item_exists);
129: PO_LOG.stmt(d_module, d_position, 'l_wf_item_end_date', l_wf_item_end_date);
130: END IF;
131:
132: d_position := 10;
125:
126: IF (PO_LOG.d_stmt) THEN
127: PO_LOG.stmt(d_module, d_position, 'l_wf_item_key', l_wf_item_key);
128: PO_LOG.stmt(d_module, d_position, 'l_wf_item_exists', l_wf_item_exists);
129: PO_LOG.stmt(d_module, d_position, 'l_wf_item_end_date', l_wf_item_end_date);
130: END IF;
131:
132: d_position := 10;
133:
135: IF (l_wf_item_exists = 'Y' AND l_wf_item_end_date IS NULL) THEN
136: d_position := 20;
137:
138: -- Workflow item exists and is still open - bypass creating workflow
139: IF (PO_LOG.d_proc) THEN
140: PO_LOG.proc_end (d_module, 'bypass workflow', l_wf_item_exists);
141: END IF;
142:
143: RETURN;
136: d_position := 20;
137:
138: -- Workflow item exists and is still open - bypass creating workflow
139: IF (PO_LOG.d_proc) THEN
140: PO_LOG.proc_end (d_module, 'bypass workflow', l_wf_item_exists);
141: END IF;
142:
143: RETURN;
144: ELSE
145: d_position := 30;
146:
147: IF (l_wf_item_exists = 'Y' AND l_wf_item_end_date IS NOT NULL) THEN
148: -- Call purge workflow to remove the completed process
149: IF (PO_LOG.d_stmt) THEN
150: PO_LOG.stmt(d_module, d_position, 'Purging completed Workflow');
151: END IF;
152:
153: WF_PURGE.TOTAL
146:
147: IF (l_wf_item_exists = 'Y' AND l_wf_item_end_date IS NOT NULL) THEN
148: -- Call purge workflow to remove the completed process
149: IF (PO_LOG.d_stmt) THEN
150: PO_LOG.stmt(d_module, d_position, 'Purging completed Workflow');
151: END IF;
152:
153: WF_PURGE.TOTAL
154: (
166: WHERE interface_header_id = p_intf_header_id
167: AND process_code = 'NOTIFIED'
168: AND nvl(price_break_flag,'N') = 'N';
169:
170: IF (PO_LOG.d_stmt) THEN
171: PO_LOG.stmt(d_module, d_position, 'l_num_of_items', l_num_of_items);
172: END IF;
173:
174: d_position := 50;
167: AND process_code = 'NOTIFIED'
168: AND nvl(price_break_flag,'N') = 'N';
169:
170: IF (PO_LOG.d_stmt) THEN
171: PO_LOG.stmt(d_module, d_position, 'l_num_of_items', l_num_of_items);
172: END IF;
173:
174: d_position := 50;
175:
185:
186: l_open_form := 'PO_POXPCATN:INTERFACE_HEADER_ID="' || '&' || 'INTERFACE_HEADER_ID"' ||
187: ' ACCESS_LEVEL_CODE="' || '&' || 'ACCESS_LEVEL_CODE"';
188:
189: IF (PO_LOG.d_stmt) THEN
190: PO_LOG.stmt(d_module, d_position, 'l_agent_username', l_agent_username);
191: PO_LOG.stmt(d_module, d_position, 'l_agent_display_name', l_agent_display_name);
192: PO_LOG.stmt(d_module, d_position, 'l_open_form', l_open_form);
193: END IF;
186: l_open_form := 'PO_POXPCATN:INTERFACE_HEADER_ID="' || '&' || 'INTERFACE_HEADER_ID"' ||
187: ' ACCESS_LEVEL_CODE="' || '&' || 'ACCESS_LEVEL_CODE"';
188:
189: IF (PO_LOG.d_stmt) THEN
190: PO_LOG.stmt(d_module, d_position, 'l_agent_username', l_agent_username);
191: PO_LOG.stmt(d_module, d_position, 'l_agent_display_name', l_agent_display_name);
192: PO_LOG.stmt(d_module, d_position, 'l_open_form', l_open_form);
193: END IF;
194:
187: ' ACCESS_LEVEL_CODE="' || '&' || 'ACCESS_LEVEL_CODE"';
188:
189: IF (PO_LOG.d_stmt) THEN
190: PO_LOG.stmt(d_module, d_position, 'l_agent_username', l_agent_username);
191: PO_LOG.stmt(d_module, d_position, 'l_agent_display_name', l_agent_display_name);
192: PO_LOG.stmt(d_module, d_position, 'l_open_form', l_open_form);
193: END IF;
194:
195: WF_ENGINE.createProcess
188:
189: IF (PO_LOG.d_stmt) THEN
190: PO_LOG.stmt(d_module, d_position, 'l_agent_username', l_agent_username);
191: PO_LOG.stmt(d_module, d_position, 'l_agent_display_name', l_agent_display_name);
192: PO_LOG.stmt(d_module, d_position, 'l_open_form', l_open_form);
193: END IF;
194:
195: WF_ENGINE.createProcess
196: (
340: itemkey => l_wf_item_key
341: );
342: END IF;
343:
344: IF (PO_LOG.d_stmt) THEN
345: PO_LOG.stmt(d_module, d_position, 'workflow started');
346: END IF;
347:
348: IF (PO_LOG.d_proc) THEN
341: );
342: END IF;
343:
344: IF (PO_LOG.d_stmt) THEN
345: PO_LOG.stmt(d_module, d_position, 'workflow started');
346: END IF;
347:
348: IF (PO_LOG.d_proc) THEN
349: PO_LOG.proc_end (d_module);
344: IF (PO_LOG.d_stmt) THEN
345: PO_LOG.stmt(d_module, d_position, 'workflow started');
346: END IF;
347:
348: IF (PO_LOG.d_proc) THEN
349: PO_LOG.proc_end (d_module);
350: END IF;
351:
352: EXCEPTION
345: PO_LOG.stmt(d_module, d_position, 'workflow started');
346: END IF;
347:
348: IF (PO_LOG.d_proc) THEN
349: PO_LOG.proc_end (d_module);
350: END IF;
351:
352: EXCEPTION
353: WHEN OTHERS THEN
405: l_index NUMBER;
406: BEGIN
407: d_position := 0;
408:
409: IF (PO_LOG.d_proc) THEN
410: PO_LOG.proc_begin(d_module, 'p_po_header_id_tbl', p_po_header_id_tbl);
411: PO_LOG.proc_begin(d_module, 'p_item_id_tbl', p_item_id_tbl);
412: PO_LOG.proc_begin(d_module, 'p_category_id_tbl', p_category_id_tbl);
413: PO_LOG.proc_begin(d_module, 'p_vendor_id_tbl', p_vendor_id_tbl);
406: BEGIN
407: d_position := 0;
408:
409: IF (PO_LOG.d_proc) THEN
410: PO_LOG.proc_begin(d_module, 'p_po_header_id_tbl', p_po_header_id_tbl);
411: PO_LOG.proc_begin(d_module, 'p_item_id_tbl', p_item_id_tbl);
412: PO_LOG.proc_begin(d_module, 'p_category_id_tbl', p_category_id_tbl);
413: PO_LOG.proc_begin(d_module, 'p_vendor_id_tbl', p_vendor_id_tbl);
414: END IF;
407: d_position := 0;
408:
409: IF (PO_LOG.d_proc) THEN
410: PO_LOG.proc_begin(d_module, 'p_po_header_id_tbl', p_po_header_id_tbl);
411: PO_LOG.proc_begin(d_module, 'p_item_id_tbl', p_item_id_tbl);
412: PO_LOG.proc_begin(d_module, 'p_category_id_tbl', p_category_id_tbl);
413: PO_LOG.proc_begin(d_module, 'p_vendor_id_tbl', p_vendor_id_tbl);
414: END IF;
415:
408:
409: IF (PO_LOG.d_proc) THEN
410: PO_LOG.proc_begin(d_module, 'p_po_header_id_tbl', p_po_header_id_tbl);
411: PO_LOG.proc_begin(d_module, 'p_item_id_tbl', p_item_id_tbl);
412: PO_LOG.proc_begin(d_module, 'p_category_id_tbl', p_category_id_tbl);
413: PO_LOG.proc_begin(d_module, 'p_vendor_id_tbl', p_vendor_id_tbl);
414: END IF;
415:
416: -- initialize out parameter
409: IF (PO_LOG.d_proc) THEN
410: PO_LOG.proc_begin(d_module, 'p_po_header_id_tbl', p_po_header_id_tbl);
411: PO_LOG.proc_begin(d_module, 'p_item_id_tbl', p_item_id_tbl);
412: PO_LOG.proc_begin(d_module, 'p_category_id_tbl', p_category_id_tbl);
413: PO_LOG.proc_begin(d_module, 'p_vendor_id_tbl', p_vendor_id_tbl);
414: END IF;
415:
416: -- initialize out parameter
417: x_price_update_tolerance_tbl := PO_TBL_NUMBER();
445: RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_tolerance_tbl;
446:
447: FOR i IN 1..l_index_tbl.COUNT
448: LOOP
449: IF (PO_LOG.d_stmt) THEN
450: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
451: PO_LOG.stmt(d_module, d_position, 'price tolerance from asl attributes',
452: l_tolerance_tbl(i));
453: END IF;
446:
447: FOR i IN 1..l_index_tbl.COUNT
448: LOOP
449: IF (PO_LOG.d_stmt) THEN
450: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
451: PO_LOG.stmt(d_module, d_position, 'price tolerance from asl attributes',
452: l_tolerance_tbl(i));
453: END IF;
454:
447: FOR i IN 1..l_index_tbl.COUNT
448: LOOP
449: IF (PO_LOG.d_stmt) THEN
450: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
451: PO_LOG.stmt(d_module, d_position, 'price tolerance from asl attributes',
452: l_tolerance_tbl(i));
453: END IF;
454:
455: x_price_update_tolerance_tbl(l_index_tbl(i)) := l_tolerance_tbl(i);
475: RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_tolerance_tbl;
476:
477: FOR I IN 1..l_index_tbl.COUNT
478: LOOP
479: IF (PO_LOG.d_stmt) THEN
480: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
481: PO_LOG.stmt(d_module, d_position, 'price tolerance from headers',
482: l_tolerance_tbl(i));
483: END IF;
476:
477: FOR I IN 1..l_index_tbl.COUNT
478: LOOP
479: IF (PO_LOG.d_stmt) THEN
480: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
481: PO_LOG.stmt(d_module, d_position, 'price tolerance from headers',
482: l_tolerance_tbl(i));
483: END IF;
484:
477: FOR I IN 1..l_index_tbl.COUNT
478: LOOP
479: IF (PO_LOG.d_stmt) THEN
480: PO_LOG.stmt(d_module, d_position, 'index', l_index_tbl(i));
481: PO_LOG.stmt(d_module, d_position, 'price tolerance from headers',
482: l_tolerance_tbl(i));
483: END IF;
484:
485: x_price_update_tolerance_tbl(l_index_tbl(i)) := l_tolerance_tbl(i);
493: LOOP
494: d_position := 60;
495:
496: IF (x_price_update_tolerance_tbl(l_index) IS NULL) THEN
497: IF (PO_LOG.d_stmt) THEN
498: PO_LOG.stmt(d_module, d_position, 'index', l_index);
499: PO_LOG.stmt(d_module, d_position, 'price tolerance from profile',
500: PO_PDOI_PARAMS.g_profile.po_price_update_tolerance);
501: END IF;
494: d_position := 60;
495:
496: IF (x_price_update_tolerance_tbl(l_index) IS NULL) THEN
497: IF (PO_LOG.d_stmt) THEN
498: PO_LOG.stmt(d_module, d_position, 'index', l_index);
499: PO_LOG.stmt(d_module, d_position, 'price tolerance from profile',
500: PO_PDOI_PARAMS.g_profile.po_price_update_tolerance);
501: END IF;
502:
495:
496: IF (x_price_update_tolerance_tbl(l_index) IS NULL) THEN
497: IF (PO_LOG.d_stmt) THEN
498: PO_LOG.stmt(d_module, d_position, 'index', l_index);
499: PO_LOG.stmt(d_module, d_position, 'price tolerance from profile',
500: PO_PDOI_PARAMS.g_profile.po_price_update_tolerance);
501: END IF;
502:
503: x_price_update_tolerance_tbl(l_index) :=
506:
507: l_index := p_index_tbl.NEXT(l_index);
508: END LOOP;
509:
510: IF (PO_LOG.d_proc) THEN
511: PO_LOG.proc_end(d_module);
512: END IF;
513:
514: EXCEPTION
507: l_index := p_index_tbl.NEXT(l_index);
508: END LOOP;
509:
510: IF (PO_LOG.d_proc) THEN
511: PO_LOG.proc_end(d_module);
512: END IF;
513:
514: EXCEPTION
515: WHEN OTHERS THEN
553: l_exceed VARCHAR2(1) := FND_API.g_FALSE;
554: BEGIN
555: d_position := 0;
556:
557: IF (PO_LOG.d_proc) THEN
558: PO_LOG.proc_begin(d_module, 'p_price_tolerance', p_price_tolerance);
559: PO_LOG.proc_begin(d_module, 'p_old_price', p_old_price);
560: PO_LOG.proc_begin(d_module, 'p_new_price', p_new_price);
561: END IF;
554: BEGIN
555: d_position := 0;
556:
557: IF (PO_LOG.d_proc) THEN
558: PO_LOG.proc_begin(d_module, 'p_price_tolerance', p_price_tolerance);
559: PO_LOG.proc_begin(d_module, 'p_old_price', p_old_price);
560: PO_LOG.proc_begin(d_module, 'p_new_price', p_new_price);
561: END IF;
562:
555: d_position := 0;
556:
557: IF (PO_LOG.d_proc) THEN
558: PO_LOG.proc_begin(d_module, 'p_price_tolerance', p_price_tolerance);
559: PO_LOG.proc_begin(d_module, 'p_old_price', p_old_price);
560: PO_LOG.proc_begin(d_module, 'p_new_price', p_new_price);
561: END IF;
562:
563: d_position := 10;
556:
557: IF (PO_LOG.d_proc) THEN
558: PO_LOG.proc_begin(d_module, 'p_price_tolerance', p_price_tolerance);
559: PO_LOG.proc_begin(d_module, 'p_old_price', p_old_price);
560: PO_LOG.proc_begin(d_module, 'p_new_price', p_new_price);
561: END IF;
562:
563: d_position := 10;
564:
566: ((1 + p_price_tolerance/100) * p_old_price < p_new_price)) THEN
567: l_exceed := FND_API.g_TRUE;
568: END IF;
569:
570: IF (PO_LOG.d_proc) THEN
571: PO_LOG.proc_return(d_module, l_exceed);
572: END IF;
573:
574: RETURN l_exceed;
567: l_exceed := FND_API.g_TRUE;
568: END IF;
569:
570: IF (PO_LOG.d_proc) THEN
571: PO_LOG.proc_return(d_module, l_exceed);
572: END IF;
573:
574: RETURN l_exceed;
575: EXCEPTION