1 PACKAGE GMO_DISPENSE_SETUP_PVT
2 -- $Header: GMOVDSSS.pls 120.3 2006/02/01 14:44:55 swasubra noship $
3
4 AUTHID CURRENT_USER AS
5
6 G_PKG_NAME CONSTANT VARCHAR2(30) := 'GMO_DISPENSE_SETUP_PVT';
7
8 -- Start of comments
9 -- API name : GET_ITEM_DISPLAY_NAME
10 -- Type : Private Function.
11 -- Function : This function is used to obtain the display name of the item
12 -- identified by the item ID.
13 -- Pre-reqs : None
14 --
15 -- IN : P_ITEM_ID - The item ID whose display name is to be fetched.
16 --
17 -- RETURN : The display name of the item identified by the item ID.
18 --End of comments
19 FUNCTION GET_ITEM_DISPLAY_NAME(P_ITEM_ID NUMBER)
20 RETURN VARCHAR2;
21
22
23
24 -- Start of comments
25 -- API name : GET_ITEM_DESCRIPTION
26 -- Type : Private Function.
27 -- Function : This function is used to obtain the description of the item
28 -- identified by the item ID.
29 --
30 -- Pre-reqs : None
31 --
32 -- IN : P_ITEM_ID - The item ID whose description is to be fetched.
33 --
34 -- RETURN : The description of the item identified by the item ID.
35 --End of comments
36 FUNCTION GET_ITEM_DESCRIPTION(P_ITEM_ID NUMBER)
37 RETURN VARCHAR2;
38
39
40 -- Start of comments
41 -- API name : CREATE_DEFN_CONTEXT
42 -- Type : Private Procedure.
43 -- Function : This procedure is used to create a definition context in Process Instructions
44 -- for the specified entity name, entity key and instruction types. It would return
45 -- a instruction process ID through its OUT parameter.
46 -- Pre-reqs : None
47 --
48 -- IN : P_ENTITY_NAME - The entity name
49 -- : P_ENTITY_KEY - The entity key
50 -- : P_ENTITY_DISPLAYNAME - The entity display name
51 -- : P_INSTRUCTION_TYPE - The instruction types associated with the entity
52 -- : P_MODE - The mode (Update or Read Only)
53 -- : P_CONTEXT_PARAMETER_NAMES - The context parameter names associated with the entity
54 -- : P_CONTEXT_PARAMETER_VALUES - The corresponding context parameter values.
55 --
56 -- OUT : X_INSTRUCTION_PROCESS_ID - The instruction process ID that identified the newly
57 -- created definition context.
58 --End of comments
59 PROCEDURE CREATE_DEFN_CONTEXT
60 (
61 P_ENTITY_NAME IN VARCHAR2,
62 P_ENTITY_KEY IN VARCHAR2,
63 P_ENTITY_DISPLAYNAME IN VARCHAR2,
64 P_INSTRUCTION_TYPE IN FND_TABLE_OF_VARCHAR2_255,
65 P_MODE IN VARCHAR2 DEFAULT GMO_CONSTANTS_GRP.G_INSTR_DEFN_MODE_UPDATE,
66 P_CONTEXT_PARAMETER_NAMES IN FND_TABLE_OF_VARCHAR2_255,
67 P_CONTEXT_PARAMETER_VALUES IN FND_TABLE_OF_VARCHAR2_255,
68 P_CURR_INSTRUCTION_PROCESS_ID IN NUMBER DEFAULT NULL,
69 X_INSTRUCTION_PROCESS_ID OUT NOCOPY NUMBER
70 );
71
72
73 -- Start of comments
74 -- API name : UPDATE_CONTEXT_PARAMS
75 -- Type : Private Procedure.
76 -- Function : This procedure is used to update the context parameters associated with the specified process ID and entity parameters
77 -- Pre-reqs : None
78 --
79 -- IN : P_INSTRUCTION_PROCESS_ID - The instruction process ID.
80 -- : P_ENTITY_NAME - The entity name.
81 -- : P_ENTITY_KEY - The entity key.
82 -- : P_ENTITY_DISPLAYNAME - The entity display name
83 -- : P_INSTRUCTION_TYPE - The instruction types associated with the entity
84 -- : P_CONTEXT_PARAMETER_NAMES - The updated context parameter names to be associated with the entity.
85 -- : P_CONTEXT_PARAMETER_VALUES - The corresponding context parameter values.
86 --
87 --End of comments
88 PROCEDURE UPDATE_CONTEXT_PARAMS
89 (
90 P_INSTRUCTION_PROCESS_ID IN NUMBER,
91 P_ENTITY_NAME IN VARCHAR2,
92 P_ENTITY_KEY IN VARCHAR2,
93 P_ENTITY_DISPLAYNAME IN VARCHAR2,
94 P_INSTRUCTION_TYPE IN FND_TABLE_OF_VARCHAR2_255,
95 P_CONTEXT_PARAMETER_NAMES IN FND_TABLE_OF_VARCHAR2_255,
96 P_CONTEXT_PARAMETER_VALUES IN FND_TABLE_OF_VARCHAR2_255
97 );
98
99
100
101 -- Start of comments
102 -- API name : GET_TRANSACTION_XML
103 -- Type : Private Procedure.
104 -- Function : This procedure is used to construct transaction XML to be send to ERES for processing.
105 -- : In particular, it obtains the process instruction details (identified by the
106 -- : instruction process ID) in XML format and merges the same with the current XML parameter.
107 -- : This merged XML is returned as the output XML.
108 --
109 -- Pre-reqs : None
110 --
111 -- IN : P_INSTR_PROCESS_ID - The instruction process ID that identifies the process instruction
112 -- : details associated with the dispense setup.
113 -- : P_CURRENT_XML - The current transaction XML.
114
115 --
116 -- OUT : X_OUTPUT_XML - The final merged transaction XML ready to be sent to ERES for
117 -- - processing.
118 --End of comments
119 PROCEDURE GET_TRANSACTION_XML
120 (
121 P_INSTR_PROCESS_ID IN NUMBER,
122 P_CURRENT_XML IN CLOB,
123 X_OUTPUT_XML OUT NOCOPY CLOB
124 );
125
126 -- Start of comments
127 -- API name : SEND_INSTR_ACKN
128 -- Type : Private Procedure.
129 -- Function : This procedure used to send an acknowledgement back to process instructions to
130 -- copy the details from the temp tables into the permanent tables for the specified
131 -- instruction process ID and entity.
132 --
133 -- Pre-reqs : None
134 --
135 -- IN : P_INSTR_PROCESS_ID - The instruction process ID.
136 -- : P_ENTITY_NAME - The entity name.
137 -- : P_SOURCE_ENTITY_KEY - The source entity key.
138 -- : P_TARGET_ENTITY_KEY - The target entity key.
139 --
140 --End of comments
141 PROCEDURE SEND_INSTR_ACKN
142 (
143 P_INSTR_PROCESS_ID IN NUMBER,
144 P_ENTITY_NAME IN VARCHAR2,
145 P_SOURCE_ENTITY_KEY IN VARCHAR2,
146 P_TARGET_ENTITY_KEY IN VARCHAR2
147 );
148
149
150 -- Start of comments
151 -- API name : GET_DISPENSE_CONFIG
152 -- Type : Private Procedure.
153 -- Function : This procedure is used to obtain the dispense configuration for the specified
154 -- : item, organization and recipe.
155 --
156 -- Pre-reqs : None
157 --
158 -- IN : P_INVENTORY_ID - The item ID
159 -- : P_ORGANIZATION_ID - The organization ID
160 -- : P_RECIPE_ID - The recipe ID
161 --
162 -- OUT : X_DISPENSE_CONFIG - The dispense configuration
163 -- : X_INSTRUCTION_DEFINITION_KEY - The associated instruction defninition key.
164 --End of comments
165 PROCEDURE GET_DISPENSE_CONFIG
166 (
167 P_INVENTORY_ITEM_ID IN NUMBER,
168 P_ORGANIZATION_ID IN NUMBER,
169 P_RECIPE_ID IN NUMBER,
170 X_DISPENSE_CONFIG OUT NOCOPY GMO_DISPENSE_CONFIG%ROWTYPE,
171 X_INSTRUCTION_DEFINITION_KEY OUT NOCOPY VARCHAR2
172 );
173
174
175 -- Start of comments
176 -- API name : IS_DISPENSE_ITEM
177 -- Type : Private Function.
178 -- Function : This function is obtain the dispense UOM value for the specified item, organization and recipe.
179 --
180 -- Pre-reqs : None
181 --
182 -- IN : P_INVENTORY_ITEM_ID - The item ID
183 -- : P_ORGANIZATION_ID - The organization ID
184 -- : P_RECIPE_ID - The recipe ID
185 --
186 -- RETURNS : The dispense UOM value
187 --End of comments
188 FUNCTION GET_DISPENSE_UOM
189 (
190 P_INVENTORY_ITEM_ID IN NUMBER,
191 P_ORGANIZATION_ID IN NUMBER,
192 P_RECIPE_ID IN NUMBER
193 ) RETURN VARCHAR2;
194
195
196 -- Start of comments
197 -- API name : IS_CONV_WITH_PRIMARY_UOM
198 -- Type : Private Function.
199 -- Function : This function is used to verify if the specified UOM is convertible with the
200 -- primary UOM value.
201 --
202 -- Pre-reqs : None
203 --
204 -- IN : P_UOM - The UOM value to be verified
205 -- : P_ITEM_ID - The item ID
206 -- : P_ORGANIZATION_ID - The organization ID
207 --
208 -- Returns : A flag indicating if the specified uom is convertible with the primmary UOM value.
209 --End of comments
210 FUNCTION IS_CONV_WITH_PRIMARY_UOM
211 (
212 P_UOM VARCHAR2,
213 P_ITEM_ID NUMBER,
214 P_ORGANIZATION_ID NUMBER
215 ) RETURN VARCHAR2;
216
217
218
219 -- API name : IS_DISPENSE_ITEM
220 -- Type : Private Procedure.
221 -- Function : This procedure is used check if dispense is required for the specified item,
222 -- : organization and recipe. If dispensing is required, it returns the corresponding
223 -- dispense config ID that can be used to identify the dispense setup.
224 --
225 -- Pre-reqs : None
226 --
227 -- IN : P_INVENTORY_ITEM_ID - The item ID
228 -- : P_ORGANIZATION_ID - The organization ID
229 -- : P_RECIPE_ID - The recipe ID
230 -- : X_IS_DISPENSE_REQUIRED - Return flag indicating if dispensing is required.
231 -- : X_DISPENSE_CONFIG_ID - The corresponding dispense config ID if dispensing is required.
232 --
233 -- RETURNS : A flag indicating if dispense is required
234 --End of comments
235 PROCEDURE IS_DISPENSE_ITEM
236 (
237 P_INVENTORY_ITEM_ID IN NUMBER,
238 P_ORGANIZATION_ID IN NUMBER,
239 P_RECIPE_ID IN NUMBER,
240 X_IS_DISPENSE_REQUIRED OUT NOCOPY VARCHAR2,
241 X_DISPENSE_CONFIG_ID OUT NOCOPY VARCHAR2
242 );
243
244
245 -- Start of comments
246 -- API name : GET_DISPENSE_CONFIG_INST
247 -- Type : Private Procedure.
248 -- Function : This procedure is used to obtain the dispense configuration for the specified ENTITY_NAME and
249 -- ENTITY_KEY from the instance tables.
250 --
251 -- Pre-reqs : None
252 --
253 -- IN : P_ENTITY_NAME - The entity name.
254 -- : P_ENTITY_KEY - The entity key.
255 --
256 -- OUT : X_DISPENSE_CONFIG - The dispense configuration
257 -- : X_INSTRUCTION_DEFINITION_KEY - The associated instruction defninition key.
258 --End of comments
259 PROCEDURE GET_DISPENSE_CONFIG_INST
260 (
261 P_ENTITY_NAME IN VARCHAR2,
262 P_ENTITY_KEY IN VARCHAR2,
263 X_DISPENSE_CONFIG OUT NOCOPY GMO_DISPENSE_CONFIG%ROWTYPE,
264 X_INSTRUCTION_DEFINITION_KEY OUT NOCOPY VARCHAR2
265 );
266
267
268 -- Start of comments
269 -- API name : INSTANTIATE_DISPENSE_SETUP
270 -- Type : Private Procedure.
271 -- Function : This procedure is used to instantiate the dispense setup identified by the specified
272 -- dispense config ID, entity name and entity key.
273 -- Pre-reqs : None
274 --
275 -- IN : P_DISPENSE_CONFIG_ID.
276 -- : P_ENTITY_NAME - The entity name.
277 -- : P_ENTITY_KEY - The entity key.
278 --End of comments
279 PROCEDURE INSTANTIATE_DISPENSE_SETUP
280 (P_DISPENSE_CONFIG_ID IN NUMBER,
281 P_ENTITY_NAME IN VARCHAR2,
282 P_ENTITY_KEY IN VARCHAR2,
283 P_INIT_MSG_LIST IN VARCHAR2,
284 P_AUTO_COMMIT IN VARCHAR2 DEFAULT FND_API.G_FALSE,
285 X_RETURN_STATUS OUT NOCOPY VARCHAR2,
286 X_MSG_COUNT OUT NOCOPY NUMBER,
287 X_MSG_DATA OUT NOCOPY VARCHAR2);
288
289
290
291 -- Start of comments
292 -- API name : INSTANTIATE_DISP_SETUP
293 -- Type : Private Procedure.
294 -- Function : This procedure is used to instantiate the dispense setup identified by the specified
295 -- dispense config ID, entity name and entity key. The transaction is committed autonomously.
296 -- Pre-reqs : None
297 --
298 -- IN : P_DISPENSE_CONFIG_ID.
299 -- : P_ENTITY_NAME - The entity name.
300 -- : P_ENTITY_KEY - The entity key.
301 --End of comments
302 PROCEDURE INSTANTIATE_DISP_SETUP_AUTO
303 (P_DISPENSE_CONFIG_ID IN NUMBER,
304 P_ENTITY_NAME IN VARCHAR2,
305 P_ENTITY_KEY IN VARCHAR2,
306 P_INIT_MSG_LIST IN VARCHAR2,
307 X_RETURN_STATUS OUT NOCOPY VARCHAR2,
308 X_MSG_COUNT OUT NOCOPY NUMBER,
309 X_MSG_DATA OUT NOCOPY VARCHAR2);
310
311
312 --This function return the dispense setup status based on the specified start and end date values.
313 --The status value returned is one of possible lookup code values contained in the lookup type
314 --GMO_DISP_SETUP_STATUS.
315 FUNCTION GET_SETUP_STATUS(P_START_DATE DATE,
316 P_END_DATE DATE)
317
318
319 RETURN VARCHAR2;
320
321 --This function checks if the the difference between the specified dates is atleast
322 --two seconds. Based on this condition it returns FND_API.G_TRUE or FND_API.G_FALSE.
323 FUNCTION IS_DATE_DIFF_SUFFICIENT(P_FIRST_DATE DATE,
324 P_SECOND_DATE DATE)
325
326 RETURN VARCHAR2;
327
328 --This function subtracts the specified number of seconds from the date provided.
329 FUNCTION SUBTRACT_SECONDS_FROM_DATE(P_DATE DATE,
330 P_SECONDS NUMBER)
331 RETURN DATE;
332
333 --This function adds the specified number of seconds from the date provided.
334 FUNCTION ADD_SECONDS_TO_DATE(P_DATE DATE,
335 P_SECONDS NUMBER)
336 RETURN DATE;
337
338 END GMO_DISPENSE_SETUP_PVT;