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: FUNCTION get_conversion_rate -- <2694908>
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: FUNCTION get_conversion_rate -- <2694908>
21: ( p_po_header_id IN PO_HEADERS_ALL.po_header_id%TYPE
324: x_rate := NULL;
325: x_price_break_id := NULL;
326:
327: IF g_debug_stmt THEN
328: PO_DEBUG.debug_begin(l_log_head);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
325: x_price_break_id := NULL;
326:
327: IF g_debug_stmt THEN
328: PO_DEBUG.debug_begin(l_log_head);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
326:
327: IF g_debug_stmt THEN
328: PO_DEBUG.debug_begin(l_log_head);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
327: IF g_debug_stmt THEN
328: PO_DEBUG.debug_begin(l_log_head);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
328: PO_DEBUG.debug_begin(l_log_head);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
329: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
330: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
331: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_quantity',p_in_quantity);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
342: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
350: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
343: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
350: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
351: END IF;
344: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
350: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
351: END IF;
352: --
345: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
350: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
351: END IF;
352: --
353:
346: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
347: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
348: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
349: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
350: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_ship_to_location');
351: END IF;
352: --
353:
354: -- <2694908 START>
361: v_ship_to_location_id ); -- IN/OUT
362:
363: l_progress := '020';
364: IF g_debug_stmt THEN
365: PO_DEBUG.debug_var(l_log_head,l_progress,'v_ship_to_location_id',v_ship_to_location_id);
366: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_conversion_rate');
367: END IF;
368:
369: -- (v_conversion_rate): Gets the correct rate for GAs and Local Blankets.
362:
363: l_progress := '020';
364: IF g_debug_stmt THEN
365: PO_DEBUG.debug_var(l_log_head,l_progress,'v_ship_to_location_id',v_ship_to_location_id);
366: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get_conversion_rate');
367: END IF;
368:
369: -- (v_conversion_rate): Gets the correct rate for GAs and Local Blankets.
370: v_conversion_rate := get_conversion_rate( p_source_document_header_id );
370: v_conversion_rate := get_conversion_rate( p_source_document_header_id );
371:
372: l_progress := '040';
373: IF g_debug_stmt THEN
374: PO_DEBUG.debug_var(l_log_head,l_progress,'v_conversion_rate',v_conversion_rate);
375: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get the base currency extended precision');
376: END IF;
377:
378: -- Fetch Price from Cursors ===============================================
371:
372: l_progress := '040';
373: IF g_debug_stmt THEN
374: PO_DEBUG.debug_var(l_log_head,l_progress,'v_conversion_rate',v_conversion_rate);
375: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get the base currency extended precision');
376: END IF;
377:
378: -- Fetch Price from Cursors ===============================================
379: --
387: FND.currency_code = GSB.currency_code;
388:
389: l_progress := '060';
390: IF g_debug_stmt THEN
391: PO_DEBUG.debug_var(l_log_head,l_progress,'l_base_curr_ext_precision',l_base_curr_ext_precision);
392: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check source document type');
393: END IF;
394:
395: --
388:
389: l_progress := '060';
390: IF g_debug_stmt THEN
391: PO_DEBUG.debug_var(l_log_head,l_progress,'l_base_curr_ext_precision',l_base_curr_ext_precision);
392: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check source document type');
393: END IF;
394:
395: --
396:
409: AND pl.line_num(+) = p_source_document_line_num;
410:
411: l_progress := '080';
412: IF g_debug_stmt THEN
413: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
410:
411: l_progress := '080';
412: IF g_debug_stmt THEN
413: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
411: l_progress := '080';
412: IF g_debug_stmt THEN
413: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
412: IF g_debug_stmt THEN
413: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
420: END IF; /* IF g_debug_stmt */
413: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
420: END IF; /* IF g_debug_stmt */
421: /*Bug5598011 Passing the order_type as REQUISITION */
414: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
420: END IF; /* IF g_debug_stmt */
421: /*Bug5598011 Passing the order_type as REQUISITION */
422: /* call the Custom Price Date API */
415: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',l_source_document_line_id);
416: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
417: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',v_ship_to_location_id);
418: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_destination_org_id);
419: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
420: END IF; /* IF g_debug_stmt */
421: /*Bug5598011 Passing the order_type as REQUISITION */
422: /* call the Custom Price Date API */
423: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_PRICE_DATE
434: p_order_type => 'REQUISITION');
435:
436: l_progress := '100';
437: IF g_debug_stmt THEN
438: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
439: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
440: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
441: END IF; /* IF g_debug_stmt */
442:
435:
436: l_progress := '100';
437: IF g_debug_stmt THEN
438: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
439: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
440: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
441: END IF; /* IF g_debug_stmt */
442:
443: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
436: l_progress := '100';
437: IF g_debug_stmt THEN
438: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
439: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
440: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
441: END IF; /* IF g_debug_stmt */
442:
443: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
444: app_exception.raise_exception;
452:
453: IF l_source_document_type IN ('BLANKET', 'QUOTATION') THEN
454: l_progress := '120';
455: IF g_debug_stmt THEN
456: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Open Cursor loc_unit_price');
457: END IF; /* IF g_debug_stmt */
458:
459: OPEN loc_unit_price;
460:
459: OPEN loc_unit_price;
460:
461: l_progress := '140';
462: IF g_debug_stmt THEN
463: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Fetch Cursor loc_unit_price');
464: END IF; /* IF g_debug_stmt */
465:
466: FETCH loc_unit_price INTO
467: v_temp
485: IF (loc_unit_price%ROWCOUNT = 0) THEN
486:
487: l_progress := '160';
488: IF g_debug_stmt THEN
489: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned no rows');
490: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get line price');
491: END IF; /* IF g_debug_stmt */
492:
493: x_currency_price := get_line_price ( p_source_document_header_id ,
486:
487: l_progress := '160';
488: IF g_debug_stmt THEN
489: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned no rows');
490: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get line price');
491: END IF; /* IF g_debug_stmt */
492:
493: x_currency_price := get_line_price ( p_source_document_header_id ,
494: p_source_document_line_num );
493: x_currency_price := get_line_price ( p_source_document_header_id ,
494: p_source_document_line_num );
495: l_progress := '180';
496: IF g_debug_stmt THEN
497: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
498: END IF; /* IF g_debug_stmt */
499:
500: /* Bug 2842675 Should be rounded off to the ext precision of the
501: base currency */
501: base currency */
502: x_base_price := round(x_currency_price * v_conversion_rate, l_base_curr_ext_precision);
503: l_progress := '200';
504: IF g_debug_stmt THEN
505: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
506: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get currency info');
507: END IF; /* IF g_debug_stmt */
508:
509: x_discount := 0; -- line price does not have a discount
502: x_base_price := round(x_currency_price * v_conversion_rate, l_base_curr_ext_precision);
503: l_progress := '200';
504: IF g_debug_stmt THEN
505: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
506: PO_DEBUG.debug_stmt(l_log_head,l_progress,'get currency info');
507: END IF; /* IF g_debug_stmt */
508:
509: x_discount := 0; -- line price does not have a discount
510: x_price_break_id := NULL; -- SERVICES FPJ
515: x_rate_date ,
516: x_rate );
517: l_progress := '220';
518: IF g_debug_stmt THEN
519: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
520: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
521: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
522: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
523: END IF; /* IF g_debug_stmt */
516: x_rate );
517: l_progress := '220';
518: IF g_debug_stmt THEN
519: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
520: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
521: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
522: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
523: END IF; /* IF g_debug_stmt */
524: ELSE
517: l_progress := '220';
518: IF g_debug_stmt THEN
519: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
520: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
521: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
522: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
523: END IF; /* IF g_debug_stmt */
524: ELSE
525: l_progress := '240';
518: IF g_debug_stmt THEN
519: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
520: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
521: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
522: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
523: END IF; /* IF g_debug_stmt */
524: ELSE
525: l_progress := '240';
526: IF g_debug_stmt THEN
523: END IF; /* IF g_debug_stmt */
524: ELSE
525: l_progress := '240';
526: IF g_debug_stmt THEN
527: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
524: ELSE
525: l_progress := '240';
526: IF g_debug_stmt THEN
527: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
525: l_progress := '240';
526: IF g_debug_stmt THEN
527: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
526: IF g_debug_stmt THEN
527: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
527: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Cursor loc_unit_price returned rows');
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
528: PO_DEBUG.debug_var(l_log_head,l_progress,'v_temp',v_temp);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
529: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
530: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
538: END IF; /* IF g_debug_stmt */
531: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
538: END IF; /* IF g_debug_stmt */
539:
532: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
538: END IF; /* IF g_debug_stmt */
539:
540: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
533: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
534: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
535: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
536: PO_DEBUG.debug_var(l_log_head,l_progress,'v_return_unit_of_measure',v_return_unit_of_measure);
537: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
538: END IF; /* IF g_debug_stmt */
539:
540: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
541:
540: END IF; /*IF (loc_unit_price%ROWCOUNT = 0)*/
541:
542: l_progress := '260';
543: IF g_debug_stmt THEN
544: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Close Cursor loc_unit_price');
545: END IF; /* IF g_debug_stmt */
546:
547: --
548: -- Bug 3417479, don't populate base_unit_price if source document is not CONTRACT
565: --
566: ELSIF l_source_document_type = 'CONTRACT' THEN
567: l_progress := '280';
568: IF g_debug_stmt THEN
569: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get Currency Info');
570: END IF; /* IF g_debug_stmt */
571:
572: PO_HEADERS_SV3.get_currency_info ( p_source_document_header_id ,
573: x_currency_code ,
575: x_rate_date ,
576: x_rate );
577: l_progress := '300';
578: IF g_debug_stmt THEN
579: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
580: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
581: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
582: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
583: END IF; /* IF g_debug_stmt */
576: x_rate );
577: l_progress := '300';
578: IF g_debug_stmt THEN
579: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
580: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
581: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
582: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
583: END IF; /* IF g_debug_stmt */
584: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
577: l_progress := '300';
578: IF g_debug_stmt THEN
579: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
580: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
581: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
582: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
583: END IF; /* IF g_debug_stmt */
584: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
585: --
578: IF g_debug_stmt THEN
579: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
580: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
581: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
582: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
583: END IF; /* IF g_debug_stmt */
584: END IF; /* l_source_document_type IN ('BLANKET', 'QUOTATION') */
585: --
586:
614: IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id)) THEN
615:
616: l_progress := '305';
617: IF g_debug_stmt THEN
618: PO_DEBUG.debug_stmt(l_log_head,l_progress,'x_currency_price: ' || x_currency_price);
619: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
620: END IF;
621:
622: PO_ADVANCED_PRICE_PVT.get_advanced_price
615:
616: l_progress := '305';
617: IF g_debug_stmt THEN
618: PO_DEBUG.debug_stmt(l_log_head,l_progress,'x_currency_price: ' || x_currency_price);
619: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
620: END IF;
621:
622: PO_ADVANCED_PRICE_PVT.get_advanced_price
623: ( p_org_id => p_org_id
648: , x_return_status => l_return_status );
649:
650: l_progress := '310';
651: IF g_debug_stmt THEN
652: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(GBPA)');
653: END IF;
654:
655: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
656: app_exception.raise_exception;
663: ELSE /* Invalid Line type*/
664:
665: l_progress := '315';
666: IF g_debug_stmt THEN
667: PO_DEBUG.debug_stmt(l_log_head, l_progress,
668: 'Not a valid price type to call Advanced Pricing API(GBPA)');
669: END IF;
670: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
671:
676: --Pass the Price passed from Advance Pricing to Custom Price Hook
677:
678: l_progress := '320';
679: IF g_debug_stmt THEN
680: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
677:
678: l_progress := '320';
679: IF g_debug_stmt THEN
680: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
678: l_progress := '320';
679: IF g_debug_stmt THEN
680: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
679: IF g_debug_stmt THEN
680: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
680: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_req_price');
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
681: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',p_source_document_header_id);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
682: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_num',p_source_document_line_num);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
683: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_in_quantity);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
684: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_of_measure',p_unit_of_measure);
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
692: END IF; /* IF g_debug_stmt */
685: PO_DEBUG.debug_var(l_log_head,l_progress,'p_deliver_to_location_id',p_deliver_to_location_id);
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
692: END IF; /* IF g_debug_stmt */
693:
686: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_currency',p_required_currency);
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
692: END IF; /* IF g_debug_stmt */
693:
694: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_REQ_PRICE
687: PO_DEBUG.debug_var(l_log_head,l_progress,'p_required_rate_type',p_required_rate_type);
688: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
689: PO_DEBUG.debug_var(l_log_head,l_progress,'p_pricing_date',l_pricing_date);
690: PO_DEBUG.debug_var(l_log_head,l_progress,'p_destination_org_id',p_destination_org_id);
691: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_price',x_currency_price);
692: END IF; /* IF g_debug_stmt */
693:
694: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_REQ_PRICE
695: (p_api_version => 1.0,
709: x_return_status => l_return_status);
710:
711: l_progress := '340';
712: IF g_debug_stmt THEN
713: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
714: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
715: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
716: END IF; /* IF g_debug_stmt */
717:
710:
711: l_progress := '340';
712: IF g_debug_stmt THEN
713: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
714: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
715: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
716: END IF; /* IF g_debug_stmt */
717:
718: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
711: l_progress := '340';
712: IF g_debug_stmt THEN
713: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_req_price');
714: PO_DEBUG.debug_var(l_log_head,l_progress,'l_new_currency_price',l_new_currency_price);
715: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
716: END IF; /* IF g_debug_stmt */
717:
718: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
719: app_exception.raise_exception;
740: -- Bug 5516257: Get the profile value to check if Adv Pricing is installed
741: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT',l_qp_license);
742: l_progress := '345';
743: IF g_debug_stmt THEN
744: PO_DEBUG.debug_var(l_log_head,l_progress,'l_qp_license',l_qp_license);
745: END IF;
746:
747: --Bug 5516257: Added the logic to nullify the output unitprice if the Adv Pricing API
748: --is not installed or licensed to PO;
750: x_currency_price := null;
751:
752: l_progress := '350';
753: IF g_debug_stmt THEN
754: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Advanced Pricing is not installed, nullify the new price');
755: END IF;
756: ELSE --Bug 5516257: Call Adv Pricing API if it's installed
757:
758: IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id)) THEN
760: -- Bug 3373445 START
761: -- p_in_price is in base currency, convert it to transaction currency
762: l_progress := '350';
763: IF g_debug_stmt THEN
764: PO_DEBUG.debug_stmt(l_log_head,l_progress,
765: 'Get currency extended precision for ' || x_currency_code);
766: END IF;
767: fnd_currency.get_info(x_currency_code, l_precision,
768: l_ext_precision, l_min_acct_unit);
766: END IF;
767: fnd_currency.get_info(x_currency_code, l_precision,
768: l_ext_precision, l_min_acct_unit);
769: IF g_debug_stmt THEN
770: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
771: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
772: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
773: END IF;
774:
767: fnd_currency.get_info(x_currency_code, l_precision,
768: l_ext_precision, l_min_acct_unit);
769: IF g_debug_stmt THEN
770: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
771: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
772: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
773: END IF;
774:
775: l_currency_unit_price := round(p_in_price/v_conversion_rate, l_ext_precision);
768: l_ext_precision, l_min_acct_unit);
769: IF g_debug_stmt THEN
770: PO_DEBUG.debug_stmt(l_log_head,l_progress,'p_in_price: ' || p_in_price);
771: PO_DEBUG.debug_stmt(l_log_head,l_progress,'v_conversion_rate: ' || v_conversion_rate);
772: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_ext_precision: ' || l_ext_precision);
773: END IF;
774:
775: l_currency_unit_price := round(p_in_price/v_conversion_rate, l_ext_precision);
776: -- Bug 3373445 END
776: -- Bug 3373445 END
777:
778: l_progress := '360';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_currency_unit_price: ' || l_currency_unit_price);
781: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
782: END IF;
783:
784:
777:
778: l_progress := '360';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_stmt(l_log_head,l_progress,'l_currency_unit_price: ' || l_currency_unit_price);
781: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
782: END IF;
783:
784:
785: PO_ADVANCED_PRICE_PVT.get_advanced_price
814:
815:
816: l_progress := '380';
817: IF g_debug_stmt THEN
818: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(CPA)');
819: END IF;
820:
821: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
822: app_exception.raise_exception;
828: x_currency_price := l_new_currency_price;
829: ELSE
830: l_progress := '400';
831: IF g_debug_stmt THEN
832: PO_DEBUG.debug_stmt(l_log_head, l_progress,
833: 'Not a valid price type to call Advanced Pricing API(CPA)');
834: END IF;
835: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
836:
844:
845:
846: l_progress := '500';
847: IF g_debug_stmt THEN
848: PO_DEBUG.debug_end(l_log_head);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
845:
846: l_progress := '500';
847: IF g_debug_stmt THEN
848: PO_DEBUG.debug_end(l_log_head);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
846: l_progress := '500';
847: IF g_debug_stmt THEN
848: PO_DEBUG.debug_end(l_log_head);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
847: IF g_debug_stmt THEN
848: PO_DEBUG.debug_end(l_log_head);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
848: PO_DEBUG.debug_end(l_log_head);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
849: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
850: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_price',x_base_price);
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
858: END IF; /* IF g_debug_stmt */
851: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_price',x_currency_price);
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
858: END IF; /* IF g_debug_stmt */
859:
852: PO_DEBUG.debug_var(l_log_head,l_progress,'x_discount',x_discount);
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
858: END IF; /* IF g_debug_stmt */
859:
860: EXCEPTION
853: PO_DEBUG.debug_var(l_log_head,l_progress,'x_currency_code',x_currency_code);
854: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_type',x_rate_type);
855: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate_date',x_rate_date);
856: PO_DEBUG.debug_var(l_log_head,l_progress,'x_rate',x_rate);
857: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
858: END IF; /* IF g_debug_stmt */
859:
860: EXCEPTION
861: WHEN OTHERS THEN
859:
860: EXCEPTION
861: WHEN OTHERS THEN
862: IF g_debug_unexp THEN
863: PO_DEBUG.debug_exc(l_log_head,l_progress);
864: END IF;
865:
866: -- bug4043100
867: -- Close th e cursor if it's still open