[Home] [Help]
PACKAGE BODY: APPS.GMI_PR_PICK_SLIP_NUMBER
Source
1 PACKAGE BODY GMI_PR_PICK_SLIP_NUMBER AS
2 /* $Header: GMIUSLPB.pls 120.0 2005/05/25 16:17:49 appldev noship $ */
3 /*
4 +===========================================================================+
5 | Copyright (c) 1999 Oracle Corporation |
6 | Redwood Shores, California, USA |
7 | All rights reserved. |
8 +===========================================================================+
9 +===========================================================================+
10
11 NAME
12
13 GMIUSLPB.pls
14
15 DESCRIPTION (direct copy from file WSHPRPNB.pls)
16
17 This package has 2 public APIs Get_Pick_Slip_Number and Print_Pick_Slip.
18
19 Get_Pick_Slip_Number is used to get a pick slip number depending on the grouping
20 rule and grouping rule attribute values passed from dynamically built PL/SQL
21 tables. A new pick slip is generated if the criteria doesn't match any of
22 the records in the dynamic table. Otherwise the exisiting one is used.
23 Also for efficiency purposes a table of grouping rules (passed to this program)
24 and grouping rule attributes is maintained.
25
26 Print_Pick_Slip is used to print a specified pick slip or all the pick slips
27 created in the particular session.
28
29 HISTORY
30
31 +===========================================================================+
32 */
33
34 -- HW BUG#:Removed reference to G_MISS_XXX
35 /* PACKAGE TYPES */
36 TYPE keyRecTyp IS RECORD (
37 grouping_rule_id NUMBER ,
38 header_id NUMBER ,
39 customer_id NUMBER ,
40 ship_method_code VARCHAR2(30) ,
41 ship_to_loc_id NUMBER ,
42 shipment_priority VARCHAR2(30) ,
43 subinventory VARCHAR2(10) ,
44 trip_stop_id NUMBER ,
45 delivery_id NUMBER ,
46 inventory_item_id NUMBER ,
47 locator_id NUMBER ,
48 lot_number VARCHAR2(32) ,
49 revision VARCHAR2(3) ,
50 organization_id NUMBER ,
51 pick_slip_number NUMBER ,
52 counter NUMBER
56 TYPE keyTabTyp IS TABLE OF keyRecTyp INDEX BY BINARY_INTEGER;
53 );
54
55
57
58 TYPE grpRecTyp IS RECORD (
59 grouping_rule_id NUMBER ,
60 use_order_ps VARCHAR2(1) := 'N',
61 use_sub_ps VARCHAR2(1) := 'N',
62 use_customer_ps VARCHAR2(1) := 'N',
63 use_ship_to_ps VARCHAR2(1) := 'N',
64 use_carrier_ps VARCHAR2(1) := 'N',
65 use_ship_priority_ps VARCHAR2(1) := 'N',
66 use_trip_stop_ps VARCHAR2(1) := 'N',
67 use_delivery_ps VARCHAR2(1) := 'N',
68 use_item_ps VARCHAR2(1) := 'N',
69 use_locator_ps VARCHAR2(1) := 'N',
70 use_lot_ps VARCHAR2(1) := 'N',
71 use_revision_ps VARCHAR2(1) := 'N'
72 );
73
74 TYPE grpTabTyp IS TABLE OF grpRecTyp INDEX BY BINARY_INTEGER;
75
76 /* PACKAGE VARIABLES */
77 g_rule_table grpTabTyp;
78 g_pskey_table keyTabTyp;
79
80 /* FORWARD DECLARATIONS */
81 PROCEDURE Insert_Key (
82 p_rule_index IN NUMBER,
83 p_header_id IN NUMBER,
84 p_customer_id IN NUMBER,
85 p_ship_method_code IN VARCHAR2,
86 p_ship_to_loc_id IN NUMBER,
87 p_shipment_priority IN VARCHAR2,
88 p_subinventory IN VARCHAR2,
89 p_trip_stop_id IN NUMBER,
90 p_delivery_id IN NUMBER,
91 p_inventory_item_id IN NUMBER,
92 p_locator_id IN NUMBER,
93 p_lot_number IN VARCHAR2,
94 p_revision IN VARCHAR2,
95 p_org_id IN NUMBER,
96 x_pick_slip_number OUT NOCOPY NUMBER
97 );
98
99 PROCEDURE Print_Pvt (
100 p_report_set_id IN NUMBER,
101 p_organization_id IN NUMBER,
102 p_pick_slip_number IN NUMBER,
103 x_api_status OUT NOCOPY VARCHAR2
104 );
105
106 /* =======================================================================
107 | Name
108 | PROCEDURE Print_Pick_Slip
109 |
110 | Purpose
111 | This function initializesthe g_use_ variables to be used
112 | in determining the how to group pick slips.
113 |
114 | Input Parameters
115 | p_pick_slip_number => pick slip number
116 | p_report_set_id => report set
117 |
118 | Output Parameters
119 | x_api_status => FND_API.G_RET_STS_SUCESSS or
120 | FND_API.G_RET_STS_ERROR or
121 | FND_API.G_RET_STS_UNEXP_ERROR
122 | x_error_message => Error message
123 =========================================================================*/
124
125 -- HW BUG#:2643440 - Replaced FND_API.G_MISS_NUM for p_pick_slip_number
126 -- with DEFAULT NULL
127 PROCEDURE Print_Pick_Slip (
128 p_pick_slip_number IN NUMBER DEFAULT NULL,
129 p_report_set_id IN NUMBER,
130 p_organization_id IN NUMBER,
131 x_api_status OUT NOCOPY VARCHAR2,
132 x_error_message OUT NOCOPY VARCHAR2 )
133 IS
134 l_index NUMBER;
135 l_ps_num NUMBER;
136 l_document_info WSH_DOCUMENT_SETS.document_set_tab_type;
137 BEGIN
138 l_index := g_pskey_table.first;
139
140 /* If report set id is NULL, there is no report to print */
141 IF (p_report_set_id IS NULL) THEN
142 x_api_status := FND_API.G_RET_STS_SUCCESS;
143 RETURN;
144 END IF;
145
146 /* If key table is empty, there is nothing to print */
147 IF (l_index IS NULL) THEN
148 x_api_status := FND_API.G_RET_STS_SUCCESS;
149 RETURN;
150 END IF;
151
152 -- HW BUG#:2643440 - Replaced comparison with FND_API.G_MISS_NUM for p_pick_slip_number
153 -- with NULL
154
155 IF p_pick_slip_number = NULL THEN
156 /* Loop through key table and print all remaining pick slips */
157 WHILE l_index IS NOT NULL LOOP
158 /* Print pick slip */
159 l_ps_num := g_pskey_table(l_index).pick_slip_number;
160 WSH_UTIL_CORE.Println('calling Print_Pvt, num =' || l_ps_num);
161 Print_Pvt(p_report_set_id, p_organization_id, l_ps_num, x_api_status);
162 WSH_UTIL_CORE.Println('x_api_status Print_Pvt:'|| x_api_status);
163
164 /* Remove from table */
165 g_pskey_table.delete(l_index);
166
167 l_index := g_pskey_table.next(l_index);
168 END LOOP;
169 ELSE
170 /* Loop through table to find specified pick slip */
171 WHILE l_index IS NOT NULL LOOP
172 IF g_pskey_table(l_index).pick_slip_number = p_pick_slip_number THEN
173 /* Print pick slip */
174 Print_Pvt(p_report_set_id, p_organization_id, p_pick_slip_number, x_api_status);
175
176 /* Remove from table */
177 g_pskey_table.delete(l_index);
178 EXIT;
179 END IF;
180
181 l_index := g_pskey_table.next(l_index);
182 END LOOP;
183 END IF;
184
185 IF x_api_status <> FND_API.G_RET_STS_SUCCESS THEN
189 END IF;
186 x_error_message := 'Error occurred in call to ' ||
187 'WSH_UTIL_CORE.Print_Document_Sets in ' ||
188 'WSH_PR_PICK_SLIP_NUMBER.Print_Pick_Slip';
190
191 EXCEPTION
192 WHEN OTHERS THEN
193 x_error_message := 'Exception occurred in WSH_PR_PICK_SLIP_NUMBER.Print_Pick_Slip';
194 x_api_status := FND_API.G_RET_STS_UNEXP_ERROR;
195 WSH_UTIL_CORE.Println('SQL error: ' || SQLERRM(SQLCODE));
196 END Print_Pick_Slip;
197
198 /* =======================================================================
199 | Name
200 | PROCEDURE Get_Pick_Slip_Number
201 |
202 | Purpose
203 | Returns pick slip number
204 |
205 | Input Parameters
206 | p_ps_mode => pick slip print mode: I=immed, E=deferred
207 | p_pick_grouping_rule_id => pick grouping rule id
208 | p_org_id => organization_id
209 | p_header_id => order header id
210 | p_customer_id => customer id
211 | p_ship_method_code => ship method
212 | p_ship_to_loc_id => ship to location
213 | p_shipment_priority => shipment priority
214 | p_subinventory => subinventory
215 | p_trip_stop_id => trip stop
216 | p_delivery_id => delivery
217 | p_inventory_item_id => item
218 | p_locator_id => locator
219 | p_lot_number => lot number
220 | p_revision => revision
221 |
222 | Output Parameters
223 | x_pick_slip_number => pick_slip_number
224 | x_ready_to_print => FND_API.G_TRUE or FND_API.G_FALSE
225 | x_api_status => FND_API.G_RET_STS_SUCESSS or
226 | FND_API.G_RET_STS_ERROR or
227 | FND_API.G_RET_STS_UNEXP_ERROR
228 | x_error_message => Error message
229 ===============================================================*/
230 PROCEDURE Get_Pick_Slip_Number (
231 p_ps_mode IN VARCHAR2,
232 p_pick_grouping_rule_id IN NUMBER,
233 p_org_id IN NUMBER,
234 p_header_id IN NUMBER,
235 p_customer_id IN NUMBER,
236 p_ship_method_code IN VARCHAR2,
237 p_ship_to_loc_id IN NUMBER,
238 p_shipment_priority IN VARCHAR2,
239 p_subinventory IN VARCHAR2,
240 p_trip_stop_id IN NUMBER,
241 p_delivery_id IN NUMBER,
242 p_inventory_item_id IN NUMBER DEFAULT NULL,
243 p_locator_id IN NUMBER DEFAULT NULL,
244 p_lot_number IN VARCHAR2 DEFAULT NULL,
245 p_revision IN VARCHAR2 DEFAULT NULL,
246 x_pick_slip_number OUT NOCOPY NUMBER,
247 x_ready_to_print OUT NOCOPY VARCHAR2,
248 x_api_status OUT NOCOPY VARCHAR2,
249 x_error_message OUT NOCOPY VARCHAR2
250 ) IS
251 /* cursor to get the pick slip grouping rule */
252 CURSOR ps_rule (v_pgr_id IN NUMBER) IS
253 SELECT NVL(ORDER_NUMBER_FLAG, 'N'),
254 NVL(SUBINVENTORY_FLAG, 'N'),
255 NVL(CUSTOMER_FLAG, 'N'),
256 NVL(SHIP_TO_FLAG, 'N'),
257 NVL(CARRIER_FLAG, 'N'),
258 NVL(SHIPMENT_PRIORITY_FLAG, 'N'),
259 NVL(TRIP_STOP_FLAG, 'N'),
260 NVL(DELIVERY_FLAG, 'N'),
261 NVL(ITEM_FLAG, 'N'),
262 NVL(LOCATOR_FLAG, 'N'),
263 NVL(LOT_FLAG, 'N'),
264 NVL(REVISION_FLAG, 'N')
265 FROM WSH_PICK_GROUPING_RULES
266 WHERE PICK_GROUPING_RULE_ID = v_pgr_id;
267
268 /* cursor to get number of times called before printer */
269 CURSOR get_limit (v_org_id IN NUMBER) IS
270 SELECT NVL(pick_slip_lines,-1)
271 FROM WSH_SHIPPING_PARAMETERS
272 WHERE ORGANIZATION_ID = v_org_id;
273
274 l_limit NUMBER;
275 l_rule_index NUMBER;
276 l_found BOOLEAN;
277 i NUMBER;
278
279 BEGIN
280 /* get the number of times called for a pick slip before */
281 /* setting the ready to print flag to TRUE, if print is immediate */
282 IF p_ps_mode = 'I' THEN
283 OPEN get_limit(p_org_id);
284 FETCH get_limit INTO l_limit;
285 IF get_limit%NOTFOUND THEN
286 x_error_message := 'Organization ' ||
287 to_char(p_org_id) ||
288 ' does not exist. ';
289 x_api_status := FND_API.G_RET_STS_ERROR;
290 RETURN;
291 END IF;
292 END IF;
293
294
295 /* Set ready to print flag to FALSE initially */
296 x_ready_to_print := FND_API.G_FALSE;
297
298 /* find grouping rule in table */
299 l_found := FALSE;
300 FOR i IN 1..g_rule_table.count LOOP
301 IF (g_rule_table(i).grouping_rule_id = p_pick_grouping_rule_id) THEN
302 l_found := TRUE;
303 l_rule_index := i;
304 EXIT;
305 END IF;
306 END LOOP;
307
308 /* if not found, fetch information about pick slip grouping rule */
309 IF (NOT l_found) THEN
310 i := g_rule_table.count + 1;
311 OPEN ps_rule(p_pick_grouping_rule_id);
312 FETCH ps_rule
313 INTO g_rule_table(i).use_order_ps,
317 g_rule_table(i).use_carrier_ps,
314 g_rule_table(i).use_sub_ps,
315 g_rule_table(i).use_customer_ps,
316 g_rule_table(i).use_ship_to_ps,
318 g_rule_table(i).use_ship_priority_ps,
319 g_rule_table(i).use_trip_stop_ps,
320 g_rule_table(i).use_delivery_ps,
321 g_rule_table(i).use_item_ps,
322 g_rule_table(i).use_locator_ps,
323 g_rule_table(i).use_lot_ps,
324 g_rule_table(i).use_revision_ps;
325 IF ps_rule%NOTFOUND THEN
326 x_error_message := 'Pick grouping rule '
327 || to_char(p_pick_grouping_rule_id) ||
328 ' does not exist';
329 x_api_status := FND_API.G_RET_STS_ERROR;
330 RETURN;
331 END IF;
332
333 g_rule_table(i).grouping_rule_id := p_pick_grouping_rule_id;
334
335 /* Insert new key to table based on grouping rule */
336 Insert_Key(p_rule_index => i,
337 p_header_id => p_header_id,
338 p_customer_id => p_customer_id,
339 p_ship_method_code => p_ship_method_code,
340 p_ship_to_loc_id => p_ship_to_loc_id,
341 p_shipment_priority => p_shipment_priority,
342 p_subinventory => p_subinventory,
343 p_trip_stop_id => p_trip_stop_id,
344 p_delivery_id => p_delivery_id,
345 p_inventory_item_id => p_inventory_item_id,
346 p_locator_id => p_locator_id,
347 p_lot_number => p_lot_number,
348 p_revision => p_revision,
349 p_org_id => p_org_id,
350 x_pick_slip_number => x_pick_slip_number );
351
352 x_api_status := FND_API.G_RET_STS_SUCCESS;
353 RETURN;
354
355 END IF;
356
357 /* If grouping rule is stored, find stored pick slip number for rule */
358 l_found := FALSE;
359 i := g_pskey_table.first;
360 LOOP
361 /* If key table is empty, there is no looping through table */
362 IF (i IS NULL) THEN
363 EXIT;
364 END IF;
365
366 IF (g_pskey_table(i).grouping_rule_id = p_pick_grouping_rule_id) THEN
367 l_found := TRUE;
368 IF (g_rule_table(l_rule_index).use_order_ps = 'Y') THEN
369 IF (NVL(g_pskey_table(i).header_id,-1) <> NVL(p_header_id,-1)) THEN
370 l_found := FALSE;
371 END IF;
372 ELSE
373 -- HW replaced by NULL
374 IF (g_pskey_table(i).header_id <> NULL) THEN
375 l_found := FALSE;
376 END IF;
377 END IF;
378
379 IF (g_rule_table(l_rule_index).use_sub_ps = 'Y') AND l_found THEN
380 IF (NVL(g_pskey_table(i).subinventory,'-1') <> NVL(p_subinventory,'-1')) THEN
381 l_found := FALSE;
382 END IF;
383 ELSE
384 -- HW replaced by NULL
385 IF (g_pskey_table(i).subinventory <> NULL) THEN
386 l_found := FALSE;
387 END IF;
388 END IF;
389
390 IF (g_rule_table(l_rule_index).use_customer_ps = 'Y') AND l_found THEN
391 IF (NVL(g_pskey_table(i).customer_id,-1) <> NVL(p_customer_id,-1)) THEN
392 l_found := FALSE;
393 END IF;
394 ELSE
395 -- HW replaced by NULL
396 IF (g_pskey_table(i).customer_id <> NULL) THEN
397 l_found := FALSE;
398 END IF;
399
400 END IF;
401
402 IF (g_rule_table(l_rule_index).use_ship_to_ps = 'Y') AND l_found THEN
403 IF (NVL(g_pskey_table(i).ship_to_loc_id,-1) <> NVL(p_ship_to_loc_id,-1)) THEN
404 l_found := FALSE;
405 END IF;
406 ELSE
407 -- HW replaced by NULL
408 IF (g_pskey_table(i).ship_to_loc_id <> NULL) THEN
409 l_found := FALSE;
410 END IF;
411 END IF;
412
413 IF (g_rule_table(l_rule_index).use_carrier_ps = 'Y') AND l_found THEN
414 IF (NVL(g_pskey_table(i).ship_method_code,'-1') <> NVL(p_ship_method_code,'-1')) THEN
415 l_found := FALSE;
416 END IF;
417 ELSE
418 -- HW replaced by NULL
419 IF (g_pskey_table(i).ship_method_code <> NULL) THEN
420 l_found := FALSE;
421 END IF;
422 END IF;
423
424 IF (g_rule_table(l_rule_index).use_ship_priority_ps = 'Y') AND l_found THEN
425 IF (NVL(g_pskey_table(i).shipment_priority,'-1') <> NVL(p_shipment_priority,'-1')) THEN
426 l_found := FALSE;
427 END IF;
428 ELSE
429 -- HW replaced by NULL
430 IF (g_pskey_table(i).shipment_priority <> NULL) THEN
431 l_found := FALSE;
432 END IF;
433 END IF;
434
435 IF (g_rule_table(l_rule_index).use_trip_stop_ps = 'Y') AND l_found THEN
436 IF (NVL(g_pskey_table(i).trip_stop_id,-1) <> NVL(p_trip_stop_id,-1)) THEN
437 l_found := FALSE;
438 END IF;
439 ELSE
440 -- HW replaced by NULL
444 END IF;
441 IF (g_pskey_table(i).trip_stop_id <> NULL) THEN
442 l_found := FALSE;
443 END IF;
445
446 IF (g_rule_table(l_rule_index).use_delivery_ps = 'Y') AND l_found THEN
447 IF (NVL(g_pskey_table(i).delivery_id,-1) <> NVL(p_delivery_id,-1)) THEN
448 l_found := FALSE;
449 END IF;
450 ELSE
451 -- HW replaced by NULL
452 IF (g_pskey_table(i).delivery_id <> NULL) THEN
453 l_found := FALSE;
454 END IF;
455 END IF;
456
457 IF (g_rule_table(l_rule_index).use_item_ps = 'Y') AND l_found THEN
458 IF (NVL(g_pskey_table(i).inventory_item_id,-1) <> NVL(p_inventory_item_id,-1)) THEN
459 l_found := FALSE;
460 END IF;
461 ELSE
462 -- HW replaced by NULL
463 IF (g_pskey_table(i).inventory_item_id <> NULL) THEN
464 l_found := FALSE;
465 END IF;
466 END IF;
467 IF (g_rule_table(l_rule_index).use_locator_ps = 'Y') AND l_found THEN
468 IF (NVL(g_pskey_table(i).locator_id,-1) <> NVL(p_locator_id,-1)) THEN
469 l_found := FALSE;
470 END IF;
471 ELSE
472 -- HW replaced by NULL
473 IF (g_pskey_table(i).locator_id <> NULL) THEN
474 l_found := FALSE;
475 END IF;
476 END IF;
477 IF (g_rule_table(l_rule_index).use_lot_ps = 'Y') AND l_found THEN
478 IF (NVL(g_pskey_table(i).lot_number,'-1') <> NVL(p_lot_number,'-1')) THEN
479 l_found := FALSE;
480 END IF;
481 ELSE
482 -- HW replaced by NULL
483 IF (g_pskey_table(i).lot_number <> NULL) THEN
484 l_found := FALSE;
485 END IF;
486 END IF;
487 IF (g_rule_table(l_rule_index).use_revision_ps = 'Y') AND l_found THEN
488 IF (NVL(g_pskey_table(i).revision,'-1') <> NVL(p_revision,'-1')) THEN
489 l_found := FALSE;
490 END IF;
491 ELSE
492 -- HW replaced by NULL
493 IF (g_pskey_table(i).revision <> NULL) THEN
494 l_found := FALSE;
495 END IF;
496 END IF;
497
498 /* Implicitly use organization */
499 IF (NVL(g_pskey_table(i).organization_id,-1) <> NVL(p_org_id,-1)) THEN
500 l_found := FALSE;
501 END IF;
502
503 /* If found, get pick slip number and increment counter */
504 IF l_found THEN
505 x_pick_slip_number := g_pskey_table(i).pick_slip_number;
506 g_pskey_table(i).counter := g_pskey_table(i).counter + 1;
507 EXIT;
508 END IF;
509 END IF;
510
511 EXIT WHEN i = g_pskey_table.last;
512 i := g_pskey_table.next(i);
513 END LOOP;
514
515 IF l_found THEN
516 /* Print is immediate so check if limit has been reached */
517 IF (p_ps_mode = 'I' AND l_limit <> -1) THEN
518 IF (g_pskey_table(i).counter >= l_limit) THEN
519 x_ready_to_print := FND_API.G_TRUE;
520 END IF;
521 END IF;
522 ELSE
523 /* Insert new key */
524 Insert_Key(p_rule_index => l_rule_index,
525 p_header_id => p_header_id,
526 p_customer_id => p_customer_id,
527 p_ship_method_code => p_ship_method_code,
528 p_ship_to_loc_id => p_ship_to_loc_id,
529 p_shipment_priority => p_shipment_priority,
530 p_subinventory => p_subinventory,
531 p_trip_stop_id => p_trip_stop_id,
532 p_delivery_id => p_delivery_id,
533 p_inventory_item_id => p_inventory_item_id,
534 p_locator_id => p_locator_id,
535 p_lot_number => p_lot_number,
536 p_revision => p_revision,
537 p_org_id => p_org_id,
538 x_pick_slip_number => x_pick_slip_number );
539 END IF;
540
541 x_api_status := FND_API.G_RET_STS_SUCCESS;
542 EXCEPTION
543 WHEN OTHERS THEN
544 x_error_message := 'Error occurred in WSH_PR_PICK_NUMBER.Get_Pick_Slip_Number';
545 x_api_status := FND_API.G_RET_STS_UNEXP_ERROR;
546
547 END Get_Pick_Slip_Number;
548
549 /* ==================================================================
550 |
551 | Name
552 | PROCEDURE Print_Pvt
553 |
554 | Purpose
555 | Print Pick Slip based on Pick Slip Number
556 |
557 | Input Parameter
558 | p_report_set_id => report set
559 | p_pick_slip_number => pick slip number
560 |
561 | Output Parameters
562 | x_api_status => FND_API.G_RET_STS_SUCESSS or
563 | FND_API.G_RET_STS_ERROR or
564 | FND_API.G_RET_STS_UNEXP_ERROR
565 ==================================================================*/
566 PROCEDURE Print_Pvt (
567 p_report_set_id IN NUMBER,
568 p_organization_id IN NUMBER,
569 p_pick_slip_number IN NUMBER,
570 x_api_status OUT NOCOPY VARCHAR2)
571 IS
572 l_report_set_id NUMBER;
573 l_trip_ids WSH_UTIL_CORE.Id_Tab_Type;
574 l_stop_ids WSH_UTIL_CORE.Id_Tab_Type;
575 l_delivery_ids WSH_UTIL_CORE.Id_Tab_Type;
576 l_document_info WSH_DOCUMENT_SETS.document_set_tab_type;
577 l_organization_id NUMBER;
578 BEGIN
579 l_document_info(1).p_report_set_id := p_report_set_id;
580 l_document_info(1).pick_slip_num_l := p_pick_slip_number;
581 l_document_info(1).pick_slip_num_h := p_pick_slip_number;
582 l_document_info(1).p_item_display := 'D';
583 l_document_info(1).p_item_flex_code := 'MSTK';
584 l_document_info(1).p_locator_flex_code :='MTLL';
585 l_document_info(1).p_pick_status := 'A';
586
587 l_organization_id := p_organization_id;
588
589 WSH_UTIL_CORE.Println('calling WSH_UTIL_CORE.Print_Document_Sets');
590 WSH_DOCUMENT_SETS.Print_Document_Sets(
591 p_report_set_id => l_report_set_id,
592 p_organization_id => l_organization_id,
593 p_trip_ids => l_trip_ids,
594 p_stop_ids => l_stop_ids,
595 p_delivery_ids => l_delivery_ids,
596 p_document_param_info => l_document_info,
597 x_return_status => x_api_status);
598
599 END Print_Pvt;
600
601 /* ========================================================================
602 |
603 | Name
604 | PROCEDURE Insert_Key
605 |
606 | Purpose
607 | Insert new key to table and returns newly generated pick slip number
608 |
609 | Input Parameter
610 | p_rule_index => index to the grouping rule table
611 | p_header_id => order header id
612 | p_customer_id => customer id
613 | p_ship_method_code => ship method
614 | p_ship_to_loc_id => ship to location
615 | p_shipment_priority => shipment priority
616 | p_subinventory => subinventory
617 | p_trip_stop_id => trip stop
618 | p_delivery_id => delivery
619 | p_inventory_item_id => item
620 | p_locator_id => locator
621 | p_lot_number => lot number
622 | p_revision => revision
623 | p_org_id => organization
624 |
625 | Output Parameter
626 | x_pick_slip_number => pick_slip_number
627 =============================================================== */
628
629 PROCEDURE Insert_Key (
630 p_rule_index IN NUMBER,
631 p_header_id IN NUMBER,
632 p_customer_id IN NUMBER,
633 p_ship_method_code IN VARCHAR2,
634 p_ship_to_loc_id IN NUMBER,
635 p_shipment_priority IN VARCHAR2,
636 p_subinventory IN VARCHAR2,
637 p_trip_stop_id IN NUMBER,
638 p_delivery_id IN NUMBER,
639 p_inventory_item_id IN NUMBER,
640 p_locator_id IN NUMBER,
641 p_lot_number IN VARCHAR2,
642 p_revision IN VARCHAR2,
643 p_org_id IN NUMBER,
644 x_pick_slip_number OUT NOCOPY NUMBER )
645 IS
646 l_tab_size NUMBER;
647 BEGIN
648 SELECT WSH_PICK_SLIP_NUMBERS_S.NEXTVAL
649 INTO x_pick_slip_number
650 FROM DUAL;
651
652 l_tab_size := NVL(g_pskey_table.last,0);
653 g_pskey_table(l_tab_size+1).grouping_rule_id := g_rule_table(p_rule_index).grouping_rule_id;
654 IF (g_rule_table(p_rule_index).use_order_ps = 'Y') THEN
655 g_pskey_table(l_tab_size+1).header_id := p_header_id;
656 END IF;
657 IF (g_rule_table(p_rule_index).use_sub_ps = 'Y') THEN
658 g_pskey_table(l_tab_size+1).subinventory := p_subinventory;
659 END IF;
660 IF (g_rule_table(p_rule_index).use_customer_ps = 'Y') THEN
661 g_pskey_table(l_tab_size+1).customer_id := p_customer_id;
662 END IF;
663 IF (g_rule_table(p_rule_index).use_carrier_ps = 'Y') THEN
664 g_pskey_table(l_tab_size+1).ship_method_code := p_ship_method_code;
665 END IF;
666 IF (g_rule_table(p_rule_index).use_ship_to_ps = 'Y') THEN
667 g_pskey_table(l_tab_size+1).ship_to_loc_id := p_ship_to_loc_id;
668 END IF;
669 IF (g_rule_table(p_rule_index).use_ship_priority_ps = 'Y') THEN
670 g_pskey_table(l_tab_size+1).shipment_priority := p_shipment_priority;
671 END IF;
672 IF (g_rule_table(p_rule_index).use_trip_stop_ps = 'Y') THEN
673 g_pskey_table(l_tab_size+1).trip_stop_id := p_trip_stop_id;
674 END IF;
675 IF (g_rule_table(p_rule_index).use_delivery_ps = 'Y') THEN
676 g_pskey_table(l_tab_size+1).delivery_id := p_delivery_id;
677 END IF;
678
679 IF (g_rule_table(p_rule_index).use_item_ps = 'Y') THEN
680 g_pskey_table(l_tab_size+1).inventory_item_id := p_inventory_item_id;
681 END IF;
682 IF (g_rule_table(p_rule_index).use_locator_ps = 'Y') THEN
683 g_pskey_table(l_tab_size+1).locator_id := p_locator_id;
684 END IF;
685 IF (g_rule_table(p_rule_index).use_lot_ps = 'Y') THEN
686 g_pskey_table(l_tab_size+1).lot_number := p_lot_number;
687 END IF;
688 IF (g_rule_table(p_rule_index).use_revision_ps = 'Y') THEN
689 g_pskey_table(l_tab_size+1).revision := p_revision;
690 END IF;
691
692 g_pskey_table(l_tab_size+1).organization_id := p_org_id;
693 g_pskey_table(l_tab_size+1).pick_slip_number := x_pick_slip_number;
694 g_pskey_table(l_tab_size+1).counter := 1;
695 END Insert_Key;
696
697 END GMI_PR_PICK_SLIP_NUMBER;