12: g_fnd_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
13:
14: --
15: -- Debugging
16: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
17: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
18: --
19:
20: /*
13:
14: --
15: -- Debugging
16: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
17: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
18: --
19:
20: /*
21: Bug 13388595 : We have defined this function in the Specs so other packages can access it, so this becomes redundant.
327: x_rate := NULL;
328: x_price_break_id := NULL;
329:
330: IF g_debug_stmt THEN
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
328: x_price_break_id := NULL;
329:
330: IF g_debug_stmt THEN
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
329:
330: IF g_debug_stmt THEN
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
330: IF g_debug_stmt THEN
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
353: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
353: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
354: END IF;
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
353: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
354: END IF;
355: --
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
353: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
354: END IF;
355: --
356:
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
350: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
351: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
352: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
353: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
354: END IF;
355: --
356:
357: -- <2694908 START>
364: v_ship_to_location_id ); -- IN/OUT
365:
366: l_progress := '020';
367: IF g_debug_stmt THEN
368: PO_DEBUG.debug_var(l_log_head,l_progress,'v_ship_to_location_id',v_ship_to_location_id);
369: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_conversion_rate');
370: END IF;
371:
372: -- (v_conversion_rate): Gets the correct rate for GAs and Local Blankets.
365:
366: l_progress := '020';
367: IF g_debug_stmt THEN
368: PO_DEBUG.debug_var(l_log_head,l_progress,'v_ship_to_location_id',v_ship_to_location_id);
369: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_conversion_rate');
370: END IF;
371:
372: -- (v_conversion_rate): Gets the correct rate for GAs and Local Blankets.
373: v_conversion_rate := get_conversion_rate( p_source_document_header_id );
373: v_conversion_rate := get_conversion_rate( p_source_document_header_id );
374:
375: l_progress := '040';
376: IF g_debug_stmt THEN
377: PO_DEBUG.debug_var(l_log_head,l_progress,'v_conversion_rate',v_conversion_rate);
378: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get the base currency extended precision');
379: END IF;
380:
381: -- Fetch Price from Cursors ===============================================
374:
375: l_progress := '040';
376: IF g_debug_stmt THEN
377: PO_DEBUG.debug_var(l_log_head,l_progress,'v_conversion_rate',v_conversion_rate);
378: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get the base currency extended precision');
379: END IF;
380:
381: -- Fetch Price from Cursors ===============================================
382: --
390: FND.currency_code = GSB.currency_code;
391:
392: l_progress := '060';
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_var(l_log_head,l_progress,'l_base_curr_ext_precision',l_base_curr_ext_precision);
395: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check source document type');
396: END IF;
397:
398: --
391:
392: l_progress := '060';
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_var(l_log_head,l_progress,'l_base_curr_ext_precision',l_base_curr_ext_precision);
395: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check source document type');
396: END IF;
397:
398: --
399:
412: AND pl.line_num(+) = p_source_document_line_num;
413:
414: l_progress := '080';
415: IF g_debug_stmt THEN
416: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
413:
414: l_progress := '080';
415: IF g_debug_stmt THEN
416: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
414: l_progress := '080';
415: IF g_debug_stmt THEN
416: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
415: IF g_debug_stmt THEN
416: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
423: END IF; /* IF g_debug_stmt */
416: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
423: END IF; /* IF g_debug_stmt */
424: /*Bug5598011 Passing the order_type as REQUISITION */
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
423: END IF; /* IF g_debug_stmt */
424: /*Bug5598011 Passing the order_type as REQUISITION */
425: /* call the Custom Price Date API */
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
420: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
421: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
423: END IF; /* IF g_debug_stmt */
424: /*Bug5598011 Passing the order_type as REQUISITION */
425: /* call the Custom Price Date API */
426: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_PRICE_DATE
446: l_pricing_date :=trunc(NVL(p_need_by_date, SYSDATE));
447: END IF; /* IF (l_pricing_date IS NULL) */
448:
449: IF g_debug_stmt THEN
450: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
451: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
452: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
453: END IF; /* IF g_debug_stmt */
454:
447: END IF; /* IF (l_pricing_date IS NULL) */
448:
449: IF g_debug_stmt THEN
450: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
451: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
452: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
453: END IF; /* IF g_debug_stmt */
454:
455: --
448:
449: IF g_debug_stmt THEN
450: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
451: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
452: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
453: END IF; /* IF g_debug_stmt */
454:
455: --
456:
456:
457: IF l_source_document_type IN ('BLANKET', 'QUOTATION') THEN
458: l_progress := '120';
459: IF g_debug_stmt THEN
460: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Open Cursor loc_unit_price');
461: END IF; /* IF g_debug_stmt */
462:
463: OPEN loc_unit_price;
464:
463: OPEN loc_unit_price;
464:
465: l_progress := '140';
466: IF g_debug_stmt THEN
467: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Fetch Cursor loc_unit_price');
468: END IF; /* IF g_debug_stmt */
469:
470: FETCH loc_unit_price INTO
471: v_temp
489: IF (loc_unit_price%ROWCOUNT = 0) THEN
490:
491: l_progress := '160';
492: IF g_debug_stmt THEN
493: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned no rows');
494: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get line price');
495: END IF; /* IF g_debug_stmt */
496:
497: x_currency_price := get_line_price ( p_source_document_header_id ,
490:
491: l_progress := '160';
492: IF g_debug_stmt THEN
493: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned no rows');
494: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get line price');
495: END IF; /* IF g_debug_stmt */
496:
497: x_currency_price := get_line_price ( p_source_document_header_id ,
498: p_source_document_line_num );
497: x_currency_price := get_line_price ( p_source_document_header_id ,
498: p_source_document_line_num );
499: l_progress := '180';
500: IF g_debug_stmt THEN
501: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
502: END IF; /* IF g_debug_stmt */
503:
504: /* Bug 2842675 Should be rounded off to the ext precision of the
505: base currency */
505: base currency */
506: x_base_price := round(x_currency_price * v_conversion_rate, l_base_curr_ext_precision);
507: l_progress := '200';
508: IF g_debug_stmt THEN
509: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
510: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get currency info');
511: END IF; /* IF g_debug_stmt */
512:
513: x_discount := 0; -- line price does not have a discount
506: x_base_price := round(x_currency_price * v_conversion_rate, l_base_curr_ext_precision);
507: l_progress := '200';
508: IF g_debug_stmt THEN
509: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
510: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get currency info');
511: END IF; /* IF g_debug_stmt */
512:
513: x_discount := 0; -- line price does not have a discount
514: x_price_break_id := NULL; -- SERVICES FPJ
519: x_rate_date ,
520: x_rate );
521: l_progress := '220';
522: IF g_debug_stmt THEN
523: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
524: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
525: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
526: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
527: END IF; /* IF g_debug_stmt */
520: x_rate );
521: l_progress := '220';
522: IF g_debug_stmt THEN
523: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
524: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
525: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
526: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
527: END IF; /* IF g_debug_stmt */
528: ELSE
521: l_progress := '220';
522: IF g_debug_stmt THEN
523: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
524: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
525: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
526: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
527: END IF; /* IF g_debug_stmt */
528: ELSE
529: l_progress := '240';
522: IF g_debug_stmt THEN
523: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
524: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
525: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
526: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
527: END IF; /* IF g_debug_stmt */
528: ELSE
529: l_progress := '240';
530: IF g_debug_stmt THEN
527: END IF; /* IF g_debug_stmt */
528: ELSE
529: l_progress := '240';
530: IF g_debug_stmt THEN
531: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
528: ELSE
529: l_progress := '240';
530: IF g_debug_stmt THEN
531: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
529: l_progress := '240';
530: IF g_debug_stmt THEN
531: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
530: IF g_debug_stmt THEN
531: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
531: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
541: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
541: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
542: END IF; /* IF g_debug_stmt */
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
541: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
542: END IF; /* IF g_debug_stmt */
543:
536: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
541: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
542: END IF; /* IF g_debug_stmt */
543:
544: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
538: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
539: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
540: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
541: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
542: END IF; /* IF g_debug_stmt */
543:
544: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
545:
544: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
545:
546: l_progress := '260';
547: IF g_debug_stmt THEN
548: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Close Cursor loc_unit_price');
549: END IF; /* IF g_debug_stmt */
550:
551: --
552: -- Bug 3417479, don't populate base_unit_price if source document is not CONTRACT
569: --
570: ELSIF l_source_document_type = 'CONTRACT' THEN
571: l_progress := '280';
572: IF g_debug_stmt THEN
573: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get Currency Info');
574: END IF; /* IF g_debug_stmt */
575:
576: PO_HEADERS_SV3.get_currency_info ( p_source_document_header_id ,
577: x_currency_code ,
579: x_rate_date ,
580: x_rate );
581: l_progress := '300';
582: IF g_debug_stmt THEN
583: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
584: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
585: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
586: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
587: END IF; /* IF g_debug_stmt */
580: x_rate );
581: l_progress := '300';
582: IF g_debug_stmt THEN
583: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
584: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
585: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
586: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
587: END IF; /* IF g_debug_stmt */
588: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
581: l_progress := '300';
582: IF g_debug_stmt THEN
583: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
584: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
585: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
586: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
587: END IF; /* IF g_debug_stmt */
588: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
589: --
582: IF g_debug_stmt THEN
583: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
584: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
585: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
586: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
587: END IF; /* IF g_debug_stmt */
588: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
589: --
590:
618: IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id)) THEN
619:
620: l_progress := '305';
621: IF g_debug_stmt THEN
622: PO_DEBUG.debug_stmt(l_log_head,l_progress,'x_currency_price: ' || x_currency_price);
623: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
624: END IF;
625:
626: PO_ADVANCED_PRICE_PVT.get_advanced_price
619:
620: l_progress := '305';
621: IF g_debug_stmt THEN
622: PO_DEBUG.debug_stmt(l_log_head,l_progress,'x_currency_price: ' || x_currency_price);
623: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
624: END IF;
625:
626: PO_ADVANCED_PRICE_PVT.get_advanced_price
627: ( p_org_id => p_org_id
652: , x_return_status => l_return_status );
653:
654: l_progress := '310';
655: IF g_debug_stmt THEN
656: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(GBPA)');
657: END IF;
658:
659: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
660: app_exception.raise_exception;
667: ELSE /* Invalid Line type*/
668:
669: l_progress := '315';
670: IF g_debug_stmt THEN
671: PO_DEBUG.debug_stmt(l_log_head, l_progress,
672: 'Not a valid price type to call Advanced Pricing API(GBPA)');
673: END IF;
674: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
675:
680: --Pass the Price passed from Advance Pricing to Custom Price Hook
681:
682: l_progress := '320';
683: IF g_debug_stmt THEN
684: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
681:
682: l_progress := '320';
683: IF g_debug_stmt THEN
684: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
682: l_progress := '320';
683: IF g_debug_stmt THEN
684: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
683: IF g_debug_stmt THEN
684: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
684: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
695: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
695: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
696: END IF; /* IF g_debug_stmt */
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
695: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
696: END IF; /* IF g_debug_stmt */
697:
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
695: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
696: END IF; /* IF g_debug_stmt */
697:
698: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_REQ_PRICE
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
692: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
693: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
694: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
695: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
696: END IF; /* IF g_debug_stmt */
697:
698: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_REQ_PRICE
699: (p_api_version => 1.0,
713: x_return_status => l_return_status);
714:
715: l_progress := '340';
716: IF g_debug_stmt THEN
717: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
718: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
719: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
720: END IF; /* IF g_debug_stmt */
721:
714:
715: l_progress := '340';
716: IF g_debug_stmt THEN
717: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
718: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
719: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
720: END IF; /* IF g_debug_stmt */
721:
722: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
715: l_progress := '340';
716: IF g_debug_stmt THEN
717: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
718: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
719: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
720: END IF; /* IF g_debug_stmt */
721:
722: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
723: app_exception.raise_exception;
744: -- Bug 5516257: Get the profile value to check if Adv Pricing is installed
745: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT',l_qp_license);
746: l_progress := '345';
747: IF g_debug_stmt THEN
748: PO_DEBUG.debug_var(l_log_head,l_progress,'l_qp_license',l_qp_license);
749: END IF;
750:
751: --Bug 5516257: Added the logic to nullify the output unitprice if the Adv Pricing API
752: --is not installed or licensed to PO;
754: x_currency_price := null;
755:
756: l_progress := '350';
757: IF g_debug_stmt THEN
758: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Advanced Pricing is not installed, nullify the new price');
759: END IF;
760: ELSE --Bug 5516257: Call Adv Pricing API if it's installed
761:
762: IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id)) THEN
764: -- Bug 3373445 START
765: -- p_in_price is in base currency, convert it to transaction currency
766: l_progress := '350';
767: IF g_debug_stmt THEN
768: PO_DEBUG.debug_stmt(l_log_head,l_progress,
769: 'Get currency extended precision for ' || x_currency_code);
770: END IF;
771: fnd_currency.get_info(x_currency_code, l_precision,
772: l_ext_precision, l_min_acct_unit);
770: END IF;
771: fnd_currency.get_info(x_currency_code, l_precision,
772: l_ext_precision, l_min_acct_unit);
773: IF g_debug_stmt THEN
774: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
775: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
776: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
777: END IF;
778:
771: fnd_currency.get_info(x_currency_code, l_precision,
772: l_ext_precision, l_min_acct_unit);
773: IF g_debug_stmt THEN
774: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
775: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
776: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
777: END IF;
778:
779: l_currency_unit_price := round(p_in_price/v_conversion_rate, l_ext_precision);
772: l_ext_precision, l_min_acct_unit);
773: IF g_debug_stmt THEN
774: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
775: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
776: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
777: END IF;
778:
779: l_currency_unit_price := round(p_in_price/v_conversion_rate, l_ext_precision);
780: -- Bug 3373445 END
780: -- Bug 3373445 END
781:
782: l_progress := '360';
783: IF g_debug_stmt THEN
784: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_currency_unit_price: ' || l_currency_unit_price);
785: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
786: END IF;
787:
788:
781:
782: l_progress := '360';
783: IF g_debug_stmt THEN
784: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_currency_unit_price: ' || l_currency_unit_price);
785: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
786: END IF;
787:
788:
789: PO_ADVANCED_PRICE_PVT.get_advanced_price
818:
819:
820: l_progress := '380';
821: IF g_debug_stmt THEN
822: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(CPA)');
823: END IF;
824:
825: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
826: app_exception.raise_exception;
832: x_currency_price := l_new_currency_price;
833: ELSE
834: l_progress := '400';
835: IF g_debug_stmt THEN
836: PO_DEBUG.debug_stmt(l_log_head, l_progress,
837: 'Not a valid price type to call Advanced Pricing API(CPA)');
838: END IF;
839: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
840:
848:
849:
850: l_progress := '500';
851: IF g_debug_stmt THEN
852: PO_DEBUG.debug_end(l_log_head);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
849:
850: l_progress := '500';
851: IF g_debug_stmt THEN
852: PO_DEBUG.debug_end(l_log_head);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
850: l_progress := '500';
851: IF g_debug_stmt THEN
852: PO_DEBUG.debug_end(l_log_head);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
851: IF g_debug_stmt THEN
852: PO_DEBUG.debug_end(l_log_head);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
852: PO_DEBUG.debug_end(l_log_head);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
861: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
861: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
862: END IF; /* IF g_debug_stmt */
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
861: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
862: END IF; /* IF g_debug_stmt */
863:
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
861: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
862: END IF; /* IF g_debug_stmt */
863:
864: EXCEPTION
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
858: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
859: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
860: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
861: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
862: END IF; /* IF g_debug_stmt */
863:
864: EXCEPTION
865: WHEN OTHERS THEN
863:
864: EXCEPTION
865: WHEN OTHERS THEN
866: IF g_debug_unexp THEN
867: PO_DEBUG.debug_exc(l_log_head,l_progress);
868: END IF;
869:
870: -- bug4043100
871: -- Close th e cursor if it's still open