1 PACKAGE inv_quantity_tree_pub as
2 /* $Header: INVPQTTS.pls 120.0 2005/05/24 19:19:41 appldev noship $*/
3
4 -- synonyms used in this program
5 -- qoh quantity on hand
6 -- rqoh reservable quantity on hand
7 -- qr quantity reserved
8 -- qs quantity suggested
9 -- att available to transact
10 -- atr available to reserve
11 --
12 -- Constant Definition
13 --
14 -- Tree mode constants
15 -- Users can call create_tree() in two mode, reservation mode and
16 -- transaction mode
17 g_reservation_mode CONSTANT INTEGER := inv_quantity_tree_pvt.g_reservation_mode;
18 g_transaction_mode CONSTANT INTEGER := inv_quantity_tree_pvt.g_transaction_mode;
19 g_loose_only_mode CONSTANT INTEGER := inv_quantity_tree_pvt.g_loose_only_mode;
20 g_no_lpn_rsvs_mode CONSTANT INTEGER :=
21 inv_quantity_tree_pvt.g_no_lpn_rsvs_mode;
22 --
23 --
24 -- Quantity type constants
25 -- User can call update_quantities to change quantities at a given level.
26 -- Quantity type constans should be used to specify which quantity the user
27 -- intents to change: quantity onhand, or quantity reserved for the (same) demand
28 -- source that was used to create the tree, and in the future, quantity suggested
29 -- when quantity suggestion is implemented.
30 g_qoh CONSTANT INTEGER := inv_quantity_tree_pvt.g_qoh;
31 -- quantity reserved by same demand source
32 g_qr_same_demand CONSTANT INTEGER := inv_quantity_tree_pvt.g_qr_same_demand;
33 -- quantity for suggested reservation
34 g_qs_rsv CONSTANT INTEGER := inv_quantity_tree_pvt.g_qs_rsv;
35 -- quantity for suggested transaction
36 g_qs_txn CONSTANT INTEGER := inv_quantity_tree_pvt.g_qs_txn;
37
38 -- Procedure
39 -- clear_quantity_cache
40 -- Description
41 -- Delete all quantity trees in the memory. Should be called when you call
42 -- rollback. Otherwise the trees in memory may not be in sync with the data
43 -- in the corresponding database tables
44 PROCEDURE clear_quantity_cache;
45
46 -- Procedure
47 -- query_quantities
48 -- Description
49 -- Query quantities at a level
50 -- specified by the input
51 PROCEDURE query_quantities
52 ( p_api_version_number IN NUMBER
53 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
54 , x_return_status OUT NOCOPY VARCHAR2
55 , x_msg_count OUT NOCOPY NUMBER
56 , x_msg_data OUT NOCOPY VARCHAR2
57 , p_organization_id IN NUMBER
58 , p_inventory_item_id IN NUMBER
59 , p_tree_mode IN INTEGER
60 , p_is_revision_control IN BOOLEAN
61 , p_is_lot_control IN BOOLEAN
62 , p_is_serial_control IN BOOLEAN
63 , p_demand_source_type_id IN NUMBER DEFAULT -9999
64 , p_demand_source_header_id IN NUMBER DEFAULT -9999
65 , p_demand_source_line_id IN NUMBER DEFAULT -9999
66 , p_demand_source_name IN VARCHAR2 DEFAULT NULL
67 , p_lot_expiration_date IN DATE DEFAULT NULL
68 , p_revision IN VARCHAR2
69 , p_lot_number IN VARCHAR2
70 , p_subinventory_code IN VARCHAR2
71 , p_locator_id IN NUMBER
72 , p_onhand_source IN NUMBER DEFAULT inv_quantity_tree_pvt.g_all_subs
73 , x_qoh OUT NOCOPY NUMBER
74 , x_rqoh OUT NOCOPY NUMBER
75 , x_qr OUT NOCOPY NUMBER
76 , x_qs OUT NOCOPY NUMBER
77 , x_att OUT NOCOPY NUMBER
78 , x_atr OUT NOCOPY NUMBER
79 , p_transfer_subinventory_code IN VARCHAR2 DEFAULT NULL
80 , p_cost_group_id IN NUMBER DEFAULT NULL
81 , p_lpn_id IN NUMBER DEFAULT NULL
82 , p_transfer_locator_id IN NUMBER DEFAULT NULL
83 );
84
85 -- invConv changes begin : overload
86 PROCEDURE query_quantities
87 ( p_api_version_number IN NUMBER
88 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
89 , x_return_status OUT NOCOPY VARCHAR2
90 , x_msg_count OUT NOCOPY NUMBER
91 , x_msg_data OUT NOCOPY VARCHAR2
92 , p_organization_id IN NUMBER
93 , p_inventory_item_id IN NUMBER
94 , p_tree_mode IN INTEGER
95 , p_is_revision_control IN BOOLEAN
96 , p_is_lot_control IN BOOLEAN
97 , p_is_serial_control IN BOOLEAN
98 , p_grade_code IN VARCHAR2 -- invConv change
99 , p_demand_source_type_id IN NUMBER DEFAULT -9999
100 , p_demand_source_header_id IN NUMBER DEFAULT -9999
101 , p_demand_source_line_id IN NUMBER DEFAULT -9999
102 , p_demand_source_name IN VARCHAR2 DEFAULT NULL
103 , p_lot_expiration_date IN DATE DEFAULT NULL
104 , p_revision IN VARCHAR2
105 , p_lot_number IN VARCHAR2
106 , p_subinventory_code IN VARCHAR2
107 , p_locator_id IN NUMBER
108 , p_onhand_source IN NUMBER DEFAULT inv_quantity_tree_pvt.g_all_subs
109 , x_qoh OUT NOCOPY NUMBER
110 , x_rqoh OUT NOCOPY NUMBER
111 , x_qr OUT NOCOPY NUMBER
112 , x_qs OUT NOCOPY NUMBER
113 , x_att OUT NOCOPY NUMBER
114 , x_atr OUT NOCOPY NUMBER
115 , x_sqoh OUT NOCOPY NUMBER -- invConv change
116 , x_srqoh OUT NOCOPY NUMBER -- invConv change
117 , x_sqr OUT NOCOPY NUMBER -- invConv change
118 , x_sqs OUT NOCOPY NUMBER -- invConv change
119 , x_satt OUT NOCOPY NUMBER -- invConv change
120 , x_satr OUT NOCOPY NUMBER -- invConv change
121 , p_transfer_subinventory_code IN VARCHAR2 DEFAULT NULL
122 , p_cost_group_id IN NUMBER DEFAULT NULL
123 , p_lpn_id IN NUMBER DEFAULT NULL
124 , p_transfer_locator_id IN NUMBER DEFAULT NULL
125 );
126 -- invConv changes end.
127
128 -- Procedure
129 -- update_quantities
130 -- Description
131 -- Update quantity at the level specified by the input and
132 -- return the quantities at the level after the update
133 PROCEDURE update_quantities
134 ( p_api_version_number IN NUMBER
135 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
136 , x_return_status OUT NOCOPY VARCHAR2
137 , x_msg_count OUT NOCOPY NUMBER
138 , x_msg_data OUT NOCOPY VARCHAR2
139 , p_organization_id IN NUMBER
140 , p_inventory_item_id IN NUMBER
141 , p_tree_mode IN INTEGER
142 , p_is_revision_control IN BOOLEAN
143 , p_is_lot_control IN BOOLEAN
144 , p_is_serial_control IN BOOLEAN
145 , p_demand_source_type_id IN NUMBER DEFAULT -9999
146 , p_demand_source_header_id IN NUMBER DEFAULT -9999
147 , p_demand_source_line_id IN NUMBER DEFAULT -9999
148 , p_demand_source_name IN VARCHAR2 DEFAULT NULL
149 , p_lot_expiration_date IN DATE DEFAULT NULL
150 , p_revision IN VARCHAR2 DEFAULT NULL
151 , p_lot_number IN VARCHAR2 DEFAULT NULL
152 , p_subinventory_code IN VARCHAR2 DEFAULT NULL
153 , p_locator_id IN NUMBER DEFAULT NULL
154 , p_primary_quantity IN NUMBER
155 , p_quantity_type IN INTEGER
156 , p_onhand_source IN NUMBER DEFAULT inv_quantity_tree_pvt.g_all_subs
157 , x_qoh OUT NOCOPY NUMBER
158 , x_rqoh OUT NOCOPY NUMBER
159 , x_qr OUT NOCOPY NUMBER
160 , x_qs OUT NOCOPY NUMBER
161 , x_att OUT NOCOPY NUMBER
162 , x_atr OUT NOCOPY NUMBER
163 , p_transfer_subinventory_code IN VARCHAR2 DEFAULT NULL
164 , p_cost_group_id IN NUMBER DEFAULT NULL
165 , p_containerized IN NUMBER DEFAULT inv_quantity_tree_pvt.g_containerized_false
166 , p_lpn_id IN NUMBER DEFAULT NULL
167 , p_transfer_locator_id IN NUMBER DEFAULT NULL
168 ) ;
169
170 -- invConv changes begin : overload
171 PROCEDURE update_quantities
172 ( p_api_version_number IN NUMBER
173 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
174 , x_return_status OUT NOCOPY VARCHAR2
175 , x_msg_count OUT NOCOPY NUMBER
176 , x_msg_data OUT NOCOPY VARCHAR2
177 , p_organization_id IN NUMBER
178 , p_inventory_item_id IN NUMBER
179 , p_tree_mode IN INTEGER
180 , p_is_revision_control IN BOOLEAN
181 , p_is_lot_control IN BOOLEAN
182 , p_is_serial_control IN BOOLEAN
183 , p_demand_source_type_id IN NUMBER DEFAULT -9999
184 , p_demand_source_header_id IN NUMBER DEFAULT -9999
185 , p_demand_source_line_id IN NUMBER DEFAULT -9999
186 , p_demand_source_name IN VARCHAR2 DEFAULT NULL
187 , p_lot_expiration_date IN DATE DEFAULT NULL
188 , p_revision IN VARCHAR2 DEFAULT NULL
189 , p_lot_number IN VARCHAR2 DEFAULT NULL
190 , p_subinventory_code IN VARCHAR2 DEFAULT NULL
191 , p_locator_id IN NUMBER DEFAULT NULL
192 , p_grade_code IN VARCHAR2 DEFAULT NULL -- invConv change
193 , p_primary_quantity IN NUMBER
194 , p_quantity_type IN INTEGER
195 , p_secondary_quantity IN NUMBER -- invConv change
196 , p_onhand_source IN NUMBER DEFAULT inv_quantity_tree_pvt.g_all_subs
197 , x_qoh OUT NOCOPY NUMBER
198 , x_rqoh OUT NOCOPY NUMBER
199 , x_qr OUT NOCOPY NUMBER
200 , x_qs OUT NOCOPY NUMBER
201 , x_att OUT NOCOPY NUMBER
202 , x_atr OUT NOCOPY NUMBER
203 , x_sqoh OUT NOCOPY NUMBER -- invConv change
204 , x_srqoh OUT NOCOPY NUMBER -- invConv change
205 , x_sqr OUT NOCOPY NUMBER -- invConv change
206 , x_sqs OUT NOCOPY NUMBER -- invConv change
207 , x_satt OUT NOCOPY NUMBER -- invConv change
208 , x_satr OUT NOCOPY NUMBER -- invConv change
209 , p_transfer_subinventory_code IN VARCHAR2 DEFAULT NULL
210 , p_cost_group_id IN NUMBER DEFAULT NULL
211 , p_containerized IN NUMBER DEFAULT inv_quantity_tree_pvt.g_containerized_false
212 , p_lpn_id IN NUMBER DEFAULT NULL
213 , p_transfer_locator_id IN NUMBER DEFAULT NULL
214 ) ;
215 -- invConv changes end.
216
217
218 -- Procedure
219 -- do_check
220 -- Description
221 -- check whether the updates done in all trees so far are still valid
222 -- Return
223 -- x_no_violation = true if no violation has found
224 -- , otherwise = false
225 PROCEDURE do_check
226 ( p_api_version_number IN NUMBER
227 , p_init_msg_lst IN VARCHAR2 DEFAULT fnd_api.g_false
228 , x_return_status OUT NOCOPY VARCHAR2
229 , x_msg_count OUT NOCOPY NUMBER
230 , x_msg_data OUT NOCOPY VARCHAR2
231 , x_no_violation OUT NOCOPY BOOLEAN
232 );
233
234 END inv_quantity_tree_pub;