1 package body okl_btch_cash_sumry_pvt_w as
2 /* $Header: OKLEBASB.pls 115.4 2003/11/11 02:02:16 rgalipo noship $ */
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 function rosetta_g_miss_num_map(n number) return number as
7 a number := fnd_api.g_miss_num;
8 b number := 0-1962.0724;
9 begin
10 if n=a then return b; end if;
11 if n=b then return a; end if;
12 return n;
13 end;
14
15 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16 function rosetta_g_miss_date_in_map(d date) return date as
17 begin
18 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19 return d;
20 end;
21
22 procedure rosetta_table_copy_in_p13(t out NOCOPY okl_btch_cash_sumry_pvt.okl_btch_sumry_tbl_type, a0 JTF_NUMBER_TABLE
23 , a1 JTF_VARCHAR2_TABLE_100
24 ) as
25 ddindx binary_integer; indx binary_integer;
26 begin
27 if a0 is not null and a0.count > 0 then
28 if a0.count > 0 then
29 indx := a0.first;
30 ddindx := 1;
31 while true loop
32 t(ddindx).id := rosetta_g_miss_num_map(a0(indx));
33 t(ddindx).trx_status_code := a1(indx);
34 ddindx := ddindx+1;
35 if a0.last =indx
36 then exit;
37 end if;
38 indx := a0.next(indx);
39 end loop;
40 end if;
41 end if;
42 end rosetta_table_copy_in_p13;
43 procedure rosetta_table_copy_out_p13(t okl_btch_cash_sumry_pvt.okl_btch_sumry_tbl_type, a0 out NOCOPY JTF_NUMBER_TABLE
44 , a1 out NOCOPY JTF_VARCHAR2_TABLE_100
45 ) as
46 ddindx binary_integer; indx binary_integer;
47 begin
48 if t is null or t.count = 0 then
49 a0 := JTF_NUMBER_TABLE();
50 a1 := JTF_VARCHAR2_TABLE_100();
51 else
52 a0 := JTF_NUMBER_TABLE();
53 a1 := JTF_VARCHAR2_TABLE_100();
54 if t.count > 0 then
55 a0.extend(t.count);
56 a1.extend(t.count);
57 ddindx := t.first;
58 indx := 1;
59 while true loop
60 a0(indx) := rosetta_g_miss_num_map(t(ddindx).id);
61 a1(indx) := t(ddindx).trx_status_code;
62 indx := indx+1;
63 if t.last =ddindx
64 then exit;
65 end if;
66 ddindx := t.next(ddindx);
67 end loop;
68 end if;
69 end if;
70 end rosetta_table_copy_out_p13;
71
72 procedure handle_batch_sumry(p_api_version NUMBER
73 , p_init_msg_list VARCHAR2
74 , x_return_status out NOCOPY VARCHAR2
75 , x_msg_count out NOCOPY NUMBER
76 , x_msg_data out NOCOPY VARCHAR2
77 , p5_a0 JTF_NUMBER_TABLE
78 , p5_a1 JTF_VARCHAR2_TABLE_100
79 )
80
81 as
82 ddp_btch_tbl okl_btch_cash_sumry_pvt.okl_btch_sumry_tbl_type;
83 ddindx binary_integer; indx binary_integer;
84 begin
85
86 -- copy data to the local IN or IN-OUT args, if any
87
88
89
90
91
92 okl_btch_cash_sumry_pvt_w.rosetta_table_copy_in_p13(ddp_btch_tbl, p5_a0
93 , p5_a1
94 );
95
96 -- here's the delegated call to the old PL/SQL routine
97 okl_btch_cash_sumry_pvt.handle_batch_sumry(p_api_version,
98 p_init_msg_list,
99 x_return_status,
100 x_msg_count,
101 x_msg_data,
102 ddp_btch_tbl);
103
104 -- copy data back from the local variables to OUT or IN-OUT args, if any
105
106
107
108
109
110 end;
111
112 end okl_btch_cash_sumry_pvt_w;