DBA Data[Home] [Help]

PACKAGE: APPS.GME_TRANSACTIONS_PVT

Source


1 PACKAGE gme_transactions_pvt AUTHID CURRENT_USER AS
2 /*  $Header: GMEVPTXS.pls 120.21.12020000.2 2012/07/26 15:41:50 gmurator ship $ */
3    /* Bug 5903208 Added PL/SQL table to store values */
4    TYPE p_qty_rec IS RECORD (doc_qty NUMBER);
5    TYPE p_qty_tab IS TABLE OF p_qty_rec INDEX BY VARCHAR2(100);
6    p_qty_tbl p_qty_tab;
7 
8    /* +==========================================================================+
9    | PROCEDURE NAME
10    |   create_material_txn
11    |
12    | USAGE
13    |    Inserts the transaction to interface table and moves to temp when
14    |    called from forms.
15    |
16    | ARGUMENTS
17    |   p_mmti_rec -- mtl_transaction_interface rowtype
18    |   p_mmli_tbl -- table of mtl_transaction_lots_inumber_tbl as input
19    |
20    | RETURNS
21    |   returns via x_status OUT parameters
22    |
23    | HISTORY
24    |   Created  02-Feb-05 Pawan Kumar
25    |
26    +==========================================================================+ */
27    PROCEDURE create_material_txn (
28       p_mmti_rec        IN              mtl_transactions_interface%ROWTYPE
29      ,p_mmli_tbl        IN              gme_common_pvt.mtl_trans_lots_inter_tbl
30      ,p_phantom_trans   IN              NUMBER DEFAULT 0
31      ,x_return_status   OUT NOCOPY      VARCHAR2);
32 
33     /* +==========================================================================+
34    | PROCEDURE NAME
35    |   update_material_txn
36    |
37    | USAGE
38    |    update the transaction in interface table - it deletes all transactions
39    |    of transaction_id passed. Creates new transactions as passed.
40    |
41    | ARGUMENTS
42    |   p_transaction_id - transaction_id from mmt for deletion
43    |   p_mmti_rec -- mtl_transaction_interface rowtype
44    |   p_mmli_tbl -- table of mtl_transaction_lots_inumber_tbl as input
45    |
46    | RETURNS
47    |   returns via x_status OUT parameters
48    |
49    | HISTORY
50    |   Created  02-Feb-05 Pawan Kumar
51    |
52    +==========================================================================+ */
53    PROCEDURE update_material_txn (
54       p_transaction_id   IN              NUMBER
55      ,p_mmti_rec         IN              mtl_transactions_interface%ROWTYPE
56      ,p_mmli_tbl         IN              gme_common_pvt.mtl_trans_lots_inter_tbl
57      ,x_return_status    OUT NOCOPY      VARCHAR2);
58 
59    /* +==========================================================================+
60    | PROCEDURE NAME
61    |   update_material_txn
62    |
63    | USAGE
64    |    update the transaction in interface table - it deletes all transactions
65    |    by getting transaction_id from the mmt record passed. Creates new transactions
66    |    in interface by converting the mmt to mmti.
67    |
68    | ARGUMENTS
69    |   p_mmt_rec -- mtl_material_transaction rowtype
70    |   p_mmln_tbl -- table of mtl_transaction_lots_inumber_tbl as input
71    |
72    | RETURNS
73    |   returns via x_status OUT parameters
74    |
75    | HISTORY
76    |   Created  02-Feb-05 Pawan Kumar
77    |
78    +==========================================================================+ */
79    PROCEDURE update_material_txn (
80       p_mmt_rec         IN              mtl_material_transactions%ROWTYPE
81      ,p_mmln_tbl        IN              gme_common_pvt.mtl_trans_lots_num_tbl
82      ,x_return_status   OUT NOCOPY      VARCHAR2);
83 
84    /* +==========================================================================+
85    | PROCEDURE NAME
86    |   delete_material_txn
87    |
88    | USAGE
89    |    delete all transactions of transaction_id passed by creating reverse transaction.
90    |
91    | ARGUMENTS
92    |   p_transaction_id -- transaction_id from mmt for deletion
93    |
94    |
95    | RETURNS
96    |   returns via x_status OUT parameters
97    |
98    | HISTORY
99    |   Created  02-Feb-05 Pawan Kumar
100    |
101    |   A. Mishra       21-Sep-2009   Bug 8605909
102    |      Added p_trans_date parameter.
103    +==========================================================================+ */
104    PROCEDURE delete_material_txn (
105       p_transaction_id   IN              NUMBER
106      ,p_txns_pair        IN              NUMBER DEFAULT NULL
107      ,p_trans_date       IN              DATE DEFAULT NULL
108      ,x_return_status    OUT NOCOPY      VARCHAR2);
109 
110    /* +==========================================================================+
111    | PROCEDURE NAME
112    |   build_txn_inter
113    |
114    | USAGE
115    |    Inserts the transaction to interface table
116    |
117    | ARGUMENTS
118    |   p_mmti_rec -- mtl_transaction_interface rowtype
119    |   p_mmli_tbl -- table of mtl_trans_lots_inter_tbl as input
120    |
121    | RETURNS
122    |   returns via x_status OUT parameters
123    |
124    | HISTORY
125    |   Created  02-Feb-05 Pawan Kumar
126    |
127    +==========================================================================+ */
128    PROCEDURE build_txn_inter (
129       p_mmti_rec         IN              mtl_transactions_interface%ROWTYPE
130      ,p_mmli_tbl         IN              gme_common_pvt.mtl_trans_lots_inter_tbl
131      ,p_assign_phantom   IN              NUMBER DEFAULT 0
132      ,x_mmti_rec         OUT NOCOPY      mtl_transactions_interface%ROWTYPE
136    /* +==========================================================================+
133      ,x_mmli_tbl         OUT NOCOPY      gme_common_pvt.mtl_trans_lots_inter_tbl
134      ,x_return_status    OUT NOCOPY      VARCHAR2);
135 
137    | PROCEDURE NAME
138    |   build_txn_inter
139    |
140    | USAGE
141    |    Inserts the transaction to interface table
142    |
143    | ARGUMENTS
144    |   p_mmti_rec -- mtl_transaction_interface rowtype
145    |
146    |
147    | RETURNS
148    |   returns via x_status OUT parameters
149    |
150    | HISTORY
151    |   Created  02-Feb-05 Pawan Kumar
152    |
153    +==========================================================================+ */
154   /* Bug 4929610 Added new parameter */
155    PROCEDURE build_txn_inter_hdr (
156       p_mmti_rec         IN              mtl_transactions_interface%ROWTYPE
157      ,p_assign_phantom   IN              NUMBER DEFAULT 0
158      ,x_mmti_rec         OUT NOCOPY      mtl_transactions_interface%ROWTYPE
159      ,x_return_status    OUT NOCOPY      VARCHAR2
160      ,p_insert_hdr       IN              BOOLEAN DEFAULT TRUE);
161 
162    /* +==========================================================================+
163    | PROCEDURE NAME
164    |   build_txn_inter_hdr
165    |
166    | USAGE
167    |    Inserts the transaction to interface table
168    |
169    | ARGUMENTS
170    |  p_mmli_rec -- record of mtl_transaction_lots_interface as input
171    |
172    | RETURNS
173    |   returns via x_status OUT parameters
174    |
175    | HISTORY
176    |   Created  02-Feb-05 Pawan Kumar
177    |   Back Port Bug 6925025 11-Apr-2008 Srinivasulu Puri
178    |    Added parameters subinventory_code and locator_id.
179    |
180    | HISTORY
181    |   Created  02-Feb-05 Pawan Kumar
182    |
183    |   G. Muratore     06-MAY-2011   Bug 12391271
184    |      Added lpn_id parameter.
185    +==========================================================================+ */
186    PROCEDURE build_txn_inter_lot (
187       p_trans_inter_id        IN              NUMBER
188      ,p_transaction_type_id   IN              NUMBER
189      ,p_inventory_item_id     IN              NUMBER
190      ,p_subinventory_code     IN              VARCHAR2
191      ,p_locator_id            IN              NUMBER
192      ,p_lpn_id                IN              NUMBER DEFAULT NULL
193      ,p_mmli_rec              IN              mtl_transaction_lots_interface%ROWTYPE
194      ,x_mmli_rec              OUT NOCOPY      mtl_transaction_lots_interface%ROWTYPE
195      ,x_return_status         OUT NOCOPY      VARCHAR2);
196 
197     /* +==========================================================================+
198    | PROCEDURE NAME
199    |   get_transactions
200    |
201    | USAGE
202    |    Gets all transactions from mmt based on transaction_id passed.
203    |
204    | ARGUMENTS
205    |   p_transaction_id -- transaction_id from mmt for fetch
206    |
207    | RETURNS
208    |
209    |   returns via x_status OUT parameters
210    |   x_mmt_rec -- mtl_transaction_interface rowtype
211    |   x_mmln_tbl -- table of mtl_trans_lots_number_tbl
212    | HISTORY
213    |   Created  02-Feb-05 Pawan Kumar
214    |
215    +==========================================================================+ */
216    PROCEDURE get_transactions (
217       p_transaction_id   IN              NUMBER
218      ,x_mmt_rec          OUT NOCOPY      mtl_material_transactions%ROWTYPE
219      ,x_mmln_tbl         OUT NOCOPY      gme_common_pvt.mtl_trans_lots_num_tbl
220      ,x_return_status    OUT NOCOPY      VARCHAR2);
221 
222     /* +==========================================================================+
223    | PROCEDURE NAME
224    |   construct_mmti
225    |
226    | USAGE
227    |    Construct interface table record based on mmt passed to it.
228    |
229    | ARGUMENTS
230    |   p_mmt_rec -- mtl_material_transaction rowtype
231    |   p_mmln_tbl -- table of mtl_trans_lots_num_tbl as input
232    |
233    | RETURNS
234    |   returns via x_status OUT parameters
235    |               x_mmti_rec mtl_transactions_interface rowtype
236    |               x_mmli_tbl table of mtl_trans_lots_inter_tbl
237    | HISTORY
238    |   Created  02-Feb-05 Pawan Kumar
239    |
240    +==========================================================================+ */
241    PROCEDURE construct_mmti (
242       p_mmt_rec         IN              mtl_material_transactions%ROWTYPE
243      ,p_mmln_tbl        IN              gme_common_pvt.mtl_trans_lots_num_tbl
244      ,x_mmti_rec        OUT NOCOPY      mtl_transactions_interface%ROWTYPE
245      ,x_mmli_tbl        OUT NOCOPY      gme_common_pvt.mtl_trans_lots_inter_tbl
246      ,x_return_status   OUT NOCOPY      VARCHAR2);
247 
248    /* +==========================================================================+
249    | PROCEDURE NAME
250    |   get_mat_trans
251    |
252    | USAGE
253    |    Gets all transactions from mmt based on material_detail_id and batch_id passed.
254    |
255    | ARGUMENTS
256    |   p_mat_det_id -- material_detail_id passed of material
257    |   p_batch_id -- batch_id to which the material belongs.
258    |
259    | RETURNS
260    |   returns via x_status OUT parameters
261    |               x_mmt_tbl- gives back all transactions of the material
262    | HISTORY
263    |   Created  02-Feb-05 Pawan Kumar
264    |
265    |
266    |  G. Muratore     19-MAR-2010   Bug 8751983
267    |     Added p_order_by parameter to allow fetching of transactions in reverse trans order.
268    +==========================================================================+ */
269    PROCEDURE get_mat_trans (
270       p_mat_det_id      IN              NUMBER
271      ,p_batch_id        IN              NUMBER
272      ,p_phantom_line_id IN              NUMBER DEFAULT NULL
273      ,p_order_by        IN              NUMBER DEFAULT 1
274      ,x_mmt_tbl         OUT NOCOPY      gme_common_pvt.mtl_mat_tran_tbl
275      ,x_return_status   OUT NOCOPY      VARCHAR2);
276 
277     /* +==========================================================================+
278    | PROCEDURE NAME
279    |   get_lot_trans
280    |
281    | USAGE
282    |    Gets all lot transactions from mmln for a given transaction_id.
283    |
284    | ARGUMENTS
285    |   p_transaction_id --  transaction_id for which all lot info is required.
286    |
287    | RETURNS
288    |   returns via x_status OUT parameters
289    |                x_mmln_tbl- all lot info for a given transaction_id.
290    | HISTORY
291    |   Created  02-Feb-05 Pawan Kumar
292    |
293    +==========================================================================+ */
294    PROCEDURE get_lot_trans (
295       p_transaction_id   IN              NUMBER
296      ,x_mmln_tbl         OUT NOCOPY      gme_common_pvt.mtl_trans_lots_num_tbl
297      ,x_return_status    OUT NOCOPY      VARCHAR2);
298 
299 /* +==========================================================================+
300 | PROCEDURE NAME
301 |   GME_PRE_PROCESS
302 |
303 | USAGE
304 |    Gets all pre-process validations based on header_id
305 |
306 | ARGUMENTS
307 |   p_transaction_hdr_id
308 |
309 |
310 | RETURNS
311 |   returns via x_status OUT parameters
312 |
313 | HISTORY
314 |   Created  02-Feb-05 Pawan Kumar
315 |
316 +==========================================================================+ */
317    PROCEDURE gme_pre_process (
318       p_transaction_hdr_id   IN              NUMBER
319      ,x_return_status        OUT NOCOPY      VARCHAR2);
320 
321    /* +==========================================================================+
322    | PROCEDURE NAME
323    |   get_returnable_qty
324    |
325    | USAGE
326    |    Gets net quantity that can be returned from mmt based on the details passed
327    |
328    | ARGUMENTS
329    |   p_mmti_rec -- mtl_transaction_interface rowtype
330    |   p_lot_number - Lot number
331    |   p_lot_control - 1 for plain 2 for lot control
332    | RETURNS
333    |   x_return_status S for success, U for unexpected
334    |   x_available_qty  Quantity that can be returned.
335    | HISTORY
336    |   Created  20-Sep-05 Shrikant Nene
337    |
338    +==========================================================================+ */
339    PROCEDURE get_returnable_qty (
340       p_mmti_rec                IN          mtl_transactions_interface%ROWTYPE,
341       p_lot_number              IN          VARCHAR2,
342       p_lot_control             IN          NUMBER,
343       x_available_qty           OUT NOCOPY  NUMBER,
344       x_return_status           OUT NOCOPY  VARCHAR2);
345 
346     /* +==========================================================================+
347    | PROCEDURE NAME
348    |   PRE_PROCESS_VAL
349    |
350    | USAGE
351    |    validations for individual transactions
352    |
353    | ARGUMENTS
354    |   p_mmti_rec -- mtl_transaction_interface rowtype
355    |
356    |
357    | RETURNS
358    |   returns via x_status OUT parameters
359    |
360    | HISTORY
361    |   Created  02-Feb-05 Pawan Kumar
362    |
363    +==========================================================================+ */
364    PROCEDURE pre_process_val (
365       p_transaction_interface_id   IN              NUMBER
366      ,x_return_status              OUT NOCOPY      VARCHAR2);
367 
368 /* +==========================================================================+
369 | PROCEDURE NAME
370 |   gme_txn_message
371 |
372 | USAGE
373 |    validations for individual transactions
374 |
375 | ARGUMENTS
376 |   p_mmti_rec -- mtl_transaction_interface rowtype
377 |
378 |
379 | RETURNS
380 |   returns via x_status OUT parameters
381 |
382 | HISTORY
383 |   Created  02-Feb-05 Pawan Kumar
384 |
385 +==========================================================================+ */
386    PROCEDURE gme_txn_message (
387       p_api_name                   IN              VARCHAR2
388      ,p_transaction_interface_id   IN              VARCHAR2);
389 
390     /* +==========================================================================+
391    | PROCEDURE NAME
392    |   gme_post_process
393    |
394    | USAGE
395    |
396    |
397    | ARGUMENTS
398    |   p_transaction_id
399    |
400    |
401    | RETURNS
402    |   returns via x_status OUT parameters
403    |
404    | HISTORY
405    |   Created  02-Feb-05 Pawan Kumar
406    |
407    +==========================================================================+ */
408    PROCEDURE gme_post_process (
409       p_transaction_id   IN              NUMBER
410      ,x_return_status    OUT NOCOPY      VARCHAR2);
411 
412 /* +==========================================================================+
413 | PROCEDURE NAME
414 |    purge_trans_pairs
415 |
416 | USAGE
417 |
418 |
419 | ARGUMENTS
420 |   p_batch_id
421 |   p_material_detail_id
422 |
423 | RETURNS
424 |   returns via x_status OUT parameters
425 |
426 | HISTORY
427 |   Created  02-Feb-05 Pawan Kumar
428 |
429 +==========================================================================+ */
430    PROCEDURE purge_trans_pairs (
431       p_batch_id             IN              NUMBER
432      ,p_material_detail_id   IN              NUMBER DEFAULT NULL
433      ,x_return_status        OUT NOCOPY      VARCHAR2);
434 
435    /* +==========================================================================+
436      | PROCEDURE NAME
437      |   Process_transactions
438      |
439      | USAGE
440      |   This is the interface procedure to the Inventory Transaction
441      |   Manager to validate and process a batch of material transaction
442      |   interface records
443      |
444      | ARGUMENTS
445      |   p_api_version API Version of this procedure. Current version is 1.0
446      |   p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not                  |
447      |   p_commit Indicates whether to commit the changes after successful processing
448      |   p_validation_level Indicates whether or not to perform a full validation
449      |   x_return_status Returns the status to indicate success or failure of execution
450      |   x_msg_count Returns number of error message in the error message stack in case of failure
451      |   x_msg_data Returns the error message in case of failure
452      |   x_trans_count The count of material transaction interface records processed.
453      |   p_table Source of transaction records with value 1 of material transaction interface table and value 2 of material transaction temp table
454      |   p_header_id Transaction header id (If not passed in then call gme_common_pvt.get_txn_header_id to populate
455      |
456      | RETURNS
457      |   returns via x_ OUT parameters
458      |
459      | HISTORY
460      |   Created  07-Mar-05 Jalaj Srivastava
461      |
462      +==========================================================================+ */
463    /* Bug 5255959 added p_clear_qty_cache parameter */
464    PROCEDURE process_transactions (
465       p_api_version        IN              NUMBER := 1
466      ,p_init_msg_list      IN              VARCHAR2 := fnd_api.g_false
467      ,p_commit             IN              VARCHAR2 := fnd_api.g_false
468      ,p_validation_level   IN              NUMBER
469             := fnd_api.g_valid_level_full
470      ,p_table              IN              NUMBER := 2
471      ,p_header_id          IN              NUMBER
472             := gme_common_pvt.get_txn_header_id
473      ,x_return_status      OUT NOCOPY      VARCHAR2
474      ,x_msg_count          OUT NOCOPY      NUMBER
475      ,x_msg_data           OUT NOCOPY      VARCHAR2
476      ,x_trans_count        OUT NOCOPY      NUMBER
477      --Bug#5584699 Changed the datatype from boolean to varchar2.
478      ,p_clear_qty_cache    IN              VARCHAR2 := fnd_api.g_true);
479      --,p_clear_qty_cache    IN              BOOLEAN DEFAULT TRUE);
480 
481    /* +==========================================================================+
482       | PROCEDURE NAME
483       |   query_quantities
484       |
485       | USAGE
486       |    Query quantities at a level specified by the input
487       |
488       | ARGUMENTS
489       |   p_api_version API Version of this procedure. Current version is 1.0
490       |   p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not                  |
491       |   x_return_status Returns the status to indicate success or failure of execution
492       |   x_msg_count Returns number of error message in the error message stack in case of failure
493       |   x_msg_data Returns the error message in case of failure
494       |
495       | RETURNS
496       |   returns via x_ OUT parameters
497       |
498       | HISTORY
499       |   Created  07-Mar-05 Jalaj Srivastava
500       |
501       +==========================================================================+ */
502    PROCEDURE query_quantities (
503       p_api_version_number           IN              NUMBER := 1
504      ,p_init_msg_lst                 IN              VARCHAR2
505             DEFAULT fnd_api.g_false
506      ,x_return_status                OUT NOCOPY      VARCHAR2
507      ,x_msg_count                    OUT NOCOPY      NUMBER
508      ,x_msg_data                     OUT NOCOPY      VARCHAR2
509      ,p_organization_id              IN              NUMBER
510      ,p_inventory_item_id            IN              NUMBER
511      ,p_tree_mode                    IN              INTEGER
512      ,p_is_serial_control            IN              BOOLEAN DEFAULT FALSE
513      ,p_grade_code                   IN              VARCHAR2
514      ,p_demand_source_type_id        IN              NUMBER
515             DEFAULT gme_common_pvt.g_txn_source_type
516      ,p_demand_source_header_id      IN              NUMBER DEFAULT -9999
517      ,p_demand_source_line_id        IN              NUMBER DEFAULT -9999
518      ,p_demand_source_name           IN              VARCHAR2 DEFAULT NULL
519      ,p_lot_expiration_date          IN              DATE DEFAULT NULL
520      ,p_revision                     IN              VARCHAR2
521      ,p_lot_number                   IN              VARCHAR2
522      ,p_subinventory_code            IN              VARCHAR2
523      ,p_locator_id                   IN              NUMBER
524      ,p_onhand_source                IN              NUMBER
525             DEFAULT inv_quantity_tree_pvt.g_all_subs
526      ,x_qoh                          OUT NOCOPY      NUMBER
530      ,x_att                          OUT NOCOPY      NUMBER
527      ,x_rqoh                         OUT NOCOPY      NUMBER
528      ,x_qr                           OUT NOCOPY      NUMBER
529      ,x_qs                           OUT NOCOPY      NUMBER
531      ,x_atr                          OUT NOCOPY      NUMBER
532      ,x_sqoh                         OUT NOCOPY      NUMBER
533      ,x_srqoh                        OUT NOCOPY      NUMBER
534      ,x_sqr                          OUT NOCOPY      NUMBER
535      ,x_sqs                          OUT NOCOPY      NUMBER
536      ,x_satt                         OUT NOCOPY      NUMBER
537      ,x_satr                         OUT NOCOPY      NUMBER
538      ,p_transfer_subinventory_code   IN              VARCHAR2 DEFAULT NULL
539      ,p_cost_group_id                IN              NUMBER DEFAULT NULL
540      ,p_lpn_id                       IN              NUMBER DEFAULT NULL
541      ,p_transfer_locator_id          IN              NUMBER DEFAULT NULL);
542 
543    /* +==========================================================================+
544             | PROCEDURE NAME
545             |   update_quantities
546             |
547             | USAGE
548             |    Update quantity at the level specified by the input and
549             |    return the quantities at the level after the update
550             |
551             | ARGUMENTS
552             |   p_api_version API Version of this procedure. Current version is 1.0
553             |   p_init_msg_list fnd_api.g_false or fnd_api.g_true is passed as input to determine whether to Initialize message list or not                  |
554             |   x_return_status Returns the status to indicate success or failure of execution
555             |   x_msg_count Returns number of error message in the error message stack in case of failure
556             |   x_msg_data Returns the error message in case of failure
557             |
558             | RETURNS
559             |   returns via x_ OUT parameters
560             |
561             | HISTORY
562             |   Created  07-Mar-05 Jalaj Srivastava
563             |
564             +==========================================================================+ */
565    PROCEDURE update_quantities (
566       p_api_version_number           IN              NUMBER := 1
567      ,p_init_msg_lst                 IN              VARCHAR2
568             DEFAULT fnd_api.g_false
569      ,x_return_status                OUT NOCOPY      VARCHAR2
570      ,x_msg_count                    OUT NOCOPY      NUMBER
571      ,x_msg_data                     OUT NOCOPY      VARCHAR2
572      ,p_organization_id              IN              NUMBER
573      ,p_inventory_item_id            IN              NUMBER
574      ,p_tree_mode                    IN              INTEGER
575      ,p_is_serial_control            IN              BOOLEAN := FALSE
576      ,p_demand_source_type_id        IN              NUMBER
577             DEFAULT gme_common_pvt.g_txn_source_type
578      ,p_demand_source_header_id      IN              NUMBER DEFAULT -9999
579      ,p_demand_source_line_id        IN              NUMBER DEFAULT -9999
580      ,p_demand_source_name           IN              VARCHAR2 DEFAULT NULL
581      ,p_lot_expiration_date          IN              DATE DEFAULT NULL
582      ,p_revision                     IN              VARCHAR2 DEFAULT NULL
583      ,p_lot_number                   IN              VARCHAR2 DEFAULT NULL
584      ,p_subinventory_code            IN              VARCHAR2 DEFAULT NULL
585      ,p_locator_id                   IN              NUMBER DEFAULT NULL
586      ,p_grade_code                   IN              VARCHAR2 DEFAULT NULL
587      ,p_primary_quantity             IN              NUMBER
588      ,p_quantity_type                IN              INTEGER
589      ,p_secondary_quantity           IN              NUMBER
590      ,p_onhand_source                IN              NUMBER
591             DEFAULT inv_quantity_tree_pvt.g_all_subs
592      ,x_qoh                          OUT NOCOPY      NUMBER
593      ,x_rqoh                         OUT NOCOPY      NUMBER
594      ,x_qr                           OUT NOCOPY      NUMBER
595      ,x_qs                           OUT NOCOPY      NUMBER
596      ,x_att                          OUT NOCOPY      NUMBER
597      ,x_atr                          OUT NOCOPY      NUMBER
598      ,x_sqoh                         OUT NOCOPY      NUMBER
599      ,x_srqoh                        OUT NOCOPY      NUMBER
600      ,x_sqr                          OUT NOCOPY      NUMBER
601      ,x_sqs                          OUT NOCOPY      NUMBER
602      ,x_satt                         OUT NOCOPY      NUMBER
603      ,x_satr                         OUT NOCOPY      NUMBER
604      ,p_transfer_subinventory_code   IN              VARCHAR2 DEFAULT NULL
605      ,p_cost_group_id                IN              NUMBER DEFAULT NULL
606      ,p_containerized                IN              NUMBER
607             DEFAULT inv_quantity_tree_pvt.g_containerized_false
608      ,p_lpn_id                       IN              NUMBER DEFAULT NULL
609      ,p_transfer_locator_id          IN              NUMBER DEFAULT NULL);
610 
611   /* Bug 4929610 Added function */
612   FUNCTION is_lot_expired (p_organization_id   IN NUMBER,
613                            p_inventory_item_id IN NUMBER,
614                            p_lot_number        IN VARCHAR2,
615                            p_date              IN DATE) RETURN BOOLEAN;
616   PROCEDURE insert_txn_inter_hdr(p_mmti_rec      IN  mtl_transactions_interface%ROWTYPE,
617                                  x_return_status OUT NOCOPY VARCHAR2);
618 -- nsinghi Bug5176319. Added the proc.
619    /* +==========================================================================+
620    | PROCEDURE NAME
621    |   get_mmt_transactions
622    |
623    | USAGE
624    |    Gets all transactions from mmt based on transaction_id passed. Unlike get_transactions,
625    |    this procedure does not check for enteries in gme_transaction_pairs
626    |
627    | ARGUMENTS
628    |   p_transaction_id -- transaction_id from mmt for fetch
629    |
630    | RETURNS
631    |
632    |   returns via x_status OUT parameters
633    |   x_mmt_rec -- mtl_material_transactions rowtype
634    |   x_mmln_tbl -- table of mtl_trans_lots_number_tbl
635    | HISTORY
636    |   Created  19-Jun-06 Namit S. Created
637    |
638    +==========================================================================+ */
639 
640   PROCEDURE get_mmt_transactions (
641       p_transaction_id   IN              NUMBER
642      ,x_mmt_rec          OUT NOCOPY      mtl_material_transactions%ROWTYPE
643      ,x_mmln_tbl         OUT NOCOPY      gme_common_pvt.mtl_trans_lots_num_tbl
644      ,x_return_status    OUT NOCOPY      VARCHAR2);
645 
646   /* Bug 5358129 Added procedure */
647   PROCEDURE validate_lot_for_ing(p_organization_id   IN NUMBER,
648                                  p_inventory_item_id IN NUMBER,
649                                  p_lot_number        IN VARCHAR2,
650                                  x_return_status     OUT NOCOPY VARCHAR2);
651   /* Added for bug 5597385 */
652   PROCEDURE gmo_pre_process_val(p_mmti_rec      IN  mtl_transactions_interface%ROWTYPE,
653                                 p_mmli_tbl      IN  gme_common_pvt.mtl_trans_lots_inter_tbl,
654                                 p_mode          IN VARCHAR2,
655                                 x_return_status OUT NOCOPY VARCHAR2);
656 
657  /* +==========================================================================+
658    | PROCEDURE NAME
659    |   check_lpn_subinv_loc(
660    |
661    | USAGE
662    |    Checks if the current LPN subinv and Locator are same as the input values
663    |
664    | ARGUMENTS
665    |   p_lpn_id     -- LPN Id
666    |   p_in_subinv  -- Subinv Code
667    |   p_in_locid   -- Locator Id
668    |
669    |
670    | RETURNS
671    |   returns a Boolean status. True if the subinv and locator info match otherwise false
672    |   x_out_subinv  The current Subinv for the LPN
673    |   x_out_locId   The current locator id for the LPN
674    |   x_context     The LPN context
675    |
676    | HISTORY
677    |   Created  06-Sep-2011 Apeksha Mishra
678    |
679    +==========================================================================+ */
680    FUNCTION check_lpn_subinv_loc(p_lpn_id     IN NUMBER,
681                                  p_in_subinv  IN VARCHAR2 default NULL,
682                                  p_in_locid   IN NUMBER default NULL,
683                                  x_out_subinv OUT NOCOPY VARCHAR2 ,
684                                  x_out_locId  OUT NOCOPY VARCHAR2,
685                                  x_out_lpnno  OUT NOCOPY VARCHAR2,
686                                  x_context    OUT NOCOPY NUMBER) RETURN BOOLEAN;
687 END gme_transactions_pvt;
688