1 PACKAGE BODY ONT_CHARGE_UTIL AS
2 /* $Header: ONTUCHRB.pls 120.0 2005/06/01 00:37:30 appldev noship $ */
3
4 -- Global constant holding the package name
5
6 G_PKG_NAME CONSTANT VARCHAR2(30) := 'ONT_CHARGE_UTIL';
7
8 /* function to return the meaning from qp_charge_lookup when lookup type i
9 passed to this function */
10
11 Function Get_Meaning
12 ( p_charge_type_code in VARCHAR2
13 , p_charge_subtype_code in VARCHAR2 := NULL
14 ) RETURN VARCHAR2
15 IS
16 l_meaning VARCHAR2(80) := NULL;
17 l_charge_type_code VARCHAR2(30);
18 l_charge_subtype_code VARCHAR2(30);
19 BEGIN
20 -- Check whether p_charge_type_code is null
21
22 -- bug 2816272, need to convert miss char to NULL.
23 l_charge_type_code := p_charge_type_code;
24 l_charge_subtype_code := p_charge_subtype_code;
25
26 IF p_charge_type_code = FND_API.G_MISS_CHAR THEN
27 l_charge_type_code := NULL;
28 END IF;
29
30 IF p_charge_subtype_code = FND_API.G_MISS_CHAR THEN
31 l_charge_subtype_code := NULL;
32 END IF;
33
34
35 IF l_charge_type_code is NULL THEN
36
37 l_meaning := NULL;
38
39 ELSE /* l_charge_type_code is not null */
40
41 IF l_charge_subtype_code is NULL THEN
42
43 BEGIN
44
45 select meaning into l_meaning
46 from wsh_lookups
47 where lookup_code = l_charge_type_code
48 and lookup_type = 'FREIGHT_COST_TYPE';
49
50 EXCEPTION
51
52 WHEN NO_DATA_FOUND THEN
53
54 select meaning into l_meaning
55 from qp_lookups
56 where lookup_code = l_charge_type_code
57 and lookup_type = 'FREIGHT_CHARGES_TYPE';
58
59 END;
60
61 ELSE /* l_charge_subtype_code is not null */
62
63 select meaning into l_meaning
64 from qp_lookups
65 where lookup_type = l_charge_type_code
66 and lookup_code = l_charge_subtype_code;
67
68 END IF; /* if l_charge_subtype_code is null */
69
70 END IF; /* if l_charge_type_code is null */
71
72 Return l_meaning;
73
74 EXCEPTION
75
76 WHEN NO_DATA_FOUND THEN
77
78 l_meaning := NULL;
79 RETURN l_meaning;
80
81 WHEN OTHERS THEN
82
83 l_meaning := NULL;
84 RETURN l_meaning;
85
86 END Get_Meaning;
87
88 END ONT_CHARGE_UTIL;