[Home] [Help]
PACKAGE BODY: APPS.OZF_FORECAST_UTIL_PVT_W
Source
1 package body ozf_forecast_util_pvt_w as
2 /* $Header: ozfwfoub.pls 120.0 2005/11/04 18:50 mkothari 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 get_best_fit_lift(p_obj_type VARCHAR2
14 , p_obj_id NUMBER
15 , p_forecast_id NUMBER
16 , p_base_quantity_ref VARCHAR2
17 , p_market_type VARCHAR2
18 , p_market_id NUMBER
19 , p_product_attribute_context VARCHAR2
20 , p_product_attribute VARCHAR2
21 , p_product_attr_value VARCHAR2
22 , p_product_id NUMBER
23 , p_tpr_percent NUMBER
24 , p_report_date date
25 ) return number
26
27 as
28 ddp_report_date date;
29 ddindx binary_integer; indx binary_integer;
30 ddrosetta_retval number;
31 begin
32
33 -- copy data to the local IN or IN-OUT args, if any
34
35
36
37
38
39
40
41
42
43
44
45 ddp_report_date := rosetta_g_miss_date_in_map(p_report_date);
46
47 -- here's the delegated call to the old PL/SQL routine
48 ddrosetta_retval := ozf_forecast_util_pvt.get_best_fit_lift(p_obj_type,
49 p_obj_id,
50 p_forecast_id,
51 p_base_quantity_ref,
52 p_market_type,
53 p_market_id,
54 p_product_attribute_context,
55 p_product_attribute,
56 p_product_attr_value,
57 p_product_id,
58 p_tpr_percent,
59 ddp_report_date);
60
61 -- copy data back from the local variables to OUT or IN-OUT args, if any
62
63
64
65
66
67
68
69
70
71
72
73
74 return ddrosetta_retval;
75 end;
76
77 procedure create_forecast(p_api_version NUMBER
78 , p_init_msg_list VARCHAR2
79 , p_commit VARCHAR2
80 , p_obj_type VARCHAR2
81 , p_obj_id NUMBER
82 , p_fcst_uom VARCHAR2
83 , p_start_date date
84 , p_end_date date
85 , p_base_quantity_type VARCHAR2
86 , p_base_quantity_ref VARCHAR2
87 , p_last_scenario_id NUMBER
88 , p_offer_code VARCHAR2
89 , x_forecast_id in out nocopy NUMBER
90 , x_activity_metric_id out nocopy NUMBER
91 , x_return_status out nocopy VARCHAR2
92 , x_msg_count out nocopy NUMBER
93 , x_msg_data out nocopy VARCHAR2
94 )
95
96 as
97 ddp_start_date date;
98 ddp_end_date date;
99 ddindx binary_integer; indx binary_integer;
100 begin
101
102 -- copy data to the local IN or IN-OUT args, if any
103
104
105
106
107
108
109 ddp_start_date := rosetta_g_miss_date_in_map(p_start_date);
110
111 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
112
113
114
115
116
117
118
119
120
121
122 -- here's the delegated call to the old PL/SQL routine
123 ozf_forecast_util_pvt.create_forecast(p_api_version,
124 p_init_msg_list,
125 p_commit,
126 p_obj_type,
127 p_obj_id,
128 p_fcst_uom,
129 ddp_start_date,
130 ddp_end_date,
131 p_base_quantity_type,
132 p_base_quantity_ref,
133 p_last_scenario_id,
134 p_offer_code,
135 x_forecast_id,
136 x_activity_metric_id,
137 x_return_status,
138 x_msg_count,
139 x_msg_data);
140
141 -- copy data back from the local variables to OUT or IN-OUT args, if any
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158 end;
159
160 procedure create_base_sales(p_api_version NUMBER
161 , p_init_msg_list VARCHAR2
162 , p_commit VARCHAR2
163 , p_obj_type VARCHAR2
164 , p_obj_id NUMBER
165 , p_forecast_id NUMBER
166 , p_activity_metric_id NUMBER
167 , p_level VARCHAR2
168 , p_dimention VARCHAR2
169 , p_fcst_uom VARCHAR2
170 , p_start_date date
171 , p_end_date date
172 , p_period_level VARCHAR2
173 , p_base_quantity_type VARCHAR2
174 , p_base_quantity_ref VARCHAR2
175 , p_last_forecast_id NUMBER
176 , p_base_quantity_start_date date
177 , p_base_quantity_end_date date
178 , p_offer_code VARCHAR2
179 , p19_a0 out nocopy NUMBER
180 , p19_a1 out nocopy NUMBER
181 , x_return_status out nocopy VARCHAR2
182 , x_msg_count out nocopy NUMBER
183 , x_msg_data out nocopy VARCHAR2
184 )
185
186 as
187 ddp_start_date date;
188 ddp_end_date date;
189 ddp_base_quantity_start_date date;
190 ddp_base_quantity_end_date date;
191 ddx_fcst_return_rec ozf_forecast_util_pvt.fcst_return_rec_type;
192 ddindx binary_integer; indx binary_integer;
193 begin
194
195 -- copy data to the local IN or IN-OUT args, if any
196
197
198
199
200
201
202
203
204
205
206 ddp_start_date := rosetta_g_miss_date_in_map(p_start_date);
207
208 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
209
210
211
212
213
214 ddp_base_quantity_start_date := rosetta_g_miss_date_in_map(p_base_quantity_start_date);
215
216 ddp_base_quantity_end_date := rosetta_g_miss_date_in_map(p_base_quantity_end_date);
217
218
219
220
221
222
223 -- here's the delegated call to the old PL/SQL routine
224 ozf_forecast_util_pvt.create_base_sales(p_api_version,
225 p_init_msg_list,
226 p_commit,
227 p_obj_type,
228 p_obj_id,
229 p_forecast_id,
230 p_activity_metric_id,
231 p_level,
232 p_dimention,
233 p_fcst_uom,
234 ddp_start_date,
235 ddp_end_date,
236 p_period_level,
237 p_base_quantity_type,
238 p_base_quantity_ref,
239 p_last_forecast_id,
240 ddp_base_quantity_start_date,
241 ddp_base_quantity_end_date,
242 p_offer_code,
243 ddx_fcst_return_rec,
244 x_return_status,
245 x_msg_count,
246 x_msg_data);
247
248 -- copy data back from the local variables to OUT or IN-OUT args, if any
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268 p19_a0 := ddx_fcst_return_rec.forecast_id;
269 p19_a1 := ddx_fcst_return_rec.spread_count;
270
271
272
273 end;
274
275 end ozf_forecast_util_pvt_w;