DBA Data[Home] [Help]

PACKAGE BODY: APPS.INV_MINMAX_HELPER_PVT

Source


1 PACKAGE BODY inv_minmax_helper_pvt AS
2 /* $Header: INVMMXDB.pls 115.1 2001/02/12 22:39:28 pkm ship      $ */
3 
4 function get_shipped_qty
5   (p_organization_id	IN	NUMBER,
6    p_inventory_item_id	IN	NUMBER,
7    p_order_line_id      IN      NUMBER
8    ) return NUMBER
9   IS
10      l_shipped_qty NUMBER := 0;
11 BEGIN
12    BEGIN
13       SELECT SUM(primary_quantity)
14 	INTO l_shipped_qty
15 	FROM mtl_material_transactions
16        WHERE transaction_action_id = 1
17 	 AND source_line_id = p_order_line_id
18 	 AND organization_id = p_organization_id
19 	 AND inventory_item_id = p_inventory_item_id;
20    EXCEPTION
21       WHEN OTHERS THEN
22 	 l_shipped_qty := 0;
23    END ;
24 
25    IF l_shipped_qty IS NULL THEN l_shipped_qty := 0;
26     ELSE l_shipped_qty := -1 * l_shipped_qty;
27    END IF;
28 
29    RETURN l_shipped_qty;
30 END get_shipped_qty;
31 
32 END inv_minmax_helper_pvt;