1 PACKAGE OKS_CON_COVERAGE_PUB AUTHID CURRENT_USER AS
2 /* $Header: OKSPACCS.pls 120.0 2005/05/25 18:30:34 appldev noship $ */
3 /*#
4 * Package containing APIs to retrieve Coverage information, specifically,
5 * apply_contract_coverage, which retrieves the discount amount for a
6 * Business Process, and get_bp_pricelist, which returns all the Business Processes
7 * and their respective Price List for a given Contract Line.
8 * @rep:scope public
9 * @rep:product OKS
10 * @rep:displayname Coverage utility procedures
11 * @rep:category BUSINESS_ENTITY OKS_COVERAGE
12 * @rep:metalink 284732.1 See Oracle Metalink Bulletin 284732.1
13 */
14
15 -- GLOBAL VARIABLES
16 -------------------------------------------------------------------------------
17 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKS_CON_COVERAGE_PUB';
18 G_APP_NAME CONSTANT VARCHAR2(3) := 'OKC';
19 -------------------------------------------------------------------------------
20
21 -- procedure apply_contract_coverage ------------------------------------
22
23 TYPE ser_rec_type IS RECORD
24 (charges_line_number Number,
25 estimate_detail_id Number,
26 contract_line_id Number,
27 txn_group_id Number,
28 business_process_id NUMBER,
29 request_date DATE ,
30 billing_type_id Number,
31 charge_amount Number);
32
33 TYPE ser_tbl_type IS TABLE OF ser_rec_type INDEX BY BINARY_INTEGER;
34
35 TYPE cov_rec_type IS RECORD
36 (charges_line_number Number,
37 estimate_detail_id Number,
38 contract_line_id Number,
39 txn_group_id Number,
40 business_process_id number,
41 request_date date ,
42 billing_type_id Number,
43 discounted_amount Number,
44 status Varchar2(1));
45
46 TYPE cov_tbl_type IS TABLE OF cov_rec_type INDEX BY BINARY_INTEGER;
47
48 /*#
49 * Returns the discounted charge amount for a given business process. This procedure returns the calculated
50 * amount for a Service or Extended Warranty based up on the Discount Amount and Percentage
51 * Covered, which are specified in the Service Contract coverage terms for a given business process.
52 * @param p_api_version Version numbers of incoming calls must match this number.
53 * @param p_init_msg_list FND_API.G_TRUE or FND_API.G_FALSE indicates if API initializes message list.
54 * @param p_est_amt_tbl Array of charge line records.
55 * @param x_return_status Possible returns are 'S'uccess, 'E'rror, or 'U'nexpected error.
56 * @param x_msg_count Returns number of messages in API message list.
57 * @param x_msg_data If x_msg_count is 1 then the message data is encoded.
58 * @param x_est_discounted_amt_tbl Array of estimated discounts for charge lines
59 * @rep:scope public
60 * @rep:lifecycle active
61 * @rep:displayname Apply Contract Coverage
62 * @rep:metalink 284732.1 See Oracle Metalink Bulletin 284732.1
63 */
64
65 PROCEDURE apply_contract_coverage
66 (p_api_version IN Number
67 ,p_init_msg_list IN Varchar2
68 ,p_est_amt_tbl IN ser_tbl_type
69 ,x_return_status OUT NOCOPY Varchar2
70 ,x_msg_count OUT NOCOPY Number
71 ,x_msg_data OUT NOCOPY Varchar2
72 ,x_est_discounted_amt_tbl OUT NOCOPY cov_tbl_type);
73
74 -- procedure apply_contract_coverage ------------------------------------
75
76 -- procedure get_bp_pricelist ------------------------------------
77
78
79
80 TYPE pricing_rec_type IS RECORD
81 ( contract_line_id Number,
82 business_process_id NUMBER,
83 BP_Price_list_id NUMBER,
84 BP_Discount_id NUMBER,
85 BP_start_date DATE,
86 BP_end_date DATE,
87 Contract_Price_list_Id NUMBER );
88
89
90 TYPE pricing_tbl_type IS TABLE OF pricing_rec_type INDEX BY BINARY_INTEGER;
91
92
93 /*#
94 * Returns the Price List for each Business Process in a given contract line.
95 * The calling program must specify a Contract Line, a Business Process or both. If a Contract Line
96 * (and only a Contract Line) is passed, then all Price Lists associated to the Contract Line's Business
97 * Processes are returned. If a Contract Line and a Business Process are passed then only the Price List
98 * associated with the Business Process is returned. Additionally, in both cases, the default Contract Price
99 * List and the discount breaks are included in the return parameter.
100 * @param p_api_version Version numbers of incoming calls must match this number.
101 * @param p_init_msg_list FND_API.G_TRUE or FND_API.G_FALSE indicates if API initializes message list.
102 * @param p_contract_line_id Unique Identifier for Contract Line
103 * @param p_business_process_id Unique Identifier for covered Business Process
104 * @param p_request_date Date on which the transaction is requested
105 * @param x_return_status Possible returns are 'S'uccess, 'E'rror, or 'U'nexpected error.
106 * @param x_msg_count Returns number of messages in API message list.
107 * @param x_msg_data If x_msg_count is 1 then the message data is encoded.
108 * @param x_pricing_tbl Array of Price List records
109 * @rep:scope public
110 * @rep:lifecycle active
111 * @rep:displayname Get Business Process Price List
112 * @rep:metalink 284732.1 See Oracle Metalink Bulletin 284732.1
113 */
114
115 PROCEDURE get_bp_pricelist
116 (p_api_version IN Number
117 ,p_init_msg_list IN Varchar2
118 ,p_Contract_line_id IN NUMBER
119 ,p_business_process_id IN NUMBER
120 ,p_request_date IN DATE -- default sysdate -- GSCC warning file.sql.35
121 ,x_return_status OUT NOCOPY Varchar2
122 ,x_msg_count OUT NOCOPY Number
123 ,x_msg_data OUT NOCOPY Varchar2
124 ,x_pricing_tbl OUT NOCOPY PRICING_TBL_TYPE );
125
126 -- procedure get_bp_pricelist ------------------------------------
127
128 -- procedure get_bill_rates ------------------------------------
129
130 TYPE input_br_rec IS RECORD
131 ( contract_line_id Number, --REQUIRED
132 Business_process_id number, --REQUIRED
133 txn_billing_type_id number, --REQUIRED
134 request_date date -- default to SYSDATE
135 );
136
137 TYPE labor_sch_rec_type IS RECORD
138 ( start_datetime DATE, --REQUIRED
139 end_datetime DATE, --REQUIRED
140 Holiday_flag VARCHAR2(1) --Y or, N can be passed , defaults to 'N'
141 );
142
143 TYPE labor_sch_tbl_type IS TABLE OF labor_sch_rec_type INDEX BY BINARY_INTEGER;
144
145 TYPE bill_rate_rec_type IS RECORD
146 ( start_datetime DATE,
147 End_datetime DATE,
148 labor_item_id number,
149 labor_item_org_id number,
150 Bill_rate_code VARCHAR2(30),
151 Flat_rate NUMBER,
152 Flat_rate_uom_code VARCHAR2(30),
153 Percent_over_listprice NUMBER);
154
155 TYPE bill_rate_tbl_type IS TABLE OF bill_rate_rec_type INDEX BY BINARY_INTEGER;
156
157 PROCEDURE get_bill_rates
158 (p_api_version IN Number
159 ,p_init_msg_list IN Varchar2
160 ,P_input_br_rec IN INPUT_BR_REC
161 ,P_labor_sch_tbl IN LABOR_SCH_TBL_TYPE
162 ,x_return_status OUT NOCOPY Varchar2
163 ,x_msg_count OUT NOCOPY Number
164 ,x_msg_data OUT NOCOPY Varchar2
165 ,X_bill_rate_tbl OUT NOCOPY BILL_RATE_TBL_TYPE );
166
167 -- procedure get_bill_rates ------------------------------------
168
169 END OKS_CON_COVERAGE_PUB;