DBA Data[Home] [Help]

PACKAGE: APPS.INV_QTY_MANAGEMENT

Source


1 PACKAGE INV_QTY_MANAGEMENT AS
2 /* $Header: INVQTYMS.pls 120.1 2005/06/11 12:39:05 appldev  $ */
3 
4 
5 -- Logical Flow
6 -- ------------
7 -- The first time the user enters the txn qty/UOM the current serial and
8 -- lot quantity and the previous transaction quantity are all null.
9 -- If the item is not under lot or serial control, it will allow the user
10 -- to change the txn qty/UOM to anything and set the p_prev_txn_qty equal
11 -- to p_txn_qty and set the p_total_lot_qty, p_total_serial_qty
12 -- to zero.
13 -- If the item is lot controlled, it will not allow the user to enter the
14 -- transaction quantity which is more than the current lot quantity.
15 -- If the item is not lot controlled but is serial controlled then the
16 -- transaction qty cannot be less than the current number of serial numbers
17 -- entered. For all comparisons, p_txn_qty would be converted to
18 -- the base UOM using the p_txn_uom.
19 -- if p_txn_qty = p_total_lot_qty then done flag = 'T'
20 --
21    -- p_txn_qty is the current transaction quantity entered. It is both
22    -- because if the quantity is not allowed to change, we should restore
23    -- it back to the previous transaction quantity value stored in
24    -- p_prev_txn_uom.
25    --
26    -- p_txn_uom_code is the UOM CODE for the txn qty and it would
27    -- also be the UOM in which the p_prev_txn_qty is specified.
28    --
29    -- p_txn_unit_of_measure is the UNIT OF MEASURE in which the
30    -- txn qty is specified. It can be null if the p_txn_uom_code is
31    -- not null.
32    --
33    -- p_primary_uom_code is the primary uom for the item. It can be null
34    -- in which case the uom is found from the item and org info provided
35    --
36    -- p_total_lot_qty stores the total number of lot quantity already
37    -- entered in the primary UOM.
38    --
39    -- p_total_serial_qty stores the total number of serial numbers
40    -- specified for the lot number if item is also lot controlled
41    -- otherwise for just serial controlled items, it just stores the
42    -- number of serial numbers specified for the txn qty.
43    --
44    -- x_error_code returns E for error and C for success
45    -- x_error_message returns the message
46 PROCEDURE when_txn_qty_entered(p_txn_qty             IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
47 			       p_txn_uom_code        IN OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
48 			       p_txn_unit_of_measure IN     VARCHAR2,
49 			       p_prev_txn_qty        IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
50 			       p_serial_control_code IN     NUMBER,
51 			       p_lot_control_code    IN     NUMBER,
52 			       p_primary_uom_code    IN OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
53 			       p_organization_id     IN     NUMBER,
54 			       p_inventory_item_id   IN     NUMBER,
55 			       p_total_lot_qty       IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
56 			       p_total_serial_qty    IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
57 			       x_done                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
58 			       x_error_code             OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
59 			       x_error_message          OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
60 			       p_txn_action_id       IN     NUMBER);
61 
62 
63 
64 -- Logical Flow
65 -- ------------
66 -- if the item is not serial controlled, then lot quantity can be allowed
67 -- to change to a value upto the current transaction quantity minus the
68 -- current total lot quantity on the higher side and upto zero  on the
69 -- lower side. Otherwise it will show an error.
70 -- If the item is also serial controlled then the lower limit would change
71 -- to the total serial qty already entered for the item and lot and the
72 -- higher limit remains the same.
73 -- For a non serialized item if the change is successful,
74 -- then the total_lot_qty is incremented by the p_current_lot_qty and
75 -- the prev_lot_qty is updated to the new lot quantity.
76 -- If the item is serial and lot control then the total_lot_qty deos not
77 -- change as it would be incremented when the serial numbers are entered.
78 -- For any errors, the current lot quantity is changed to the previous
79 -- lot quantity.
80 --
81 --
82   -- p_txn_qty current transaction quantity on the UI
83   --
84   -- p_txn_uom_code current transaction UOM
85   --
86   -- p_current_lot_qty current lot quantity on the UI. If it is not correct
87   -- it is updated to the older value otherwise it retains the new value.
88   --
89   -- p_prev_lot_qty previous lot quantity entered stored in the txn UOM
90   --
91   -- p_total_lot_qty stores the number of lots entered into the system
92   -- it is updated as serial numbers are entered for a lot/serial controlled
93   -- item and updated here with the new lot quantity if the item is just
94   -- lot controlled. It is in base UOM
95   --
96   -- p_total_serial_qty is the quantity in the base UOM of the number of
97   -- serial numbers entered on the UI for the current lot. It MUST be reset
98   -- to zero when a new lot is created for proper operation.
99 PROCEDURE when_lot_qty_entered(p_txn_qty             IN     NUMBER,
100 			       p_txn_uom_code        IN     VARCHAR2,
101 			       p_primary_uom_code    IN     VARCHAR2,
102 			       p_inventory_item_id   IN     NUMBER,
103 			       p_lot_control_code    IN     NUMBER,
104 			       p_serial_control_code IN     NUMBER,
105 			       p_current_lot_qty     IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
106 			       p_prev_lot_qty        IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
107 			       p_total_lot_qty       IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
108 			       p_total_serial_qty    IN     NUMBER,
109 			       x_done                IN OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
110 			       x_lot_done               OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
111 			       x_error_code             OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
112 			       x_error_message          OUT NOCOPY /* file.sql.39 change */ VARCHAR2);
113 
114 
115 PROCEDURE when_lot_num_entered(p_total_serial_qty IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
116 			       p_serial_number_control_code IN NUMBER);
117 
118 
119 -- Logical Flow
120 -- ------------
121 -- If the item is not lot controlled then total_serial_qty is incremented
122 -- by the number of serial numbers entered based on the range or individual
123 -- serials entered. p_total_lot_qty is not changed at all.
124 -- If the item is also lot controlled then the p_total_lot_qty is
125 -- incremented by the number of serial numbers entered and so is
126 -- p_total_serial_qty.
127 PROCEDURE when_srl_num_entered(p_txn_qty             IN     NUMBER,
128 			       p_txn_uom_code        IN     VARCHAR2,
129 			       p_primary_uom_code    IN     VARCHAR2,
130 			       p_inventory_item_id   IN     NUMBER,
131 			       p_current_lot_qty     IN     NUMBER,
132 			       p_lot_control_code    IN     NUMBER,
133 			       p_serial_control_code IN     NUMBER,
134 			       p_from_serial         IN     VARCHAR2,
135 			       p_to_serial           IN     VARCHAR2,
136 			       p_total_lot_qty       IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
137 			       p_total_serial_qty    IN OUT NOCOPY /* file.sql.39 change */ NUMBER,
138 			       x_done                   OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
139 			       x_lot_done               OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
140 			       x_error_code             OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
141 			       x_error_message          OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
142 			       p_txn_action_id       IN     NUMBER);
143 
144 
145 
146 END inv_qty_management;