DBA Data[Home] [Help]

PACKAGE: APPS.WSH_DELIVERY_DETAILS_ACTIONS

Source


1 PACKAGE WSH_DELIVERY_DETAILS_ACTIONS as
2 /* $Header: WSHDDACS.pls 120.4.12010000.1 2008/07/29 05:59:24 appldev ship $ */
3 
4 
5   -- for splitting records
6   CURSOR c_split_detail_info(x_delivery_detail_id NUMBER) IS
7     SELECT wdd.delivery_detail_id,
8            wdd.requested_quantity,
9            wdd.picked_quantity,
10            wdd.shipped_quantity,
11            wdd.cycle_count_quantity,
12            wdd.requested_quantity_uom,
13            wdd.requested_quantity2,
14            wdd.picked_quantity2,
15            wdd.shipped_quantity2,
16            wdd.cycle_count_quantity2,
17            wdd.requested_quantity_uom2,
18            wdd.organization_id,
19            wdd.inventory_item_id,
20            wdd.subinventory,
21            wdd.lot_number,
22 -- HW OPMCONV. No need for sublot anymore
23 --         wdd.sublot_number,
24            wdd.locator_id,
25            wdd.source_line_id,
26            wdd.net_weight,
27            wdd.volume,
28            wdd.weight_uom_code,
29            wdd.volume_uom_code,
30            wdd.cancelled_quantity,
31            wdd.cancelled_quantity2,
32            wdd.serial_number,
33            wdd.to_serial_number,
34            wdd.transaction_temp_id,
35            wdd.container_flag,
36            wdd.released_status,
37            wda.delivery_id,
38            wda.parent_delivery_detail_id,
39            -- Bug 2419301
40            wdd.oe_interfaced_flag,
41            wdd.source_line_set_id,   -- anxsharm bug 2181132
42            wdd.received_quantity,   -- J-IB-NPARIKH
43            wdd.received_quantity2,  -- J-IB-NPARIKH
44            wdd.returned_quantity,   -- J-IB-NPARIKH
45            wdd.returned_quantity2,  -- J-IB-NPARIKH
46            nvl(line_direction,'O') line_direction,      -- J-IB-NPARIKH
47            -- J: W/V Changes
48            wdd.gross_weight,
49            NVL(wv_frozen_flag,'Y'),
50            wda.parent_delivery_id,
51            NVL(wda.type, 'S'),
52            replenishment_status     --bug# 6689448 (replenishment project)
53     FROM wsh_delivery_details     wdd,
54          wsh_delivery_assignments wda
55     WHERE wdd.delivery_detail_id = x_delivery_detail_id
56     AND   wda.delivery_detail_id = wdd.delivery_detail_id
57     AND   NVL(wda.type, 'S') in ('S', 'C');
58 
59 
60 TYPE SplitDetailRecType IS RECORD (
61        delivery_detail_id       WSH_DELIVERY_DETAILS.delivery_detail_id%TYPE,
62        requested_quantity       WSH_DELIVERY_DETAILS.requested_quantity%TYPE,
63        picked_quantity          WSH_DELIVERY_DETAILS.picked_quantity%TYPE,
64        shipped_quantity         WSH_DELIVERY_DETAILS.shipped_quantity%TYPE,
65        cycle_count_quantity     WSH_DELIVERY_DETAILS.cycle_count_quantity%TYPE,
66        requested_quantity_uom   WSH_DELIVERY_DETAILS.requested_quantity_uom%TYPE,
67        requested_quantity2      WSH_DELIVERY_DETAILS.requested_quantity2%TYPE,
68        picked_quantity2         WSH_DELIVERY_DETAILS.picked_quantity2%TYPE,
69        shipped_quantity2        WSH_DELIVERY_DETAILS.shipped_quantity2%TYPE,
70        cycle_count_quantity2    WSH_DELIVERY_DETAILS.cycle_count_quantity2%TYPE,
71        requested_quantity_uom2  WSH_DELIVERY_DETAILS.requested_quantity_uom2%TYPE,
72        organization_id          WSH_DELIVERY_DETAILS.organization_id%TYPE,
73        inventory_item_id        WSH_DELIVERY_DETAILS.inventory_item_id%TYPE,
74        subinventory             WSH_DELIVERY_DETAILS.subinventory%TYPE,
75        lot_number               WSH_DELIVERY_DETAILS.lot_number%TYPE,
76 -- HW OPMCONV. No need for sublot anymore
77 --     sublot_number            WSH_DELIVERY_DETAILS.sublot_number%TYPE,
78        locator_id               WSH_DELIVERY_DETAILS.locator_id%TYPE,
79        source_line_id           WSH_DELIVERY_DETAILS.source_line_id%TYPE,
80        net_weight               WSH_DELIVERY_DETAILS.net_weight%TYPE,
81        volume                   WSH_DELIVERY_DETAILS.volume%TYPE,
82        weight_uom_code          WSH_DELIVERY_DETAILS.weight_uom_code%TYPE,
83        volume_uom_code          WSH_DELIVERY_DETAILS.volume_uom_code%TYPE,
84        cancelled_quantity       WSH_DELIVERY_DETAILS.cancelled_quantity%TYPE,
85        cancelled_quantity2      WSH_DELIVERY_DETAILS.cancelled_quantity2%TYPE,
86        serial_number            WSH_DELIVERY_DETAILS.serial_number%TYPE,
87        to_serial_number         WSH_DELIVERY_DETAILS.to_serial_number%TYPE,
88        transaction_temp_id      WSH_DELIVERY_DETAILS.transaction_temp_id%TYPE,
89        container_flag           WSH_DELIVERY_DETAILS.container_flag%TYPE,
90        released_status          WSH_DELIVERY_DETAILS.released_status%TYPE,
91        delivery_id              wsh_delivery_assignments_v.delivery_id%TYPE,
92        parent_delivery_detail_id  wsh_delivery_assignments_v.parent_delivery_detail_id%TYPE,
93        -- Bug 2419301
94        oe_interfaced_flag       WSH_DELIVERY_DETAILS.oe_interfaced_flag%TYPE,
95        -- anxsharm bug 2181132
96        source_line_set_id       WSH_DELIVERY_DETAILS.source_line_set_id%TYPE,
97        received_quantity        WSH_DELIVERY_DETAILS.received_quantity%TYPE,-- J-IB-NPARIKH
98        received_quantity2       WSH_DELIVERY_DETAILS.received_quantity2%TYPE,-- J-IB-NPARIKH
99        returned_quantity        WSH_DELIVERY_DETAILS.returned_quantity%TYPE,-- J-IB-NPARIKH
100        returned_quantity2       WSH_DELIVERY_DETAILS.returned_quantity2%TYPE,-- J-IB-NPARIKH
101        line_direction           WSH_DELIVERY_DETAILS.line_direction%TYPE,-- J-IB-NPARIKH
102        -- J: W/V Changes
103        gross_weight             WSH_DELIVERY_DETAILS.gross_weight%TYPE,
104        wv_frozen_flag           WSH_DELIVERY_DETAILS.wv_frozen_flag%TYPE,
105        parent_delivery_id       WSH_DELIVERY_ASSIGNMENTS_V.parent_delivery_id%TYPE,
106        wda_type                 WSH_DELIVERY_ASSIGNMENTS_V.type%TYPE,
107        replenishment_status     WSH_DELIVERY_DETAILS.replenishment_status%TYPE  --bug# 6689448 (replenishment project)
108 );
109 
110 -- anxsharm
111 -- for Split Serial Number
112 TYPE SerialRecType IS RECORD (
113        serial_number            WSH_DELIVERY_DETAILS.serial_number%TYPE,
114        to_serial_number         WSH_DELIVERY_DETAILS.to_serial_number%TYPE,
115        transaction_temp_id      WSH_DELIVERY_DETAILS.transaction_temp_id%TYPE,
116        delivery_detail_id       WSH_DELIVERY_DETAILS.delivery_detail_id%TYPE);
117 
118 TYPE Serial_tab is TABLE of SerialRecType INDEX BY BINARY_INTEGER;
119 --
120 -- PACKAGE VARIABLES
121 --
122 /** Bug 1571143
123    Instead of Using 2 cursors just use One Cursor with a UNION
124 */
125 --
126 -- LPN CONV. rv
127 --Based on assumption that we are using wsh_delivery_assignments_v,
128 --delivery and its contents will belong to same organization.
129 --Similarly, container and its contents will belong to same organization.
130 --Hence, we are checking for WMS org or non-WMS org. at the parent level (i.e. delivery/container)
131 --rather than at line-level for performance reasons.
132 
133 --If this assumptions were to be violated in anyway
134 -- i.e Query was changed to refer to base table wsh_delivery_assignments instead of
135 --     wsh_delivery_assignments_v
136 -- or
137 --     if existing query were to somehow return/fetch records where
138 --     delivery and its contents may belong to diff. org.
139 --     container and its contents may belong to diff. org.
140 --     then
141 --       Calls to check_wms_org needs to be re-adjusted at
142 --       appropriate level (line/delivery/container).
143 -- LPN CONV. rv
144 --
145 CURSOR C_INSIDE_OUTSIDE_OF_CONTAINER (c_detail_id number) is
146      SELECT delivery_detail_id,
147             parent_delivery_detail_id,
148             delivery_id
149        FROM wsh_delivery_assignments_v
150      START WITH delivery_detail_id = c_detail_id
151      CONNECT BY prior delivery_detail_id = parent_delivery_detail_id
152      UNION
153      SELECT delivery_detail_id,
154             parent_delivery_detail_id,
155             delivery_id
156        FROM wsh_delivery_assignments_v
157      START WITH delivery_detail_id = c_detail_id
158      CONNECT BY prior parent_delivery_detail_id = delivery_detail_id;
159 
160 /** Variable Declaration for Fetching the Cursor */
161 l_inside_outside_of_container c_inside_outside_of_container%ROWTYPE;
162 l_inside_outside_of_container2 c_inside_outside_of_container%ROWTYPE;
163 
164 CURSOR C_DEL_ID_FOR_CONT_OR_DETAIL(c_detail_id number) is
165 	SELECT  wda.delivery_id	,
166                 wdd.organization_id,
167                 wdd.ship_from_location_id,
168                 wdd.customer_id,
169                 wdd.intmed_ship_to_location_id,
170                 wdd.fob_code,
171                 wdd.freight_terms_code,
172                 wdd.ship_method_code ,
173                 wda.parent_delivery_detail_id,
174                 NVL(wdd.line_direction,'O') line_direction,   -- J-IB-NPARIKH
175                 -- J: W/V Changes
176                 wdd.released_status,
177                 wdd.gross_weight,
178                 wdd.net_weight,
179                 wdd.volume,
180                 wdd.container_flag,
181                 NVL(wdd.ignore_for_planning,'N') ignore_for_planning, --J TP Release
182                 wdd.mode_of_transport,
183                 wdd.service_level,
184                 wdd.carrier_id,
185                 wdd.weight_uom_code,
186                 wdd.volume_uom_code,
187                 wdd.inventory_item_id,
188                 wda.type wda_type
189 	FROM	wsh_delivery_assignments_v wda,
190                 wsh_delivery_details wdd
191 	WHERE	wdd.delivery_detail_id = wda.delivery_detail_id
192           AND   wda.delivery_detail_id = c_detail_id;
193 
194 -- Consolidation of Back Order Delivery Details Enhancement
195 --
196 -- PACKAGE VARIABLES
197 --
198 -- HW OPM BUG#:3121616- Added qty2s
199 TYPE Cons_Source_Line_Rec_Typ IS RECORD(
200 DELIVERY_DETAIL_ID               NUMBER,
201 DELIVERY_ID                      NUMBER,
202 SOURCE_LINE_ID                   NUMBER,
203 REQ_QTY                          NUMBER,
204 BO_QTY                           NUMBER,
205 OVERPICK_QTY                     NUMBER,	-- Bug#3263952
206 REQ_QTY2                         NUMBER,
207 BO_QTY2                          NUMBER
208 );
209 
210 TYPE Cons_Source_Line_Rec_Tab is TABLE of Cons_Source_Line_Rec_Typ INDEX BY BINARY_INTEGER;
211 
212 /*---------------------------------------------------------------------
213 Procedure Name : Unreserve_delivery_detail
214 Description    : This API calls Inventory's APIs to Unreserve. It first
215                  queries the reservation records, and then calls
216                  delete_reservations until the p_quantity_to_unreserve
217                  is satisfied.
218 --------------------------------------------------------------------- */
219 -- HW OPM BUG#:3121616 Added p_quantity2_to_unreserve
220 Procedure Unreserve_delivery_detail
221 ( p_delivery_detail_id            IN NUMBER
222 , p_quantity_to_unreserve         IN  NUMBER
223 , p_quantity2_to_unreserve    IN NUMBER default NULL
224 , p_unreserve_mode                IN  VARCHAR2
225 , p_override_retain_ato_rsv       IN  VARCHAR2 DEFAULT NULL    -- 2747520
226 , x_return_status                 OUT NOCOPY  VARCHAR2) ;
227 
228 --
229 --Procedure:        Assign_Detail_to_Delivery
230 --Parameters:       p_detail_id,
231 --                  p_delivery_id,
232 --                  x_return_status
233 -- x_dlvy_has_lines : 'Y' :delivery has non-container lines.
234 --                    'N' : delivery does not have non-container lines
235 --Description:      This procedure will assign the specified
236 --                  delivery_detail to the specified delivery
237 --                  and return the status
238 
239 PROCEDURE Assign_Detail_to_Delivery(
240 	P_DETAIL_ID	IN NUMBER,
241 	P_DELIVERY_ID	IN NUMBER,
242 	X_RETURN_STATUS	OUT NOCOPY  VARCHAR2,
243         x_dlvy_has_lines          IN OUT NOCOPY VARCHAR2 ,    -- J-IB-NPARIKH
244         x_dlvy_freight_terms_code IN OUT NOCOPY VARCHAR2 ,-- J-IB-NPARIKH
245         P_CALLER             IN VARCHAR2 DEFAULT NULL
246     );
247 
248 -------------------------------------------------------------------
249 -- This procedure is only for backward compatibility.
250 -------------------------------------------------------------------
251 
252 PROCEDURE Assign_Detail_to_Delivery(
253     P_DETAIL_ID     IN NUMBER,
254     P_DELIVERY_ID   IN NUMBER,
255     X_RETURN_STATUS OUT NOCOPY  VARCHAR2,
256     P_CALLER             IN VARCHAR2 DEFAULT NULL
257     );
258 
259 --
260 --Procedure:        Assign_Detail_to_Cont
261 --Parameters:       p_detail_id,
262 --                  p_parent_detail_id,
263 --                  x_return_status
264 --Description:      This procedure will assign the specified
265 --                  delivery_detail to the specified container
266 --                  and return the status
267 
268 --                  If container is already assigned to a delivery,
269 --                  its parent containers and child containers must
270 --                  be also assigned to the same delivery already.
271 --                  So all it needs to do is just get the delivery_id
272 --                  from the current container and assign it to the detail also.
273 
274 --                  If the detail is already assigned to a delivery,
275 --                  then drill up and down to update the delivery id for all the
276 --                  parent and chile containers
277 
281 	X_RETURN_STATUS OUT NOCOPY  VARCHAR2);
278 PROCEDURE Assign_Detail_to_Cont(
279 	P_DETAIL_ID	IN NUMBER,
280 	P_PARENT_DETAIL_ID IN NUMBER,
282 --
283 --Procedure:        Unssign_Detail_from_Cont
284 --Parameters:       p_detail_id,
285 --                  p_parent_detail_id,
286 --                  x_return_status
287 --Description:
288 --  if detail is already assigned to a delivery which means the container must
289 --  be assigned to the same delivery too, in this case even though the detail
290 --  is getting removed from the container, it will still stay assigned to the delivery
291 -- if the container is already assigned to a delivery, the detail must also be a
292 -- ssigned to the same delivery
293 PROCEDURE Unassign_Detail_from_Cont(
294 	P_DETAIL_ID			IN NUMBER,
295 	X_RETURN_STATUS 	OUT NOCOPY  VARCHAR2,
296 	p_validate_flag 	IN VARCHAR2 DEFAULT NULL);
297 
298 PROCEDURE Assign_Cont_To_Delivery(
299 	P_DETAIL_ID	IN NUMBER,
300 	P_DELIVERY_ID	IN NUMBER,
301 	X_RETURN_STATUS OUT NOCOPY  VARCHAR2);
302 
303 -------------------------------------------------------------------
304 --Assign_Top_Detail_To_Delivery should only be called for the topmost
305 --container in a hierarchy/detail (if it is a loose detail) assigns
306 --all the details below (including containers) to delivery
307 -- x_dlvy_has_lines : 'Y' :delivery has non-container lines.
308 --                    'N' : delivery does not have non-container lines
309 -------------------------------------------------------------------
310 
311 PROCEDURE Assign_Top_Detail_To_Delivery(
312 	P_DETAIL_ID	IN NUMBER,
313 	P_DELIVERY_ID	IN NUMBER,
314 	X_RETURN_STATUS OUT NOCOPY  VARCHAR2,
315     x_dlvy_has_lines          IN OUT NOCOPY VARCHAR2,    -- J-IB-NPARIKH
316     x_dlvy_freight_terms_code IN OUT NOCOPY VARCHAR2,     -- J-IB-NPARIKH
317     P_CALLER             IN VARCHAR2 DEFAULT NULL
318     );
319 
320 
321 -------------------------------------------------------------------
322 -- This procedure is only for backward compatibility.
323 -------------------------------------------------------------------
324 
325 PROCEDURE Assign_Top_Detail_To_Delivery(
326     P_DETAIL_ID     IN NUMBER,
327     P_DELIVERY_ID   IN NUMBER,
328     X_RETURN_STATUS OUT NOCOPY  VARCHAR2
329     );
330 
331 
332 
333 PROCEDURE Unassign_Cont_from_Delivery(
334 	P_DETAIL_ID			IN NUMBER,
335 	X_RETURN_STATUS 	OUT NOCOPY  VARCHAR2,
336 	p_validate_flag 	IN VARCHAR2 DEFAULT NULL);
337 
338 PROCEDURE Assign_Cont_To_Cont(
339 	P_DETAIL_ID1	IN NUMBER,
340 	P_DETAIL_ID2	IN NUMBER,
341 	X_RETURN_STATUS OUT NOCOPY  VARCHAR2);
342 
343 PROCEDURE Unassign_Cont_from_Cont(
344 	P_DETAIL_ID	IN NUMBER,
345 	X_RETURN_STATUS OUT NOCOPY  VARCHAR2);
346 
347 PROCEDURE Assign_Multiple_Details(
348 	p_rec_of_detail_ids	IN WSH_UTIL_CORE.ID_TAB_TYPE,
349 	p_delivery_id	IN NUMBER,
350 	p_cont_ins_id	IN NUMBER,
351 	x_return_status	OUT NOCOPY  VARCHAR2);
352 
353 
354 
355 PROCEDURE Unassign_Detail_from_Delivery(
356 	p_detail_id			IN NUMBER,
357 	x_return_status	OUT NOCOPY  VARCHAR2,
358 	p_validate_flag 	IN VARCHAR2 DEFAULT NULL,
359     p_action_prms  IN WSH_GLBL_VAR_STRCT_GRP.dd_action_parameters_rec_type   -- J-IB-NPARIKH
360 	);
361 
362 --This procedure is for backward compatibility only. Do not use this.
363 PROCEDURE Unassign_Detail_from_Delivery(
364     p_detail_id         IN NUMBER,
365     x_return_status OUT NOCOPY  VARCHAR2,
366     p_validate_flag     IN VARCHAR2 DEFAULT NULL
367     );
368 
369 PROCEDURE Unassign_Multiple_Details(
370     p_rec_of_detail_ids IN WSH_UTIL_CORE.ID_TAB_TYPE,
371     p_from_delivery     IN VARCHAR2,
372     p_from_container        IN VARCHAR2,
373     x_return_status        OUT NOCOPY   VARCHAR2,
374     p_validate_flag         IN VARCHAR2 DEFAULT NULL,
375     p_action_prms  IN WSH_GLBL_VAR_STRCT_GRP.dd_action_parameters_rec_type   -- J-IB-NPARIKH
376     );
377 
378 --This procedure is for backward compatibility only. Do not use this.
379 PROCEDURE Unassign_Multiple_Details(
380 	p_rec_of_detail_ids	IN WSH_UTIL_CORE.ID_TAB_TYPE,
381 	p_from_delivery		IN VARCHAR2,
382 	p_from_container		IN VARCHAR2,
383 	x_return_status		   OUT NOCOPY 	VARCHAR2,
384 	p_validate_flag 		IN VARCHAR2 DEFAULT NULL
385 	);
386 
387 /********* anxsharm *********************/
388 /********* ADDED FOR AUTOPACK *********************/
389 -- anxsharm
390 -- This API has been added to bulkalize
391 -- call from Auto Packing
392 PROCEDURE Split_Delivery_Details_Bulk(
393 	p_from_detail_id	NUMBER,
394 	p_req_quantity		IN OUT NOCOPY  NUMBER ,
395 	p_unassign_flag     IN VARCHAR2 DEFAULT 'N',
396 	p_req_quantity2   IN NUMBER DEFAULT NULL,
397         p_converted_flag IN VARCHAR2 DEFAULT NULL ,
398         p_manual_split   IN VARCHAR2 DEFAULT NULL ,
399         p_num_of_split   IN NUMBER DEFAULT NULL,
400 	x_new_detail_id	OUT NOCOPY 	NUMBER,
401         x_dd_id_tab      OUT NOCOPY  WSH_UTIL_CORE.id_tab_type,
402 	x_return_status	OUT NOCOPY 	VARCHAR2
403 	);
404 
405 -- anxsharm
406 -- This API has been added to bulkalize
407 -- call from Auto Packing
408 -- HW OPMCONV - Removed parameter p_process_flag
409 PROCEDURE Split_Detail_INT_Bulk(
410                p_old_delivery_detail_rec      IN  SplitDetailRecType,
411                p_new_source_line_id  IN  NUMBER   DEFAULT NULL,
415                p_converted_flag      IN  VARCHAR2 DEFAULT NULL,
412                p_quantity_to_split   IN  NUMBER,
413                p_quantity_to_split2  IN  NUMBER   DEFAULT NULL,
414                p_unassign_flag       IN  VARCHAR2 DEFAULT 'N',
416 --             p_process_flag        IN  VARCHAR2,
417                p_manual_split        IN  VARCHAR2 DEFAULT NULL,
418                p_split_sn            IN  VARCHAR2 DEFAULT 'Y',
419                p_num_of_split   IN NUMBER,
420                x_split_detail_id     OUT NOCOPY  NUMBER,
421                x_return_status       OUT NOCOPY  VARCHAR2,
422                x_dd_id_tab      OUT NOCOPY  WSH_UTIL_CORE.id_tab_type
423                );
424 /********* End of anxsharm *********************/
425 -- fabdi : Begin of OPM Changes (Pick_Confirm)
426 -- added a new parameter called p_req_quantity2
427 -- fabdi : End of OPM Changes (Pick_Confirm)
428 
429 -- HW BUG#:1636578 - added a new paramter p_converted_flag
430 PROCEDURE Split_Delivery_Details(
431 	p_from_detail_id	NUMBER,
432 	p_req_quantity		IN OUT NOCOPY  NUMBER ,
433 	x_new_detail_id	OUT NOCOPY 	NUMBER,
434 	x_return_status	OUT NOCOPY 	VARCHAR2,
435 	p_unassign_flag     IN VARCHAR2 DEFAULT 'N',
436 	p_req_quantity2   IN NUMBER DEFAULT NULL,
437         p_converted_flag IN VARCHAR2 DEFAULT NULL ,
438         p_manual_split   IN VARCHAR2 DEFAULT NULL
439 	);
440 
441 --  Procedure:      Split_Detail_INT
442 --
443 --  Description:    This is an internal API.
444 --                  Copies the delivery detail and update their quantites
445 --                  and serial numbers
446 --                  in order to split the delivery line and serial numbers.
447 --
448 -- HW OPMCONV - Removed parameter p_process_flag
449 PROCEDURE Split_Detail_INT(
450                p_old_delivery_detail_rec      IN  SplitDetailRecType,
451                p_new_source_line_id  IN  NUMBER   DEFAULT NULL,
452                p_quantity_to_split   IN  NUMBER,
453                p_quantity_to_split2  IN  NUMBER   DEFAULT NULL,
454                p_unassign_flag       IN  VARCHAR2 DEFAULT 'N',
455                p_converted_flag      IN  VARCHAR2 DEFAULT NULL,
456 --             p_process_flag        IN  VARCHAR2,
457                p_manual_split        IN  VARCHAR2 DEFAULT NULL,
458                p_split_sn            IN  VARCHAR2 DEFAULT 'Y',
459                x_split_detail_id     OUT NOCOPY  NUMBER,
460                x_return_status       OUT NOCOPY  VARCHAR2);
461 
462 
463 PROCEDURE Explode_Delivery_Details(
464 	p_delivery_detail_id NUMBER,
465 	x_return_status OUT NOCOPY  VARCHAR2);
466 
467 PROCEDURE unassign_unpack_empty_cont (
468       p_ids_tobe_unassigned IN wsh_util_core.id_tab_type,
469       p_validate_flag   IN VARCHAR2,
470       x_return_status   OUT NOCOPY  VARCHAR2
471 );
472 
473 -- ******** Added for Consolidation of Back Order delivery details enhancement
474 
475 --  Procedure:      Consolidate_Source_Line
476 --
477 --  Parameters: p_Cons_Source_Line_Rec_Tab  -> List of delivery details and its corresponding req qtys,
478 --                                        bo qtys, source line ids and delivery ids.
479 --              x_consolidate_ids     ->  Contains the list of existing BO dd_ids, into which the dd_ids passed
480 --                                        in the parameter p_Cons_Source_Line_Rec_Tab got consolidated.
481 --
482 --  Description:    This is an internal API.
483 --                  Consolidates all the unpacked and unassigned back order delivery detail lines
484 --                  into one delivery detail id for the given source line id
485 --
486 --
487 PROCEDURE Consolidate_Source_Line(
488         p_Cons_Source_Line_Rec_Tab  IN           WSH_DELIVERY_DETAILS_ACTIONS.Cons_Source_Line_Rec_Tab,
489         x_consolidate_ids           OUT NOCOPY WSH_UTIL_CORE.Id_Tab_Type,
490         x_return_status             OUT NOCOPY VARCHAR2 );
491 
492 
493 --  Procedure:      Consolidate_Delivery_Details
494 --
495 --  Parameters: p_delivery_details_tab  -> list of delivery details and its corresponding req qtys, bo qtys,
496 --		 			   source line ids and delivery ids
497 --              p_bo_mode		-> Either  'UNRESERVE'  or 'CYCLE_COUNT'
498 --		x_cons_delivery_details_tab -> Contains the list of dds into which the dds passed in the
499 --					   parameter p_delivery_details_tab get consolidated.
500 --					   This also contains the corresponding req qtys, bo qyts and
501 --					   source line ids.
502 --		x_remain_bo_qtys	-> Contains the sum of backorder quantities of delivery details (except
503 --					   for the dd_id in x_cons_delivery_details_tab) for each source line.
504 --					   x_remain_bo_qtys has a quantity for each dd_id in
505 --					   x_cons_delivery_details_tab.
506 --  Description:    This API is Internally used by ShipConfirm to
507 --		    consolidate the delivery details going to be BackOrdered.
508 --                  This Procedure takes the list of delivery details
509 --		    under a Delivery and consolidates them into one
510 --		    delivery detail for each source line id.
511 --
512 -- HW OPM BUG#:3121616 Added x_remain_bo_qty2s
513 PROCEDURE Consolidate_Delivery_Details(
514 	 	p_delivery_details_tab  IN     WSH_DELIVERY_DETAILS_ACTIONS.Cons_Source_Line_Rec_Tab,
515 		p_bo_mode	        IN     VARCHAR2,
516 	 	x_cons_delivery_details_tab  OUT NOCOPY  WSH_DELIVERY_DETAILS_ACTIONS.Cons_Source_Line_Rec_Tab,
517 		x_remain_bo_qtys	OUT NOCOPY       WSH_UTIL_CORE.Id_Tab_Type,
518                 x_remain_bo_qty2s	OUT NOCOPY       WSH_UTIL_CORE.Id_Tab_Type,
519 		x_return_status		OUT NOCOPY       VARCHAR2
520 		);
521 
522 
523 PROCEDURE Create_Consol_Record(
524                     p_detail_id_tab IN  wsh_util_core.id_tab_type,
525                     x_return_status OUT NOCOPY VARCHAR2);
526 
527 PROCEDURE Delete_Consol_Record(
528                        p_detail_id_tab IN  wsh_util_core.id_tab_type,
529                        x_return_status OUT NOCOPY VARCHAR2);
530 
531 END WSH_DELIVERY_DETAILS_ACTIONS;
532