[Home] [Help]
58: i := 1;
59:
60:
61: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
62: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' get_zone (+)',
63: p_msg_level=>fnd_log.level_procedure);
64: END IF;
65:
66: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
63: p_msg_level=>fnd_log.level_procedure);
64: END IF;
65:
66: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
67: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' Param p_location_table_name '||p_location_table_name
68: ||' p_location_id '||p_location_id
69: ||' p_zone_type '||p_zone_type
70: ||' p_date '||p_date,
71: p_msg_level=>fnd_log.level_statement);
102: AND rownum = 1;
103: END;
104:
105: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
106: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>'For Zone type '||p_zone_type||' Relationship type count is '||l_count,
107: p_msg_level=>fnd_log.level_statement);
108: END IF;
109:
110: IF l_count = 0 THEN
129: WHERE location_id = p_location_id;
130: END IF;
131:
132: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
133: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' Country Code for location '||p_location_id||' is '||l_country_code,
134: p_msg_level=>fnd_log.level_statement);
135: END IF;
136:
137:
149: AND location_id = p_location_id
150: AND rownum = 1;
151:
152: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
153: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For location '||p_location_id||' Geo Name References count is '||l_gnr_count,
154: p_msg_level=>fnd_log.level_statement);
155: END IF;
156:
157: -- Below code is commenmted for bug # 5011582
185: AND location_id = p_location_id
186: AND geography_type = l_ref_geo_type;
187:
188: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
189: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>'For geography_type '||l_ref_geo_type||' and Location '||
190: p_location_id||', Geography_id is '||l_geography_id,
191: p_msg_level=>fnd_log.level_statement);
192: END IF;
193:
204: -- Bug 5410283 (Added on 07-Aug-2006)
205: AND p_date BETWEEN start_date AND end_date;
206: END IF;
207: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
208: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>'In Exception blk - For geography_type '||l_ref_geo_type||' and Location '||
209: p_location_id||', Geography_id is '||l_geography_id,
210: p_msg_level=>fnd_log.level_exception);
211: END IF;
212:
220: EXIT WHEN C_GET_ZONES%NOTFOUND;
221: l_zone_tbl(i).zone_id := l_zone_id;
222:
223: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
224: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For Geo Type '||l_ref_geo_type
225: ||' and Geograpphy Id '||l_geography_id
226: ||' Zone information :'||l_zone_id,
227: p_msg_level=>fnd_log.level_statement);
228: END IF;
233: FROM hz_geography_types_b
234: WHERE geography_type = p_zone_type;
235:
236: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
237: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For Geography Type '||p_zone_type
238: ||' postal_code_range_flag is '||l_postal_code_range_flag
239: ||' and geography_use is '||l_geography_use,
240: p_msg_level=>fnd_log.level_statement);
241: END IF;
264: AND geography_use = 'TAX'
265: AND rownum = 1;
266:
267: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
268: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For Geo Type : '||p_zone_type
269: ||' and Geograpphy Id '||l_zone_id||' GEOGRAPHY Ranges count is ' ||l_count,
270: p_msg_level=>fnd_log.level_statement);
271: END IF;
272: IF l_count > 0 THEN
287: FROM hz_locations
288: WHERE location_id = p_location_id;
289:
290: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
291: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For Location '||p_location_id||' Postal Code is '||l_postal_code,
292: p_msg_level=>fnd_log.level_statement);
293: END IF;
294:
295:
310: AND rownum = 1;
311:
312:
313: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
314: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For Geo Type : '||p_zone_type
315: ||' and Postal code range Geography Ranges count is ' ||l_count,
316: p_msg_level=>fnd_log.level_statement);
317: END IF;
318:
323: l_zone_id := NULL;
324: l_zone_tbl(i).zone_id := l_zone_id;
325: i := i-1;
326: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
327: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' Making Zone_id NULL in array. ',
328: p_msg_level=>fnd_log.level_statement);
329: END IF;
330: END IF;
331:
360: RAISE FND_API.G_EXC_ERROR;
361: END IF;
362:
363: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
364: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' Array l_zone_tbl Count is '||l_zone_tbl.COUNT,
365: p_msg_level=>fnd_log.level_statement);
366: END IF;
367:
368: IF l_zone_tbl.COUNT > 0 THEN
382: j := l_zone_tbl_final.NEXT(j);
383: END LOOP;
384:
385: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
386: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' For '||l_zone_tbl(i).zone_id||' populate_tbl flag is '||l_populate_tbl,
387: p_msg_level=>fnd_log.level_statement);
388: END IF;
389:
390: IF l_populate_tbl = 'Y' THEN
400: AND p_date BETWEEN start_date AND end_date;
401: l_zone_tbl_final(l_tbl_count+1).zone_type := p_zone_type;
402:
403: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
404: HZ_UTILITY_V2PUB.DEBUG(P_PREFIX=>L_DEBUG_PREFIX,P_MESSAGE=>' Array Index : '||TO_CHAR(L_TBL_COUNT+1)
405: ||' Zone Id '||TO_CHAR(L_ZONE_TBL_FINAL(L_TBL_COUNT+1).ZONE_ID)
406: ||' Zone Code '||TO_CHAR(L_ZONE_TBL_FINAL(L_TBL_COUNT+1).ZONE_CODE)
407: ||' Zone Name '||TO_CHAR(L_ZONE_TBL_FINAL(L_TBL_COUNT+1).ZONE_NAME)
408: ||' Zone Type '||TO_CHAR(L_ZONE_TBL_FINAL(L_TBL_COUNT+1).ZONE_TYPE)
410: END IF;
411: EXCEPTION
412: WHEN NO_DATA_FOUND THEN
413: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
414: HZ_UTILITY_V2PUB.DEBUG(P_PREFIX=>L_DEBUG_PREFIX,P_MESSAGE=>'Geography information is missing for geography_id '||l_zone_tbl(i).zone_id
415: ||'. Either data does not exists or out of date range.'
416: , p_msg_level=>fnd_log.level_exception);
417: END IF;
418: WHEN OTHERS THEN
416: , p_msg_level=>fnd_log.level_exception);
417: END IF;
418: WHEN OTHERS THEN
419: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
420: HZ_UTILITY_V2PUB.DEBUG(P_PREFIX=>L_DEBUG_PREFIX,P_MESSAGE=>'Geography information is missing for geography_id ERRROR - '||SQLERRM
421: , p_msg_level=>fnd_log.level_exception);
422: END IF;
423:
424: END;
434:
435: l_zone_tbl_final(i).zone_type := p_zone_type;
436:
437: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
438: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' First insert in l_zone_tbl_final ',
439: p_msg_level=>fnd_log.level_statement);
440: END IF;
441:
442: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
439: p_msg_level=>fnd_log.level_statement);
440: END IF;
441:
442: IF fnd_log.level_statement>=fnd_log.g_current_runtime_level THEN
443: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' Array Index : '||i
444: ||' Zone Id '||l_zone_tbl_final(i).zone_id
445: ||' Zone Code '||l_zone_tbl_final(i).zone_code
446: ||' Zone Name '||l_zone_tbl_final(i).zone_name,
447: p_msg_level=>fnd_log.level_statement);
448: END IF;
449: EXCEPTION
450: WHEN NO_DATA_FOUND THEN
451: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
452: HZ_UTILITY_V2PUB.DEBUG(P_PREFIX=>L_DEBUG_PREFIX,P_MESSAGE=>'Geography information is missing for geography_id '||l_zone_tbl(i).zone_id
453: ||'. Either data does not exists or out of date range.'
454: , p_msg_level=>fnd_log.level_exception);
455: END IF;
456: WHEN OTHERS THEN
454: , p_msg_level=>fnd_log.level_exception);
455: END IF;
456: WHEN OTHERS THEN
457: IF fnd_log.level_exception>=fnd_log.g_current_runtime_level THEN
458: HZ_UTILITY_V2PUB.DEBUG(P_PREFIX=>L_DEBUG_PREFIX,P_MESSAGE=>'Geography information is missing for geography_id ERRROR - '||SQLERRM
459: , p_msg_level=>fnd_log.level_exception);
460: END IF;
461: END;
462: END IF;
467: END IF;
468:
469: x_zone_tbl := l_zone_tbl_final;
470: IF fnd_log.level_procedure>=fnd_log.g_current_runtime_level THEN
471: hz_utility_v2pub.debug(p_prefix=>l_debug_prefix,p_message=>' get_zone (-)',
472: p_msg_level=>fnd_log.level_procedure);
473: END IF;
474:
475: EXCEPTION
524: from hz_geographies
525: where geography_id = l_geo_id;
526: Exception
527: When no_data_found then
528: return hz_utility_v2pub.Get_LookupMeaning('AR_LOOKUPS', 'HZ_GEO_DISPLAY_ONLY', 'WORLD');
529: end;
530:
531: l_clause := 'nvl2(geography_element1, geography_element1, geography_name)';
532: