Sample Code for Qp_preq_pub.Price_request Api to Simulate an Ask for Promotion Modifier
- DECLARE
- p_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
- p_qual_tbl QP_PREQ_GRP.QUAL_TBL_TYPE;
- p_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
- p_LINE_DETAIL_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
- p_LINE_DETAIL_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
- p_LINE_DETAIL_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
- p_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
- p_control_rec QP_PREQ_GRP.CONTROL_RECORD_TYPE;
- x_line_tbl QP_PREQ_GRP.LINE_TBL_TYPE;
- x_line_qual QP_PREQ_GRP.QUAL_TBL_TYPE;
- x_line_attr_tbl QP_PREQ_GRP.LINE_ATTR_TBL_TYPE;
- x_line_detail_tbl QP_PREQ_GRP.LINE_DETAIL_TBL_TYPE;
- x_line_detail_qual_tbl QP_PREQ_GRP.LINE_DETAIL_QUAL_TBL_TYPE;
- x_line_detail_attr_tbl QP_PREQ_GRP.LINE_DETAIL_ATTR_TBL_TYPE;
- x_related_lines_tbl QP_PREQ_GRP.RELATED_LINES_TBL_TYPE;
- x_return_status VARCHAR2(240);
- x_return_status_text VARCHAR2(240);
- qual_rec QP_PREQ_GRP.QUAL_REC_TYPE;
- line_attr_rec QP_PREQ_GRP.LINE_ATTR_REC_TYPE;
- line_rec QP_PREQ_GRP.LINE_REC_TYPE;
- rltd_rec QP_PREQ_GRP.RELATED_LINES_REC_TYPE;
- ldet_rec QP_PREQ_GRP.LINE_DETAIL_REC_TYPE;
- line_detail_attr_rec QP_PREQ_GRP.LINE_DETAIL_ATTR_REC_TYPE;
- line_detail_qual_rec QP_PREQ_GRP.LINE_DETAIL_QUAL_REC_TYPE;
- l_pricing_contexts_Tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
- l_qualifier_contexts_Tbl QP_Attr_Mapping_PUB.Contexts_Result_Tbl_Type;
- I BINARY_INTEGER;
- l_version VARCHAR2(240);
- --Variables
- l_operation QP_LIST_LINES.ARITHMETIC_OPERATOR%TYPE; --Operation
- l_operand QP_LIST_LINES.OPERAND%TYPE; --Operand
- l_list_line_type_code QP_LIST_LINES.LIST_LINE_TYPE_CODE%TYPE; --List line type
- l_mod_level_code QP_LIST_LINES.MODIFIER_LEVEL_CODE%TYPE; --Modifier level code
- BEGIN
- DBMS_OUTPUT.ENABLE(10000);
- oe_debug_pub.SetDebugLevel(5); -- Set debug level
- oe_debug_pub.G_DIR :='/usr/tmp'; -- Directory to store debug file
- --Print debug file name
- dbms_output.put_line('The File is'|| oe_debug_pub.Set_Debug_Mode('FILE'));
- --Initialization
- oe_debug_pub.Initialize;
- oe_debug_pub.debug_on;
- --fnd_global.apps_initialize(1564,21623,660);
- mo_global.init('QP');
- /*QP_Attr_Mapping_PUB.Build_Contexts(
- p_request_type_code => 'ONT',
- p_pricing_type => 'L',
- x_price_contexts_result_tbl => l_pricing_contexts_Tbl,
- x_qual_contexts_result_tbl => l_qualifier_Contexts_Tbl );*/
- -- Passing Information to the Pricing Engine
- -- Setting up the control record variables
- -- Please refer documentation for explanation of each of these settings
- ---- Control Record
- p_control_rec.pricing_event :='LINE';-- 'BATCH';
- p_control_rec.calculate_flag := 'Y'; --QP_PREQ_GRP.G_SEARCH_N_CALCULATE;
- p_control_rec.simulation_flag := 'N';
- p_control_rec.rounding_flag := 'Q';
- p_control_Rec.manual_discount_flag := 'Y';
- p_control_rec.request_type_code := 'ONT';
- p_control_rec.TEMP_TABLE_INSERT_FLAG := 'Y';
- -- Request Line (Order Line) Information
- line_rec.request_type_code :='ONT';
- line_rec.line_id :=17157; -- Order Line Id. This can be any thing for this script
- line_rec.line_Index :='1'; -- Request Line Index
- line_rec.line_type_code := 'LINE'; -- LINE or ORDER(Summary Line)
- line_rec.pricing_effective_date := sysdate; -- Pricing as of what date ?
- line_rec.active_date_first := sysdate; -- Can be Ordered Date or Ship Date
- line_rec.active_date_second := sysdate; -- Can be Ordered Date or Ship Date
- line_rec.active_date_first_type := 'NO TYPE'; -- ORD/SHIP
- line_rec.active_date_second_type :='NO TYPE'; -- ORD/SHIP
- line_rec.line_quantity := 1; -- Ordered Quantity
- line_rec.line_uom_code := 'EA'; -- Ordered UOM Code
- line_rec.currency_code := 'USD'; -- Currency Code
- line_rec.price_flag := 'Y'; -- Price Flag can have 'Y' , 'N'(No pricing) , 'P'(Phase)
- p_line_tbl(1) := line_rec;
- --Attach detail attributes
- -- Pricing Attributes Passed In
- --Pass inventory item id
- line_attr_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
- line_attr_rec.PRICING_CONTEXT :='ITEM';
- line_attr_rec.PRICING_ATTRIBUTE :='PRICING_ATTRIBUTE1';
- line_attr_rec.PRICING_ATTR_VALUE_FROM := '25006';-- Inventory Item Id
- line_attr_rec.VALIDATED_FLAG :='N';
- p_line_attr_tbl(3):= line_attr_rec;
- --Pass price list id
- qual_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
- qual_rec.QUALIFIER_CONTEXT :='MODLIST';
- qual_rec.QUALIFIER_ATTRIBUTE :='QUALIFIER_ATTRIBUTE4';
- qual_rec.QUALIFIER_ATTR_VALUE_FROM :='6009'; -- Price List Id
- qual_rec.COMPARISON_OPERATOR_CODE := '=';
- qual_rec.VALIDATED_FLAG :='Y';
- p_qual_tbl(1):= qual_rec;
- --Modifier Line
- qual_rec.LINE_INDEX := 1; -- Attributes for the above line. Attributes are attached with the line index
- qual_rec.QUALIFIER_CONTEXT :='MODLIST';
- qual_rec.QUALIFIER_ATTRIBUTE :='QUALIFIER_ATTRIBUTE2';
- qual_rec.QUALIFIER_ATTR_VALUE_FROM :='47682'/*'39360'*/; -- Modifier line id
- qual_rec.COMPARISON_OPERATOR_CODE := '=';
- qual_rec.VALIDATED_FLAG :='N';
- p_qual_tbl(2):= qual_rec;
- -- Actual Call to the Pricing Engine
- QP_PREQ_PUB.PRICE_REQUEST
- (p_line_tbl,
- p_qual_tbl,
- p_line_attr_tbl,
- p_line_detail_tbl,
- p_line_detail_qual_tbl,
- p_line_detail_attr_tbl,
- p_related_lines_tbl,
- p_control_rec,
- x_line_tbl,
- x_line_qual,
- x_line_attr_tbl,
- x_line_detail_tbl,
- x_line_detail_qual_tbl,
- x_line_detail_attr_tbl,
- x_related_lines_tbl,
- x_return_status,
- x_return_status_text);
- /*
- -- Interpreting Information From the Pricing Engine . Output statements commented. Please uncomment for debugging
- */
- -- Return Status Information ..
- DBMS_OUTPUT.PUT_LINE('Return Status text '|| x_return_status_text);
- DBMS_OUTPUT.PUT_LINE('Return Status '|| x_return_status);
- DBMS_OUTPUT.PUT_LINE('+---------Information Returned to Caller---------------------+ ');
- DBMS_OUTPUT.PUT_LINE('-------------Request Line Information-------------------');
- I := x_line_tbl.FIRST;
- IF I IS NOT NULL THEN
- LOOP
- DBMS_OUTPUT.PUT_LINE('Line Index: '||x_line_tbl(I).line_index);
- DBMS_OUTPUT.PUT_LINE('Unit_price: '||x_line_tbl(I).unit_price);
- DBMS_OUTPUT.PUT_LINE('Percent price: '||x_line_tbl(I).percent_price);
- DBMS_OUTPUT.PUT_LINE('Adjusted Unit Price: '||x_line_tbl(I).adjusted_unit_price);
- DBMS_OUTPUT.PUT_LINE('Pricing status code: '||x_line_tbl(I).status_code);
- DBMS_OUTPUT.PUT_LINE('Pricing status text: '||x_line_tbl(I).status_text);
- EXIT WHEN I = x_line_tbl.LAST;
- I := x_line_tbl.NEXT(I);
- END LOOP;
- END IF;
- DBMS_OUTPUT.PUT_LINE('-----------Pricing Attributes Information-------------');
- I := x_line_detail_attr_tbl.FIRST;
- IF I IS NOT NULL THEN
- LOOP
- DBMS_OUTPUT.PUT_LINE('Line detail Index '||x_line_detail_attr_tbl(I).line_detail_index);
- DBMS_OUTPUT.PUT_LINE('Context '||x_line_detail_attr_tbl(I).pricing_context);
- DBMS_OUTPUT.PUT_LINE('Attribute '||x_line_detail_attr_tbl(I).pricing_attribute);
- DBMS_OUTPUT.PUT_LINE('Value '||x_line_detail_attr_tbl(I).pricing_attr_value_from);
- DBMS_OUTPUT.PUT_LINE('Status Code '||x_line_detail_attr_tbl(I).status_code);
- DBMS_OUTPUT.PUT_LINE('---------------------------------------------------');
- EXIT WHEN I = x_line_detail_attr_tbl.last;
- I:=x_line_detail_attr_tbl.NEXT(I);
- END LOOP;
- END IF;
- DBMS_OUTPUT.PUT_LINE('-----------Qualifier Attributes Information-------------');
- I := x_line_detail_qual_tbl.FIRST;
- IF I IS NOT NULL THEN
- LOOP
- DBMS_OUTPUT.PUT_LINE('Line Detail Index '||x_line_detail_qual_tbl(I).line_detail_index);
- DBMS_OUTPUT.PUT_LINE('Context '||x_line_detail_qual_tbl(I).qualifier_context);
- DBMS_OUTPUT.PUT_LINE('Attribute '||x_line_detail_qual_tbl(I).qualifier_attribute);
- DBMS_OUTPUT.PUT_LINE('Value '||x_line_detail_qual_tbl(I).qualifier_attr_value_from);
- DBMS_OUTPUT.PUT_LINE('Status Code '||x_line_detail_qual_tbl(I).status_code);
- DBMS_OUTPUT.PUT_LINE('---------------------------------------------------');
- EXIT WHEN I = x_line_detail_qual_tbl.last;
- I:=x_line_detail_qual_tbl.NEXT(I);
- END LOOP;
- END IF;
- I := x_line_detail_tbl.FIRST;
- DBMS_OUTPUT.PUT_LINE('------------Price List/Discount Information------------');
- IF I IS NOT NULL THEN
- LOOP
- DBMS_OUTPUT.PUT_LINE('Line Index: '||x_line_detail_tbl(I).line_index);
- DBMS_OUTPUT.PUT_LINE('Line Detail Index: '||x_line_detail_tbl(I).line_detail_index);
- DBMS_OUTPUT.PUT_LINE('Line Detail Type:'||x_line_detail_tbl(I).line_detail_type_code);
- DBMS_OUTPUT.PUT_LINE('List Header Id: '||x_line_detail_tbl(I).list_header_id);
- DBMS_OUTPUT.PUT_LINE('List Line Id: '||x_line_detail_tbl(I).list_line_id);
- DBMS_OUTPUT.PUT_LINE('List Line Type Code: '||x_line_detail_tbl(I).list_line_type_code);
- DBMS_OUTPUT.PUT_LINE('Adjustment Amount : '||x_line_detail_tbl(I).adjustment_amount);
- DBMS_OUTPUT.PUT_LINE('Line Quantity : '||x_line_detail_tbl(I).line_quantity);
- DBMS_OUTPUT.PUT_LINE('Operand Calculation Code: '||x_line_detail_tbl(I).Operand_calculation_code);
- DBMS_OUTPUT.PUT_LINE('Operand value: '||x_line_detail_tbl(I).operand_value);
- DBMS_OUTPUT.PUT_LINE('Automatic Flag: '||x_line_detail_tbl(I).automatic_flag);
- DBMS_OUTPUT.PUT_LINE('Override Flag: '||x_line_detail_tbl(I).override_flag);
- DBMS_OUTPUT.PUT_LINE('status_code: '||x_line_detail_tbl(I).status_code);
- DBMS_OUTPUT.PUT_LINE('status text: '||x_line_detail_tbl(I).status_text);
- DBMS_OUTPUT.PUT_LINE('-------------------------------------------');
- EXIT WHEN I = x_line_detail_tbl.LAST;
- I := x_line_detail_tbl.NEXT(I);
- END LOOP;
- END IF;
- DBMS_OUTPUT.PUT_LINE('--------------Related Lines Information for Price Breaks/Service Items---------------');
- I := x_related_lines_tbl.FIRST;
- IF I IS NOT NULL THEN
- LOOP
- DBMS_OUTPUT.PUT_LINE('Line Index :'||x_related_lines_tbl(I).line_index);
- DBMS_OUTPUT.PUT_LINE('Line Detail Index: '||x_related_lines_tbl(I).LINE_DETAIL_INDEX);
- DBMS_OUTPUT.PUT_LINE('Relationship Type Code: '||x_related_lines_tbl(I).relationship_type_code);
- DBMS_OUTPUT.PUT_LINE('Related Line Index: '||x_related_lines_tbl(I).RELATED_LINE_INDEX);
- DBMS_OUTPUT.PUT_LINE('Related Line Detail Index: '||x_related_lines_tbl(I).related_line_detail_index);
- DBMS_OUTPUT.PUT_LINE('Status Code: '|| x_related_lines_tbl(I).STATUS_CODE);
- EXIT WHEN I = x_related_lines_tbl.LAST;
- I := x_related_lines_tbl.NEXT(I);
- END LOOP;
- END IF;
- END;
Sample Code for Qp_preq_pub.Price_request Api to Simulate an Ask for Promotion Modifier的更多相关文章
- HOW to Use QP_PREQ_PUB.PRICE_REQUEST API to Price an Item
In this Document Goal Solution References APPLIES TO: Oracle Advanced Pricing - Version 11.5.10 ...
- How to Simulate the Price Order or Price Line Function using API QP_PREQ_PUB.PRICE_REQUEST Includes
How to Simulate the Price Order or Price Line Function using API QP_PREQ_PUB.PRICE_REQUEST Includes ...
- 如何将经纬度利用Google Map API显示C# VS2005 Sample Code
原文 如何将经纬度利用Google Map API显示C# VS2005 Sample Code 日前写了一篇如何用GPS抓取目前所在,并回传至资料库储存,这篇将会利用这些回报的资料,将它显示在地图上 ...
- Sample Code之Web scene-slides
这是我的第一篇随笔,在开始正文前说几句. 这个系列会记录我学习Arcgis js API 4.10的全过程,希望能对自己也对其他有需要的人有帮助.很多时候上网看一些大神的帖子会感到一头雾水,一是自己水 ...
- android studio2.2 的Find Sample Code点击没有反应
1 . 出现的问题描述: 右键点击Find Sample Code后半天没有反应,然后提示 Samples are currently unavailable for :{**** ...
- Code First 关系 Fluent API
通过实体框架 Code First,可以使用您自己的域类表示 EF 执行查询.更改跟踪和更新函数所依赖的模型.Code First 利用称为“约定先于配置”的编程模式.这意味着 Code First ...
- IOS开发苹果官方Sample Code及下载地址
IOS开发苹果官方Sample Code及下载地址 在线浏览地址:https://developer.apple.com/library/ios/navigation/#section=Resourc ...
- OAF Sample Code(转)
原文地址: OAF Sample Code
- Code First约定-Fluent API配置
转自:http://blog.163.com/m13864039250_1/blog/static/2138652482015283397609/ 用Fluent API 配置/映射属性和类型 简介 ...
随机推荐
- ROS(indigo) 用于机器人控制的图形化编程工具--code_it robot_blockly
0 简介: 编程语言有汇编,高级语言,解释语言等,现在图形化编程也越来越流行.图形化编程简单易学.8年前,微软推出了VPL用于机器人程序设计,如Python和JavaScript都可以用图形化框图实现 ...
- 23 服务的绑定启动Demo3
MainActivity.java package com.example.day23_service_demo3; import com.example.day23_service_demo3.My ...
- C++ 虚函数表 多重继承
上次研究的是单继承的情况,这次研究多重继承下的虚函数表的排列情况. 这次A,A1,A2,B这几个类的继承关系如下图: 测试代码如下: #include<iostream> using na ...
- activiti 多实例任务
1.1.1. 前言 个人,那么当5个人都投票的时候大概分为如下几种: 1.部门所有人都去投票,当所有人都投票完成的时候,这个节点结束,流程运转到下一个节点.(所有的人都需要投票) 2.部门所有人都去投 ...
- Combiners和Partitioner编程
Combiners的作用: 每一个map可能会产生大量的输出,combiner的作用就是在map端对输出先做一次合并,以减少传输到reducer的数据量. combiner最基本是实现本地key的归并 ...
- 在Gazebo中使用DEM構建起伏地形環境
所需資料下載地址: 1. https://bitbucket.org/osrf/gazebo_tutorials/raw/default/dem/files/ 数字高程模型(致謝谷歌翻譯)概述数字高程 ...
- Struts 2 之拦截器
拦截器概述 Struts2拦截器是在访问某个Action或Action的某个方法,字段之前或之后实施拦截,并且Struts2拦截器是可插拔的,拦截器是AOP(Aspect Oriented Progr ...
- 【Netty源码分析】Netty服务端bind端口过程
这一篇博客我们介绍一下Netty服务端绑定端口的过程,我们通过跟踪代码一直到NIO原生绑定端口的操作. 绑定端口操作 ChannelFuture future = serverBootstrap.bi ...
- Android打包遇到的那些坑
说说今天打包遇到的坑,由于线上有个支付的bug需要紧急修复,而我们的项目又没有使用热修复,所以只能通过编译打包等传统流程,还好android上线比较快. 说说我进早上打包遇到的几个问题吧,首先我使用b ...
- Android反编译 -- 错误代码还原
PS:如果阅读体验不好,可以尝试Github版 (<-点左边) 1. setColor(-16777216) 反编译的代码中会有很多setColor(int)的情况,比如setColor(-16 ...