DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_DUAL_UOM_HOOK

Source


1 PACKAGE BODY OE_DUAL_UOM_HOOK AS
2 /* $Header: OEXDUHOB.pls 120.0.12020000.4 2013/03/12 18:03:16 sbartl noship $ */
3 
4 
5 ---------------------------------------------------------------------
6 -- Function get_fulfillment_base
7 --
8 -- PVT API to return value of fulfillment_base filed on a line.
9 -- IN parameters -
10 -- p_line_rec   : The function will take OE_Order_PUB.Line_Rec_Type record and return FB (if required based upon custom logic)
11 ---------------------------------------------------------------------
12 Function get_fulfillment_base
13                (  p_line_rec IN OE_Order_PUB.Line_Rec_Type
14                 ) RETURN VARCHAR2
15       IS
16 
17 l_fulfillment_base  oe_order_lines_all.fulfillment_base%type;
18 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
19  --
20 BEGIN
21 
22     IF l_debug_level > 0 THEN
23         oe_debug_pub.add('Entering OE_DUAL_UOM_HOOK.get_fulfillment_base  ' ||p_line_rec.fulfillment_base);
24     END IF;
25 
26      /*
27        THIS HOOK SHOUlD ONLY RETURN VALUE 'P' or 'S'or NULL(to denote hook not in use).
28        Any other value will result in error.
29 
30       If using the hook, raise the version of the file (in the $Header... line)  to a high value, such as 120.1000,
31       so that it is not accidentally overwritten by later patches. */
32 
33 
34      /*Start Custom Code*/
35 
36 
37      /*End Custom Code */
38 
39      IF l_debug_level > 0 THEN
40         oe_debug_pub.add('Exiting as OE_DUAL_UOM_HOOK .get_fulfillment_base not used ' ||p_line_rec.fulfillment_base);
41      END IF;
42     RETURN NULL ;
43 
44 EXCEPTION
45    WHEN OTHERS THEN
46    IF l_debug_level > 0 THEN
47       oe_debug_pub.add('OE_DUAL_UOM_HOOK get_fulfillment_base  error ' ||sqlerrm);
48    END IF ;
49         IF oe_msg_pub.Check_Msg_Level(oe_msg_pub.G_MSG_LVL_UNEXP_ERROR)
50         THEN
51             oe_msg_pub.Add_Exc_Msg
52             (   'OE_DUAL_UOM_HOOK.get_fulfillment_base'
53           ,   'get_fulfillment_base'
54             );
55         END IF;
56   RETURN 'E'; --'E' is not a valid value (for FB), it will signify that hook API has errored out
57 END get_fulfillment_base;
58  ------------------------------------------------------------------------------------------------------
59 
60 -- 16206165 CW Start
61 --------------------------------------------------------------------------------------------------------------------------------------
62 -- Function get_pricing_uom
63 --
64 -- This hook is only meant for Dual UOM controlled item for which Fulfillment Base is populated.
65 -- IN parameters -
66 -- p_line_rec   : The function will take OE_Order_PUB.Line_Rec_Type record and return Pricing UOM (if required based upon custom logic)
67 --------------------------------------------------------------------------------------------------------------------------------------
68 Function get_pricing_uom
69                (  p_line_rec IN OE_Order_PUB.Line_Rec_Type
70                 ) RETURN VARCHAR2
71       IS
72 
73 l_pricing_uom  oe_order_lines_all.pricing_quantity_uom%type;
74 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
75  --
76 BEGIN
77 
78     IF l_debug_level > 0 THEN
79         oe_debug_pub.add('Entering oe_dual_uom_pricing_hook.get_pricing_uom  ' ||p_line_rec.pricing_quantity_uom);
80     END IF;
81 
82      /*
83 
84         If using the hook, raise the version of the file (in the $Header... line) to a high value,
85         such as 120.1000, so that it is not accidentally overwritten by later patches.
86 
87 
88        This hook is only meant for Dual UOM controlled item for which Fulfillment Base is populated.
89        This should only return value 'O' (Ordered UOM) , 'P' (Primary UOM) or 'S' (Secondary UOM) or NULL(to denote hook not in use).
90        Any other value will result in error.
91 
92        IF the hook returns 'O' , OM will do Pricing Based on Ordered Quantity and Ordered UOM.
93        IF the hook returns 'P' , OM will do Pricing Based on Primary Shipped Quantity and Primary UOM.
94        IF the hook returns 'S' , OM will do Pricing Based on Secondary Shipped Quantity and Secondary UOM.
95 
96        If this hook does not return a value , then Pricing for Dual UOM controlled item with Fulfillment Base featured enabled will behave
97        as follows:
98 
99        IF Fulfillment Base is Primary
100        and Item Master Pricing UOM is Secondary
101        THEN
102 
103             OM will do Pricing based on Secondary Shipped Quantity and Secondary UOM.
104             If Secondary Shipped Quantity is not present then Ordered Quantity2 will be taken.
105 
106        ELSIF Fulfillment Base is Secondary
107        	   and Item Master Pricing UOM is Primary
108        	   and Ordered UOM Class = Secondary  UOM Class
109        	   and Primary UOM Class <> Secondary UOM Class
110        	   THEN
111 
112             OM will do Pricing based on Primary Shipped Quantity and Primary UOM.
113             If Primary Shipped Quantity is not present then Ordered Quantity converted to Primary UOM will be taken.
114 
115            END IF;
116 
117        ELSE
118        		 OM will do Pricing based on Ordered Quantity and Ordered UOM.
119        END IF;
120        */
121 
122 
123      /*Start Custom Code*/
124 
125 
126      /*End Custom Code */
127 
128      IF l_debug_level > 0 THEN
129         oe_debug_pub.add('Exiting as oe_dual_uom_pricing_hook.get_pricing_uom ' ||p_line_rec.pricing_quantity_uom);
130      END IF;
131     RETURN NULL ;
132 
133 EXCEPTION
134    WHEN OTHERS THEN
135    IF l_debug_level > 0 THEN
136       oe_debug_pub.add('oe_dual_uom_pricing_hook get_pricing_uom  error ' ||sqlerrm);
137    END IF ;
138         IF oe_msg_pub.Check_Msg_Level(oe_msg_pub.G_MSG_LVL_UNEXP_ERROR)
139         THEN
140             oe_msg_pub.Add_Exc_Msg
141             (   'OE_DUAL_UOM_PRICING_HOOK.GET_PRICING_UOM'
142           ,   'get_pricing_uom'
143             );
144         END IF;
145   RETURN  NULL;
146 END get_pricing_uom;
147 -- 16206165 CW End
148 
149 
150 END OE_DUAL_UOM_HOOK;