[Home] [Help]
PACKAGE BODY: APPS.HZ_GEO_UI_UTIL_PUB_W
Source
1 package body hz_geo_ui_util_pub_w as
2 /* $Header: ARHGEUJB.pls 120.3 2005/09/28 20:10:59 sroychou 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 -- 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 rosetta_table_copy_in_p1(t out nocopy hz_geo_ui_util_pub.tax_geo_tbl_type, a0 JTF_NUMBER_TABLE
23 , a1 JTF_VARCHAR2_TABLE_400
24 , a2 JTF_VARCHAR2_TABLE_400
25 , a3 JTF_VARCHAR2_TABLE_100
26 ) as
27 ddindx binary_integer; indx binary_integer;
28 begin
29 if a0 is not null and a0.count > 0 then
30 if a0.count > 0 then
31 indx := a0.first;
32 ddindx := 1;
33 while true loop
34 t(ddindx).level_number := rosetta_g_miss_num_map(a0(indx));
35 t(ddindx).geography_type := a1(indx);
36 t(ddindx).loc_comp := a2(indx);
37 t(ddindx).tax_geo_valid := a3(indx);
38 ddindx := ddindx+1;
39 if a0.last =indx
40 then exit;
41 end if;
42 indx := a0.next(indx);
43 end loop;
44 end if;
45 end if;
46 end rosetta_table_copy_in_p1;
47 procedure rosetta_table_copy_out_p1(t hz_geo_ui_util_pub.tax_geo_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
48 , a1 out nocopy JTF_VARCHAR2_TABLE_400
49 , a2 out nocopy JTF_VARCHAR2_TABLE_400
50 , a3 out nocopy JTF_VARCHAR2_TABLE_100
51 ) as
52 ddindx binary_integer; indx binary_integer;
53 begin
54 if t is null or t.count = 0 then
55 a0 := JTF_NUMBER_TABLE();
56 a1 := JTF_VARCHAR2_TABLE_400();
57 a2 := JTF_VARCHAR2_TABLE_400();
58 a3 := JTF_VARCHAR2_TABLE_100();
59 else
60 a0 := JTF_NUMBER_TABLE();
61 a1 := JTF_VARCHAR2_TABLE_400();
62 a2 := JTF_VARCHAR2_TABLE_400();
63 a3 := JTF_VARCHAR2_TABLE_100();
64 if t.count > 0 then
65 a0.extend(t.count);
66 a1.extend(t.count);
67 a2.extend(t.count);
68 a3.extend(t.count);
69 ddindx := t.first;
70 indx := 1;
71 while true loop
72 a0(indx) := rosetta_g_miss_num_map(t(ddindx).level_number);
73 a1(indx) := t(ddindx).geography_type;
74 a2(indx) := t(ddindx).loc_comp;
75 a3(indx) := t(ddindx).tax_geo_valid;
76 indx := indx+1;
77 if t.last =ddindx
78 then exit;
79 end if;
80 ddindx := t.next(ddindx);
81 end loop;
82 end if;
83 end if;
84 end rosetta_table_copy_out_p1;
85
86 procedure update_map_usages(p_map_id NUMBER
87 , p1_a0 JTF_NUMBER_TABLE
88 , p1_a1 JTF_VARCHAR2_TABLE_400
89 , p1_a2 JTF_VARCHAR2_TABLE_400
90 , p1_a3 JTF_VARCHAR2_TABLE_100
91 , p2_a0 JTF_NUMBER_TABLE
92 , p2_a1 JTF_VARCHAR2_TABLE_400
93 , p2_a2 JTF_VARCHAR2_TABLE_400
94 , p2_a3 JTF_VARCHAR2_TABLE_100
95 , p_init_msg_list VARCHAR2
96 , x_return_status out nocopy VARCHAR2
97 , x_msg_count out nocopy NUMBER
98 , x_msg_data out nocopy VARCHAR2
99 , x_show_gnr out nocopy VARCHAR2
100 )
101
102 as
103 ddp_tax_tbl hz_geo_ui_util_pub.tax_geo_tbl_type;
104 ddp_geo_tbl hz_geo_ui_util_pub.tax_geo_tbl_type;
105 ddindx binary_integer; indx binary_integer;
106 begin
107
108 -- copy data to the local IN or IN-OUT args, if any
109
110 hz_geo_ui_util_pub_w.rosetta_table_copy_in_p1(ddp_tax_tbl, p1_a0
111 , p1_a1
112 , p1_a2
113 , p1_a3
114 );
115
116 hz_geo_ui_util_pub_w.rosetta_table_copy_in_p1(ddp_geo_tbl, p2_a0
117 , p2_a1
118 , p2_a2
119 , p2_a3
120 );
121
122
123
124
125
126
127 -- here's the delegated call to the old PL/SQL routine
128 hz_geo_ui_util_pub.update_map_usages(p_map_id,
129 ddp_tax_tbl,
130 ddp_geo_tbl,
131 p_init_msg_list,
132 x_return_status,
133 x_msg_count,
134 x_msg_data,
135 x_show_gnr);
136
137 -- copy data back from the local variables to OUT or IN-OUT args, if any
138
139
140
141
142
143
144
145 end;
146
147 end hz_geo_ui_util_pub_w;