1 PACKAGE CSD_CHARGE_LINE_UTIL AUTHID CURRENT_USER AS
2 /* $Header: csdvclus.pls 120.1.12000000.2 2007/04/18 22:53:58 takwong ship $ */
3
4
5 TYPE MLE_LINES_REC_TYPE IS RECORD
6 (
7 INVENTORY_ITEM_ID NUMBER,
8 UOM VARCHAR2(3),
9 QUANTITY NUMBER,
10 SELLING_PRICE NUMBER,
11 ITEM_NAME VARCHAR2(100),
12 COMMS_NL_TRACKABLE_FLAG VARCHAR2(1),
13 TXN_BILLING_TYPE_ID NUMBER,
14 TRANSACTION_TYPE_ID NUMBER,
15 SOURCE_CODE VARCHAR2(30),
16 SOURCE_ID1 NUMBER,
17 SOURCE_ID2 NUMBER,
18 ITEM_COST NUMBER,
19 RESOURCE_ID NUMBER, -- ER 3607765, vkjain.
20 OVERRIDE_CHARGE_FLAG VARCHAR2(1)
21 );
22
23 TYPE MLE_LINES_TBL_TYPE IS TABLE OF MLE_LINES_REC_TYPE INDEX BY BINARY_INTEGER;
24
25 -- A table of charge records
26 TYPE CHARGE_LINES_TBL_TYPE IS TABLE OF
27 CS_CHARGE_DETAILS_PUB.CHARGES_REC_TYPE INDEX BY BINARY_INTEGER;
28
29
30 /*----------------------------------------------------------------*/
31 /* function name: Get_PLCurrCode */
32 /* description : Gets the currency for a price list */
33 /* */
34 /* p_price_list_id Price List ID to get currency */
35 /* */
36 /*----------------------------------------------------------------*/
37 FUNCTION Get_PLCurrCode
38 (
39 p_price_list_id IN NUMBER
40 )
41 RETURN VARCHAR2;
42
43 /*----------------------------------------------------------------*/
44 /* procedure name: Get_DefaultPriceList */
45 /* description : Gets the price list from contract (default */
46 /* contract if null), if not, default price list */
47 /* from profile option. */
48 /* */
49 /* p_api_version Standard IN param */
50 /* p_init_msg_list Standard IN param */
51 /* p_repair_type_id Repair Type ID */
52 /* p_repair_line_id Repair Line ID */
53 /* p_contract_line_id Contract Line ID */
54 /* p_currency_code RO Currency */
55 /* x_return_status Standard OUT param */
56 /* x_msg_count Standard OUT param */
57 /* x_msg_data Standard OUT param */
58 /* */
59 /*----------------------------------------------------------------*/
60 PROCEDURE Get_DefaultPriceList
61 (
62 p_api_version IN NUMBER,
63 p_init_msg_list IN VARCHAR2,
64 p_repair_line_id IN NUMBER,
65 p_repair_type_id IN NUMBER,
66 p_contract_line_id IN NUMBER,
67 p_currency_code IN VARCHAR2,
68 x_contract_validated OUT NOCOPY BOOLEAN,
69 x_default_pl_id OUT NOCOPY NUMBER,
70 x_return_status OUT NOCOPY VARCHAR2,
71 x_msg_count OUT NOCOPY NUMBER,
72 x_msg_data OUT NOCOPY VARCHAR2
73 );
74
75 /*----------------------------------------------------------------*/
76 /* function name: Get_RO_PriceList */
77 /* description : Gets the price list header id for a repair order*/
78 /* */
79 /* p_repair_line_id Repair Line ID to get Price List */
80 /* */
81 /*----------------------------------------------------------------*/
82 FUNCTION Get_RO_PriceList
83 (
84 p_repair_line_id IN NUMBER
85 )
86 RETURN NUMBER;
87
88
89 /* bug#3875036 */
90 /*----------------------------------------------------------------*/
91 /* function name: Get_SR_AccountId */
92 /* description : Gets the SR Customer Account Id for a repair order */
93 /* */
94 /* p_repair_line_id Repair Line ID to get SR Customer Account Id */
95 /* */
96 /*----------------------------------------------------------------*/
97 FUNCTION Get_SR_AccountId
98 (
99 p_repair_line_id IN NUMBER
100 )
101 RETURN NUMBER;
102
103
104 /*----------------------------------------------------------------*/
105 /* function name: Get_DefaultContract */
106 /* description : Gets the default contract set in Product */
107 /* Coverage. */
108 /* */
109 /* p_repair_line_id Repair Line ID to get contract */
110 /* */
111 /*----------------------------------------------------------------*/
112 FUNCTION Get_DefaultContract
113 (
114 p_repair_line_id IN NUMBER
115 )
116 RETURN NUMBER;
117
118 /*----------------------------------------------------------------*/
119 /* procedure name: Get_ContractPriceList */
120 /* description : procedure used to get ets the price list */
121 /* specified by the contract */
122 /* */
123 /* p_api_version Standard IN param */
124 /* p_init_msg_list Standard IN param */
125 /* p_contract_line_id Contract Line ID */
126 /* p_repair_type_id Repair Type ID */
127 /* p_currency_code RO Currency */
128 /* x_contract_validated Whether the contract can be used */
129 /* x_contract_pl_id Contract Price List ID */
130 /* x_billing_pl_id Billing Price List ID */
131 /* x_return_status Standard OUT param */
132 /* x_msg_count Standard OUT param */
133 /* x_msg_data Standard OUT param */
134 /* */
135 /*----------------------------------------------------------------*/
136 PROCEDURE Get_ContractPriceList
137 (
138 p_api_version IN NUMBER,
139 p_init_msg_list IN VARCHAR2,
140 p_contract_line_id IN NUMBER,
141 p_repair_type_id IN NUMBER,
142 p_currency_code IN VARCHAR2,
143 x_contract_validated OUT NOCOPY BOOLEAN,
144 x_contract_pl_id OUT NOCOPY NUMBER,
145 x_billing_pl_id OUT NOCOPY NUMBER,
146 x_return_status OUT NOCOPY VARCHAR2,
147 x_msg_count OUT NOCOPY NUMBER,
148 x_msg_data OUT NOCOPY VARCHAR2
149 );
150
151 /*----------------------------------------------------------------*/
152 /* procedure name: Validate_Contract */
153 /* description : Checks the currency of the contract to see if */
154 /* it matches the one for repair order */
155 /* */
156 /* p_api_version Standard IN param */
157 /* p_init_msg_list Standard IN param */
158 /* p_contract_line_id Contract Line ID to check currency*/
159 /* p_repair_type_id Repair Type ID to get contract PL */
160 /* p_ro_currency_code RO currency code */
161 /* x_contract_currency_code Contract PriceList Currency */
162 /* x_contract_validated Whether the contract can be used */
163 /* x_return_status Standard OUT param */
164 /* x_msg_count Standard OUT param */
165 /* x_msg_data Standard OUT param */
166 /* */
167 /*----------------------------------------------------------------*/
168
169 PROCEDURE Validate_Contract
170 (
171 p_api_version IN NUMBER,
172 p_init_msg_list IN VARCHAR2,
173 p_contract_line_id IN NUMBER,
174 p_repair_type_id IN NUMBER,
175 p_ro_currency_code IN VARCHAR2,
176 x_contract_currency_code OUT NOCOPY VARCHAR2,
177 x_contract_validated OUT NOCOPY BOOLEAN,
178 x_return_status OUT NOCOPY VARCHAR2,
179 x_msg_count OUT NOCOPY NUMBER,
180 x_msg_data OUT NOCOPY VARCHAR2
181 );
182
183
184 /*----------------------------------------------------------------*/
185 /* function name: Validate_PriceList */
186 /* description : Checks the currency the price list to see if it */
187 /* matches the one for repair order */
188 /* */
189 /* p_price_list_id Price List ID to get currency */
190 /* p_currency_code RO currency */
191 /* */
192 /*----------------------------------------------------------------*/
193 FUNCTION Validate_PriceList (
194 p_price_list_id IN NUMBER,
195 p_currency_code IN VARCHAR2
196 )
197 RETURN BOOLEAN;
198
199
200 /*----------------------------------------------------------------*/
201 /* procedure name: Get_DiscountedPrice */
202 /* description : procedure used to get the discounted price */
203 /* for applying a contract */
204 /* */
205 /* p_api_version Standard IN param */
206 /* p_init_msg_list Standard IN param */
207 /* p_contract_line_id Contract Line ID */
208 /* p_repair_type_id Repair Type ID */
209 /* p_txn_billing_type_id Transaction Billing Type ID */
210 /* p_coverage_txn_grp_id Coverage Transaction Group ID */
211 /* p_extended_price Extended Price */
212 /* p_no_charge_flag No Charge Flag */
213 /* x_discounted_price Discounted Price */
214 /* x_return_status Standard OUT param */
215 /* x_msg_count Standard OUT param */
216 /* x_msg_data Standard OUT param */
217 /* */
218 /*----------------------------------------------------------------*/
219 PROCEDURE Get_DiscountedPrice
220 (
221 p_api_version IN NUMBER,
222 p_init_msg_list IN VARCHAR2,
223 p_contract_line_id IN NUMBER,
224 p_repair_type_id IN NUMBER,
225 p_txn_billing_type_id IN NUMBER,
226 p_coverage_txn_grp_id IN NUMBER,
227 p_extended_price IN NUMBER,
228 p_no_charge_flag IN VARCHAR2,
229 x_discounted_price OUT NOCOPY NUMBER,
230 x_return_status OUT NOCOPY VARCHAR2,
231 x_msg_count OUT NOCOPY NUMBER,
232 x_msg_data OUT NOCOPY VARCHAR2
233 );
234
235 /*----------------------------------------------------------------*/
236 /* procedure name: Get_CoverageInfo */
237 /* description : procedure used to get the converage information*/
238 /* for a given contract line and business process */
239 /* */
240 /* p_contract_line_id Contract Line ID */
241 /* p_business_process_id Business process ID */
242 /* x_return_status Standard OUT param */
243 /* x_msg_count Standard OUT param */
244 /* x_msg_data Standard OUT param */
245 /* x_contract_id Contract ID */
246 /* x_contract_number Contract Number */
247 /* x_coverage_id Coverage ID */
248 /* x_coverage_txn_grp_id Coverage Transaction Group ID */
249 /* */
250 /*----------------------------------------------------------------*/
251
252 PROCEDURE Get_CoverageInfo (p_contract_line_id IN NUMBER,
253 p_business_process_id IN NUMBER,
254 x_return_status OUT NOCOPY VARCHAR2,
255 x_msg_count OUT NOCOPY NUMBER,
256 x_msg_data OUT NOCOPY VARCHAR2,
257 x_contract_id OUT NOCOPY NUMBER,
258 x_contract_number OUT NOCOPY VARCHAR2, -- swai bug fix 4770958
259 -- x_contract_number OUT NOCOPY NUMBER, -- swai bug fix 4770958
260 x_coverage_id OUT NOCOPY NUMBER,
261 x_coverage_txn_group_id OUT NOCOPY NUMBER
262 );
263
264 /*----------------------------------------------------------------*/
265 /* procedure name: Convert_To_Charge_Lines */
266 /* description : The procedure takes in a set of generic MLE */
267 /* records and sorts out 'good' records that are */
268 /* eligible for creating charge lines. It also */
269 /* logs warning messages for 'bad' records */
270 /* indicating the reason. */
271 /* */
272 /*----------------------------------------------------------------*/
273
274 PROCEDURE Convert_To_Charge_Lines (
275 p_api_version IN NUMBER,
276 p_commit IN VARCHAR2,
277 p_init_msg_list IN VARCHAR2,
278 p_validation_level IN NUMBER,
279 x_return_status OUT NOCOPY VARCHAR2,
280 x_msg_count OUT NOCOPY NUMBER,
281 x_msg_data OUT NOCOPY VARCHAR2,
282 p_est_act_module_code IN VARCHAR2,
283 p_est_act_msg_entity IN VARCHAR2,
284 p_charge_line_type IN VARCHAR2,
285 p_repair_line_id IN NUMBER,
286 p_repair_actual_id IN NUMBER,
287 p_repair_type_id IN NUMBER,
288 p_business_process_id IN NUMBER,
289 p_currency_code IN VARCHAR2,
290 p_incident_id IN NUMBER,
291 p_organization_id IN NUMBER,
292 p_price_list_id IN NUMBER,
293 p_contract_line_id IN NUMBER,
294 p_MLE_lines_tbl IN MLE_LINES_TBL_TYPE,
295 px_valid_MLE_lines_tbl IN OUT NOCOPY MLE_LINES_TBL_TYPE,
296 px_charge_lines_tbl IN OUT NOCOPY CHARGE_LINES_TBL_TYPE,
297 x_warning_flag OUT NOCOPY VARCHAR2
298 );
299
300
301
302 END CSD_CHARGE_LINE_UTIL;