DBA Data[Home] [Help]

PACKAGE: APPS.INV_LABEL

Source


1 PACKAGE INV_LABEL AS
2 /* $Header: INVLABPS.pls 120.5.12010000.2 2008/07/29 13:40:08 ptkumar ship $ */
3 /*#
4   * This procedure initiates a label print request for Oracle Warehouse
5   * Management or Mobile Supply Chain Applications
6   * @rep:scope public
7   * @rep:product INV
8   * @rep:lifecycle active
9   * @rep:displayname Label Printing request for WMS/MSCA
10   * @rep:category BUSINESS_ENTITY WMS_LABEL
11   */
12 
13 G_PKG_NAME  CONSTANT VARCHAR2(50) := 'INV_LABEL';
14 
15 -- Table type definition for an array of transaction_id reocrds and input parameters
16 TYPE transaction_id_rec_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
17 
18 TYPE input_parameter_rec_type is TABLE OF MTL_MATERIAL_TRANSACTIONS_TEMP%ROWTYPE
19     INDEX BY BINARY_INTEGER;
20 
21 txn_id_null_rec      transaction_id_rec_type;
22 input_param_null_rec input_parameter_rec_type;
23 
24 -- Table type definition of label type header information
25 TYPE label_type_rec is RECORD
26 (
27     business_flow_code      NUMBER
28 ,   label_type_id           NUMBER        -- Label Type ID
29 ,   label_type              VARCHAR2(200) -- Label Type Desc
30 ,   default_format_id       NUMBER
31 ,   default_format_name     VARCHAR2(200)
32 ,   default_printer         VARCHAR2(200)
33 ,   default_no_of_copies    NUMBER
34 ,   manual_format_id        NUMBER        -- Added for Add format/printer for manual request
35 ,   manual_format_name      VARCHAR2(200) -- Added for Add format/printer for manual request
36 ,   manual_printer          VARCHAR2(200) -- Added for Add format/printer for manual request
37 );
38 TYPE label_type_tbl_type IS TABLE OF label_type_rec INDEX BY BINARY_INTEGER;
39 
40 
41 ---------------------------------------------------------------------------------------------
42 -- Project: 'Custom Labels' (A 11i10+ Project)                                               |
43 -- Author: Dinesh ([email protected])                                                      |
44 -- Change Description:                                                                       |
45 -- Included sql_Stmt to label_field_var_rec to hold the 'Custom Query' supplied by the user  |
46 ---------------------------------------------------------------------------------------------
47 -- Record type and table of record type defintion for the selected fields for a format
48 TYPE label_field_variable_rec IS RECORD
49 (
50     label_field_id      NUMBER
51 ,   variable_name       VARCHAR2(100)
52 ,   column_name         VARCHAR2(100)
53 ,   sql_stmt            VARCHAR2(4000)  -- This field is newly added for the Custom SQL project.
54 );
55 ------------------------End of this change for Custom Labels project code--------------------
56 
57 TYPE label_field_variable_tbl_type IS TABLE OF label_field_variable_rec INDEX BY BINARY_INTEGER;
58 
59 TYPE lpn_table_type IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
60 
61 -- Record type and table of record type definition to
62 --  keep lot and serial number data for material label
63 --  for receipt, inspection and put away
64 TYPE material_label_input_rec IS RECORD
65 (
66     item_id         NUMBER
67 ,   lot_number      VARCHAR2(240)
68 ,   lot_quantity    NUMBER
69 ,   serial_number   VARCHAR2(240)
70 );
71 TYPE material_label_input_tbl IS TABLE OF material_label_input_rec INDEX BY BINARY_INTEGER;
72 
73 TYPE serial_tab_type IS TABLE OF VARCHAR(100) INDEX BY BINARY_INTEGER;
74 
75 -- Table of record type to store label data.
76 --  Each record is a LONG variable to store one piece of label data
77 --  <LABEL> ... </LABEL>
78 --TYPE label_tbl_type IS TABLE OF LONG INDEX BY BINARY_INTEGER;
79 
80 -- Sept.10: Patchset I change for label history and reprint
81 -- In addtion to the LONG variable for label data,
82 -- added information of Label format, Printer, and RequestID
83 TYPE label_rec_type IS RECORD
84 (
85     label_request_id    NUMBER
86 ,   label_content       LONG
87 ,   label_status        VARCHAR2(1)
88 ,   error_message       VARCHAR2(1000)
89 );
90 TYPE label_tbl_type IS TABLE OF label_rec_type INDEX BY BINARY_INTEGER;
91 
92 TYPE t_genref IS REF CURSOR;
93 
94 /* Bug 3417450. This table contains the request_id - label_type_id mapping which is
95  * used to fetch the correct label format for the LPN Summary labels, if they are printed
96  * from the LPN Content label print call
97  */
98 TYPE label_request_rec IS RECORD
99 (
100     label_request_id NUMBER
101 ,   label_type_id NUMBER
102 );
103 
104 TYPE label_request_tbl IS TABLE OF label_request_rec INDEX BY BINARY_INTEGER;
105 
106 
107 
108 /*******************************************
109  ** -- Global Variables
110  *******************************************/
111 g_xml_content          LONG;
112 g_xml_header           LONG;
113 g_material_label_input material_label_input_tbl;
114 g_label_request_tbl    label_request_tbl;
115 
116 -- Transaction Identifier denotes the source of Transaction. This is used
117 -- in conjunction with p_transaction_id to retrive the details. Possible values :
118 /* MANUAL: Manual mode. source is from p_input_param.p_transaction_id       */
119 /* MMTT : transaction is MTL_MATERIAL_TRANSACTIONS_TEMP.transaction_temp_id */
120 /* MTI  : transaction is MTL_TRANSACTION_INTERFACE.transaction_interface_id */
121 /* MTRL : transaction is MTL_TXN_REQUEST_LINES.line_id                      */
122 /* WFS  : transaction is WIP_FLOW_SCHEDULES.wip_entity_id                   */
123 /* RT   : transaction is RCV_TRANSACTION.lpn_group_id                       */
124 /* RSH  : transaction is RCV_SHIPMENT_HEADERS.shipment_header_id            */
125 
126 -- bug #6417575, Label Printing Support for WIP Move Transactions (12.1)
127 /* WMT  : transaction is WIP_MOVE_TRANSACTIONS.transaction_id               */
128 
129 
130 TRX_ID_MANUAL CONSTANT NUMBER := 0;
131 TRX_ID_MMTT   CONSTANT NUMBER := 1;
132 TRX_ID_MTI    CONSTANT NUMBER := 2;
133 TRX_ID_MTRL   CONSTANT NUMBER := 3;
134 TRX_ID_WFS    CONSTANT NUMBER := 4;
135 TRX_ID_RT     CONSTANT NUMBER := 5;
136 TRX_ID_RSH    CONSTANT NUMBER := 6;
137 TRX_ID_DIS    CONSTANT NUMBER := 7; -- fabdi, added for gmo
138 TRX_ID_UNDIS  CONSTANT NUMBER := 8; -- fabdi, added for gmo
139 TRX_ID_WMT    CONSTANT NUMBER := 9; -- hjogleka, added for Label Printing Support for WIP Move Transactions (12.1)
140 
141 -- Global Variable for RFID
142 -- Added for 11.5.10+ RFID Compliance project as lpn_group_id
143 -- Modified in R12 RFID project as EPC_GROUP_ID
144 -- This is used to  retrieve EPC for LPN/Material/Serial
145 -- For each label printing request, there will be a new LPN Group ID from WMS_EPC_S2
146 -- At the end of the label printing request, the value will be set to null
147 epc_group_id           NUMBER;
148 
149 /*************************************************************************
150 *   Print Label
151 *     This can be called from transaction process or manual
152 *     p_print_mode:  1 => Transaction Driven
153 *                    2 => Manual print
154 *     If it is transaction driven, business flow code and transaction are required
155 *     If it is manual print, label type and input record are required
156 *  LABEL Types
157 *          1 Material
158 *          2 Serial
159 *          3 LPN
160 *          4 LPN Content
161 *          5 LPN Summary
162 *          6 Location
163 *          7 Shipping
164 *          8 Shipping Contents
165 *          9 WIP Content
166 *         10 WIP Flow
167 *         16 WIP Move Contents
168 ***************************************************************************/
169 PROCEDURE PRINT_LABEL
170 (
171     x_return_status          OUT NOCOPY VARCHAR2
172 ,   x_msg_count              OUT NOCOPY NUMBER
173 ,   x_msg_data               OUT NOCOPY VARCHAR2
174 ,   x_label_status           OUT NOCOPY VARCHAR2
175 ,   p_api_version            IN         NUMBER
176 ,   p_init_msg_list          IN         VARCHAR2       := fnd_api.g_false
177 ,   p_commit                 IN         VARCHAR2       := fnd_api.g_false
178 ,   p_print_mode             IN         NUMBER
179 ,   p_business_flow_code     IN         NUMBER    DEFAULT NULL
180 ,   p_transaction_id         IN         transaction_id_rec_type   default txn_id_null_rec
181 ,   p_input_param_rec        IN         input_parameter_rec_type  default input_param_null_rec
182 ,   p_label_type_id          IN         NUMBER    DEFAULT NULL
183 ,   p_no_of_copies           IN         NUMBER         := 1
184 ,   p_transaction_identifier IN         NUMBER    DEFAULT NULL
185 ,   p_format_id              IN         NUMBER    DEFAULT NULL   -- Added for the Add Printer and Format Project.
186 ,   p_printer_name           IN         VARCHAR2  DEFAULT NULL -- Added for the Add Printer and Format Project.
187 ) ;
188 
189 /*************************************************************************
190 *   Print Label
191 *   New Overloaded procedure add by GMO fabdi
192 *
193 *    This can be called from transaction process or manual
194 *     p_print_mode:  1 => Transaction Driven
195 *                    2 => Manual print
196 *       If it is transaction driven, business flow code and transaction are required
197 *       If it is manual print, label type and input record are required
198 *  LABEL Types
199 *          1 Material
200 *          2 Serial
201 *          3 LPN
202 *          4 LPN Content
203 *          5 LPN Summary
204 *          6 Location
205 *          7 Shipping
206 *          8 Shipping Contents
207 *          9 WIP Content
208 *         10 WIP Flow
209 *         11 Process material
210 *         12 Dispense material
211 *         13 dispense cage
212 *         14 process product
213 *         15 process sample
214 *
215 ***************************************************************************/
216 PROCEDURE PRINT_LABEL
217 (
218     x_return_status           OUT NOCOPY VARCHAR2
219 ,   x_msg_count               OUT NOCOPY NUMBER
220 ,   x_msg_data                OUT NOCOPY VARCHAR2
221 ,   x_label_status            OUT NOCOPY VARCHAR2
222 ,   x_label_request_id        OUT NOCOPY NUMBER -- fabdi, new para
223 ,   p_api_version             IN         NUMBER
224 ,   p_init_msg_list           IN         VARCHAR2      := fnd_api.g_false
225 ,   p_commit                  IN         VARCHAR2      := fnd_api.g_false
226 ,   p_print_mode              IN         NUMBER
227 ,   p_business_flow_code      IN         NUMBER   DEFAULT NULL
228 ,   p_transaction_id          IN         transaction_id_rec_type  default txn_id_null_rec
229 ,   p_input_param_rec         IN         input_parameter_rec_type default input_param_null_rec
230 ,   p_label_type_id           IN         NUMBER   DEFAULT NULL
231 ,   p_no_of_copies            IN         NUMBER        := 1
232 ,   p_transaction_identifier  IN         NUMBER   DEFAULT NULL
233 ,   p_format_id               IN         NUMBER   DEFAULT NULL   -- Added for the Add Printer and Format Project.
234 ,   p_printer_name            IN         VARCHAR2 DEFAULT NULL -- Added for the Add Printer and Format Project.
235 ) ;
236 
237 /********************************************
238  * Wrapper API for calling printing from Java
239  * This wrapper is for giving transaction ID
240  *******************************************/
241 PROCEDURE PRINT_LABEL_WRAP
242 (
243     x_return_status           OUT NOCOPY VARCHAR2
244 ,   x_msg_count               OUT NOCOPY NUMBER
245 ,   x_msg_data                OUT NOCOPY VARCHAR2
246 ,   x_label_status            OUT NOCOPY VARCHAR2
247 ,   p_business_flow_code      IN         NUMBER   DEFAULT NULL
248 ,   p_transaction_id          IN         NUMBER
249 ,   p_transaction_identifier  IN         NUMBER   DEFAULT NULL
250 ) ;
251 
252 /********************************************
253  * Wrapper API for calling printing from Java
254  * This wrapper is for Manual Mode
255  *******************************************/
256 /*#
257 * These procedure initiates manual label print request based on the provided
258 * information.  Note that the label will be generated with the given information
259 * provided by the input parameters, and will not be based on any transaction
260 * records such as MTL_MATERIAL_TRANSACTIONS_TEMP records. However, a
261 * business flow code can be provided for those transactions that do not have
262 * transaction records, such as Serial Generation, Cost Group Update, etc.
263 *
264 * @param x_return_status Return status of the procedure. If the procedure
265 * succeeds, the value will be fnd_api.g_ret_sts_success; if there is an expected * error, the value will be fnd_api.g_ret_sts_error; if there is an unexpected
266 * error, the value will be fnd_api.g_ret_sts_unexp_error;
267 * @ paraminfo {@rep:required}
268 * @ param x_msg_count if there is one or more errors, the number of error
269 * messages in the buffer
270 * @ paraminfo {@rep:required}
271 * @ param x_msg_data if there is one and only one error, the error message is x_msg_data, otherwise, get the messages from the message stack
272 * @ paraminfo {@rep:required}
273 * @ param x_label_status status message from printer. Currently not used
274 * @ paraminfo {@rep:required}
275 * @ param p_business_flow_code the business flow code that initiate this printing request. It is null for a manual print request. Valid values are specified in lookup WMS_BUSINESS_FLOW. Default value is  NULL
276 * @ paraminfo {@rep:optional}
277 * @ param p_label_type Type of label that is requested. Valid values are specified in lookup WMS_LABEL_TYPE. Default value is  NULL
278 * @ paraminfo {@rep:optional}
279 * @ param p_organization_id Organization ID. It is required for Material and Serial label. Default value is  NULL
280 * @ paraminfo {@rep:optional}
281 * @ param p_inventory_item_id Inventory Item ID. It is required for Material and Serial label. Default value is  NULL
282 * @ paraminfo {@rep:optional}
283 * @ param p_revision Item Revision.It is required for Material and Serial label, if applicable. Default value is  NULL
284 * @ paraminfo {@rep:optional}
285 * @ param p_lot_number Lot Number.It is required for Material and Serial label, if applicable. Default value is  NULL
286 * @ paraminfo {@rep:optional}
287 * @ param p_fm_serial_number From Serial Number. It is required for Serial label. Default value is  NULL
288 * @ paraminfo {@rep:optional}
289 * @ param p_to_serial_number To Serial Number. It is required for Material and Serial label, when printing for a range of serial numbers, if applicable.Default value is  NULL
290 * @ paraminfo {@rep:optional}
291 * @ param p_lpn_id License Plate Number ID. It is required for LPN, LPN Content, LPN Summary, and Shipping Content label. Default value is  NULL
292 * @ paraminfo {@rep:optional}
293 * @ param p_subinventory_code Subinventory Code. It may be required for Location label. Default value is  NULL
294 * @ paraminfo {@rep:optional}
295 * @ param p_locator_id Locator ID, It may be required for Location label. Default value is  NULL
296 * @ paraminfo {@rep:optional}
297 * @ param p_delivery_id Delivery ID. It is required for Shipping and Shipping Content label. Default value is  NULL
298 * @ paraminfo {@rep:optional}
299 * @ param p_quantity Quantity. It is required for Material label. Default value is  NULL
300 * @ paraminfo {@rep:optional}
301 * @ param p_uom Unit of Measure code. It is required for Material label. Default value is  NULL
302 * @ paraminfo {@rep:optional}
303 * @ param p_wip_entity_id WIP Entity Id. It is required for WIP Move Contents Label, Default value is NULL
304 * @ paraminfo {@rep:optional}
305 * @ param p_no_of_copies Number of copies of the label. Default value is  NULL
306 * @ paraminfo {@rep:optional}
307 * @ param p_fm_schedule_number From Schedule Number. Default value is  NULL. It is not used currently
308 * @ paraminfo {@rep:optional}
309 * @ param p_to_schedule_number To Schedule Number. Default value is  NULL. It is not used currently. Default value is  NULL
310 * @ paraminfo {@rep:optional}
311 * @ param p_format_id Label Format ID. If provided, this specific label format will be used to generate labels. Otherwise, the label format will be decided with WMS Rules Engine or default label format in a Inventory only appplication. Default is NULL
312 * @ paraminfo {@rep:optional}
313 * @ param p_printer_name Printer Name. If it is provided, this specific printer will be used to print a label. Otherwise, the printer will be decided with printer setup. Default value is  NULL
314 * @ paraminfo {@rep:optional}
315 * @rep:scope public
316 * @rep:lifecycle active
317 * @rep:displayname API to initiate a manual label printing request
318 * @rep:businessevent print_label_manual_wrap
319 */
320 PROCEDURE PRINT_LABEL_MANUAL_WRAP
321 (
322     x_return_status                   OUT NOCOPY  VARCHAR2
326 ,   p_business_flow_code              IN          NUMBER   DEFAULT NULL
323 ,   x_msg_count                       OUT NOCOPY  NUMBER
324 ,   x_msg_data                        OUT NOCOPY  VARCHAR2
325 ,   x_label_status                    OUT NOCOPY  VARCHAR2
327 ,   p_label_type                      IN          NUMBER   DEFAULT NULL
328 ,   p_organization_id                 IN          NUMBER   DEFAULT NULL
329 ,   p_inventory_item_id               IN          NUMBER   DEFAULT NULL
330 ,   p_revision                        IN          VARCHAR2 DEFAULT NULL
331 ,   p_lot_number                      IN          VARCHAR2 DEFAULT NULL
332 ,   p_fm_serial_number                IN          VARCHAR2 DEFAULT NULL
333 ,   p_to_serial_number                IN          VARCHAR2 DEFAULT NULL
334 ,   p_lpn_id                          IN          NUMBER   DEFAULT NULL
335 ,   p_subinventory_code               IN          VARCHAR2 DEFAULT NULL
336 ,   p_locator_id                      IN          NUMBER   DEFAULT NULL
337 ,   p_delivery_id                     IN          NUMBER   DEFAULT NULL
338 ,   p_quantity                        IN          NUMBER   DEFAULT NULL
339 ,   p_uom                             IN          VARCHAR2 DEFAULT NULL
340 ,   p_wip_entity_id                   IN          NUMBER   DEFAULT NULL
341 ,   p_no_of_copies                    IN          NUMBER   DEFAULT NULL
342 ,   p_fm_schedule_number              IN          VARCHAR2 DEFAULT NULL
343 ,   p_to_schedule_number              IN          VARCHAR2 DEFAULT NULL
344 ,   p_format_id                       IN          NUMBER   DEFAULT NULL
345 ,   p_printer_name                    IN          VARCHAR2 DEFAULT NULL
346 );
347 
348 /*****************************************************
349  * API to get the label fields defined for a specific
350  * format. This get called from the individual label
351  * API's often.
352  *****************************************************/
353 PROCEDURE GET_VARIABLES_FOR_FORMAT(
354     x_variables         OUT NOCOPY label_field_variable_tbl_type
355 ,   x_variables_count   OUT NOCOPY NUMBER
356 ,   p_format_id         IN         NUMBER
357 );
358 /******************************************************
359  * Overloaded procedure GET_VARIABLES_FOR_FORMAT
360  * Added in 11.5.10+
361  * Also it can check whether a given variable is included
362  * in the given format
363  * p_exist_variable_name has the name of the variable
364  *  that will be checked for existence
365  * x_is_variable_exist returns whether the given variable exists
366  *  possible value is 'Y' or 'N'
367  *******************************************************/
368 PROCEDURE GET_VARIABLES_FOR_FORMAT(
369     x_variables           OUT NOCOPY label_field_variable_tbl_type
370 ,   x_variables_count     OUT NOCOPY NUMBER
371 ,   x_is_variable_exist   OUT NOCOPY VARCHAR2
372 ,   p_format_id           IN         NUMBER
373 ,   p_exist_variable_name IN         VARCHAR2 DEFAULT NULL
374 );
375 
376 /*****************************************************
377  * API to get default formatfor a pabel type passed in
378  *****************************************************/
379 PROCEDURE GET_DEFAULT_FORMAT
380   (p_label_type_id   IN         number,
381    p_label_format    OUT NOCOPY VARCHAR2,
382    p_label_format_id OUT NOCOPY NUMBER
383 );
384 
385 /**********************************************************
386  * Rules Engine call from within the individual label API's
387  **********************************************************/
388 PROCEDURE GET_FORMAT_WITH_RULE
389 (
390  P_DOCUMENT_ID                        IN         NUMBER               ,
391  P_LABEL_FORMAT_ID                    IN         NUMBER   default null,
392  P_ORGANIZATION_ID                    IN         NUMBER   default null,
393  P_INVENTORY_ITEM_ID                  IN         NUMBER   default null,
394  P_SUBINVENTORY_CODE                  IN         VARCHAR2 default null,
395  P_LOCATOR_ID                         IN         NUMBER   default null,
396  P_LOT_NUMBER                         IN         VARCHAR2 default null,
397  P_REVISION                           IN         VARCHAR2 default null,
398  P_SERIAL_NUMBER                      IN         VARCHAR2 default null,
399  P_LPN_ID                             IN         NUMBER   default null,
400  P_SUPPLIER_ID                        IN         NUMBER   default null,
401  P_SUPPLIER_SITE_ID                   IN         NUMBER   default null,
402  P_SUPPLIER_ITEM_ID                   IN         NUMBER   default null,
403  P_CUSTOMER_ID                        IN         NUMBER   default null,
404  P_CUSTOMER_SITE_ID                   IN         NUMBER   default null,
405  P_CUSTOMER_ITEM_ID                   IN         NUMBER   default null,
406  P_CUSTOMER_CONTACT_ID                IN         NUMBER   default null,
407  P_FREIGHT_CODE                       IN         VARCHAR2 default null,
408  P_LAST_UPDATE_DATE                   IN         DATE                 ,
409  P_LAST_UPDATED_BY                    IN         NUMBER               ,
410  P_CREATION_DATE                      IN         DATE                 ,
411  P_CREATED_BY                         IN         NUMBER               ,
412  P_LAST_UPDATE_LOGIN                  IN         NUMBER   default null,
413  P_REQUEST_ID                         IN         NUMBER   default null,
414  P_PROGRAM_APPLICATION_ID             IN         NUMBER   default null,
415  P_PROGRAM_ID                         IN         NUMBER   default null,
416  P_PROGRAM_UPDATE_DATE                IN         DATE     default null,
417  P_ATTRIBUTE_CATEGORY                 IN         VARCHAR2 default null,
418  P_ATTRIBUTE1                         IN         VARCHAR2 default null,
419  P_ATTRIBUTE2                         IN         VARCHAR2 default null,
420  P_ATTRIBUTE3                         IN         VARCHAR2 default null,
421  P_ATTRIBUTE4                         IN         VARCHAR2 default null,
422  P_ATTRIBUTE5                         IN         VARCHAR2 default null,
423  P_ATTRIBUTE6                         IN         VARCHAR2 default null,
424  P_ATTRIBUTE7                         IN         VARCHAR2 default null,
425  P_ATTRIBUTE8                         IN         VARCHAR2 default null,
426  P_ATTRIBUTE9                         IN         VARCHAR2 default null,
427  P_ATTRIBUTE10                        IN         VARCHAR2 default null,
428  P_ATTRIBUTE11                        IN         VARCHAR2 default null,
429  P_ATTRIBUTE12                        IN         VARCHAR2 default null,
430  P_ATTRIBUTE13                        IN         VARCHAR2 default null,
431  P_ATTRIBUTE14                        IN         VARCHAR2 default null,
432  P_ATTRIBUTE15                        IN         VARCHAR2 default null,
433  P_PRINTER_NAME                       IN         VARCHAR2 default null,
434  P_DELIVERY_ID                        IN         NUMBER   default null,
435  P_BUSINESS_FLOW_CODE                 IN         NUMBER   default null,
436  P_PACKAGE_ID                         IN         NUMBER   default null,
437  p_sales_order_header_id              IN         NUMBER   default null,  -- bug 2326102
438  p_sales_order_line_id                IN         NUMBER   default null,  -- bug 2326102
439  p_delivery_detail_id                 IN         NUMBER   default null,  -- bug 2326102
440  p_use_rule_engine                    IN         VARCHAR2 default null,  -- For label history of multi-rec label types
441  x_return_status                      OUT NOCOPY VARCHAR2             ,
442  x_label_format_id                    OUT NOCOPY NUMBER               ,
443  x_label_format                       OUT NOCOPY VARCHAR2             ,
444  x_label_request_id                   OUT NOCOPY NUMBER                  -- For label history
445 );
446 
447 PROCEDURE trace(p_message IN VARCHAR2,
448                 p_prompt  IN VARCHAR2 ,
449                 p_level   IN NUMBER DEFAULT 12);
450 
451 
452 /***************************************
453  * Get numbers between a specified range
454  ***************************************/
455 PROCEDURE GET_NUMBER_BETWEEN_RANGE(
456     fm_x_number     IN         VARCHAR2
457 ,   to_x_number     IN         VARCHAR2
458 ,   x_return_status OUT NOCOPY VARCHAR2
459 ,   x_number_table  OUT NOCOPY serial_tab_type );
460 
461 /***************************************
462  * Update history record
463  ***************************************/
464 PROCEDURE update_history_record(
465     p_label_request_id  IN NUMBER
466 ,   p_status_flag       IN VARCHAR2 DEFAULT NULL
467 ,   p_job_status        IN VARCHAR2 DEFAULT NULL
468 ,   p_printer_status    IN VARCHAR2 DEFAULT NULL
469 ,   p_status_type       IN VARCHAR2 DEFAULT NULL
470 ,   p_outfile_name      IN VARCHAR2 DEFAULT NULL
471 ,   p_outfile_directory IN VARCHAR2 DEFAULT NULL
472 ,   p_error_message     IN VARCHAR2 DEFAULT NULL
473 );
474 
475 /**************************************
476  * Reprint a previous label to a specified
477  *  printer or no of copies
478  * The input parameters are
479  * p_hist_label_request_id :
480        is the label request ID of the original
481        label printing history record
482  * p_printer_name: new printer name
483  * p_no_of_copies: new number of copies
484  **************************************/
485 PROCEDURE RESUBMIT_LABEL_REQUEST(
486     x_return_status         OUT NOCOPY VARCHAR2
487 ,   x_msg_count             OUT NOCOPY NUMBER
488 ,   x_msg_data              OUT NOCOPY VARCHAR2
489 ,   p_hist_label_request_id IN         NUMBER
490 ,   p_printer_name          IN         VARCHAR2 DEFAULT NULL
491 ,   p_no_of_copy            IN         NUMBER   DEFAULT NULL
492 );
493 
494 /*************************************
495  * Obtain Label Request Print Hist
496  *************************************/
497 PROCEDURE INV_LABEL_REQUESTS_REPRINT (
498                x_label_rep_hist_inqs    OUT NOCOPY t_genref,
499                p_printer_Name           IN         VARCHAR2,
500                p_bus_flow_Code          IN         NUMBER,
501                p_label_type_Id          IN         NUMBER,
502                p_lpn_Id                 IN         NUMBER,
503                p_Requests               IN         NUMBER,
504                p_created_By             IN         NUMBER,
505                x_Status                 OUT NOCOPY VARCHAR2,
506                x_Message                OUT NOCOPY VARCHAR2
507 );
508 
509 -- Bug #3067059
510 /**************************************
511  * Checks if there is a GTIN defined for the
512  * Item + UOM + Rev combination.
513  * Also fetches  GTIN and GTIN Desc. if it is
514  * defined for the given Org, Item, UOM, Rev
515 **************************************/
516 PROCEDURE IS_ITEM_GTIN_ENABLED(
517         x_return_status         OUT NOCOPY VARCHAR2
518       , x_gtin_enabled          OUT NOCOPY BOOLEAN
519       , x_gtin                  OUT NOCOPY VARCHAR2
520       , x_gtin_desc             OUT NOCOPY VARCHAR2
521       , p_organization_id       IN         NUMBER
522       , p_inventory_item_id     IN         NUMBER
523       , p_unit_of_measure       IN         VARCHAR2
524       , p_revision              IN         VARCHAR2
525 );
526 
527 /*****************************************
528  * Global variables for business flow code
529  *****************************************/
530 WMS_BF_RECEIPT             CONSTANT NUMBER := 1;
531 WMS_BF_INSPECTION          CONSTANT NUMBER := 2;
532 WMS_BF_DELIVERY            CONSTANT NUMBER := 3;
533 WMS_BF_PUTAWAY_DROP        CONSTANT NUMBER := 4;
534 WMS_BF_LPN_CORRECTION      CONSTANT NUMBER := 5;
535 WMS_BF_CROSSDOCK           CONSTANT NUMBER := 6;
536 WMS_BF_REPLENISHMENT_DROP  CONSTANT NUMBER := 7;
537 WMS_BF_CYCLE_COUNT         CONSTANT NUMBER := 8;
538 WMS_BF_PHYSICAL_COUNT      CONSTANT NUMBER := 9;
539 WMS_BF_MAT_STATUS_UPD      CONSTANT NUMBER := 10;
540 WMS_BF_COST_GROUP_UPD      CONSTANT NUMBER := 11;
541 WMS_BF_LOT_SPLIT_MERGE     CONSTANT NUMBER := 12;
542 WMS_BF_MISC_RECEIPT        CONSTANT NUMBER := 13;
543 WMS_BF_ORG_TRANSFER        CONSTANT NUMBER := 14;
544 WMS_BF_SUB_TRANSFER        CONSTANT NUMBER := 15;
545 WMS_BF_LPN_GENERATION      CONSTANT NUMBER := 16;
546 WMS_BF_SN_GENERATION       CONSTANT NUMBER := 17;
547 WMS_BF_PICK_LOAD           CONSTANT NUMBER := 18;
548 WMS_BF_PICK_DROP           CONSTANT NUMBER := 19;
549 WMS_BF_PACK_LPN            CONSTANT NUMBER := 20;
550 WMS_BF_SHIP_CONFIRM        CONSTANT NUMBER := 21;
551 WMS_BF_CARTONIZATION       CONSTANT NUMBER := 22;
552 WMS_BF_MISC_ISSUE          CONSTANT NUMBER := 23;
553 WMS_BF_DYNAMIC_LOCATOR     CONSTANT NUMBER := 24;
554 WMS_BF_IMPORT_ASN          CONSTANT NUMBER := 25;
555 WMS_BF_WIP_COMPLETION      CONSTANT NUMBER := 26;
556 WMS_BF_PUTAWAY_PREGEN      CONSTANT NUMBER := 27;
557 WMS_BF_WIP_PICK_LOAD       CONSTANT NUMBER := 28;
558 WMS_BF_WIP_PICK_DROP       CONSTANT NUMBER := 29;
559 WMS_BF_INV_PUTAWAY         CONSTANT NUMBER := 30;
560 WMS_BF_FLOW_LINE_START     CONSTANT NUMBER := 31;
561 WMS_BF_FLOW_LINE_OPERATION CONSTANT NUMBER := 32;
562 WMS_BF_FLOW_WORK_ASSEMBLY  CONSTANT NUMBER := 33;
563 WMS_BF_REPLENISHMENT_LOAD  CONSTANT NUMBER := 34;
564 WMS_BF_WIP_FLOW_PUTAWAY    CONSTANT NUMBER := 35;
565 
566 
567 /*******************************************
568  * Global variables for Date, Time, User
569  *******************************************/
570 G_DATE  VARCHAR2(20);
571 G_TIME  VARCHAR2(20);
572 G_USER  VARCHAR2(100);
573 G_DATE_FORMAT_MASK VARCHAR2(100);
574 
575 /*******************************************
576  * Global variable for Character Set and
577  *  XML encoding
578  *******************************************/
579 G_CHARACTER_SET VARCHAR2(50):= NULL;
580 G_XML_ENCODING  VARCHAR2(50):= NULL;
581 G_DEFAULT_XML_ENCODING CONSTANT VARCHAR2(50) := 'UTF-8';
582 
583 /************************************
584  * Global variable for Profile values
585  ************************************/
586 G_PROFILE_PRINT_MODE NUMBER;
587 G_PROFILE_PREFIX     VARCHAR2(100);
588 G_PROFILE_OUT_DIR    VARCHAR2(200);
589 -- Bug #3067059
590 G_PROFILE_GTIN       VARCHAR2(100) := NULL;
591 /***********************************
592  * Global variable for debug profile
593  ***********************************/
594 L_DEBUG NUMBER := 0;
595 
596 
597 /***********************************
598  * Global variable for label status
599  ***********************************/
600 G_SUCCESS VARCHAR2(1) := 'S';
601 G_ERROR VARCHAR2(1) := 'E';
602 G_WARNING VARCHAR2(1) := 'W';
603 --added for lpn status project to get the status of the lpn after the transaction has been commited
604 FUNCTION get_txn_lpn_status
605          (p_lpn_id IN NUMBER,
606           p_transaction_id IN NUMBER,
607           p_organization_id IN NUMBER,
608           p_business_flow IN NUMBER)
609           RETURN VARCHAR2 ;
610 --end of lpn status project
611 
612 END INV_LABEL;