DBA Data[Home] [Help]

PACKAGE: APPS.WSH_DELIVERY_DETAILS_ACTIONS

Source


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