1 PACKAGE BODY GML_READ_IC_B AS
2 /* $Header: GMLRITMB.pls 115.5 2002/03/18 11:38:43 pkm ship $ */
3
4 /*##########################################################################
5 #
6 # FUNCTION
7 # read_price_qty_source
8 #
9 # DESCRIPTION (see above)
10 #
11 #
12 # MODIFICATION HISTORY
13 # 18-JAN-2002 Plowe Created
14 #########################################################################*/
15
16 FUNCTION read_price_qty_source
17
18 (
19 p_inventory_item_id IN NUMBER
20 ,p_ship_from_org_id IN NUMBER
21 )
22
23 RETURN NUMBER IS
24
25
26 l_pricing_qty_source NUMBER;
27
28
29 CURSOR c_opm_item ( discrete_org_id IN NUMBER
30 ,discrete_item_id IN NUMBER) IS
31 SELECT nvl(ont_pricing_qty_source,0)
32 FROM ic_item_mst_b
33 WHERE delete_mark = 0
34 AND item_no in (SELECT segment1
35 FROM mtl_system_items
36 WHERE organization_id = discrete_org_id
37 AND inventory_item_id = discrete_item_id);
38
39
40 BEGIN
41
42 oe_debug_pub.add('OPM - Entering GML_READ_IC_B.read_price_qty_source', 5);
43
44
45 OPEN c_opm_item( p_ship_from_org_id
46 , p_inventory_item_id);
47 FETCH c_opm_item
48 INTO l_pricing_qty_source;
49 IF c_opm_item%NOTFOUND THEN
50 /* clear the pricing_qty_source field in the cache */
51 l_pricing_qty_source := NULL;
52 END IF;
53
54 RETURN (l_pricing_qty_source);
55
56 EXCEPTION
57 WHEN OTHERS THEN
58 RETURN (0);
59
60 END read_price_qty_source;
61
62 END GML_READ_IC_B;