1 PACKAGE Bom_Compute_Functions AUTHID CURRENT_USER AS
2 /* $Header: BOMCMPFS.pls 120.0 2005/05/25 04:26:55 appldev noship $ */
3 /*# This package defines the atttribute Compute functions and Rollup compute functions
4 * Whenever an item attribute needs to have computation based on related attributes
5 * a computation function can be added and registered in the Attribute Map. Only
6 * function per attribute is permitted.
7 * Similarly, Rollup functions help in computing the value of a Parent in a Parent
8 * Child relationship.
9 * For eg. Container's wt = Wt. of Container item + 1..n[Sum(qty of child * unit wt of child)]
10 * A rollup function is expected to impact atmost 1 attribute of the parent.
11 * When rollup functions are registered, it is not required for them to always belong to this
12 * package, but are expected to conform to the input/output parameter restrictions.
13 * @rep:scope private
14 * @rep:product BOM
15 * @rep:displayname Rollup Functions
16 * @rep:compatibility S
17 * @rep:category BUSINESS_ENTITY BOM_BILL_OF_MATERIAL
18 */
19
20
21 /*#
22 * This method will be used for computing the net_weight attributes value
23 * The method does not have any parameters, but it will have access to the
24 * attribute map or the current item in process.
25 * This should not be confused with the actual rollup function. This function
26 * helps the derivation of the net_weight attribute for that particulat item
27 * whereas rollup function of net_weight would take into consideration all the
28 * child components of the current item.
29 * @param p_component_sequence_id IN Component Identifier
30 * @param x_attribute_value OUT Attribute Value
31 * @rep:scope private
32 * @rep:lifecycle active
33 * @rep:displayname Compute Net weight
34 */
35 PROCEDURE Compute_Net_Weight( x_attribute_value IN OUT NOCOPY VARCHAR2
36 , p_component_sequence_id IN OUT NOCOPY NUMBER);
37
38 /*#
39 * This method will be used for computing the net_weight attributes value
40 * The method does not have any parameters, but it will have access to the
41 * attribute map or the current item in process.
42 * This should not be confused with the actual rollup function. This function
43 * helps the derivation of the net_weight attribute for that particulat item
44 * whereas rollup function of net_weight would take into consideration all the
45 * child components of the current item.
46 *
47 * @param p_component_sequence_id IN Component Identifier
48 * @param x_attribute_value OUT Attribute Value
49 * @rep:scope private
50 * @rep:lifecycle active
51 * @rep:displayname Compute Net weight
52 */
53 PROCEDURE Compute_Gross_Weight( x_attribute_value IN OUT NOCOPY VARCHAR2
54 , p_component_sequence_id IN OUT NOCOPY NUMBER
55 );
56
57 /*#
58 * This method will be used for computing the net_weight attributes value
59 * The method does not have any parameters, but it will have access to the
60 * attribute map or the current item in process.
61 * This should not be confused with the actual rollup function. This function
62 * helps the derivation of the net_weight attribute for that particulat item
63 * whereas rollup function of net_weight would take into consideration all the
64 * child components of the current item.
65 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
66 * with Bom_Rollup_Pub.G_COMPUTE_GROSS_WEIGHT
67 *
68 * @param p_header_item_id IN Header Item Identifier
69 * @param p_organization_id IN Header Item's Organization Identifier
70 * @param p_validate IN Flag specifying whether to perform validation
71 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
72 * @param x_return_status OUT Return Status
73 * @param x_error_message OUT Error Message
74 * @rep:scope private
75 * @rep:lifecycle active
76 * @rep:displayname Rollup Net weight
77 */
78 PROCEDURE Rollup_Net_Weight(p_header_item_id IN NUMBER DEFAULT NULL
79 ,p_organization_id IN NUMBER DEFAULT NULL
80 ,p_validate IN VARCHAR2
81 ,p_halt_on_error IN VARCHAR2
82 ,x_return_status OUT NOCOPY VARCHAR2
83 ,x_error_message OUT NOCOPY VARCHAR2
84 );
85
86
87 /*#
88 * This method will be used for computing the net_weight attributes value
89 * The method does not have any parameters, but it will have access to the
90 * attribute map or the current item in process.
91 * This is the actual rollup function. This function
92 * helps the derivation of the gross_weight attribute for a parent item.
93 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
94 * with Bom_Rollup_Pub.G_COMPUTE_NET_WEIGHT
95 *
96 * @param p_header_item_id IN Header Item Identifier
97 * @param p_organization_id IN Header Item's Organization Identifier
98 * @param p_validate IN Flag specifying whether to perform validation
99 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
100 * @param x_return_status OUT Return Status
101 * @param x_error_message OUT Error Message
102 * @rep:scope private
103 * @rep:lifecycle active
104 * @rep:displayname Rollup Net weight
105 */
106 PROCEDURE Rollup_Gross_Weight(p_header_item_id IN NUMBER DEFAULT NULL
107 ,p_organization_id IN NUMBER DEFAULT NULL
108 ,p_validate IN VARCHAR2
109 ,p_halt_on_error IN VARCHAR2
110 ,x_return_status OUT NOCOPY VARCHAR2
111 ,x_error_message OUT NOCOPY VARCHAR2
112 );
113
114 /*#
115 * This method will be used for propogating value of Private Flag.
116 * Propogation of Private flag is based on a simple rule:
117 * A non-private Parent cannot have a Private Child.
118 * This attribute will be propogated in 2 cases:
119 * 1. When user added a private component to a public parent
120 * 2. When private flag atttribute changes from N to Y for a GTIN
121 *
122 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
123 * with Bom_Rollup_Pub.G_PROPOGATE_PRIVATE_FLAG
124 * @param p_header_item_id IN Header Item Identifier
125 * @param p_organization_id IN Header Item's Organization Identifier
126 * @param p_validate IN Flag specifying whether to perform validation
127 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
128 * @param x_return_status OUT Return Status
129 * @param x_error_message OUT Error Message
130 * @rep:scope private
131 * @rep:lifecycle active
132 * @rep:displayname Propogate Private Flag
133 */
134 PROCEDURE Propogate_Private_Flag(p_header_item_id IN NUMBER DEFAULT NULL
135 ,p_organization_id IN NUMBER DEFAULT NULL
136 ,p_validate IN VARCHAR2
137 ,p_halt_on_error IN VARCHAR2
138 ,x_return_status OUT NOCOPY VARCHAR2
139 ,x_error_message OUT NOCOPY VARCHAR2
140 );
141
142 /*#
143 * This method will be used for propogating value of Private Flag.
144 * Propogation of Private flag is based on a simple rule:
145 * A non-private Parent cannot have a Private Child.
146 * This attribute will be propogated in 2 cases:
147 * 1. When user added a private component to a public parent
148 * 2. When private flag atttribute changes from N to Y for a GTIN
149 *
150 * @param p_header_item_id IN Header Item Identifier
151 * @param p_organization_id IN Header Item's Organization Identifier
152 * @param p_validate IN Flag specifying whether to perform validation
153 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
154 * @param x_return_status OUT Return Status
155 * @param x_error_message OUT Error Message
156 * @rep:scope private
157 * @rep:lifecycle active
158 * @rep:displayname Propogate Brand Info
159 */
160 PROCEDURE Propogate_Brand_Info(p_header_item_id IN NUMBER DEFAULT NULL
161 ,p_organization_id IN NUMBER DEFAULT NULL
162 ,p_validate IN VARCHAR2
163 ,p_halt_on_error IN VARCHAR2
164 ,x_return_status OUT NOCOPY VARCHAR2
165 ,x_error_message OUT NOCOPY VARCHAR2
166 );
167
168
169 /*#
170 * This method will compute the TOP GTIN flag.
171 * Computation of TOP GTIN is based on 2 flags, Consumable and Orderable other than the fact
172 * that both the Parent Item and Component Item have to be GTINs.
173 * At any time there are atmost 2 rows that will be affected, one is the current row
174 * and second is the top item.
175 * Following matrix explains which combination evaluates to a Top GTIN flag of Yes:
176 * All other conditions evaluate to a Top GTIN flag = No.
177 * ---------------------------------------------------
178 * | Top Item Flag | Consumable | Orderable |
179 * ---------------------------------------------------
180 * | Yes | Component Item | Component Item |
181 * | -------------------------------------------------
182 * | Yes | Component Item | Top Item |
183 * | -------------------------------------------------
184 * | Yes | Top Item | Component Item |
185 * | -------------------------------------------------
186 * | Yes | Top Item | Top Item |
187 * | -------------------------------------------------
188 *
189 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
190 * with Bom_Rollup_Pub.G_COMPUTE_TOP_GTIN_FLAG
191 *
192 * @param p_header_item_id IN Header Item Identifier
193 * @param p_organization_id IN Header Item's Organization Identifier
194 * @param p_validate IN Flag specifying whether to perform validation
195 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
196 * @param x_return_status OUT Return Status
197 * @param x_error_message OUT Error Message
198 * @rep:scope private
199 * @rep:lifecycle active
200 * @rep:displayname Compute Top GTIN Flag
201 */
202 PROCEDURE Propogate_Top_GTIN_Flag
203 (p_header_item_id IN NUMBER DEFAULT NULL
204 ,p_organization_id IN NUMBER DEFAULT NULL
205 ,p_validate IN VARCHAR2
206 ,p_halt_on_error IN VARCHAR2
207 ,x_return_status OUT NOCOPY VARCHAR2
208 ,x_error_message OUT NOCOPY VARCHAR2
209 );
210
211
212 /*#
213 * This method will compute the MultirowAttrs.
214 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
215 * with Bom_Rollup_Pub.G_COMPUTE_MULTI_ROW_ATTRS
216 *
217 * @param p_header_item_id IN Header Item Identifier
218 * @param p_organization_id IN Header Item's Organization Identifier
219 * @param p_validate IN Flag specifying whether to perform validation
220 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
221 * @param x_return_status OUT Return Status
222 * @param x_error_message OUT Error Message
223 * @rep:scope private
224 * @rep:lifecycle active
225 * @rep:displayname Compute Top GTIN Flag
226 */
227 PROCEDURE Compute_Multi_Row_Attrs
228 (p_header_item_id IN NUMBER DEFAULT NULL
229 ,p_organization_id IN NUMBER DEFAULT NULL
230 ,p_validate IN VARCHAR2
231 ,p_halt_on_error IN VARCHAR2
232 ,x_return_status OUT NOCOPY VARCHAR2
233 ,x_error_message OUT NOCOPY VARCHAR2
234 );
235
236 /*#
237 * This method will copy storage and handling temperature maximums, minimums, and uoms.
238 * To call this function create an action map by calling Bom_Rollup_Pub.Add_Rollup_Action
239 * with Bom_Rollup_Pub.G_PROPAGATE_SH_TEMPS
240 *
241 * @param p_header_item_id IN Header Item Identifier
242 * @param p_organization_id IN Header Item's Organization Identifier
243 * @param p_validate IN Flag specifying whether to perform validation
244 * @param p_halt_on_error IN Flag specifying whether to halt on validation errors
245 * @param x_return_status OUT Return Status
246 * @param x_error_message OUT Error Message
247 * @rep:scope private
248 * @rep:lifecycle active
249 * @rep:displayname Propagate SH Temps
250 */
251 PROCEDURE Propagate_SH_Temps
252 (p_header_item_id IN NUMBER DEFAULT NULL
253 ,p_organization_id IN NUMBER DEFAULT NULL
254 ,p_validate IN VARCHAR2
255 ,p_halt_on_error IN VARCHAR2
256 ,x_return_status OUT NOCOPY VARCHAR2
257 ,x_error_message OUT NOCOPY VARCHAR2
258 );
259
260 /*#
261 * This method is the DML Function for Net Weight and UOM
262 *
263 * @param p_header_item_id IN Header Item Identifier
264 * @param p_organization_id IN Header Item's Organization Identifier
265 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
266 * @param x_return_status OUT Return Status
267 * @param x_msg_count OUT Message Count
268 * @param x_msg_data OUT Message Data
269 * @rep:scope private
270 * @rep:lifecycle active
271 * @rep:displayname Set Net Weight
272 */
273 PROCEDURE Set_Net_Weight
274 ( p_Header_Item_Id IN NUMBER
275 , p_Organization_Id IN NUMBER
276 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
277 , x_return_status OUT NOCOPY VARCHAR2
278 , x_msg_count OUT NOCOPY NUMBER
279 , x_msg_data OUT NOCOPY VARCHAR2
280 );
281
282 /*#
283 * This method is the DML Function for Private Flag
284 *
285 * @param p_header_item_id IN Header Item Identifier
286 * @param p_organization_id IN Header Item's Organization Identifier
287 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
288 * @param x_return_status OUT Return Status
289 * @param x_msg_count OUT Message Count
290 * @param x_msg_data OUT Message Data
291 * @rep:scope private
292 * @rep:lifecycle active
293 * @rep:displayname Set Private Flag
294 */
295 PROCEDURE Set_Private_Flag
296 ( p_Header_Item_Id IN NUMBER
297 , p_Organization_Id IN NUMBER
298 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
302 );
299 , x_return_status OUT NOCOPY VARCHAR2
300 , x_msg_count OUT NOCOPY NUMBER
301 , x_msg_data OUT NOCOPY VARCHAR2
303
304 /*#
305 * This method is the DML Function for Brand Info
306 *
307 * @param p_header_item_id IN Header Item Identifier
308 * @param p_organization_id IN Header Item's Organization Identifier
309 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
310 * @param x_return_status OUT Return Status
311 * @param x_msg_count OUT Message Count
312 * @param x_msg_data OUT Message Data
313 * @rep:scope private
314 * @rep:lifecycle active
315 * @rep:displayname Set Brand Info
316 */
317 PROCEDURE Set_Brand_Info
318 ( p_Header_Item_Id IN NUMBER
319 , p_Organization_Id IN NUMBER
320 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
321 , x_return_status OUT NOCOPY VARCHAR2
322 , x_msg_count OUT NOCOPY NUMBER
323 , x_msg_data OUT NOCOPY VARCHAR2
324 );
325
326 /*#
327 * This method is the DML Function for Top GTIN Flag
328 *
329 * @param p_header_item_id IN Header Item Identifier
330 * @param p_organization_id IN Header Item's Organization Identifier
331 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
332 * @param x_return_status OUT Return Status
333 * @param x_msg_count OUT Message Count
334 * @param x_msg_data OUT Message Data
335 * @rep:scope private
336 * @rep:lifecycle active
337 * @rep:displayname Set Top GTIN Flag
338 */
339 PROCEDURE Set_Top_GTIN_Flag
340 ( p_Header_Item_Id IN NUMBER
341 , p_Organization_Id IN NUMBER
342 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
343 , x_return_status OUT NOCOPY VARCHAR2
344 , x_msg_count OUT NOCOPY NUMBER
345 , x_msg_data OUT NOCOPY VARCHAR2
346 );
347
348 /*#
349 * This method is the DML Function for Multirow Attributes
350 *
351 * @param p_header_item_id IN Header Item Identifier
352 * @param p_organization_id IN Header Item's Organization Identifier
353 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
354 * @param x_return_status OUT Return Status
355 * @param x_msg_count OUT Message Count
356 * @param x_msg_data OUT Message Data
357 * @rep:scope private
358 * @rep:lifecycle active
359 * @rep:displayname Set Multirow Attributes
360 */
361 PROCEDURE Set_Multirow_Attributes
362 ( p_Header_Item_Id IN NUMBER
363 , p_Organization_Id IN NUMBER
364 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
365 , x_return_status OUT NOCOPY VARCHAR2
366 , x_msg_count OUT NOCOPY NUMBER
367 , x_msg_data OUT NOCOPY VARCHAR2
368 );
369
370 /*#
371 * This method is the DML Function for Storage Handling Temps
372 *
373 * @param p_header_item_id IN Header Item Identifier
374 * @param p_organization_id IN Header Item's Organization Identifier
375 * @param p_header_attrs_flag IN Flag that is 'Y' if using Header Attributes Map
376 * @param x_return_status OUT Return Status
377 * @param x_msg_count OUT Message Count
378 * @param x_msg_data OUT Message Data
379 * @rep:scope private
380 * @rep:lifecycle active
381 * @rep:displayname Set SH Temps
382 */
383 PROCEDURE Set_SH_Temps
384 ( p_Header_Item_Id IN NUMBER
385 , p_Organization_Id IN NUMBER
386 , p_Header_Attrs_Flag IN VARCHAR2 DEFAULT 'Y'
387 , x_return_status OUT NOCOPY VARCHAR2
388 , x_msg_count OUT NOCOPY NUMBER
389 , x_msg_data OUT NOCOPY VARCHAR2
390 );
391 END Bom_Compute_Functions;