1 PACKAGE RCV_QUANTITIES_S AUTHID CURRENT_USER AS
2 /* $Header: RCVTXQUS.pls 115.6 2003/11/04 00:39:08 pparthas ship $*/
3
4 /*===========================================================================
5 PROCEDURE NAME: get_available_quantity()
6
7 DESCRIPTION:
8 This procedure returns the available quantity to transact for each
9 Receiving transaction in the parent transactions unit of measure.
10
11 PARAMETERS:
12 Name Mode Type Required Value Default
13
14 p_transaction_type IN VARCHAR2 Yes RECEIVE, MATCH, TRANSFER
15 INSPECT, DELIVER, CORRECT,
16 RETURN TO VENDOR,
17 RETURN TO RECEIVING,
18 DIRECT RECEIPT,
19 STANDARD DELIVER N/A
20
21 p_parent_id IN NUMBER Yes line_location_id or
22 shipment_line_id or
23 transaction_id or
24 po_distribution_id N/A
25
26 p_receipt_source_code IN VARCHAR2 No VENDOR or INVENTORY or
27 INTERNAL ORDER NULL
28
29 p_parent_transaction_type IN VARCHAR2 No UNORDERED, RECEIVE, MATCH,
30 TRANSFER, ACCEPT, REJECT,
31 DELIVER, RETURN TO VENDOR NULL
32
33 p_grand_parent_id IN NUMBER No line_location_id or
34 shipment_line_id or
35 transaction_id 0
36
37 p_correction_type IN VARCHAR2 No NEGATIVE or POSITIVE NEGATIVE
38
39 p_available_quantity IN OUT NOCOPY NUMBER Yes N/A
40
41 p_tolerable_quantity IN OUT NOCOPY NUMBER Yes N/A
42
43 p_unit_of_measure IN OUT NOCOPY VARCHAR2 Yes N/A
44
45 DESIGN REFERENCES: RCVTXECO.dd
46
47 ALGORITHM:
48
49 NOTES:
50
51 The following is a list of transaction types and the arguments that must
52 be passed in order to use this function.
53
54 1. RECEIVE or MATCH :
55 p_transaction_type RECEIVE or MATCH
56 p_parent_id line_location_id or shipment_line_id depending
57 on Vendor receipt or Internal receipt.
58 p_receipt_source_code VENDOR or INVENTORY or INTERNAL ORDER
59 p_available_quantity Output parameter
60 p_tolerable_quantity Output parameter only needed for Vendor receipt
61 Returned value is null otherwise
62 p_unit_of_measure Output parameter
63
64 2. TRANSFER or INSPECT or DELIVER
65 p_transaction_type TRANSFER or INSPECT or DELIVER
66 p_parent_id transaction id of the parent transaction
67 p_available_quantity Output parameter
68 p_tolerable_quantity Output Parameter - Return value is null
69 p_unit_of_measure Output parameter
70
71 3. RETURN TO VENDOR or RETURN TO RECEIVING or CORRECT (negative only)
72 p_transaction_type RETURN TO VENDOR or RETURN TO RECEIVING or
73 CORRECT
74 p_parent_id transaction id of the parent transaction
75 p_parent_transaction_type UNORDERED or RECEIVE or MATCH or TRANSFER or
76 ACCEPT or REJECT or DELIVER or RETURN TO VENDOR
77 p_correction_type NEGATIVE
78 p_available_quantity Output parameter
79 p_tolerable_quantity Output Parameter - Return value is null
80 p_unit_of_measure Output parameter
81
82 4. CORRECT (positive only)
83 p_transaction_type CORRECT
84 p_parent_id transaction id of the parent transaction
85 p_receipt_source_code VENDOR or INVENTORY or INTERNAL ORDER
86 p_parent_transaction_type RECEIVE or MATCH or TRANSFER or
87 ACCEPT or REJECT or DELIVER or RETURN TO VENDOR
88 p_grand_parent_id transaction id of the grand parent transaction
89 or line_location_id for corrections against
90 Vendor RECEIVE or MATCH
91 or shipment_line_id for corrections against
92 Internal RECEIVE
93 p_correction_type POSITIVE
94 p_available_quantity Output parameter
95 p_tolerable_quantity Output parameter required for corrections
96 against Vendor Receipts or Match transactions.
97 Return value is null otherwise
98 p_unit_of_measure Output parameter
99
100 5. DIRECT RECEIPT (to be called from the Enter Receipts form)
101 p_transaction_type DIRECT RECEIPT
102 p_parent_id po_distribution_id
103 p_available_quantity Output parameter
104 p_unit_of_measure Output parameter
105
106 6. STANDARD DELIVER (to be called from the Receiving Transactions form)
107 p_transaction_type STANDARD DELIVER
108 p_parent_id po_distribution_id
109 p_grand_parent_id rcv_transaction_id
110 p_available_quantity Output parameter
111 p_unit_of_measure Output parameter
112
113 OPEN ISSUES:
114
115 CLOSED ISSUES:
116
117 CHANGE HISTORY:
118
119 Please fix both the get_available_quantity procedures since this is overloaded.
120 ===========================================================================*/
121 PROCEDURE get_available_quantity(p_transaction_type IN VARCHAR2,
122 p_parent_id IN NUMBER,
123 p_receipt_source_code IN VARCHAR2,
124 p_parent_transaction_type IN VARCHAR2,
125 p_grand_parent_id IN NUMBER,
126 p_correction_type IN VARCHAR2,
127 p_available_quantity IN OUT NOCOPY NUMBER,
128 p_tolerable_quantity IN OUT NOCOPY NUMBER,
129 p_unit_of_measure IN OUT NOCOPY VARCHAR2);
130
131
132 /* ========================================================================
133 This procedure performs the same funciton as the one above
134 It is overloaded for comon receiving project as this is called from
135 POXPOVPO2.pld to calculate quantity_due and in order not to hhave PO library
136 dependednt on a receivcing package this was overloaded.
137 ============================================================================*/
138 PROCEDURE get_available_quantity(p_transaction_type IN VARCHAR2,
139 p_parent_id IN NUMBER,
140 p_receipt_source_code IN VARCHAR2,
141 p_parent_transaction_type IN VARCHAR2,
142 p_grand_parent_id IN NUMBER,
143 p_correction_type IN VARCHAR2,
144 p_available_quantity IN OUT NOCOPY NUMBER,
145 p_tolerable_quantity IN OUT NOCOPY NUMBER,
146 p_unit_of_measure IN OUT NOCOPY VARCHAR2,
147 /*Bug# 1548597 */
148 p_secondary_available_qty IN OUT NOCOPY NUMBER );
149
150 /*===========================================================================
151
152 PROCEDURE NAME: get_available_rma_amount()
153
154 DESCRIPTION:
155 This procedure returns the available amount to transact for each
156 Receiving transaction.
157 ===========================================================================*/
158 PROCEDURE get_available_amount(p_transaction_type IN VARCHAR2,
159 p_parent_id IN NUMBER,
160 p_receipt_source_code IN VARCHAR2,
161 p_parent_transaction_type IN VARCHAR2,
162 p_grand_parent_id IN NUMBER,
163 p_correction_type IN VARCHAR2,
164 p_available_amount IN OUT NOCOPY NUMBER,
165 p_tolerable_amount IN OUT NOCOPY NUMBER);
166
167 /*===========================================================================
168
169 PROCEDURE NAME: get_available_rma_quantity()
170
171 DESCRIPTION:
172 This procedure returns the available quantity to transact for each
173 Receiving transaction in the parent transactions unit of measure for the
174 RMA transactions.
175 ===========================================================================*/
176
177 PROCEDURE get_available_rma_quantity(p_transaction_type IN VARCHAR2,
178 p_parent_id IN NUMBER,
179 p_receipt_source_code IN VARCHAR2,
180 p_parent_transaction_type IN VARCHAR2,
181 p_grand_parent_id IN NUMBER,
182 p_correction_type IN VARCHAR2,
183 p_oe_order_header_id IN NUMBER,
184 p_oe_order_line_id IN NUMBER,
185 p_available_quantity IN OUT NOCOPY NUMBER,
186 p_tolerable_quantity IN OUT NOCOPY NUMBER,
187 p_unit_of_measure IN OUT NOCOPY VARCHAR2,
188 /*Bug# 1548597 */
189 p_secondary_available_qty IN OUT NOCOPY NUMBER );
190
191
192 /*===========================================================================
193 PROCEDURE NAME: val_quantity()
194
195 DESCRIPTION:
196 o VAL - If primary return qty > primary available qty give error
197 RCV_TRX_QTY_EXCEEDS_AVAILABLE
198 PARAMETERS:
199
200 DESIGN REFERENCES: RCVTXECO.dd
201 RCVTXERE.dd
202
203 ALGORITHM:
204
205 NOTES:
206
207 OPEN ISSUES:
208
209 CLOSED ISSUES:
210
211 CHANGE HISTORY:
212 ===========================================================================*/
213
214 PROCEDURE val_quantity;
215
216 /*===========================================================================
217 PROCEDURE NAME: get_primary_qty_uom()
218
219 DESCRIPTION: go get the primary quantity and uom for a given
220 item based on a transaction quantity and uom
221
222 PARAMETERS: X_transaction_qty IN NUMBER,
223 X_transaction_uom IN VARCHAR2,
224 X_item_id IN NUMBER,
225 X_organization_id IN NUMBER,
226 X_primary_qty IN OUT NOCOPY NUMBER,
227 X_primary_uom IN OUT NOCOPY VARCHAR2);
228
229
230 DESIGN REFERENCES:
231
232
233 ALGORITHM:
234
235 NOTES:
236
237 OPEN ISSUES:
238
239 CLOSED ISSUES:
240
241 CHANGE HISTORY:
242 ===========================================================================*/
243 PROCEDURE get_primary_qty_uom (
244 X_transaction_qty IN NUMBER,
245 X_transaction_uom IN VARCHAR2,
246 X_item_id IN NUMBER,
247 X_organization_id IN NUMBER,
248 X_primary_qty IN OUT NOCOPY NUMBER,
249 X_primary_uom IN OUT NOCOPY VARCHAR2);
250
251 /*=========================================================================*/
252 FUNCTION get_pending_qty(p_line_location_id IN NUMBER) RETURN NUMBER;
253
254 /*===========================================================================
255 PROCEDURE NAME: get_ship_qty_in_int()
256 DESCRIPTION: get qty in RTI for a particular PO shipment and ASN shipment
257
258 PARAMETERS: p_shipment_line_id IN NUMBER,
259 p_line_location_id IN NUMBER,
260 p_ship_qty_in_int IN OUT NOCOPY NUMBER
261
262
263 DESIGN REFERENCES:
264
265
266 ALGORITHM:
267
268 NOTES:
269
270 OPEN ISSUES:
271
272 CLOSED ISSUES:
273
274 CHANGE HISTORY:
275 ===========================================================================*/
276 PROCEDURE get_ship_qty_in_int (
277 p_shipment_line_id IN NUMBER,
278 p_line_location_id IN NUMBER,
279 p_ship_qty_in_int IN OUT NOCOPY NUMBER);
280
281
282 /*===========================================================================
283 PROCEDURE NAME: get_available_asn_quantity()
284 DESCRIPTION: get qty in RTI for a particular ASN shipment for
285 Standard and Direct receipts
286 ===========================================================================*/
287
288 PROCEDURE get_available_asn_quantity(
289 p_transaction_type IN VARCHAR2,
290 p_shipment_line_id IN NUMBER,
291 p_line_location_id IN NUMBER,
292 p_distribution_id IN VARCHAR2,
293 x_unit_of_measure IN OUT NOCOPY VARCHAR2, x_available_quantity IN OUT NOCOPY NUMBER,
294 x_tolerable_quantity IN OUT NOCOPY NUMBER,
295 x_secondary_available_qty IN OUT NOCOPY NUMBER);
296 END RCV_QUANTITIES_S;