[Home] [Help]
PACKAGE BODY: APPS.AS_SALES_LEADS_PUB_W2
Source
1 package body as_sales_leads_pub_w2 as
2 /* $Header: asxwsl2b.pls 115.18 2003/09/18 22:44:23 ckapoor ship $ */
3 rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4 rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5
6 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7 function rosetta_g_miss_date_in_map(d date) return date as
8 begin
9 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10 return d;
11 end;
12
13 function rosetta_g_miss_num_map(n number) return number as
14 a number := fnd_api.g_miss_num;
15 b number := 0-1962.0724;
16 begin
17 if n=a then return b; end if;
18 if n=b then return a; end if;
19 return n;
20 end;
21
22 procedure copy_lead_to_opportunity(p_api_version_number NUMBER
23 , p_init_msg_list VARCHAR2
24 , p_commit VARCHAR2
25 , p_validation_level NUMBER
26 , p_check_access_flag VARCHAR2
27 , p_admin_flag VARCHAR2
28 , p_admin_group_id NUMBER
29 , p_identity_salesforce_id NUMBER
30 , p_identity_salesgroup_id NUMBER
31 , p9_a0 JTF_VARCHAR2_TABLE_100
32 , p9_a1 JTF_VARCHAR2_TABLE_300
33 , p_sales_lead_id NUMBER
34 , p11_a0 JTF_NUMBER_TABLE
35 , p11_a1 JTF_DATE_TABLE
36 , p11_a2 JTF_NUMBER_TABLE
37 , p11_a3 JTF_DATE_TABLE
38 , p11_a4 JTF_NUMBER_TABLE
39 , p11_a5 JTF_NUMBER_TABLE
40 , p11_a6 JTF_NUMBER_TABLE
41 , p11_a7 JTF_NUMBER_TABLE
42 , p11_a8 JTF_NUMBER_TABLE
43 , p11_a9 JTF_DATE_TABLE
44 , p11_a10 JTF_NUMBER_TABLE
45 , p11_a11 JTF_VARCHAR2_TABLE_100
46 , p11_a12 JTF_NUMBER_TABLE
47 , p11_a13 JTF_NUMBER_TABLE
48 , p11_a14 JTF_NUMBER_TABLE
49 , p11_a15 JTF_NUMBER_TABLE
50 , p11_a16 JTF_VARCHAR2_TABLE_100
51 , p11_a17 JTF_NUMBER_TABLE
52 , p11_a18 JTF_NUMBER_TABLE
53 , p11_a19 JTF_NUMBER_TABLE
54 , p11_a20 JTF_VARCHAR2_TABLE_100
55 , p11_a21 JTF_VARCHAR2_TABLE_200
56 , p11_a22 JTF_VARCHAR2_TABLE_200
57 , p11_a23 JTF_VARCHAR2_TABLE_200
58 , p11_a24 JTF_VARCHAR2_TABLE_200
59 , p11_a25 JTF_VARCHAR2_TABLE_200
60 , p11_a26 JTF_VARCHAR2_TABLE_200
61 , p11_a27 JTF_VARCHAR2_TABLE_200
62 , p11_a28 JTF_VARCHAR2_TABLE_200
63 , p11_a29 JTF_VARCHAR2_TABLE_200
64 , p11_a30 JTF_VARCHAR2_TABLE_200
65 , p11_a31 JTF_VARCHAR2_TABLE_200
66 , p11_a32 JTF_VARCHAR2_TABLE_200
67 , p11_a33 JTF_VARCHAR2_TABLE_200
68 , p11_a34 JTF_VARCHAR2_TABLE_200
69 , p11_a35 JTF_VARCHAR2_TABLE_200
70 , p11_a36 JTF_NUMBER_TABLE
71 , p_opportunity_id NUMBER
72 , x_return_status out nocopy VARCHAR2
73 , x_msg_count out nocopy NUMBER
74 , x_msg_data out nocopy VARCHAR2
75 )
76
77 as
78 ddp_sales_lead_profile_tbl as_utility_pub.profile_tbl_type;
79 ddp_sales_lead_line_tbl as_sales_leads_pub.sales_lead_line_tbl_type;
80 ddindx binary_integer; indx binary_integer;
81 begin
82
83 -- copy data to the local IN or IN-OUT args, if any
84
85
86
87
88
89
90
91
92
93 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_sales_lead_profile_tbl, p9_a0
94 , p9_a1
95 );
96
97
98 as_sales_leads_pub_w.rosetta_table_copy_in_p7(ddp_sales_lead_line_tbl, p11_a0
99 , p11_a1
100 , p11_a2
101 , p11_a3
102 , p11_a4
103 , p11_a5
104 , p11_a6
105 , p11_a7
106 , p11_a8
107 , p11_a9
108 , p11_a10
109 , p11_a11
110 , p11_a12
111 , p11_a13
112 , p11_a14
113 , p11_a15
114 , p11_a16
115 , p11_a17
116 , p11_a18
117 , p11_a19
118 , p11_a20
119 , p11_a21
120 , p11_a22
121 , p11_a23
122 , p11_a24
123 , p11_a25
124 , p11_a26
125 , p11_a27
126 , p11_a28
127 , p11_a29
128 , p11_a30
129 , p11_a31
130 , p11_a32
131 , p11_a33
132 , p11_a34
133 , p11_a35
134 , p11_a36
135 );
136
137
138
139
140
141 -- here's the delegated call to the old PL/SQL routine
142 as_sales_leads_pub.copy_lead_to_opportunity(p_api_version_number,
143 p_init_msg_list,
144 p_commit,
145 p_validation_level,
146 p_check_access_flag,
147 p_admin_flag,
148 p_admin_group_id,
149 p_identity_salesforce_id,
150 p_identity_salesgroup_id,
151 ddp_sales_lead_profile_tbl,
152 p_sales_lead_id,
153 ddp_sales_lead_line_tbl,
154 p_opportunity_id,
155 x_return_status,
156 x_msg_count,
157 x_msg_data);
158
159 -- copy data back from the local variables to OUT or IN-OUT args, if any
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175 end;
176
177 procedure link_lead_to_opportunity(p_api_version_number NUMBER
178 , p_init_msg_list VARCHAR2
179 , p_commit VARCHAR2
180 , p_validation_level NUMBER
181 , p_check_access_flag VARCHAR2
182 , p_admin_flag VARCHAR2
183 , p_admin_group_id NUMBER
184 , p_identity_salesforce_id NUMBER
185 , p_identity_salesgroup_id NUMBER
186 , p9_a0 JTF_VARCHAR2_TABLE_100
187 , p9_a1 JTF_VARCHAR2_TABLE_300
188 , p_sales_lead_id NUMBER
189 , p_opportunity_id NUMBER
190 , x_return_status out nocopy VARCHAR2
191 , x_msg_count out nocopy NUMBER
192 , x_msg_data out nocopy VARCHAR2
193 )
194
195 as
196 ddp_sales_lead_profile_tbl as_utility_pub.profile_tbl_type;
197 ddindx binary_integer; indx binary_integer;
198 begin
199
200 -- copy data to the local IN or IN-OUT args, if any
201
202
203
204
205
206
207
208
209
210 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_sales_lead_profile_tbl, p9_a0
211 , p9_a1
212 );
213
214
215
216
217
218
219 -- here's the delegated call to the old PL/SQL routine
220 as_sales_leads_pub.link_lead_to_opportunity(p_api_version_number,
221 p_init_msg_list,
222 p_commit,
223 p_validation_level,
224 p_check_access_flag,
225 p_admin_flag,
226 p_admin_group_id,
227 p_identity_salesforce_id,
228 p_identity_salesgroup_id,
229 ddp_sales_lead_profile_tbl,
230 p_sales_lead_id,
231 p_opportunity_id,
232 x_return_status,
233 x_msg_count,
234 x_msg_data);
235
236 -- copy data back from the local variables to OUT or IN-OUT args, if any
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251 end;
252
253 procedure create_opportunity_for_lead(p_api_version_number NUMBER
254 , p_init_msg_list VARCHAR2
255 , p_commit VARCHAR2
256 , p_validation_level NUMBER
257 , p_check_access_flag VARCHAR2
258 , p_admin_flag VARCHAR2
259 , p_admin_group_id NUMBER
260 , p_identity_salesforce_id NUMBER
261 , p_identity_salesgroup_id NUMBER
262 , p9_a0 JTF_VARCHAR2_TABLE_100
263 , p9_a1 JTF_VARCHAR2_TABLE_300
264 , p_sales_lead_id NUMBER
265 , p_opp_status VARCHAR2
266 , x_return_status out nocopy VARCHAR2
267 , x_msg_count out nocopy NUMBER
268 , x_msg_data out nocopy VARCHAR2
269 , x_opportunity_id out nocopy NUMBER
270 )
271
272 as
273 ddp_sales_lead_profile_tbl as_utility_pub.profile_tbl_type;
274 ddindx binary_integer; indx binary_integer;
275 begin
276
277 -- copy data to the local IN or IN-OUT args, if any
278
279
280
281
282
283
284
285
286
287 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_sales_lead_profile_tbl, p9_a0
288 , p9_a1
289 );
290
291
292
293
294
295
296
297 -- here's the delegated call to the old PL/SQL routine
298 as_sales_leads_pub.create_opportunity_for_lead(p_api_version_number,
299 p_init_msg_list,
300 p_commit,
301 p_validation_level,
302 p_check_access_flag,
303 p_admin_flag,
304 p_admin_group_id,
305 p_identity_salesforce_id,
306 p_identity_salesgroup_id,
307 ddp_sales_lead_profile_tbl,
308 p_sales_lead_id,
309 p_opp_status,
310 x_return_status,
311 x_msg_count,
312 x_msg_data,
313 x_opportunity_id);
314
315 -- copy data back from the local variables to OUT or IN-OUT args, if any
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331 end;
332
333 procedure assign_sales_lead(p_api_version_number NUMBER
334 , p_init_msg_list VARCHAR2
335 , p_commit VARCHAR2
336 , p_validation_level NUMBER
337 , p_check_access_flag VARCHAR2
338 , p_admin_flag VARCHAR2
339 , p_admin_group_id NUMBER
340 , p_identity_salesforce_id NUMBER
341 , p8_a0 JTF_VARCHAR2_TABLE_100
342 , p8_a1 JTF_VARCHAR2_TABLE_300
343 , p_sales_lead_id NUMBER
344 , x_return_status out nocopy VARCHAR2
345 , x_msg_count out nocopy NUMBER
346 , x_msg_data out nocopy VARCHAR2
347 , p13_a0 out nocopy JTF_NUMBER_TABLE
348 , p13_a1 out nocopy JTF_NUMBER_TABLE
349 )
350
351 as
352 ddp_sales_lead_profile_tbl as_utility_pub.profile_tbl_type;
353 ddx_assign_id_tbl as_sales_leads_pub.assign_id_tbl_type;
354 ddindx binary_integer; indx binary_integer;
355 begin
356
357 -- copy data to the local IN or IN-OUT args, if any
358
359
360
361
362
363
364
365
366 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_sales_lead_profile_tbl, p8_a0
367 , p8_a1
368 );
369
370
371
372
373
374
375 -- here's the delegated call to the old PL/SQL routine
376 as_sales_leads_pub.assign_sales_lead(p_api_version_number,
377 p_init_msg_list,
378 p_commit,
379 p_validation_level,
380 p_check_access_flag,
381 p_admin_flag,
382 p_admin_group_id,
383 p_identity_salesforce_id,
384 ddp_sales_lead_profile_tbl,
385 p_sales_lead_id,
386 x_return_status,
387 x_msg_count,
388 x_msg_data,
389 ddx_assign_id_tbl);
390
391 -- copy data back from the local variables to OUT or IN-OUT args, if any
392
393
394
395
396
397
398
399
400
401
402
403
404
405 as_sales_leads_pub_w.rosetta_table_copy_out_p19(ddx_assign_id_tbl, p13_a0
406 , p13_a1
407 );
408 end;
409
410 procedure get_access_profiles(p0_a0 JTF_VARCHAR2_TABLE_100
411 , p0_a1 JTF_VARCHAR2_TABLE_300
412 , p1_a0 out nocopy VARCHAR2
413 , p1_a1 out nocopy VARCHAR2
414 , p1_a2 out nocopy VARCHAR2
415 , p1_a3 out nocopy VARCHAR2
416 , p1_a4 out nocopy VARCHAR2
417 )
418
419 as
420 ddp_profile_tbl as_utility_pub.profile_tbl_type;
421 ddx_access_profile_rec as_access_pub.access_profile_rec_type;
422 ddindx binary_integer; indx binary_integer;
423 begin
424
425 -- copy data to the local IN or IN-OUT args, if any
426 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_profile_tbl, p0_a0
427 , p0_a1
428 );
429
430
431 -- here's the delegated call to the old PL/SQL routine
432 as_sales_leads_pub.get_access_profiles(ddp_profile_tbl,
433 ddx_access_profile_rec);
434
435 -- copy data back from the local variables to OUT or IN-OUT args, if any
436
437 p1_a0 := ddx_access_profile_rec.cust_access_profile_value;
438 p1_a1 := ddx_access_profile_rec.lead_access_profile_value;
439 p1_a2 := ddx_access_profile_rec.opp_access_profile_value;
440 p1_a3 := ddx_access_profile_rec.mgr_update_profile_value;
441 p1_a4 := ddx_access_profile_rec.admin_update_profile_value;
442 end;
443
444 function get_profile(p0_a0 JTF_VARCHAR2_TABLE_100
445 , p0_a1 JTF_VARCHAR2_TABLE_300
446 , p_profile_name VARCHAR2
447 ) return varchar2
448
449 as
450 ddp_profile_tbl as_utility_pub.profile_tbl_type;
451 ddindx binary_integer; indx binary_integer;
452 ddrosetta_retval varchar2(4000);
453 begin
454
455 -- copy data to the local IN or IN-OUT args, if any
456 as_utility_pub_w.rosetta_table_copy_in_p6(ddp_profile_tbl, p0_a0
457 , p0_a1
458 );
459
460
461 -- here's the delegated call to the old PL/SQL routine
462 ddrosetta_retval := as_sales_leads_pub.get_profile(ddp_profile_tbl,
463 p_profile_name);
464
465 -- copy data back from the local variables to OUT or IN-OUT args, if any
466
467
468 return ddrosetta_retval;
469 end;
470
471 procedure run_lead_engines(p_api_version_number NUMBER
472 , p_init_msg_list VARCHAR2
473 , p_commit VARCHAR2
474 , p_validation_level NUMBER
475 , p_admin_group_id NUMBER
476 , p_identity_salesforce_id NUMBER
477 , p_salesgroup_id NUMBER
478 , p_sales_lead_id NUMBER
479 , p8_a0 out nocopy VARCHAR2
480 , p8_a1 out nocopy NUMBER
481 , p8_a2 out nocopy VARCHAR2
482 , p8_a3 out nocopy VARCHAR2
483 , p8_a4 out nocopy VARCHAR2
484 , x_return_status out nocopy VARCHAR2
485 , x_msg_count out nocopy NUMBER
486 , x_msg_data out nocopy VARCHAR2
487 )
488
489 as
490 ddx_lead_engines_out_rec as_sales_leads_pub.lead_engines_out_rec_type;
491 ddindx binary_integer; indx binary_integer;
492 begin
493
494 -- copy data to the local IN or IN-OUT args, if any
495
496
497
498
499
500
501
502
503
504
505
506
507 -- here's the delegated call to the old PL/SQL routine
508 as_sales_leads_pub.run_lead_engines(p_api_version_number,
509 p_init_msg_list,
510 p_commit,
511 p_validation_level,
512 p_admin_group_id,
513 p_identity_salesforce_id,
514 p_salesgroup_id,
515 p_sales_lead_id,
516 ddx_lead_engines_out_rec,
517 x_return_status,
518 x_msg_count,
519 x_msg_data);
520
521 -- copy data back from the local variables to OUT or IN-OUT args, if any
522
523
524
525
526
527
528
529
530 p8_a0 := ddx_lead_engines_out_rec.qualified_flag;
531 p8_a1 := rosetta_g_miss_num_map(ddx_lead_engines_out_rec.lead_rank_id);
532 p8_a2 := ddx_lead_engines_out_rec.channel_code;
533 p8_a3 := ddx_lead_engines_out_rec.indirect_channel_flag;
534 p8_a4 := ddx_lead_engines_out_rec.sales_team_flag;
535
536
537
538 end;
539
540 end as_sales_leads_pub_w2;