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: --------------------------------------------------------------------------------
486: x_unit_price := p_unit_price;
487: l_draft_id := p_draft_id; --Enhanced Pricing
488:
489: IF g_debug_stmt THEN
490: PO_DEBUG.debug_begin(l_log_head);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
487: l_draft_id := p_draft_id; --Enhanced Pricing
488:
489: IF g_debug_stmt THEN
490: PO_DEBUG.debug_begin(l_log_head);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
488:
489: IF g_debug_stmt THEN
490: PO_DEBUG.debug_begin(l_log_head);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
489: IF g_debug_stmt THEN
490: PO_DEBUG.debug_begin(l_log_head);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
490: PO_DEBUG.debug_begin(l_log_head);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
491: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
492: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
493: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
494: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
495: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
496: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
497: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
498: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
499: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
500: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
501: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
502: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
503: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
504: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
505: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
506: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
507: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
508: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
516: --Bug:8598002 renamed p_retro_pricing to p_pricing_call_src, to distinguish calls from retro and auto creation
509: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
510: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
516: --Bug:8598002 renamed p_retro_pricing to p_pricing_call_src, to distinguish calls from retro and auto creation
517: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_pricing_call_src', p_pricing_call_src);
511: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
512: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
516: --Bug:8598002 renamed p_retro_pricing to p_pricing_call_src, to distinguish calls from retro and auto creation
517: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_pricing_call_src', p_pricing_call_src);
518: --
519: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
513: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
514: --
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
516: --Bug:8598002 renamed p_retro_pricing to p_pricing_call_src, to distinguish calls from retro and auto creation
517: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_pricing_call_src', p_pricing_call_src);
518: --
519: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
520: END IF;
521:
515: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_draft_id', p_draft_id);
516: --Bug:8598002 renamed p_retro_pricing to p_pricing_call_src, to distinguish calls from retro and auto creation
517: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_pricing_call_src', p_pricing_call_src);
518: --
519: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
520: END IF;
521:
522: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT', l_qp_license);
523: l_qp_license_product := FND_PROFILE.VALUE_SPECIFIC(NAME => 'QP_LICENSED_FOR_PRODUCT',application_id => 201); /*Added for bug 8762015*/
522: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT', l_qp_license);
523: l_qp_license_product := FND_PROFILE.VALUE_SPECIFIC(NAME => 'QP_LICENSED_FOR_PRODUCT',application_id => 201); /*Added for bug 8762015*/
524: l_progress := '020';
525: IF g_debug_stmt THEN
526: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_qp_license', l_qp_license);
527: END IF;
528:
529: --Bug 5555953: Remove the logic to nullify the output unitprice if the Adv Pricing API
530: --is not installed or licensed to PO;
537: END IF;
538:
539: l_progress := '040';
540: IF g_debug_stmt THEN
541: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set Price Request ID');
542: END IF;
543:
544: QP_PRICE_REQUEST_CONTEXT.set_request_id;
545:
544: QP_PRICE_REQUEST_CONTEXT.set_request_id;
545:
546: l_progress := '060';
547: IF g_debug_stmt THEN
548: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Populate Global Header Structure');
549: END IF;
550:
551: populate_header_record(
552: p_org_id => p_org_id,
559: p_ship_to_org_id => p_ship_to_org_id);
560:
561: l_progress := '080';
562: IF g_debug_stmt THEN
563: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Populate Global Line Structure');
564: END IF;
565:
566: populate_line_record(
567: p_order_line_id => p_order_line_id,
584:
585:
586: l_progress := '090';
587: IF g_debug_stmt THEN
588: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set OE Debug');
589: OE_DEBUG_PUB.SetDebugLevel(10);
590: PO_DEBUG.debug_stmt(l_log_head, l_progress, 'Debug File Location:'||
591: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
592: OE_DEBUG_PUB.Initialize;
586: l_progress := '090';
587: IF g_debug_stmt THEN
588: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set OE Debug');
589: OE_DEBUG_PUB.SetDebugLevel(10);
590: PO_DEBUG.debug_stmt(l_log_head, l_progress, 'Debug File Location:'||
591: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
592: OE_DEBUG_PUB.Initialize;
593: OE_DEBUG_PUB.Debug_On;
594: END IF;
594: END IF;
595:
596: l_progress := '100';
597: IF g_debug_stmt THEN
598: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Build Attributes Mapping Contexts');
599: END IF;
600:
601: QP_Attr_Mapping_PUB.Build_Contexts(
602: p_request_type_code => 'PO',
607: x_pass_line => l_pass_line);
608:
609: l_progress := '110';
610: IF g_debug_stmt THEN
611: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Get UOM Code');
612: END IF;
613:
614: BEGIN
615: -- Make sure we pass uom_code instead of unit_of_measure.
623: END;
624:
625: l_progress := '120';
626: IF g_debug_stmt THEN
627: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_uom_code', l_uom_code);
628: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Directly Insert into Temp table');
629: END IF;
630:
631: l_request_type_code_tbl(1) := 'PO';
624:
625: l_progress := '120';
626: IF g_debug_stmt THEN
627: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_uom_code', l_uom_code);
628: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Directly Insert into Temp table');
629: END IF;
630:
631: l_request_type_code_tbl(1) := 'PO';
632: l_line_id_tbl(1) := l_line_id; -- order line id
679: l_list_price_overide_flag_tbl(1) := 'O'; -- Override price
680:
681: l_progress := '140';
682: IF g_debug_stmt THEN
683: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Call INSERT_LINES2');
684: END IF;
685:
686: QP_PREQ_GRP.INSERT_LINES2
687: (p_line_index => l_line_index_tbl,
723: x_status_text => l_return_status_text);
724:
725: l_progress := '160';
726: IF g_debug_stmt THEN
727: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
728: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
729: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
730: END IF;
731:
724:
725: l_progress := '160';
726: IF g_debug_stmt THEN
727: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
728: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
729: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
730: END IF;
731:
732: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
725: l_progress := '160';
726: IF g_debug_stmt THEN
727: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
728: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
729: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
730: END IF;
731:
732: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
733: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
776: --Enhanced Pricing End
777:
778: l_progress := '180';
779: IF g_debug_stmt THEN
780: PO_DEBUG.debug_stmt(l_log_head, l_progress,
781: 'Populate Control Record for Pricing Request Call');
782: END IF;
783:
784: l_control_rec.calculate_flag := 'Y';
797: l_control_rec.get_freight_flag := 'N';
798:
799: l_progress := '200';
800: IF g_debug_stmt THEN
801: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Call PRICE_REQUEST');
802: END IF;
803:
804: QP_PREQ_PUB.PRICE_REQUEST(
805: p_control_rec => l_control_rec,
807: x_return_status_Text => l_return_status_Text);
808:
809: l_progress := '220';
810: IF g_debug_stmt THEN
811: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
812: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
813: END IF;
814:
815: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
808:
809: l_progress := '220';
810: IF g_debug_stmt THEN
811: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
812: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
813: END IF;
814:
815: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
816: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
860: );
861:
862: l_progress := '230';
863: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
864: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status', l_return_status);
865: PO_DEBUG.debug_unexp(l_log_head, l_progress,'audit_qp_price_adjustment errors out');
866: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
867: FND_MESSAGE.SET_TOKEN('ERROR_TEXT', l_msg_data);
868: FND_MSG_PUB.Add;
861:
862: l_progress := '230';
863: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
864: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status', l_return_status);
865: PO_DEBUG.debug_unexp(l_log_head, l_progress,'audit_qp_price_adjustment errors out');
866: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
867: FND_MESSAGE.SET_TOKEN('ERROR_TEXT', l_msg_data);
868: FND_MSG_PUB.Add;
869: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
871: --
872:
873: l_progress := '240';
874: IF g_debug_stmt THEN
875: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Fetch QP pricing');
876: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
877: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
878: END IF;
879:
872:
873: l_progress := '240';
874: IF g_debug_stmt THEN
875: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Fetch QP pricing');
876: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
877: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
878: END IF;
879:
880: /* Use API insted
873: l_progress := '240';
874: IF g_debug_stmt THEN
875: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Fetch QP pricing');
876: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
877: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
878: END IF;
879:
880: /* Use API insted
881: -- SQL What: Fetch Price from Pricing Temp table
904: );
905:
906: l_progress := '260';
907: IF g_debug_stmt THEN
908: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
909: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price', x_base_unit_price);
910: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price', x_unit_price);
911: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_code', l_price_status_code);
912: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_text', l_price_status_text);
905:
906: l_progress := '260';
907: IF g_debug_stmt THEN
908: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
909: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price', x_base_unit_price);
910: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price', x_unit_price);
911: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_code', l_price_status_code);
912: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_text', l_price_status_text);
913: END IF;
906: l_progress := '260';
907: IF g_debug_stmt THEN
908: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
909: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price', x_base_unit_price);
910: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price', x_unit_price);
911: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_code', l_price_status_code);
912: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_text', l_price_status_text);
913: END IF;
914:
907: IF g_debug_stmt THEN
908: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
909: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price', x_base_unit_price);
910: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price', x_unit_price);
911: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_code', l_price_status_code);
912: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_text', l_price_status_text);
913: END IF;
914:
915: x_unit_price := NVL(x_unit_price, x_base_unit_price);
908: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
909: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price', x_base_unit_price);
910: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price', x_unit_price);
911: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_code', l_price_status_code);
912: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_price_status_text', l_price_status_text);
913: END IF;
914:
915: x_unit_price := NVL(x_unit_price, x_base_unit_price);
916:
921: END IF;
922:
923: l_progress := '300';
924: IF g_debug_stmt THEN
925: PO_DEBUG.debug_end(l_log_head);
926: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status',
927: x_return_status);
928: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price',
929: x_base_unit_price);
922:
923: l_progress := '300';
924: IF g_debug_stmt THEN
925: PO_DEBUG.debug_end(l_log_head);
926: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status',
927: x_return_status);
928: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price',
929: x_base_unit_price);
930: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price',
924: IF g_debug_stmt THEN
925: PO_DEBUG.debug_end(l_log_head);
926: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status',
927: x_return_status);
928: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price',
929: x_base_unit_price);
930: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price',
931: x_unit_price);
932: END IF;
926: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status',
927: x_return_status);
928: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_base_unit_price',
929: x_base_unit_price);
930: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_unit_price',
931: x_unit_price);
932: END IF;
933:
934: EXCEPTION
938: p_msg_index => FND_MSG_PUB.G_LAST
939: , p_encoded => 'F'
940: );
941: IF g_debug_unexp THEN
942: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
943: l_exception_msg);
944: END IF;
945: x_return_status := FND_API.g_ret_sts_error;
946: -- Push the po_return_msg onto msg list and message stack
953: p_msg_index => FND_MSG_PUB.G_LAST
954: , p_encoded => 'F'
955: );
956: IF g_debug_unexp THEN
957: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
958: l_exception_msg);
959: END IF;
960: x_return_status := FND_API.g_ret_sts_unexp_error;
961: -- Push the po_return_msg onto msg list and message stack
963: FND_MESSAGE.SET_TOKEN('ERROR_TEXT', l_exception_msg);
964:
965: WHEN OTHERS THEN
966: IF g_debug_unexp THEN
967: PO_DEBUG.debug_exc(l_log_head, l_progress);
968: END IF;
969: --unexpected error from this procedure: get SQLERRM
970: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
971: l_exception_msg := FND_MESSAGE.get;
969: --unexpected error from this procedure: get SQLERRM
970: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
971: l_exception_msg := FND_MESSAGE.get;
972: IF g_debug_unexp THEN
973: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
974: l_exception_msg);
975: END IF;
976: x_return_status := FND_API.g_ret_sts_unexp_error;
977: -- Push the po_return_msg onto msg list and message stack
1016: -- l_matching_basis PO_LINE_TYPES.matching_basis%TYPE;
1017: l_value_basis PO_LINE_TYPES.order_type_lookup_code%TYPE;
1018: BEGIN
1019: IF g_debug_stmt THEN
1020: PO_DEBUG.debug_begin(l_log_head);
1021: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_line_type_id', p_line_type_id);
1022: END IF;
1023:
1024: IF (p_line_type_id IS NULL) THEN
1017: l_value_basis PO_LINE_TYPES.order_type_lookup_code%TYPE;
1018: BEGIN
1019: IF g_debug_stmt THEN
1020: PO_DEBUG.debug_begin(l_log_head);
1021: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_line_type_id', p_line_type_id);
1022: END IF;
1023:
1024: IF (p_line_type_id IS NULL) THEN
1025: RETURN TRUE;
1038: WHERE line_type_id = p_line_type_id;
1039:
1040: l_progress := '020';
1041: IF g_debug_stmt THEN
1042: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Retrieved line type');
1043: END IF;
1044:
1045: IF (l_purchase_basis IN ('TEMP LABOR', 'SERVICES') AND
1046: -- Bug 3343261: should use value_basis instead of matching_basis
1049: END IF;
1050:
1051: l_progress := '030';
1052: IF g_debug_stmt THEN
1053: PO_DEBUG.debug_end(l_log_head);
1054: END IF;
1055:
1056: RETURN TRUE;
1057: EXCEPTION
1364: d_pos := 140;
1365:
1366: IF g_debug_stmt THEN
1367: --make the pricing debug ON
1368: PO_DEBUG.debug_stmt(l_log_head, d_pos,'Set OE Debug');
1369: OE_DEBUG_PUB.SetDebugLevel(10);
1370: PO_DEBUG.debug_stmt(l_log_head, d_pos, 'Debug File Location: '||
1371: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1372: OE_DEBUG_PUB.Initialize;
1366: IF g_debug_stmt THEN
1367: --make the pricing debug ON
1368: PO_DEBUG.debug_stmt(l_log_head, d_pos,'Set OE Debug');
1369: OE_DEBUG_PUB.SetDebugLevel(10);
1370: PO_DEBUG.debug_stmt(l_log_head, d_pos, 'Debug File Location: '||
1371: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1372: OE_DEBUG_PUB.Initialize;
1373: OE_DEBUG_PUB.Debug_On;
1374: END IF;
1586: );
1587:
1588: l_progress := '230';
1589: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1590: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
1591: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
1592: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
1593: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
1594: FND_MSG_PUB.Add;
1587:
1588: l_progress := '230';
1589: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1590: PO_DEBUG.debug_var(l_log_head,l_progress,'l_return_status',l_return_status);
1591: PO_DEBUG.debug_unexp(l_log_head,l_progress,'audit_qp_price_adjustment errors out');
1592: FND_MESSAGE.SET_NAME('PO','PO_QP_PRICE_API_ERROR');
1593: FND_MESSAGE.SET_TOKEN('ERROR_TEXT',l_msg_data);
1594: FND_MSG_PUB.Add;
1595: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1891: --Initialize OUT parameters
1892: x_return_status := FND_API.G_RET_STS_SUCCESS;
1893:
1894: IF g_debug_stmt THEN
1895: PO_DEBUG.debug_begin(l_log_head);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1892: x_return_status := FND_API.G_RET_STS_SUCCESS;
1893:
1894: IF g_debug_stmt THEN
1895: PO_DEBUG.debug_begin(l_log_head);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1893:
1894: IF g_debug_stmt THEN
1895: PO_DEBUG.debug_begin(l_log_head);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1894: IF g_debug_stmt THEN
1895: PO_DEBUG.debug_begin(l_log_head);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1895: PO_DEBUG.debug_begin(l_log_head);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1896: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_org_id', p_org_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1897: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_id', p_supplier_id);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1898: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_site_id', p_supplier_site_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1899: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_creation_date', p_creation_date);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1900: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_type', p_order_type);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1901: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_location_id', p_ship_to_location_id);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1902: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_ship_to_org_id', p_ship_to_org_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1903: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_header_id', p_order_header_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1904: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_order_line_id', p_order_line_id);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1905: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_revision', p_item_revision);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1906: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_item_id', p_item_id);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1907: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_category_id', p_category_id);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1908: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_supplier_item_num', p_supplier_item_num);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1909: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_type', p_agreement_type);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1910: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_id', p_agreement_id);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1911: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_agreement_line_id', p_agreement_line_id);
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1919: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
1912: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate', p_rate);
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1919: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
1920: END IF;
1913: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_rate_type', p_rate_type);
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1919: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
1920: END IF;
1921:
1914: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_currency_code', p_currency_code);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1919: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
1920: END IF;
1921:
1922: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT', l_qp_license);
1915: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_need_by_date', p_need_by_date);
1916: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_quantity', p_quantity);
1917: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_uom', p_uom);
1918: PO_DEBUG.debug_var(l_log_head, l_progress, 'p_unit_price', p_unit_price);
1919: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Check Advanced Pricing License');
1920: END IF;
1921:
1922: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT', l_qp_license);
1923: l_progress := '020';
1921:
1922: FND_PROFILE.get('QP_LICENSED_FOR_PRODUCT', l_qp_license);
1923: l_progress := '020';
1924: IF g_debug_stmt THEN
1925: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_qp_license', l_qp_license);
1926: END IF;
1927:
1928: IF (l_qp_license IS NULL OR l_qp_license <> 'PO') THEN
1929: RETURN;
1930: END IF;
1931:
1932: l_progress := '040';
1933: IF g_debug_stmt THEN
1934: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set Price Request ID');
1935: END IF;
1936:
1937: QP_PRICE_REQUEST_CONTEXT.set_request_id;
1938:
1937: QP_PRICE_REQUEST_CONTEXT.set_request_id;
1938:
1939: l_progress := '060';
1940: IF g_debug_stmt THEN
1941: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Populate Global Header Structure');
1942: END IF;
1943:
1944: populate_header_record(
1945: p_org_id => p_org_id,
1952: p_ship_to_org_id => p_ship_to_org_id);
1953:
1954: l_progress := '080';
1955: IF g_debug_stmt THEN
1956: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Populate Global Line Structure');
1957: END IF;
1958:
1959: populate_line_record(
1960: p_order_line_id => p_order_line_id,
1977:
1978:
1979: l_progress := '090';
1980: IF g_debug_stmt THEN
1981: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set OE Debug');
1982: OE_DEBUG_PUB.SetDebugLevel(10);
1983: PO_DEBUG.debug_stmt(l_log_head, l_progress, 'Debug File Location:'||
1984: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1985: OE_DEBUG_PUB.Initialize;
1979: l_progress := '090';
1980: IF g_debug_stmt THEN
1981: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Set OE Debug');
1982: OE_DEBUG_PUB.SetDebugLevel(10);
1983: PO_DEBUG.debug_stmt(l_log_head, l_progress, 'Debug File Location:'||
1984: OE_DEBUG_PUB.Set_Debug_Mode('FILE'));
1985: OE_DEBUG_PUB.Initialize;
1986: OE_DEBUG_PUB.Debug_On;
1987: END IF;
1987: END IF;
1988:
1989: l_progress := '100';
1990: IF g_debug_stmt THEN
1991: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Build Attributes Mapping Contexts');
1992: END IF;
1993:
1994: QP_Attr_Mapping_PUB.Build_Contexts(
1995: p_request_type_code => 'PO',
2000: x_pass_line => l_pass_line);
2001:
2002: l_progress := '110';
2003: IF g_debug_stmt THEN
2004: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Get UOM Code');
2005: END IF;
2006:
2007: BEGIN
2008: -- Make sure we pass uom_code instead of unit_of_measure.
2016: END;
2017:
2018: l_progress := '120';
2019: IF g_debug_stmt THEN
2020: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_uom_code', l_uom_code);
2021: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Directly Insert into Temp table');
2022: END IF;
2023:
2024: l_request_type_code_tbl(1) := 'PO';
2017:
2018: l_progress := '120';
2019: IF g_debug_stmt THEN
2020: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_uom_code', l_uom_code);
2021: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Directly Insert into Temp table');
2022: END IF;
2023:
2024: l_request_type_code_tbl(1) := 'PO';
2025: l_line_id_tbl(1) := l_line_id; -- order line id
2072: l_list_price_overide_flag_tbl(1) := 'O'; -- Override price
2073:
2074: l_progress := '140';
2075: IF g_debug_stmt THEN
2076: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Call INSERT_LINES2');
2077: END IF;
2078:
2079: QP_PREQ_GRP.INSERT_LINES2
2080: (p_line_index => l_line_index_tbl,
2116: x_status_text => l_return_status_text);
2117:
2118: l_progress := '160';
2119: IF g_debug_stmt THEN
2120: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
2121: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2122: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
2123: END IF;
2124:
2117:
2118: l_progress := '160';
2119: IF g_debug_stmt THEN
2120: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
2121: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2122: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
2123: END IF;
2124:
2125: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2118: l_progress := '160';
2119: IF g_debug_stmt THEN
2120: PO_DEBUG.debug_stmt(l_log_head, l_progress,'After Calling INSERT_LINES2');
2121: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2122: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
2123: END IF;
2124:
2125: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2126: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
2138: -- ASK_FOR attributes
2139:
2140: l_progress := '180';
2141: IF g_debug_stmt THEN
2142: PO_DEBUG.debug_stmt(l_log_head, l_progress,
2143: 'Populate Control Record for Pricing Request Call to fetch the manual modifiers');
2144: END IF;
2145:
2146: l_control_rec.manual_adjustments_call_flag := qp_preq_grp.G_YES;
2160: l_control_rec.get_freight_flag := 'N';
2161:
2162: l_progress := '200';
2163: IF g_debug_stmt THEN
2164: PO_DEBUG.debug_stmt(l_log_head, l_progress,'Call PRICE_REQUEST');
2165: END IF;
2166:
2167: QP_PREQ_PUB.PRICE_REQUEST(
2168: p_control_rec => l_control_rec,
2170: x_return_status_Text => l_return_status_Text);
2171:
2172: l_progress := '220';
2173: IF g_debug_stmt THEN
2174: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2175: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
2176: END IF;
2177:
2178: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2171:
2172: l_progress := '220';
2173: IF g_debug_stmt THEN
2174: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2175: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_return_status_text', l_return_status_text);
2176: END IF;
2177:
2178: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2179: FND_MESSAGE.SET_NAME('PO', 'PO_QP_PRICE_API_ERROR');
2188: END IF;
2189:
2190: l_progress := '240';
2191: IF g_debug_stmt THEN
2192: PO_DEBUG.debug_stmt(l_log_head, l_progress,'The QP call is made successfully. The Manual modifiers can be fetched from QP temp tables');
2193: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
2194: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
2195: END IF;
2196:
2189:
2190: l_progress := '240';
2191: IF g_debug_stmt THEN
2192: PO_DEBUG.debug_stmt(l_log_head, l_progress,'The QP call is made successfully. The Manual modifiers can be fetched from QP temp tables');
2193: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
2194: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
2195: END IF;
2196:
2197: l_progress := '300';
2190: l_progress := '240';
2191: IF g_debug_stmt THEN
2192: PO_DEBUG.debug_stmt(l_log_head, l_progress,'The QP call is made successfully. The Manual modifiers can be fetched from QP temp tables');
2193: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_line_id', l_line_id);
2194: PO_DEBUG.debug_table(l_log_head, l_progress, 'QP_PREQ_LINES_TMP_T', PO_DEBUG.g_all_rows, NULL, 'QP');
2195: END IF;
2196:
2197: l_progress := '300';
2198: IF g_debug_stmt THEN
2195: END IF;
2196:
2197: l_progress := '300';
2198: IF g_debug_stmt THEN
2199: PO_DEBUG.debug_end(l_log_head);
2200: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2201: END IF;
2202:
2203: EXCEPTION
2196:
2197: l_progress := '300';
2198: IF g_debug_stmt THEN
2199: PO_DEBUG.debug_end(l_log_head);
2200: PO_DEBUG.debug_var(l_log_head, l_progress, 'x_return_status', x_return_status);
2201: END IF;
2202:
2203: EXCEPTION
2204: WHEN FND_API.G_EXC_ERROR THEN
2207: p_msg_index => FND_MSG_PUB.G_LAST
2208: , p_encoded => 'F'
2209: );
2210: IF g_debug_unexp THEN
2211: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
2212: l_exception_msg);
2213: END IF;
2214: x_return_status := FND_API.g_ret_sts_error;
2215: -- Push the po_return_msg onto msg list and message stack
2222: p_msg_index => FND_MSG_PUB.G_LAST
2223: , p_encoded => 'F'
2224: );
2225: IF g_debug_unexp THEN
2226: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
2227: l_exception_msg);
2228: END IF;
2229: x_return_status := FND_API.g_ret_sts_unexp_error;
2230: -- Push the po_return_msg onto msg list and message stack
2232: FND_MESSAGE.SET_TOKEN('ERROR_TEXT', l_exception_msg);
2233:
2234: WHEN OTHERS THEN
2235: IF g_debug_unexp THEN
2236: PO_DEBUG.debug_exc(l_log_head, l_progress);
2237: END IF;
2238: --unexpected error from this procedure: get SQLERRM
2239: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
2240: l_exception_msg := FND_MESSAGE.get;
2238: --unexpected error from this procedure: get SQLERRM
2239: po_message_s.sql_error(g_pkg_name, l_api_name, l_progress, SQLCODE, SQLERRM);
2240: l_exception_msg := FND_MESSAGE.get;
2241: IF g_debug_unexp THEN
2242: PO_DEBUG.debug_var(l_log_head, l_progress, 'l_exception_msg',
2243: l_exception_msg);
2244: END IF;
2245: x_return_status := FND_API.g_ret_sts_unexp_error;
2246: -- Push the po_return_msg onto msg list and message stack