6: g_pkg_name CONSTANT varchar2(30) := 'PO_ADVANCED_PRICE_PVT';
7: g_log_head CONSTANT VARCHAR2(50) := 'po.plsql.'|| g_pkg_name || '.';
8:
9: -- Debugging
10: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
11: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
12:
13: --------------------------------------------------------------------------------
14: -- Forward procedure declarations
7: g_log_head CONSTANT VARCHAR2(50) := 'po.plsql.'|| g_pkg_name || '.';
8:
9: -- Debugging
10: g_debug_stmt BOOLEAN := PO_DEBUG.is_debug_stmt_on;
11: g_debug_unexp BOOLEAN := PO_DEBUG.is_debug_unexp_on;
12:
13: --------------------------------------------------------------------------------
14: -- Forward procedure declarations
15: --------------------------------------------------------------------------------
467: x_base_unit_price := p_unit_price;
468: x_unit_price := p_unit_price;
469:
470: IF g_debug_stmt THEN
471: PO_DEBUG.debug_begin(l_log_head);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
468: x_unit_price := p_unit_price;
469:
470: IF g_debug_stmt THEN
471: PO_DEBUG.debug_begin(l_log_head);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
469:
470: IF g_debug_stmt THEN
471: PO_DEBUG.debug_begin(l_log_head);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
470: IF g_debug_stmt THEN
471: PO_DEBUG.debug_begin(l_log_head);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
471: PO_DEBUG.debug_begin(l_log_head);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
472: PO_DEBUG.debug_var(l_log_head,l_progress,'p_org_id',p_org_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
473: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
474: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_site_id',p_supplier_site_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
475: PO_DEBUG.debug_var(l_log_head,l_progress,'p_creation_date',p_creation_date);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
476: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_type',p_order_type);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
477: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_location_id',p_ship_to_location_id);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
478: PO_DEBUG.debug_var(l_log_head,l_progress,'p_ship_to_org_id',p_ship_to_org_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
479: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_header_id',p_order_header_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
480: PO_DEBUG.debug_var(l_log_head,l_progress,'p_order_line_id',p_order_line_id);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
481: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_revision',p_item_revision);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
482: PO_DEBUG.debug_var(l_log_head,l_progress,'p_item_id',p_item_id);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
483: PO_DEBUG.debug_var(l_log_head,l_progress,'p_category_id',p_category_id);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
484: PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_item_num',p_supplier_item_num);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
485: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_type',p_agreement_type);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
486: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_id',p_agreement_id);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
487: PO_DEBUG.debug_var(l_log_head,l_progress,'p_agreement_line_id',p_agreement_line_id);
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
495: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check Advanced Pricing License');
488: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate',p_rate);
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
495: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check Advanced Pricing License');
496: END IF;
489: PO_DEBUG.debug_var(l_log_head,l_progress,'p_rate_type',p_rate_type);
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
495: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check Advanced Pricing License');
496: END IF;
497:
490: PO_DEBUG.debug_var(l_log_head,l_progress,'p_currency_code',p_currency_code);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
495: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check Advanced Pricing License');
496: END IF;
497:
498: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT',l_qp_license);
491: PO_DEBUG.debug_var(l_log_head,l_progress,'p_need_by_date',p_need_by_date);
492: PO_DEBUG.debug_var(l_log_head,l_progress,'p_quantity',p_quantity);
493: PO_DEBUG.debug_var(l_log_head,l_progress,'p_uom',p_uom);
494: PO_DEBUG.debug_var(l_log_head,l_progress,'p_unit_price',p_unit_price);
495: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Check Advanced Pricing License');
496: END IF;
497:
498: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT',l_qp_license);
499: l_progress := '020';
497:
498: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT',l_qp_license);
499: l_progress := '020';
500: IF g_debug_stmt THEN
501: PO_DEBUG.debug_var(l_log_head,l_progress,'l_qp_license',l_qp_license);
502: END IF;
503:
504: --Bug 5555953: Remove the logic to nullify the output unitprice if the Adv Pricing API
505: --is not installed or licensed to PO;
508: END IF;
509:
510: l_progress := '040';
511: IF g_debug_stmt THEN
512: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Set Price Request ID');
513: END IF;
514:
515: QP_PRICE_REQUEST_CONTEXT.set_request_id;
516:
515: QP_PRICE_REQUEST_CONTEXT.set_request_id;
516:
517: l_progress := '060';
518: IF g_debug_stmt THEN
519: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Populate Global Header Structure');
520: END IF;
521:
522: populate_header_record(
523: p_org_id => p_org_id,
530: p_ship_to_org_id => p_ship_to_org_id);
531:
532: l_progress := '080';
533: IF g_debug_stmt THEN
534: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Populate Global Line Structure');
535: END IF;
536:
537: populate_line_record(
538: p_order_line_id => p_order_line_id,
554:
555:
556: l_progress := '090';
557: IF g_debug_stmt THEN
558: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Set OE Debug');
559: OE_DEBUG_PUB.SetDebugLevel(10);
560: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Debug File Location:'||
561: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
562: OE_DEBUG_PUB.Initialize;
556: l_progress := '090';
557: IF g_debug_stmt THEN
558: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Set OE Debug');
559: OE_DEBUG_PUB.SetDebugLevel(10);
560: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Debug File Location:'||
561: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
562: OE_DEBUG_PUB.Initialize;
563: OE_DEBUG_PUB.Debug_On;
564: END IF;
564: END IF;
565:
566: l_progress := '100';
567: IF g_debug_stmt THEN
568: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Build Attributes Mapping Contexts');
569: END IF;
570:
571: QP_Attr_Mapping_PUB.Build_Contexts(
572: p_request_type_code => 'PO',
577: x_pass_line => l_pass_line);
578:
579: l_progress := '110';
580: IF g_debug_stmt THEN
581: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Get UOM Code');
582: END IF;
583:
584: BEGIN
585: -- Make sure we pass uom_code instead of unit_of_measure.
593: END;
594:
595: l_progress := '120';
596: IF g_debug_stmt THEN
597: PO_DEBUG.debug_var(l_log_head,l_progress,'l_uom_code',l_uom_code);
598: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Directly Insert into Temp table');
599: END IF;
600:
601: l_request_type_code_tbl(1) := 'PO';
594:
595: l_progress := '120';
596: IF g_debug_stmt THEN
597: PO_DEBUG.debug_var(l_log_head,l_progress,'l_uom_code',l_uom_code);
598: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Directly Insert into Temp table');
599: END IF;
600:
601: l_request_type_code_tbl(1) := 'PO';
602: l_line_id_tbl(1) := l_line_id; -- order line id
649: l_list_price_overide_flag_tbl(1) := 'O'; -- Override price
650:
651: l_progress := '140';
652: IF g_debug_stmt THEN
653: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call INSERT_LINES2');
654: END IF;
655:
656: QP_PREQ_GRP.INSERT_LINES2
657: (p_line_index => l_line_index_tbl,
693: x_status_text => l_return_status_text);
694:
695: l_progress := '160';
696: IF g_debug_stmt THEN
697: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling INSERT_LINES2');
698: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
699: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status_text',l_return_status_text);
700: END IF;
701:
694:
695: l_progress := '160';
696: IF g_debug_stmt THEN
697: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling INSERT_LINES2');
698: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
699: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status_text',l_return_status_text);
700: END IF;
701:
702: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
695: l_progress := '160';
696: IF g_debug_stmt THEN
697: PO_DEBUG.debug_stmt(l_log_head,l_progress,'After Calling INSERT_LINES2');
698: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
699: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status_text',l_return_status_text);
700: END IF;
701:
702: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
703: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
715: -- ASK_FOR attributes
716:
717: l_progress := '180';
718: IF g_debug_stmt THEN
719: PO_DEBUG.debug_stmt(l_log_head,l_progress,
720: 'Populate Control Record for Pricing Request Call');
721: END IF;
722:
723: l_control_rec.calculate_flag := 'Y';
736: l_control_rec.get_freight_flag := 'N';
737:
738: l_progress := '200';
739: IF g_debug_stmt THEN
740: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Call PRICE_REQUEST');
741: END IF;
742:
743: QP_PREQ_PUB.PRICE_REQUEST(
744: p_control_rec => l_control_rec,
746: x_return_status_Text => l_return_status_Text);
747:
748: l_progress := '220';
749: IF g_debug_stmt THEN
750: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
751: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status_text',l_return_status_text);
752: END IF;
753:
754: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
747:
748: l_progress := '220';
749: IF g_debug_stmt THEN
750: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
751: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status_text',l_return_status_text);
752: END IF;
753:
754: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
755: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
775: );
776:
777: l_progress := '230';
778: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
779: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
780: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
781: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
782: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
783: FND_MSG_PUB.Add;
776:
777: l_progress := '230';
778: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
779: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
780: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
781: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
782: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
783: FND_MSG_PUB.Add;
784: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
786: --
787:
788: l_progress := '240';
789: IF g_debug_stmt THEN
790: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Fetch QP pricing');
791: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_id',l_line_id);
792: PO_DEBUG.debug_table(l_log_head,l_progress,'QP_PREQ_LINES_TMP_T',PO_DEBUG.g_all_rows,NULL,'QP');
793: END IF;
794:
787:
788: l_progress := '240';
789: IF g_debug_stmt THEN
790: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Fetch QP pricing');
791: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_id',l_line_id);
792: PO_DEBUG.debug_table(l_log_head,l_progress,'QP_PREQ_LINES_TMP_T',PO_DEBUG.g_all_rows,NULL,'QP');
793: END IF;
794:
795: /* Use API insted
788: l_progress := '240';
789: IF g_debug_stmt THEN
790: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Fetch QP pricing');
791: PO_DEBUG.debug_var(l_log_head,l_progress,'l_line_id',l_line_id);
792: PO_DEBUG.debug_table(l_log_head,l_progress,'QP_PREQ_LINES_TMP_T',PO_DEBUG.g_all_rows,NULL,'QP');
793: END IF;
794:
795: /* Use API insted
796: -- SQL What: Fetch Price from Pricing Temp table
819: );
820:
821: l_progress := '260';
822: IF g_debug_stmt THEN
823: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
824: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
825: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',x_unit_price);
826: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_code',l_price_status_code);
827: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_text',l_price_status_text);
820:
821: l_progress := '260';
822: IF g_debug_stmt THEN
823: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
824: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
825: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',x_unit_price);
826: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_code',l_price_status_code);
827: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_text',l_price_status_text);
828: END IF;
821: l_progress := '260';
822: IF g_debug_stmt THEN
823: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
824: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
825: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',x_unit_price);
826: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_code',l_price_status_code);
827: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_text',l_price_status_text);
828: END IF;
829:
822: IF g_debug_stmt THEN
823: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
824: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
825: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',x_unit_price);
826: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_code',l_price_status_code);
827: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_text',l_price_status_text);
828: END IF;
829:
830: x_unit_price := NVL(x_unit_price, x_base_unit_price);
823: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',x_return_status);
824: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',x_base_unit_price);
825: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',x_unit_price);
826: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_code',l_price_status_code);
827: PO_DEBUG.debug_var(l_log_head,l_progress,'l_price_status_text',l_price_status_text);
828: END IF;
829:
830: x_unit_price := NVL(x_unit_price, x_base_unit_price);
831:
836: END IF;
837:
838: l_progress := '300';
839: IF g_debug_stmt THEN
840: PO_DEBUG.debug_end(l_log_head);
841: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',
842: x_return_status);
843: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',
844: x_base_unit_price);
837:
838: l_progress := '300';
839: IF g_debug_stmt THEN
840: PO_DEBUG.debug_end(l_log_head);
841: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',
842: x_return_status);
843: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',
844: x_base_unit_price);
845: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',
839: IF g_debug_stmt THEN
840: PO_DEBUG.debug_end(l_log_head);
841: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',
842: x_return_status);
843: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',
844: x_base_unit_price);
845: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',
846: x_unit_price);
847: END IF;
841: PO_DEBUG.debug_var(l_log_head,l_progress,'x_return_status',
842: x_return_status);
843: PO_DEBUG.debug_var(l_log_head,l_progress,'x_base_unit_price',
844: x_base_unit_price);
845: PO_DEBUG.debug_var(l_log_head,l_progress,'x_unit_price',
846: x_unit_price);
847: END IF;
848:
849: EXCEPTION
853: p_msg_index => FND_MSG_PUB.G_LAST
854: , p_encoded => 'F'
855: );
856: IF g_debug_unexp THEN
857: PO_DEBUG.debug_var(l_log_head,l_progress,'l_exception_msg',
858: l_exception_msg);
859: END IF;
860: x_return_status := FND_API.g_ret_sts_error;
861: -- Push the po_return_msg onto msg list and message stack
868: p_msg_index => FND_MSG_PUB.G_LAST
869: , p_encoded => 'F'
870: );
871: IF g_debug_unexp THEN
872: PO_DEBUG.debug_var(l_log_head,l_progress,'l_exception_msg',
873: l_exception_msg);
874: END IF;
875: x_return_status := FND_API.g_ret_sts_unexp_error;
876: -- Push the po_return_msg onto msg list and message stack
878: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_exception_msg);
879:
880: WHEN OTHERS THEN
881: IF g_debug_unexp THEN
882: PO_DEBUG.debug_exc(l_log_head,l_progress);
883: END IF;
884: --unexpected error from this procedure: get SQLERRM
885: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
886: l_exception_msg := FND_MESSAGE.get;
884: --unexpected error from this procedure: get SQLERRM
885: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
886: l_exception_msg := FND_MESSAGE.get;
887: IF g_debug_unexp THEN
888: PO_DEBUG.debug_var(l_log_head,l_progress,'l_exception_msg',
889: l_exception_msg);
890: END IF;
891: x_return_status := FND_API.g_ret_sts_unexp_error;
892: -- Push the po_return_msg onto msg list and message stack
931: -- l_matching_basis PO_LINE_TYPES.matching_basis%TYPE;
932: l_value_basis PO_LINE_TYPES.order_type_lookup_code%TYPE;
933: BEGIN
934: IF g_debug_stmt THEN
935: PO_DEBUG.debug_begin(l_log_head);
936: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
937: END IF;
938:
939: IF (p_line_type_id IS NULL) THEN
932: l_value_basis PO_LINE_TYPES.order_type_lookup_code%TYPE;
933: BEGIN
934: IF g_debug_stmt THEN
935: PO_DEBUG.debug_begin(l_log_head);
936: PO_DEBUG.debug_var(l_log_head,l_progress,'p_line_type_id',p_line_type_id);
937: END IF;
938:
939: IF (p_line_type_id IS NULL) THEN
940: RETURN TRUE;
953: WHERE line_type_id = p_line_type_id;
954:
955: l_progress := '020';
956: IF g_debug_stmt THEN
957: PO_DEBUG.debug_stmt(l_log_head,l_progress,'Retrieved line type');
958: END IF;
959:
960: IF (l_purchase_basis IN ('TEMP LABOR', 'SERVICES') AND
961: -- Bug 3343261: should use value_basis instead of matching_basis
964: END IF;
965:
966: l_progress := '030';
967: IF g_debug_stmt THEN
968: PO_DEBUG.debug_end(l_log_head);
969: END IF;
970:
971: RETURN TRUE;
972: EXCEPTION
1277: d_pos := 140;
1278:
1279: IF g_debug_stmt THEN
1280: --make the pricing debug ON
1281: PO_DEBUG.debug_stmt(l_log_head,d_pos,'Set OE Debug');
1282: OE_DEBUG_PUB.SetDebugLevel(10);
1283: PO_DEBUG.debug_stmt(l_log_head,d_pos, 'Debug File Location: '||
1284: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1285: OE_DEBUG_PUB.Initialize;
1279: IF g_debug_stmt THEN
1280: --make the pricing debug ON
1281: PO_DEBUG.debug_stmt(l_log_head,d_pos,'Set OE Debug');
1282: OE_DEBUG_PUB.SetDebugLevel(10);
1283: PO_DEBUG.debug_stmt(l_log_head,d_pos, 'Debug File Location: '||
1284: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1285: OE_DEBUG_PUB.Initialize;
1286: OE_DEBUG_PUB.Debug_On;
1287: END IF;
1499: );
1500:
1501: l_progress := '230';
1502: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1503: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
1504: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
1505: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
1506: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
1507: FND_MSG_PUB.Add;
1500:
1501: l_progress := '230';
1502: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1503: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
1504: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
1505: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
1506: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
1507: FND_MSG_PUB.Add;
1508: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;