[Home] [Help]
PACKAGE BODY: APPS.QLTINVCB
Source
1 PACKAGE BODY QLTINVCB as
2 /* $Header: qltinvcb.plb 115.2 2002/11/27 19:26:32 jezheng ship $ */
3 -- 5/20/96 - created
4 -- Paul Mishkin
5
6 FUNCTION NO_NEG_BALANCE(RESTRICT_FLAG NUMBER,
7 NEG_FLAG NUMBER,
8 ACTION NUMBER) RETURN BOOLEAN IS
9 VALUE VARCHAR2(30);
10 DO_NOT BOOLEAN;
11 BEGIN
12 if (restrict_flag = 2 or restrict_flag IS NULL) then
13 if (neg_flag = 2) THEN
14 if (action = 1 OR action = 2 or action = 3 or
15 action = 21 or action = 30 or action = 32) then
16 DO_NOT := TRUE;
17 else
18 DO_NOT := FALSE;
19 end if;
20 else
21 DO_NOT := FALSE;
22 end if;
23 elsif (restrict_flag = 1) then
24 DO_NOT := TRUE;
25 end if;
26 return DO_NOT;
27 END NO_NEG_BALANCE;
28
29
30 FUNCTION CONTROL (ORG_CONTROL NUMBER DEFAULT NULL,
31 SUB_CONTROL NUMBER DEFAULT NULL,
32 ITEM_CONTROL NUMBER DEFAULT NULL,
33 RESTRICT_FLAG NUMBER DEFAULT NULL,
34 NEG_FLAG NUMBER DEFAULT NULL,
35 ACTION NUMBER DEFAULT NULL) RETURN NUMBER IS
36 VALUE VARCHAR2(30);
37 LOCATOR_CONTROL NUMBER;
38 BEGIN
39 if (org_control = 1) then
40 locator_control := 1;
41 elsif (org_control = 2) then
42 locator_control := 2;
43 elsif (org_control = 3) then
44 locator_control := 3;
45 if (qltinvcb.no_neg_balance(restrict_flag,
46 neg_flag,action)) then
47 locator_control := 2;
48 end if;
49 elsif (org_control = 4) then
50 if (sub_control = 1) then
51 locator_control := 1;
52 elsif (sub_control = 2) then
53 locator_control := 2;
54 elsif (sub_control = 3) then
55 locator_control := 3;
56 if (qltinvcb.no_neg_balance(restrict_flag,
57 neg_flag,action)) then
58 locator_control := 2;
59 end if;
60 elsif (sub_control = 5) then
61 if (item_control = 1) then
62 locator_control := 1;
63 elsif (item_control = 2) then
64 locator_control := 2;
65 elsif (item_control = 3) then
66 locator_control := 3;
67 if (qltinvcb.no_neg_balance(restrict_flag,
68 neg_flag,action)) then
69 locator_control := 2;
70 end if;
71 elsif (item_control IS NULL) then
72 locator_control := sub_control;
73 end if;
74 end if;
75 end if;
76 return locator_control;
77
78 END CONTROL;
79
80
81 END QLTINVCB;
82