1 PACKAGE RCV_TRANSACTIONS_SV AUTHID CURRENT_USER AS
2 /* $Header: RCVTXTXS.pls 115.3 2004/02/12 02:03:45 pjiang ship $*/
3
4 /*===========================================================================
5 FUNCTION NAME: val_receiving_controls
6
7 DESCRIPTION: Validates the receiving controls for express. There
8 are restrictions for this function since express
9 doesn't validate all controls. Here is a description
10 of what is does. To use this for standard
11 functionality, we'll have to add the quantity
12 tolerances and the ship-to-location and add a parameter
13 for express/standard receiving.
14
15
16 1. Receiving controls are only checked for vendor receipts. Intransit
17 shipments cannot be rejected and we have not way to define org->org
18 receiving controls.
19 2. Controls are only checked if the exception level is 'REJECT'
20 3. Quantity tolerances are not checked. It is not possible to
21 over-receive an express receipt.
22 4. Standard receipts will be created for the ship-to location
23 specified on the PO so the 'enforce ship-to location' control
24 is not tested.
25 5. Routing controls are checked for both Vendor sourced and
26 intransit receipts.
27
28
29
30 PARAMETERS:
31
32 Parameter IN/OUT Datatype Description
33 ------------- ------ ---------- ----------------------------
34 X_transaction_type IN VARCHAR2 What type of transaction are
35 you validating(RECEIPT,TRANSFER,etc)
36 (Used for routing checks)
37 X_auto_transact_code IN VARCHAR2 Same as above except for direct
38 receipts this is set to DELIVER
39 (Also used for routing checks)
40
41 X_expected_receipt_date IN DATE What is the promised/need by date
42 X_transaction_date IN DATE When was this transaction processed
43 X_routing_header_id IN NUMBER What is the routing for this trans
44 1 = Standard Receipt
45 2 = Inspection Required
46 3 = Direct Receipt
47 X_po_line_location_id IN NUMBER What is the ling location to get
48 the receiving controls
49 (Debug: Should all the controls be
50 passed in)
51 X_item_id IN NUMBER What is the item to get the
52 receiving controls
53 X_vendor_id IN NUMBER Vendor Id - same reason as above
54 X_to_organization_id IN NUMBER Receiving org - same reason as above
55
56 RETURN VALUE: Returns whether the values are valid for the receiving
57 controls
58
59 DESIGN REFERENCES:
60
61 ALGORITHM:
62
63 NOTES:
64
65 OPEN ISSUES:
66
67 CLOSED ISSUES:
68
69 CHANGE HISTORY:
70 ===========================================================================*/
71 FUNCTION val_receiving_controls (
72 X_transaction_type IN VARCHAR2,
73 X_auto_transact_code IN VARCHAR2,
74 X_expected_receipt_date IN DATE,
75 X_transaction_date IN DATE,
76 X_routing_header_id IN NUMBER,
77 X_po_line_location_id IN NUMBER,
78 X_item_id IN NUMBER,
79 X_vendor_id IN NUMBER,
80 X_to_organization_id IN NUMBER)
81 RETURN NUMBER;
82
83 /*===========================================================================
84 FUNCTION NAME: val_wip_info
85
86 DESCRIPTION: Check that the required info for shop floor
87 destinations are present: the
88 job, the op seq num, the reource seq num, the
89 repetive schedule and the wip line
90
91 PARAMETERS:
92
93 Parameter IN/OUT Datatype Description
94 ------------- ------ ---------- ----------------------------
95 X_to_organization_id IN NUMBER Receiving Org
96 X_wip_entity_id IN NUMBER Wip Entity
97 X_wip_operation_seq_num IN NUMBER Wip Oper Sequence Number
98 X_wip_resource_seq_num IN NUMBER Wip Resrc Sequence Number
99 X_wip_line_id IN NUMBER Wip Line
100 X_wip_repetitive_schedule_id IN NUMBER Wip Repetitve Schedule Id
101 p_po_line_id IN NUMBER PO Line Id -- bug 2619164
102
103
104 RETURN VALUE: Returns whether the values are valid
105
106 DESIGN REFERENCES:
107
108 ALGORITHM:
109
110 NOTES:
111
112 OPEN ISSUES:
113
114 CLOSED ISSUES:
115
116 CHANGE HISTORY:
117 ===========================================================================*/
118 FUNCTION val_wip_info (
119 X_to_organization_id IN NUMBER,
120 X_wip_entity_id IN NUMBER,
121 X_wip_operation_seq_num IN NUMBER,
122 X_wip_resource_seq_num IN NUMBER,
123 X_wip_line_id IN NUMBER,
124 X_wip_repetitive_schedule_id IN NUMBER,
125 p_po_line_id IN NUMBER) -- bug 2619164
126 RETURN NUMBER;
127
128 /*===========================================================================
129 PROCEDURE NAME: val_if_inventory_destination
130
131 DESCRIPTION: Check to see if any of the distributions are of
132 type inventory. This is used to tell us if we need
133 to check for item rev control for an item. If there
134 are no inventory destinations then you don't care
135 about the item rev if it's not specified.
136
137 PARAMETERS: X_line_location_id IN NUMBER
138 X_shipment_line_id IN NUMBER
139
140 DESIGN REFERENCES: RCVRCERC.dd
141 RCVTXERT.dd
142
143 ALGORITHM:
144
145 NOTES:
146
147 OPEN ISSUES:
148
149 CLOSED ISSUES:
150
151 CHANGE HISTORY:
152
153 ===========================================================================*/
154 FUNCTION val_if_inventory_destination (
155 X_line_location_id IN NUMBER,
156 X_shipment_line_id IN NUMBER)
157 RETURN BOOLEAN;
158
159 /*===========================================================================
160 PROCEDURE NAME: val_deliver_destination
161
162 DESCRIPTION: Ensure that all mandatory columns for each
163 destination type are populated. If a mandatory
164 column is not specified, the transaction
165 cannot be processed via express.
166 The exceptions are subinventory and locator.
167 If a sub is provided it will be used otherwise
168 the default receiving subinventory will
169 be used (if available). Locator control is
170 evaluated if a sub is provided or defaulted
171 and if locator control is required, the default
172 locator for the sub will be used.
173
174 PARAMETERS: X_to_organization_id IN NUMBER
175 X_item_id IN NUMBER
176 X_destination_type_code IN VARCHAR2
177 X_deliver_to_location_id IN NUMBER
178 X_subinventory IN VARCHAR2
179
180 DESIGN REFERENCES: RCVRCERC.dd
181 RCVTXERT.dd
182
183 ALGORITHM:
184
185 NOTES:
186
187 OPEN ISSUES:
188
189 CLOSED ISSUES:
190
191 CHANGE HISTORY:
192
193 ===========================================================================*/
194 FUNCTION val_deliver_destination (
195 X_to_organization_id IN NUMBER,
196 X_item_id IN NUMBER,
197 X_destination_type_code IN VARCHAR2,
198 X_deliver_to_location_id IN NUMBER,
199 X_subinventory IN VARCHAR2)
200 RETURN NUMBER;
201
202 /*===========================================================================
203
204 PROCEDURE NAME: val_destination_info
205
206 /*===========================================================================
207 PROCEDURE NAME: val_deliver_destination
208
209 DESCRIPTION:
210
211 Ensure that all destination information is still valid at the time of
212 receipt. A po can be created with a ship to location or a deliver to
213 location that could become invalid by the time the receipt is entered.
214 To ensure that the lov's for one of these fields does not come up
215 because the item is not in the valid list, we will not populate the
216 column if it is disabled
217
218
219 PARAMETERS: X_to_organization_id IN NUMBER
220 X_item_id IN NUMBER
221 X_ship_to_location_id IN NUMBER
222 X_deliver_to_location_id IN NUMBER
223 X_deliver_to_person_id IN NUMBER
224 X_subinventory IN VARCHAR2
225 X_valid_ship_to_location OUT BOOLEAN
226 X_valid_deliver_to_location OUT BOOLEAN
227 X_valid_deliver_to_person OUT BOOLEAN
228 X_valid_subinventory OUT BOOLEAN
229
230
231 DESIGN REFERENCES: RCVRCERC.dd
232 RCVTXERT.dd
233
234 ALGORITHM:
235
236 NOTES:
237
238 OPEN ISSUES:
239
240 CLOSED ISSUES:
241
242 CHANGE HISTORY:
243
244 ===========================================================================*/
245
246 PROCEDURE val_destination_info (
247 X_to_organization_id IN NUMBER,
248 X_item_id IN NUMBER,
249 X_ship_to_location_id IN NUMBER,
250 X_deliver_to_location_id IN NUMBER,
251 X_deliver_to_person_id IN NUMBER,
252 X_subinventory IN VARCHAR2,
253 X_valid_ship_to_location OUT NOCOPY BOOLEAN,
254 X_valid_deliver_to_location OUT NOCOPY BOOLEAN,
255 X_valid_deliver_to_person OUT NOCOPY BOOLEAN,
256 X_valid_subinventory OUT NOCOPY BOOLEAN);
257
258 /*===========================================================================
259 FUNCTION NAME: val_pending_receipt_trx
260
261 DESCRIPTION: If there are any receipt supply rows that have
262 not been delivered and this line location has
263 multiple distributions then it cannot be
264 transacted since you don't know how the user
265 will distribute that quantity
266
267 PARAMETERS: X_po_line_location_id IN NUMBER
268 X_group_id IN NUMBER
269
270 DESIGN REFERENCES: RCVRCERC.dd
271 RCVTXERT.dd
272
273 ALGORITHM:
274
275 NOTES:
276
277 OPEN ISSUES:
278
279 CLOSED ISSUES:
280
281 CHANGE HISTORY:
282
283 ===========================================================================*/
284 FUNCTION val_pending_receipt_trx (
285 X_po_line_location_id IN NUMBER,
286 X_group_id IN NUMBER)
287 RETURN BOOLEAN;
288
289 /*===========================================================================
290
291 PROCEDURE NAME: get_wip_info
292
293 DESCRIPTION: Goes out and gets the wip information related to
294 a po line.
295
296 PARAMETERS:
297
298 X_wip_entity_id IN NUMBER
299 X_wip_repetitive_schedule_id IN NUMBER
300 X_wip_line_id IN NUMBER
301 X_wip_operation_seq_num IN NUMBER
302 X_wip_resource_seq_num IN NUMBER
303 X_to_organization_id IN NUMBER
304 X_job IN OUT VARCHAR2
305 X_line_num IN OUT VARCHAR2
306 X_sequence IN OUT NUMBER
307 X_department IN OUT VARCHAR2
308
309 DESIGN REFERENCES: RCVRCERC.dd
310 RCVTXERT.dd
311
312 ALGORITHM:
313
314 NOTES:
315
316 OPEN ISSUES:
317
318 CLOSED ISSUES:
319
320 CHANGE HISTORY:
321 FUNCTION NAME: get_wip_info
322
323 ===========================================================================*/
324 /*
325 ** Go get the outside processing information for a given receipt line
326 */
327
328 PROCEDURE get_wip_info
329 (X_wip_entity_id IN NUMBER,
330 X_wip_repetitive_schedule_id IN NUMBER,
331 X_wip_line_id IN NUMBER,
332 X_wip_operation_seq_num IN NUMBER,
333 X_wip_resource_seq_num IN NUMBER,
334 X_to_organization_id IN NUMBER,
335 X_job IN OUT NOCOPY VARCHAR2,
336 X_line_num IN OUT NOCOPY VARCHAR2,
337 X_sequence IN OUT NOCOPY NUMBER,
338 X_department IN OUT NOCOPY VARCHAR2);
339
340 /*===========================================================================
341
342 PROCEDURE NAME: get_rma_dest_info
343
344 DESCRIPTION: Go get the destination information for a given RMA line
345
346 PARAMETERS:
347
348 x_oe_order_header_id IN NUMBER,
349 x_oe_order_line_id IN NUMBER,
350 x_item_id IN NUMBER,
351 x_deliver_to_sub IN OUT NOCOPY VARCHAR2,
352 x_deliver_to_location_id IN OUT NOCOPY NUMBER,
353 x_deliver_to_location IN OUT NOCOPY VARCHAR2,
354 x_destination_type_dsp IN OUT NOCOPY VARCHAR2,
355 x_destination_type_code IN OUT NOCOPY VARCHAR2,
356 x_to_organization_id IN OUT NOCOPY NUMBER,
357 x_rate IN OUT NOCOPY NUMBER,
358 x_rate_date IN OUT NOCOPY DATE
359
360 DESIGN REFERENCES:
361
362 ALGORITHM:
363
364 NOTES:
365
366 OPEN ISSUES:
367
368 CLOSED ISSUES:
369
370 CHANGE HISTORY:
371
372 ===========================================================================*/
373 /*
374 ** Go get the destination information for a given RMA line
375 */
376
377 PROCEDURE get_rma_dest_info
378 (x_oe_order_header_id IN NUMBER,
379 x_oe_order_line_id IN NUMBER,
380 x_item_id IN NUMBER,
381 x_deliver_to_sub IN OUT NOCOPY VARCHAR2,
382 x_deliver_to_location_id IN OUT NOCOPY NUMBER,
383 x_deliver_to_location IN OUT NOCOPY VARCHAR2,
384 x_destination_type_dsp IN OUT NOCOPY VARCHAR2,
385 x_destination_type_code IN OUT NOCOPY VARCHAR2,
386 x_to_organization_id IN OUT NOCOPY NUMBER,
387 x_rate IN OUT NOCOPY NUMBER,
388 x_rate_date IN OUT NOCOPY DATE);
389
390 END RCV_TRANSACTIONS_SV;