1 PACKAGE BODY CSP_PACKLIST_PVT AS
2 /* $Header: cspvtpab.pls 115.8 2002/11/26 08:12:46 hhaugeru ship $ */
3
4 G_PKG_NAME CONSTANT VARCHAR2(30):='CSP_PACKLIST_PVT';
5
6 FUNCTION packed_quantity
7 ( p_picklist_line_id IN NUMBER)
8 RETURN NUMBER IS
9
10 l_quantity_packed NUMBER;
11
12 cursor c_packed_quantity is
13 select sum(nvl(cpal.quantity_packed,0))
14 from csp_packlist_lines cpal
15 where cpal.picklist_line_id = p_picklist_line_id;
16
17 BEGIN
18 open c_packed_quantity;
19 fetch c_packed_quantity into l_quantity_packed;
20 close c_packed_quantity;
21 return nvl(l_quantity_packed,0);
22 END packed_quantity;
23
24 FUNCTION packed_serial_lots
25 ( p_picklist_line_id IN NUMBER,
26 p_serial_number IN VARCHAR2,
27 p_lot_number IN VARCHAR2)
28 RETURN NUMBER IS
29
30 l_quantity_packed NUMBER;
31
32 cursor c_packed_quantity is
33 select sum(nvl(cpasl.quantity,0))
34 from csp_packlist_serial_lots cpasl,
35 csp_packlist_lines cpal
36 where cpal.picklist_line_id = p_picklist_line_id
37 and cpasl.packlist_line_id = cpal.packlist_line_id
38 and decode(p_serial_number,null,'1',cpasl.serial_number) = decode(p_serial_number,null,'1',p_serial_number)
39 and decode(p_lot_number,null,'1',cpasl.lot_number) = decode(p_lot_number,null,'1',p_lot_number);
40
41 BEGIN
42 open c_packed_quantity;
43 fetch c_packed_quantity into l_quantity_packed;
44 close c_packed_quantity;
45 return nvl(l_quantity_packed,0);
46 END packed_serial_lots;
47
48 END csp_packlist_pvt;