1 package WMS_Engine_PVT AUTHID CURRENT_USER as
2 /* $Header: WMSVPPES.pls 120.8.12020000.3 2013/01/31 22:03:15 sahmahes ship $ */
3 -- File : WMSVPPES.pls
4 -- Content : WMS_Engine_PVT package specification
5 -- Description : wms rules engine private API's
6 -- Notes :
7 -- Modified : 30/10/98 ckuenzel created
8 -- 02/08/99 mzeckzer changed
9
10
11 --changed by jcearley on 11/22/99 from nested table to table indexed
12 -- by binary integer. was causing error in insert_detail_temp_records
13 TYPE g_number_tbl_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
14
15 -- Static values used for p_simulation_mode parameter
16 g_full_simulation NUMBER := 0;
17 g_pick_strategy_mode NUMBER := 1;
18 g_pick_rule_mode NUMBER := 2;
19 g_put_strategy_mode NUMBER := 3;
20 g_put_rule_mode NUMBER := 4;
21 g_pick_full_mode NUMBER := 5;
22 g_available_inventory NUMBER := 10;
23 g_put_full_mode NUMBER := 20;
24 g_no_simulation NUMBER := -1;
25
26 g_mo_quantity NUMBER ;
27 g_mo_sec_qty NUMBER ;
28 g_Is_xdock BOOLEAN;
29 --
30 -- API name : Create_Suggestions
31 -- Type : Private
32 -- Function : Creates pick / put away suggestions according to provided
33 -- transaction or reservation input parameters and set up master
34 -- data.
35 -- Notes
36 -- 1. Integration with reservations
37 -- If table p_reservations passed by the calling is not empty, the
38 -- engine will detailing based on a combination of the info in the
39 -- move order line (the record that represents detailing request),
40 -- and the info in p_reservations. For example, a sales order line
41 -- can have two reservations, one for revision A in quantity of 10,
42 -- and one for revision B in quantity of 5, and the line quantity
43 -- can be 15; so when the pick release api calls the engine
44 -- p_reservations will have two records of the reservations. So
45 -- if the move order line based on the sales order line does not
46 -- specify a revision, the engine will merge the information from
47 -- move order line and p_reservations to create the input for
48 -- detailing as two records, one for revision A, and one for revision
49 -- B. Please see documentation for the pick release API for more
50 -- details.
51 --
52 -- 2. Serial Number Detailing in Picking
53 -- Currently the serial number detailing is quite simple. If the caller
54 -- gives a range (start, and end) serial numbers in the move order line
55 -- and pass p_suggest_serial as fnd_api.true, the engine will filter
56 -- the locations found from a rule, and suggest unused serial numbers
57 -- in the locator. If p_suggest_serial is passed as fnd_api.g_false
58 -- (default), the engine will not give serial numbers in the output.
59 --
60 -- Input Parameters
61 -- p_api_version_number standard input parameter
62 -- p_init_msg_lst standard input parameter
63 -- p_commit standard input parameter
64 -- p_validation_level standard input parameter
65 -- p_transaction_temp_id equals to the move order line id
66 -- for the detailing request
67 -- p_reservations reservations for the demand source
68 -- as the transaction source
69 -- in the move order line.
70 -- p_suggest_serial whether or not the engine should suggest
71 -- serial numbers in the detailing
72 -- p_simulation_mode indicates whether engine is being called
73 -- from the simulation forms or not, and
74 -- whether the simulation is on the rule
75 -- or the strategy; if simulating the entire
76 -- rules engine run, then set = 0;
77 -- p_simulation_id If simulation_mode = 1, this should be
78 -- the strategy_id to simulate
79 -- IF simulation mode = 2, this should be
80 -- the id of the rule to simulate
81 -- p_quick_pick_flag in varchar2 default 'N' The other value is 'Y'
82 -- 'Y' is passed in patchset 'J' onwards for Inventory Moves
83 -- when the lpn_request_context is 1
84 --
85 -- Output Parameters
86 -- x_return_status standard output parameters
87 -- x_msg_count standard output parameters
88 -- x_msg_data standard output parameters
89 --
90 -- Version : Current version 1.0
91 PROCEDURE create_suggestions
92 (p_api_version IN NUMBER,
93 p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false,
94 p_commit IN VARCHAR2 DEFAULT fnd_api.g_false,
95 p_validation_level IN NUMBER DEFAULT fnd_api.g_valid_level_none,
96 x_return_status OUT NOCOPY VARCHAR2,
97 x_msg_count OUT NOCOPY NUMBER,
98 x_msg_data OUT NOCOPY VARCHAR2,
99 p_transaction_temp_id IN NUMBER,
100 p_reservations IN inv_reservation_global.mtl_reservation_tbl_type,
101 p_suggest_serial IN VARCHAR2 DEFAULT fnd_api.g_false,
102 p_simulation_mode IN NUMBER DEFAULT -1,
103 p_simulation_id IN NUMBER DEFAULT NULL,
104 p_plan_tasks IN BOOLEAN DEFAULT FALSE,
105 p_quick_pick_flag IN VARCHAR2 DEFAULT 'N',
106 p_wave_simulation_mode IN VARCHAR2 DEFAULT 'N'
107 );
108
109
110 --Global variable. If the move order type is Pick Wave, then
111 --pick detailing can pick from the destination sub/locator, and this
112 --is set to 1. Set in this package, but used in WMS_RULE_PVT.apply
113 g_dest_sub_pick_allowed NUMBER;
114
115 --Global variable for locator code of from_sub, to_sub, and item
116 --Bug #3051649 /Grao : Org locator control
117 --Set in this package, but used in wms_rule_pvt.apply for determining
118 --if from sub/loc = to sub/loc.
119
120 g_org_loc_control NUMBER;
121 g_sub_loc_control NUMBER;
122 g_item_loc_control NUMBER;
123
124 --Global variables used for debug trace
125 g_trace_header_id NUMBER;
126 g_business_object_id NUMBER;
127
128 --Bug 2400549
129 --these values are used in wms_rule_pvt.Apply
130 g_move_order_type NUMBER;
131 g_transaction_action_id NUMBER;
132
133 g_wip_entity_type NUMBER; --BUG14517947
134
135 --bug 2589499
136 --this value used in wms_rule_pvt.Apply
137 g_reservable_putaway_sub_only BOOLEAN;
138
139 --bug 2778814
140 --this value used in wms_rule_pvt.Apply
141 g_serial_number_control_code NUMBER;
142
143 -- LG convergence add
144 G_inventory_availability_tbl wms_search_order_globals_pvt.pre_suggestions_record_tbl;
145 -- END of LG convergence add
146
147 -- patchset 'J' : to populate more meaningful error messages during inventory moves and Rules Simulator
148 -- This global variable would be updated from WMS_ENGINE_PVT.create_suggestions, WMS_STRATEGY_PVT.APPLY(),
149 -- and WMS_RULES_PVT.APPLY() and WMS_RULES_PVT,QUICK_PICK().
150 -- At the end of the create suggestion call, the contents of this variable would be pushed to message stack.
151 -- This message would be retrived from Rules Simulator and Putaway drop /load pages.
152
153
154 g_sugg_failure_message VARCHAR2(4000);
155 --
156 FUNCTION check_exp_lot_txn_allowed (p_mol_id NUMBER)
157 RETURN BOOLEAN;
158
159 g_sec_qty_round_mode VARCHAR2(1);
160 g_fulfillment_base VARCHAR2(1);
161
162 END wms_engine_pvt;