DBA Data[Home] [Help]

PACKAGE: APPS.WMS_RULE_PVT

Source


1 PACKAGE wms_rule_pvt AUTHID CURRENT_USER AS
2 /* $Header: WMSVPPRS.pls 120.10.12020000.3 2013/01/31 22:04:44 sahmahes ship $ */
3 --
4 -- File        : WMSVPPRS.pls
5 -- Content     : WMS_Rule_PVT package specification
6 -- Description : WMS rule private API's
7 -- Notes       :
8 -- Modified    : 02/08/99 mzeckzer created
9 -- Modified    : 10/02/02 htnguyen modified
10 --
11 -- API name    : Apply
12 -- Type        : Private
13 -- Function    : Applies a wms rule to the given transaction
14 --               or reservation input parameters and creates recommendations
15 -- Pre-reqs    : Record in WMS_STRATEGY_MAT_TXN_TMP_V uniquely
16 --               identified by parameters p_transaction_temp_id and
17 --               p_type_code ( base table for the view is
18 --               MTL_MATERIAL_TRANSACTIONS_TEMP );
19 --               At least one transaction detail record in
20 --               WMS_TRX_DETAILS_TMP_V identified by line type code = 1
21 --               and parameters p_transaction_temp_id and p_type_code
22 --               ( base tables are MTL_MATERIAL_TRANSACTIONS_TEMP and
23 --               WMS_TRANSACTIONS_TEMP, respectively );
24 --               Rule record has to exist in WMS_RULES_B uniquely
25 --               identified by parameter p_rule_id;
26 --               If picking, quantity tree has to exist, created through
27 --               INV_Quantity_Tree_PVT.Create_Tree and uniquely identified
28 --               by parameter p_tree_id
29 -- Parameters  :
30 --   p_api_version          Standard Input Parameter
31 --   p_init_msg_list        Standard Input Parameter
32 --   p_commit               Standard Input Parameter
33 --   p_validation_level     Standard Input Parameter
34 --   p_rule_id              Identifier of the rule to apply
35 --   p_type_code            Type code of the rule
36 --   p_partial_success_allowed_flag
37 --  			    'Y' or 'N'
38 --   p_transaction_temp_id  Identifier for the record in view
39 --  			    wms_strategy_mat_txn_tmp_v that represents
40 --  			    the request for detailing
41 --   p_organization_id      Organization identifier
42 --   p_inventory_item_id    Inventory item identifier
43 --   p_transaction_uom      Transaction UOM code
44 --   p_primary_uom          Primary UOM code
45 --   p_tree_id              Identifier for the quantity tree
46 --
47 -- Output Parameters
48 --   x_return_status        Standard Output Parameter
49 --   x_msg_count            Standard Output Parameter
50 --   x_msg_data             Standard Output Parameter
51 --   x_finished             whether the rule has found enough quantity to
52 --                          find a location that completely satisfy
53 --                          the requested quantity (value is 'Y' or 'N')
54 --
55 -- Version
56 --   Currently version is 1.0
57 --
58 -- Notes       : Calls API's of WMS_Common_PVT and INV_Quantity_Tree_PVT
59 --               This API must be called internally by
60 --               WMS_Strategy_PVT.Apply only !
61 --
62 
63 --
64 --  Added by htnguyen for Agilent Performance / invalid package issues
65 --  which was causing mobile pages to throw "fatal database error"
66 --  wheneve  any rule is modified, if it is in use.
67 
68 --  Creating ref cursor  to call picking rules
69 
70 --  10182554 Global variable to set if expired lots are allowed to be transacted
71 
72 g_allow_expired_lot_txn  varchar2(1) := 'N';
73  TYPE t_pick_rec IS RECORD (
74         revision             WMS_TRANSACTIONS_TEMP.REVISION%TYPE,
75         lot_number           WMS_TRANSACTIONS_TEMP.LOT_NUMBER%TYPE,
76         lot_expiration_date  WMS_TRANSACTIONS_TEMP.LOT_EXPIRATION_DATE%TYPE,
77         subinventory_code    WMS_TRANSACTIONS_TEMP.FROM_SUBINVENTORY_CODE%TYPE,
78         locator_id           WMS_TRANSACTIONS_TEMP.FROM_LOCATOR_ID%TYPE,
79         cost_group_id        WMS_TRANSACTIONS_TEMP.FROM_COST_GROUP_ID%TYPE,
80         uom_code             VARCHAR2(3),
81         lpn_id               WMS_TRANSACTIONS_TEMP.LPN_ID%TYPE,
82         serial_number        VARCHAR2(30),
83         quantity             WMS_TRANSACTIONS_TEMP.PRIMARY_QUANTITY%TYPE,
84         secondary_quantity   WMS_TRANSACTIONS_TEMP.SECONDARY_QUANTITY%TYPE,
85         grade_code           VARCHAR2(150),
86         consist_string       VARCHAR2(1000),
87         order_by_string      VARCHAR2(1000)
88  );
89 
90   v_pick_rec t_pick_rec;
91   TYPE Cv_pick_type IS REF CURSOR return v_pick_rec%type;
92 
93 
94 --- end of ref picking cursor ---
95 
96  TYPE t_put_rec IS RECORD (
97            subinventory_code   WMS_TRANSACTIONS_TEMP.FROM_SUBINVENTORY_CODE%TYPE,
98            locator_id          WMS_TRANSACTIONS_TEMP.FROM_LOCATOR_ID%TYPE,
99            project_id          MTL_ITEM_LOCATIONS.PROJECT_ID%TYPE,
100            task_id             MTL_ITEM_LOCATIONS.TASK_ID%TYPE
101    );
102 
103   v_put_rec t_put_rec;
104   TYPE Cv_put_type IS REF CURSOR return v_put_rec%type;
105 
106 
107 ----
108 
109 TYPE Cv_type IS REF CURSOR;
110 
111 -- Global variable to hold counter values for each rule type which would be used to buffer the counter
112 -- for a given session
113 
114 g_rule_list_pick_ctr 	NUMBER;
115 g_rule_list_put_ctr  	NUMBER;
116 g_rule_list_op_ctr   	NUMBER;
117 g_rule_list_task_ctr   	NUMBER;
118 g_rule_list_label_ctr   NUMBER;
119 
120 ---------------
121 g_serial_objects_used NUMBER ;
122 --[ added as a part of lot indiv support ]
123 g_max_tolerance         NUMBER;
124 g_max_sec_tolerance     NUMBER;
125 g_min_tolerance         NUMBER;
126 g_min_sec_tolerance     NUMBER;
127 g_min_qty_to_allocate   NUMBER;
128 g_min_sec_qty_to_alloc  NUMBER;
129 g_over_allocation       VARCHAR2(1);
130 
131 PROCEDURE apply
132   (p_api_version                  IN   NUMBER                              ,
133    p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
134    p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
135    p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
136    x_return_status                OUT  NOCOPY VARCHAR2                            ,
137    x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
138    x_msg_data                     OUT  NOCOPY VARCHAR2                            ,
139    p_rule_id                      IN   NUMBER   DEFAULT NULL ,
140    p_type_code                    IN   NUMBER   DEFAULT NULL ,
141    p_partial_success_allowed_flag IN   VARCHAR2 DEFAULT NULL,
142    p_transaction_temp_id          IN   NUMBER   DEFAULT NULL ,
143    p_organization_id              IN   NUMBER   DEFAULT NULL ,
144    p_inventory_item_id            IN   NUMBER   DEFAULT NULL ,
145    p_transaction_uom              IN   VARCHAR2 DEFAULT NULL,
146    p_primary_uom                  IN   VARCHAR2 DEFAULT NULL,
147    p_secondary_uom                IN   VARCHAR2 DEFAULT NULL,                -- new
148    p_grade_code                   IN   VARCHAR2 DEFAULT NULL,                -- new
149    p_transaction_type_id          IN   NUMBER   DEFAULT NULL ,
150    p_tree_id                      IN   NUMBER   DEFAULT NULL ,
151    x_finished                     OUT  NOCOPY VARCHAR2 			   ,
152    p_detail_serial                IN   BOOLEAN  DEFAULT FALSE 		   ,
153    p_from_serial                  IN   VARCHAR2 DEFAULT NULL 		   ,
154    p_to_serial                    IN   VARCHAR2 DEFAULT NULL 		   ,
155    p_detail_any_serial            IN   NUMBER   DEFAULT NULL,
156    p_unit_volume                  IN   NUMBER   DEFAULT NULL,
157    p_volume_uom_code              IN   VARCHAR2 DEFAULT NULL,
158    p_unit_weight                  IN   NUMBER   DEFAULT NULL,
159    p_weight_uom_code              IN   VARCHAR2 DEFAULT NULL,
160    p_base_uom_code                IN   VARCHAR2 DEFAULT NULL,
161    p_lpn_id                       IN   NUMBER   DEFAULT NULL,
162    p_unit_number                  IN   VARCHAR2   DEFAULT NULL,
163    p_simulation_mode              IN   NUMBER   DEFAULT -1,
164    p_project_id                   IN   NUMBER   DEFAULT NULL,
165    p_task_id                      IN   NUMBER   DEFAULT NULL,
166    p_wave_simulation_mode         IN   VARCHAR2 DEFAULT 'N'
167   );
168 
169 
170 -- high volume project
171 PROCEDURE execute_task_rule(p_rule_id IN NUMBER, p_task_id IN NUMBER, x_return_status OUT NOCOPY NUMBER);
172 --Added for bug3237702
173 -- API name    : ApplyDefLoc
174 -- Type        : Private
175 -- Function    : Verifies a Putaway location with the given transaction
176 --               input parameters and creates recommendations
177 --               This API does not utlize the rules and should only be
178 --               called when the Inventory Locator is specified on
179 --               the input transaction and there is no requirement
180 --               to check capacity.
181 -- Pre-reqs    :
182 --
183 -- Parameters  :
184 --   p_api_version          Standard Input Parameter
185 --   p_init_msg_list        Standard Input Parameter
186 --   p_commit               Standard Input Parameter
187 --   p_validation_level     Standard Input Parameter
188 --   p_transaction_temp_id  Identifier for the record in view
189 --                          wms_strategy_mat_txn_tmp_v that represents
190 --                          the request for detailing
191 --   p_organization_id      Organization identifier
192 --   p_inventory_item_id    Inventory item identifier
193 --   p_transaction_uom      Transaction UOM code
194 --   p_primary_uom          Primary UOM code
195 --   p_project_id           Project associated with transaction
196 --   p_task_id              Task associated with transaction
197 --
198 -- Output Parameters
199 --   x_return_status        Standard Output Parameter
200 --   x_msg_count            Standard Output Parameter
201 --   x_msg_data             Standard Output Parameter
202 --   x_finished             whether the rule has found enough quantity to
203 --                          find a location that completely satisfy
204 --                          the requested quantity (value is 'Y' or 'N')
205 --
206 -- Version
207 --   Currently version is 1.0
208 --
209 -- Notes       : Calls API's of WMS_Common_PVT
210 --               This API must be called internally by
211 --               WMS_Engine_PVT.Create_Suggestions only !
212 --APPLYDEFLOC
213 
214 PROCEDURE applydefloc(
215    p_api_version                  IN   NUMBER   ,
216    p_init_msg_list                IN   VARCHAR2 ,
217    p_commit                       IN   VARCHAR2 ,
218    p_validation_level             IN   NUMBER   ,
219    x_return_status                OUT  NOCOPY VARCHAR2 ,
220    x_msg_count                    OUT  NOCOPY NUMBER   ,
221    x_msg_data                     OUT  NOCOPY VARCHAR2 ,
222    p_transaction_temp_id          IN   NUMBER   ,
223    p_organization_id              IN   NUMBER   ,
224    p_inventory_item_id            IN   NUMBER   ,
225    p_subinventory_code            IN   VARCHAR2 ,
226    p_locator_id                   IN   NUMBER   ,
227    p_transaction_uom              IN   VARCHAR2 ,
228    p_primary_uom                  IN   VARCHAR2 ,
229    p_transaction_type_id          IN   NUMBER   ,
230    x_finished                     OUT  NOCOPY VARCHAR2 ,
231    p_lpn_id                       IN   NUMBER   ,
232    p_simulation_mode              IN   NUMBER   ,
233    p_project_id                   IN   NUMBER   ,
234    p_task_id                      IN   NUMBER
235   );
236 --bug3237702 ends
237 --
238 --
239 -- API name    : CheckSyntax
240 -- Type        : Private
241 -- Function    : Checks a wms rule for syntax errors
242 --               ( called by 'WMS Rules' definition form
243 --                 during enabling functionality )
244 -- Pre-reqs    : one record in WMS_RULES_B uniquely identified by parameter
245 --                p_rule_id
246 -- Input Parameters  :
247 --   p_api_version       Standard Input Parameter
248 --   p_init_msg_list     Standard Input Parameter
249 --   p_validation_level  Standard Input Parameter
250 --   p_rule_id           Identifier of the rule to check
251 --
252 -- Output Parameters  :
253 --   x_return_status     Standard Output Parameter
254 --   x_msg_count         Standard Output Parameter
255 --   x_msg_data          Standard Output Parameter
256 --
257 -- Version     :
258 --   Current version 1.0
259 --
260 -- Notes       : calls API's of WMS_RE_Common_PVT
261 --
262 PROCEDURE CheckSyntax
263   (p_api_version      IN   NUMBER                                 ,
264    p_init_msg_list    IN   VARCHAR2 DEFAULT fnd_api.g_false	  ,
265    p_validation_level IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
266    x_return_status    OUT  NOCOPY VARCHAR2 				  ,
267    x_msg_count        OUT  NOCOPY NUMBER 				  ,
268    x_msg_data         OUT  NOCOPY VARCHAR2 				  ,
269    p_rule_id          IN   NUMBER   DEFAULT NULL
270    );
271 --
272 TYPE rule_rec IS RECORD
273   (rule_id         wms_rules_vl.rule_id%TYPE DEFAULT NULL          ,
274    organization_id wms_rules_vl.organization_id%TYPE DEFAULT NULL	 ,
275    type_code       wms_rules_vl.type_code%TYPE DEFAULT NULL	 ,
276    name            wms_rules_vl.name%TYPE DEFAULT NULL		 ,
277    description     wms_rules_vl.description%TYPE DEFAULT NULL	 ,
278    qty_function_parameter_id
279                    wms_rules_vl.qty_function_parameter_id%TYPE DEFAULT NULL,
280    enabled_flag    wms_rules_vl.enabled_flag%TYPE DEFAULT NULL    ,
281    user_defined_flag
282                    wms_rules_vl.user_defined_flag%TYPE DEFAULT NULL ,
283    attribute_category
284                    wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
285    attribute1      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
286    attribute2      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
287    attribute3      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
288    attribute4      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
289    attribute5      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
290    attribute6      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
291    attribute7      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
292    attribute8      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
293    attribute9      wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
294    attribute10     wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
295    attribute11     wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
296    attribute12     wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
297    attribute13     wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
298    attribute14     wms_rules_vl.attribute_category%TYPE DEFAULT NULL,
299    attribute15     wms_rules_vl.attribute_category%TYPE DEFAULT NULL
300   );
301 --
302 -- API name    : Find_Rule
303 -- Type        : Private
304 -- Function    : find a rule by id
305 -- Input Parameters  :
306 --   p_api_version     Standard Input Parameter
307 --   p_init_msg_list   Standard Input Parameter
308 --   p_rule_id         Identifier of the rule
309 --
310 -- Output Parameters:
311 --   x_return_status   Standard Output Parameter
312 --   x_msg_count       Standard Output Parameter
313 --   x_msg_data        Standard Output Parameter
314 --   x_found           true if found ; else false
315 --   x_rule_rec        info of the rule if found
316 
317 -- Version     :
318 --   Current version 1.0
319 --
320 -- Notes       : calls API's of WMS_RE_Common_PVT
321 --
322 PROCEDURE find_rule
323   ( p_api_version      IN  NUMBER
324    ,p_init_msg_list    IN  VARCHAR2 DEFAULT fnd_api.g_false
325    ,x_return_status    OUT NOCOPY VARCHAR2
326    ,x_msg_count        OUT NOCOPY NUMBER
327    ,x_msg_data         OUT NOCOPY VARCHAR2
328    ,p_rule_id          IN  NUMBER
329    ,x_found            OUT NOCOPY BOOLEAN
330    ,x_rule_rec         OUT NOCOPY rule_rec
331    );
332 
333 PROCEDURE GetPackageName
334   (p_rule_id	IN	NUMBER,
335    x_package_name OUT NOCOPY VARCHAR2
336   );
337 
338 -- ### Added by Johnson Abraham.
339 -- ### Until patchset 'I', this used to be a private API.
340 -- ### Added signature to the Spec to make it a Public API since it is
341 -- ### also called from the wms_rule_pvt_ext_psetj(WMSOPPAB.pls) in patchset
342 -- ### 'J'.
343 Procedure execute_op_rule(
344    p_rule_id in number
345 ,  p_task_id in number
346 ,  x_return_status out NOCOPY number
347 );
348 
349 
350 PROCEDURE GenerateRulePackage
351   (p_api_version      IN   NUMBER                                 ,
352    p_init_msg_list    IN   VARCHAR2 DEFAULT fnd_api.g_false	  ,
353    p_validation_level IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
354    x_return_status    OUT  NOCOPY VARCHAR2 				  ,
355    x_msg_count        OUT  NOCOPY NUMBER 				  ,
356    x_msg_data         OUT  NOCOPY VARCHAR2 				  ,
357    p_rule_id          IN   NUMBER   DEFAULT NULL
358    );
359 
360 --
361 -- API name    : AssignTTs
362 -- Type        : Private
363 -- Function    : Assign task type to records in MMTT
364 -- Input Parameters  :
365 --
366 -- Output Parameters:
367 -- Version     :
368 --   Current version 1.0
369 --
370 -- Notes       : calls AssignTT(p_task_id NUMBER)
371 --               for a given MO header
372 --
373 
374 PROCEDURE assignTTs
375   (p_api_version                  IN   NUMBER                              ,
376    p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
377    p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
378    p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
379    x_return_status                OUT  NOCOPY VARCHAR2,
380    x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
381    x_msg_data                     OUT  NOCOPY VARCHAR2                    	   ,
382    p_move_order_header_id         IN   NUMBER);
383 
384 
385 --
386 -- API name    : AssignTT
387 -- Type        : Private
388 -- Function    : Assign task type to a specific record in MMTT
389 -- Input Parameters  :
390 --           p_task_id NUMBER
391 --
392 -- Output Parameters:
393 -- Version     :
394 --   Current version 1.0
395 --
396 -- Notes       :
397 --
398 
399 PROCEDURE AssignTT(
400    p_api_version                  IN   NUMBER                              ,
401    p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
402    p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
403    p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
404    x_return_status                OUT  NOCOPY VARCHAR2,
405    x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
406    x_msg_data                     OUT  NOCOPY VARCHAR2                    	   ,
407    p_task_id                      IN   NUMBER DEFAULT NULL  );
408 
409 
410 
411 --
412 -- API name    : CalcRuleWeight
413 -- Type        : Private
414 -- Function    : Calculate initial rule weight based on number of distinct restriction
415 --               parameters. This is currently the requirement for task type assignment
416 --
417 -- Input Parameters  :
418 --           p_task_id NUMBER
419 --
420 -- Output Parameters:
421 -- Version     :
422 --   Current version 1.0
423 --
424 -- Notes       :
425 --
426 
427 PROCEDURE CalcRuleWeight (p_rule_id NUMBER);
428 
429 --Name: GetConversionRate
430 --Function: Returns conversion rate between uom and base uom for
431 --	    given inventory_item_id, or returns default conversion rate
432 --	    for given UOM.
433 --
434 
435 FUNCTION GetConversionRate (p_uom_code VARCHAR2,
436 			    p_organization_id NUMBER,
437 			    p_inventory_item_id NUMBER DEFAULT 0)
438 	RETURN NUMBER;
439 
440 
441 --===========================================================================================
442 --
443 -- API name    : ApplyLabel
444 -- Type        : Private
445 -- Function    : Retrieve Label based on Label request
446 -- Input Parameters  :
447 --           p_label_request_id  NUMBER
448 --           p_document_id       NUMBER
449 --
450 -- Output Parameters: x_label_format_id
451 -- Version     :
452 -- Current version 1.0
453 --
454 -- Notes       :
455 --
456 -- This procedure retrieves a specific label for a label request in
457 -- wms_label_requests.
458 -- This procedure calls the rule package created for Label rules to check
459 -- which label rule actually matches the label request in question.
460 --===========================================================================================
461 
462 
463 PROCEDURE ApplyLabel(
464    p_api_version                  IN   NUMBER,
465    p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false,
466    p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false,
467    p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
468    p_label_request_id             IN   NUMBER,
469    x_return_status                OUT  NOCOPY VARCHAR2,
470    x_msg_count                    OUT  NOCOPY NUMBER,
471    x_msg_data                     OUT  NOCOPY VARCHAR2,
472    x_label_format_id              OUT   NOCOPY NUMBER,
473    x_label_format_name            OUT  NOCOPY VARCHAR2);
474 
475 
476 
477 /********************************************************************
478 *  THis api does the mapping between move order type and WMS system task type
479 *  Input :  p_move_order_type NUMBER
480 *  Out :  x_wms_sys_task_type NUMBER
481 *****************************************************************/
482 
483 
484 PROCEDURE get_WMS_sys_task_type
485   (p_move_order_type            IN NUMBER,
486    p_transaction_Action_id      IN NUMBER DEFAULT NULL,
487    p_transaction_source_type_id IN NUMBER DEFAULT NULL,
488    x_wms_sys_task_type          OUT NOCOPY NUMBER);
489 
490 
491 --compile_all_rule_packages
492 --Concurrent program for compiling all rules
493 PROCEDURE compile_all_rule_packages
494 (  ERRBUF             OUT NOCOPY VARCHAR2
495  , RETCODE            OUT NOCOPY NUMBER);
496 
497 
498 FUNCTION IsRuleDebugOn
499     (p_simulation_mode  IN NUMBER)
500 RETURN BOOLEAN;
501 
502 --
503 -- Name        : Rollback_Capacity_Update
504 -- Function    : Used in Apply for Put Away rules.
505 --               In Apply, the update_loc_suggested_capacity procedure gets
506 --               called to update the capacity for a locator.  This
507 --               procedure is an autonomous transaction, so it issues
508 --               a commit.  If some sort of error occurs in Apply, we need to
509 --               undo those changes.  We call revert_loc_suggested_capacity
510 --               to decrement the suggested capacity field.  The procedure
511 --               is also a autonomous transaction.  This procedure is
512 --		 also called from WMS_ENGINE_PVT.
513 -- Pre-reqs    : cursor has to be parsed and executed already.
514 -- Notes       : private procedure for internal use only
515 --
516 PROCEDURE rollback_capacity_update (
517          x_return_status OUT NOCOPY VARCHAR2
518         ,x_msg_count     OUT NOCOPY NUMBER
519         ,x_msg_data      OUT NOCOPY VARCHAR2
520         ,p_organization_id IN NUMBER
521         ,p_inventory_item_id IN NUMBER);
522 
523  --
524  -- API name    : Assign_operation_plans
525  -- Type        : Private
526  -- Function    : Assign operation_plans to records in MMTT
527  -- Input Parameters  :
528  --
529  -- Output Parameters:
530  -- Version     :
531  --   Current version 1.0
532  --
533  -- Notes       : calls AssignTT(p_task_id NUMBER)
534  --               for a given MO header
535  --
536 
537  PROCEDURE assign_operation_plans
538    (p_api_version                  IN   NUMBER                              ,
539     p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
540     p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
541     p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
542     x_return_status                OUT  NOCOPY VARCHAR2,
543     x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
544     x_msg_data                     OUT  NOCOPY VARCHAR2                    	   ,
545     p_move_order_header_id         IN   NUMBER);
546 
547 
548  --
549  -- API name    : Assign_operation_plan
550  -- Type        : Private
551  -- Function    : Assign operation_plan to a specific record in MMTT
552  -- Input Parameters  :
553  --           p_task_id NUMBER
554  --
555  -- Output Parameters:
556  -- Version     :
557  --   Current version 1.0
558  --
559  -- Notes       :
560  --
561 
562  PROCEDURE Assign_operation_plan(
563     p_api_version                  IN   NUMBER                              ,
564     p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
565     p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
566     p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
567     x_return_status                OUT  NOCOPY VARCHAR2,
568     x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
569     x_msg_data                     OUT  NOCOPY VARCHAR2                    	   ,
570     p_task_id                      IN   NUMBER);
571 
572 
573  --
574  --
575 
576   -- J Project
577   -- API name    : QuickPick
578   -- Type        : Private
579   -- Function    : Validates Quantity on Hand and Material Status for the picking Locations
580   --               Called for Inventory Moves.
581   -- Pre-reqs    : None
582   --
583   -- Input Parameters  :
584   --   p_api_version       Standard Input Parameter
585   --   p_init_msg_list     Standard Input Parameter
586   --   p_validation_level  Standard Input Parameter
587   --   p_rule_id           Identifier of the rule to check
588   --
589   -- Output Parameters  :
590   --   x_return_status     Standard Output Parameter
591   --   x_msg_count         Standard Output Parameter
592   --   x_msg_data          Standard Output Parameter
593   --
594   -- Version     :
595   --   Current version 1.0
596   --
597   -- Notes       : calls APPLY() API's of WMS_STRATEGY_PVT
598 
599 PROCEDURE QuickPick
600   (p_api_version                  IN   NUMBER                              ,
601    p_init_msg_list                IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
602    p_commit                       IN   VARCHAR2 DEFAULT fnd_api.g_false	   ,
603    p_validation_level             IN   NUMBER   DEFAULT fnd_api.g_valid_level_full ,
604    x_return_status                OUT  NOCOPY VARCHAR2                            ,
605    x_msg_count                    OUT  NOCOPY NUMBER 	                           ,
606    x_msg_data                     OUT  NOCOPY VARCHAR2                            ,
607    p_type_code                    IN   NUMBER   DEFAULT NULL ,
608    p_transaction_temp_id          IN   NUMBER   DEFAULT NULL ,
609    p_organization_id              IN   NUMBER   DEFAULT NULL ,
610    p_inventory_item_id            IN   NUMBER   DEFAULT NULL ,
611    p_transaction_uom              IN   VARCHAR2 DEFAULT NULL,
612    p_primary_uom                  IN   VARCHAR2 DEFAULT NULL,
613    p_secondary_uom                IN   VARCHAR2 DEFAULT NULL,                  -- new
614    p_grade_code                   IN   VARCHAR2 DEFAULT NULL,                  -- new
615    p_transaction_type_id          IN   NUMBER   DEFAULT NULL ,
616    p_tree_id                      IN   NUMBER   DEFAULT NULL ,
617    x_finished                     OUT  NOCOPY VARCHAR2 			   ,
618    p_detail_serial                IN   BOOLEAN  DEFAULT FALSE 		   ,
619    p_from_serial                  IN   VARCHAR2 DEFAULT NULL 		   ,
620    p_to_serial                    IN   VARCHAR2 DEFAULT NULL 		   ,
621    p_detail_any_serial            IN   NUMBER   DEFAULT NULL,
622    p_unit_volume                  IN   NUMBER   DEFAULT NULL,
623    p_volume_uom_code              IN   VARCHAR2 DEFAULT NULL,
624    p_unit_weight                  IN   NUMBER   DEFAULT NULL,
625    p_weight_uom_code              IN   VARCHAR2 DEFAULT NULL,
626    p_base_uom_code                IN   VARCHAR2 DEFAULT NULL,
627    p_lpn_id                       IN   NUMBER   DEFAULT NULL,
628    p_unit_number                  IN   VARCHAR2   DEFAULT NULL,
629    p_simulation_mode              IN   NUMBER   DEFAULT -1,
630    p_project_id                   IN   NUMBER   DEFAULT NULL,
631    p_task_id                      IN   NUMBER   DEFAULT NULL
632   );
633 
634   PROCEDURE get_available_inventory(
635     p_api_version                  IN            NUMBER
636   , p_init_msg_list                IN            VARCHAR2
637   , p_commit                       IN            VARCHAR2
638   , p_validation_level             IN            NUMBER
639   , x_return_status                OUT NOCOPY    VARCHAR2
640   , x_msg_count                    OUT NOCOPY    NUMBER
641   , x_msg_data                     OUT NOCOPY    VARCHAR2
642   , p_rule_id                      IN            NUMBER
643   , p_type_code                    IN            NUMBER
644   , p_partial_success_allowed_flag IN            VARCHAR2
645   , p_transaction_temp_id          IN            NUMBER
646   , p_organization_id              IN            NUMBER
647   , p_inventory_item_id            IN            NUMBER
648   , p_transaction_uom              IN            VARCHAR2
649   , p_primary_uom                  IN            VARCHAR2
650   , p_transaction_type_id          IN            NUMBER
651   , p_tree_id                      IN            NUMBER
652   , x_finished                     OUT NOCOPY    VARCHAR2
653   , p_detail_serial                IN            BOOLEAN
654   , p_from_serial                  IN            VARCHAR2
655   , p_to_serial                    IN            VARCHAR2
656   , p_detail_any_serial            IN            NUMBER
657   , p_unit_volume                  IN            NUMBER
658   , p_volume_uom_code              IN            VARCHAR2
659   , p_unit_weight                  IN            NUMBER
660   , p_weight_uom_code              IN            VARCHAR2
661   , p_base_uom_code                IN            VARCHAR2
662   , p_lpn_id                       IN            NUMBER
663   , p_unit_number                  IN            VARCHAR2
664   , p_simulation_mode              IN            NUMBER
665   , p_project_id                   IN            NUMBER
666   , p_task_id                      IN            NUMBER
667   );
668 
669  --Added FOR Bug9669364
670  FUNCTION match_planning_group(p_organization_id  IN NUMBER,
671           p_locator_id   IN NUMBER,
672           p_g_project_id     IN NUMBER,
673           p_mo_project_id       IN NUMBER DEFAULT NULL,
674           p_mo_task_id          IN NUMBER DEFAULT NULL,
675 	  p_transaction_type_id IN NUMBER DEFAULT NULL, -- Added for Bug 10379126
676 	  p_inventory_item_id   IN NUMBER DEFAULT NULL, -- Added for Bug 10379126
677 	  p_moqd_project_id     IN NUMBER DEFAULT NULL, -- Added for Bug 10379126
678 	  p_moqd_task_id        IN NUMBER DEFAULT NULL  -- Added for Bug 10379126
679 ) RETURN NUMBER ;
680 
681  --Added for 14699845 (Flexible lot allocation)
682  FUNCTION get_allocate_lot_flag(P_ORGANIZATION_ID IN NUMBER,
683                                  P_MOVE_ORDER_LINE_ID IN NUMBER DEFAULT NULL,
684                                  P_TRANSACTION_TEMP_ID IN NUMBER DEFAULT NULL,
685                                  P_INVENTORY_ITEM_ID IN NUMBER DEFAULT NULL,
686                                  P_SUBINVENTORY_CODE IN VARCHAR2 DEFAULT NULL,
687                                  P_LOCATOR_ID IN NUMBER DEFAULT NULL,
688                                  P_REVISION IN VARCHAR2 DEFAULT NULL,
689                                  P_LPN_ID IN NUMBER DEFAULT NULL
690 ) RETURN VARCHAR2 ;
691 
692 END wms_rule_pvt;