20: g_fnd_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
21:
22: --
23: -- Debugging
24: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
25: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
26: --
27:
28: FUNCTION get_break_price(x_order_quantity IN NUMBER,
21:
22: --
23: -- Debugging
24: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
25: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
26: --
27:
28: FUNCTION get_break_price(x_order_quantity IN NUMBER,
29: x_ship_to_org IN NUMBER,
327: -- Bug 3340552, initialize with passed in price
328: -- l_price := p_in_price;
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_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
328: -- l_price := p_in_price;
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_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
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_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
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_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
331: PO_DEBUG.debug_begin(l_log_head);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
332: PO_DEBUG.debug_var(l_log_head,l_progress,'p_api_version',p_api_version);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
333: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_quantity',p_order_quantity);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
334: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org',p_ship_to_org);
335: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_ship_to_loc',p_ship_to_loc);
336: PO_DEBUG.debug_var(l_log_head,l_progress,'p_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_po_line_id',p_po_line_id);
337: PO_DEBUG.debug_var(l_log_head,l_progress,'p_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_cum_flag',p_cum_flag);
338: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_need_by_date',p_need_by_date);
339: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_line_location_id',p_line_location_id);
340: PO_DEBUG.debug_var(l_log_head,l_progress,'p_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_contract_id',p_contract_id);
341: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_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_org_id',p_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_uom',p_uom);
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
354: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
354: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
355: END IF;
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
354: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
355: END IF;
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
354: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
355: END IF;
356: --
357:
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_uom',p_uom);
353: PO_DEBUG.debug_var(l_log_head,l_progress,'p_in_price',p_in_price);
354: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
355: END IF;
356: --
357:
358: -- Check for the API version
365: -- SQL Why : Get source document line id to call GET_CUSTOM_PRICE_DATE,
366: -- Get source document type since we only allow custom pricing for
367: -- Blanket and Quotation.
368: IF g_debug_stmt THEN
369: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get source document header id and type');
370: END IF;
371:
372: IF (p_po_line_id IS NOT NULL) THEN
373: SELECT ph.type_lookup_code,
390:
391: /* call the Custom Pricing Date API */
392: l_progress := '010';
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
391: /* call the Custom Pricing Date API */
392: l_progress := '010';
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
392: l_progress := '010';
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
400: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
393: IF g_debug_stmt THEN
394: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
400: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
401: END IF; /* IF g_debug_stmt */
394: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call get_custom_price_date');
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
400: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
401: END IF; /* IF g_debug_stmt */
402:
395: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_header_id',l_source_document_header_id);
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
400: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
401: END IF; /* IF g_debug_stmt */
402:
403: /*Bug5598011 Pass the order_type as PO */
396: PO_DEBUG.debug_var(l_log_head,l_progress,'p_source_document_line_id',p_po_line_id);
397: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_order_quantity);
398: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_loc);
399: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_organization_id',p_ship_to_org);
400: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
401: END IF; /* IF g_debug_stmt */
402:
403: /*Bug5598011 Pass the order_type as PO */
404: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_PRICE_DATE
416:
417:
418: l_progress := '020';
419: IF g_debug_stmt THEN
420: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
421: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
423: END IF; /* IF g_debug_stmt */
424:
417:
418: l_progress := '020';
419: IF g_debug_stmt THEN
420: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
421: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
423: END IF; /* IF g_debug_stmt */
424:
425: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
418: l_progress := '020';
419: IF g_debug_stmt THEN
420: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling get_custom_price_date');
421: PO_DEBUG.debug_var(l_log_head,l_progress,'l_pricing_date',l_pricing_date);
422: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
423: END IF; /* IF g_debug_stmt */
424:
425: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
426: app_exception.raise_exception;
442: -- To improve performance, moved this so that we only call
443: -- get_release_quantity if pricing is cumulative.
444: l_progress := '040';
445: IF g_debug_stmt THEN
446: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get Release Quantity');
447: END IF;
448:
449: /* Call get_release_quantity to a) determine how to select
450: ** the correct break price and b) the quantity released against
456: match_type);
457:
458: l_progress := '060';
459: IF g_debug_stmt THEN
460: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get Release Quantity');
461: END IF;
462: --
463:
464: -- Bug 670873, lpo, 05/28/98
552: l_rate := NULL;
553:
554: l_progress := '125';
555: IF g_debug_stmt THEN
556: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_code',l_currency_code);
557: PO_DEBUG.debug_var(l_log_head,l_progress,'l_adv_price',l_adv_price);
558: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
559: END IF; /* IF g_debug_stmt */
560:
553:
554: l_progress := '125';
555: IF g_debug_stmt THEN
556: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_code',l_currency_code);
557: PO_DEBUG.debug_var(l_log_head,l_progress,'l_adv_price',l_adv_price);
558: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
559: END IF; /* IF g_debug_stmt */
560:
561:
554: l_progress := '125';
555: IF g_debug_stmt THEN
556: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_code',l_currency_code);
557: PO_DEBUG.debug_var(l_log_head,l_progress,'l_adv_price',l_adv_price);
558: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(GBPA)');
559: END IF; /* IF g_debug_stmt */
560:
561:
562: PO_ADVANCED_PRICE_PVT.get_advanced_price
588: , x_return_status => l_return_status );
589:
590: l_progress := '130';
591: IF g_debug_stmt THEN
592: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(GBPA)');
593: END IF;
594:
595: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
596: app_exception.raise_exception;
597: END IF; /* IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) */
598:
599: l_progress := '135';
600: IF g_debug_stmt THEN
601: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',l_return_status);
602: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',l_base_unit_price);
603: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',l_price);
604: END IF;
605:
598:
599: l_progress := '135';
600: IF g_debug_stmt THEN
601: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',l_return_status);
602: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',l_base_unit_price);
603: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',l_price);
604: END IF;
605:
606: ELSE /* Invalid Line type*/
599: l_progress := '135';
600: IF g_debug_stmt THEN
601: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',l_return_status);
602: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',l_base_unit_price);
603: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',l_price);
604: END IF;
605:
606: ELSE /* Invalid Line type*/
607:
605:
606: ELSE /* Invalid Line type*/
607:
608: IF g_debug_stmt THEN
609: PO_DEBUG.debug_stmt(l_log_head, l_progress,
610: 'Not a valid price type to call Advanced Pricing API(GBPA)');
611: END IF;
612:
613: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
621:
622: --
623: l_progress := '140';
624: IF g_debug_stmt THEN
625: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call get_custom_po_price');
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
622: --
623: l_progress := '140';
624: IF g_debug_stmt THEN
625: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call get_custom_po_price');
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
623: l_progress := '140';
624: IF g_debug_stmt THEN
625: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call get_custom_po_price');
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
624: IF g_debug_stmt THEN
625: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call get_custom_po_price');
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
625: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Call get_custom_po_price');
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
633: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_price',l_price);
626: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_order_quantity',p_order_quantity);
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
633: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_price',l_price);
634: END IF; /* IF g_debug_stmt */
627: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_org',p_ship_to_org);
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
633: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_price',l_price);
634: END IF; /* IF g_debug_stmt */
635:
628: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_ship_to_loc',p_ship_to_loc);
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
633: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_price',l_price);
634: END IF; /* IF g_debug_stmt */
635:
636: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_PO_PRICE(p_api_version => 1.0,
629: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_po_line_id',p_po_line_id);
630: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_need_by_date',p_need_by_date);
631: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_pricing_date',l_pricing_date);
632: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_line_location_id',p_line_location_id);
633: PO_DEBUG.debug_var(l_log_head,l_progress, 'p_price',l_price);
634: END IF; /* IF g_debug_stmt */
635:
636: PO_CUSTOM_PRICE_PUB.GET_CUSTOM_PO_PRICE(p_api_version => 1.0,
637: p_order_quantity => p_order_quantity,
648: p_req_line_price => p_req_line_price);
649:
650: l_progress := '160';
651: IF g_debug_stmt THEN
652: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'After Call get_custom_po_price');
653: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_new_price',l_new_price);
654: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_return_status',x_return_status);
655: END IF; /* IF g_debug_stmt */
656:
649:
650: l_progress := '160';
651: IF g_debug_stmt THEN
652: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'After Call get_custom_po_price');
653: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_new_price',l_new_price);
654: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_return_status',x_return_status);
655: END IF; /* IF g_debug_stmt */
656:
657: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
650: l_progress := '160';
651: IF g_debug_stmt THEN
652: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'After Call get_custom_po_price');
653: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_new_price',l_new_price);
654: PO_DEBUG.debug_var(l_log_head,l_progress, 'x_return_status',x_return_status);
655: END IF; /* IF g_debug_stmt */
656:
657: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
658: app_exception.raise_exception;
683:
684: IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id)) THEN
685: l_progress := '180';
686: IF g_debug_stmt THEN
687: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
688: END IF;
689:
690: l_progress := '200';
691: IF g_debug_stmt THEN
688: END IF;
689:
690: l_progress := '200';
691: IF g_debug_stmt THEN
692: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get Currency Info');
693: END IF; /* IF g_debug_stmt */
694:
695:
696: -- bug5339880
707: l_rate := NULL;
708:
709: l_progress := '220';
710: IF g_debug_stmt THEN
711: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_code',l_currency_code);
712: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
713: END IF; /* IF g_debug_stmt */
714:
715: PO_ADVANCED_PRICE_PVT.get_advanced_price
708:
709: l_progress := '220';
710: IF g_debug_stmt THEN
711: PO_DEBUG.debug_var(l_log_head,l_progress,'l_currency_code',l_currency_code);
712: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call Advanced Pricing API(CPA)');
713: END IF; /* IF g_debug_stmt */
714:
715: PO_ADVANCED_PRICE_PVT.get_advanced_price
716: ( p_org_id => p_org_id
742: , x_return_status => l_return_status );
743:
744: l_progress := '380';
745: IF g_debug_stmt THEN
746: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Call Advanced Pricing API(CPA)');
747: END IF;
748:
749: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
750: app_exception.raise_exception;
752:
753: ELSE
754: l_progress := '400';
755: IF g_debug_stmt THEN
756: PO_DEBUG.debug_stmt(l_log_head, l_progress,
757: 'Not a valid price type to call Advanced Pricing API(CPA)');
758: END IF;
759: END IF; /*IF (PO_ADVANCED_PRICE_PVT.is_valid_qp_line_type(p_line_type_id))*/
760:
776: END;
777:
778: l_progress := '400';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_end(l_log_head);
781: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
782: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
783: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',x_price);
784: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
777:
778: l_progress := '400';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_end(l_log_head);
781: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
782: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
783: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',x_price);
784: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
785: END IF; /* IF g_debug_stmt */
778: l_progress := '400';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_end(l_log_head);
781: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
782: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
783: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',x_price);
784: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
785: END IF; /* IF g_debug_stmt */
786:
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_end(l_log_head);
781: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
782: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
783: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',x_price);
784: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
785: END IF; /* IF g_debug_stmt */
786:
787: EXCEPTION
780: PO_DEBUG.debug_end(l_log_head);
781: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
782: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
783: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price',x_price);
784: PO_DEBUG.debug_var(l_log_head,l_progress,'x_price_break_id',x_price_break_id);
785: END IF; /* IF g_debug_stmt */
786:
787: EXCEPTION
788: