1 PACKAGE WSH_SHIPMENT_BATCH_PKG AUTHID CURRENT_USER AS
2 /* $Header: WSHSBPKS.pls 120.0.12020000.2 2013/01/17 03:57:11 ueshanka ship $ */
3
4 TYPE Shipment_Batch_Record IS RECORD (
5 customer_id WSH_DELIVERY_DETAILS.customer_id%TYPE,
6 organization_id WSH_DELIVERY_DETAILS.organization_id%TYPE,
7 ship_from_location_id WSH_DELIVERY_DETAILS.ship_from_location_id%TYPE,
8 org_id WSH_DELIVERY_DETAILS.org_id%TYPE,
9 currency_code WSH_DELIVERY_DETAILS.currency_code%TYPE,
10 ship_to_site_use_id WSH_DELIVERY_DETAILS.ship_to_site_use_id%TYPE,
11 invoice_to_site_use_id NUMBER,
12 deliver_to_site_use_id WSH_DELIVERY_DETAILS.deliver_to_site_use_id%TYPE,
13 ship_to_contact_id WSH_DELIVERY_DETAILS.ship_to_contact_id%TYPE,
14 invoice_to_contact_id NUMBER,
15 deliver_to_contact_id WSH_DELIVERY_DETAILS.deliver_to_contact_id%TYPE,
16 ship_method_code WSH_DELIVERY_DETAILS.ship_method_code%TYPE,
17 freight_terms_code WSH_DELIVERY_DETAILS.freight_terms_code%TYPE,
18 fob_code WSH_DELIVERY_DETAILS.fob_code%TYPE,
19 group_id NUMBER );
20
21 TYPE Shipment_Batch_Tbl IS TABLE OF Shipment_Batch_Record index by binary_integer;
22
23 --
24 --=============================================================================
25 -- PUBLIC PROCEDURE :
26 -- Create_Shipment_Batch
27 --
28 -- PARAMETERS:
29 -- errbuf => Message returned to Concurrent Manager
30 -- retcode => Code (0, 1, 2) returned to Concurrent Manager
31 -- p_organization_id => Orgnaization
32 -- p_customer_id => Consignee/Customer
33 -- p_ship_to_location_id => Ship To Location
34 -- p_transaction_type_id => Sales Order Type
35 -- p_from_order_number => From Order Number
36 -- p_to_order_number => To Order Number
37 -- p_from_request_date => From Request Date
38 -- p_to_request_date => To Request Date
39 -- p_from_schedule_date => From Schedule Date
40 -- p_to_schedule_date => To Schedule Date
41 -- p_shipment_priority => Shipment Priority
42 -- p_include_internal_so => Incude Internal Sales Order
43 -- Bug 14620571: Added parameter p_include_lines_with_hold
44 -- p_include_lines_with_hold => Include order lines with Hold
45 -- p_log_level => Either 1(Debug), 0(No Debug)
46 --
47 -- COMMENT:
48 -- API will be invoked from Concurrent Manager whenever concurrent program
49 -- 'Create Shipment Batches' is triggered.
50 -- Wrapper for 'Crete Shipment Batch' API
51 --=============================================================================
52 --
53 PROCEDURE Create_Shipment_Batch (
54 errbuf OUT NOCOPY VARCHAR2,
55 retcode OUT NOCOPY NUMBER,
56 p_organization_id IN NUMBER,
57 p_customer_id IN NUMBER,
58 p_ship_to_location_id IN NUMBER,
59 p_transaction_type_id IN NUMBER,
60 p_from_order_number IN VARCHAR2,
61 p_to_order_number IN VARCHAR2,
62 p_from_request_date IN VARCHAR2,
63 p_to_request_date IN VARCHAR2,
64 p_from_schedule_date IN VARCHAR2,
65 p_to_schedule_date IN VARCHAR2,
66 p_shipment_priority IN VARCHAR,
67 p_include_internal_so IN VARCHAR,
68 p_include_lines_with_hold IN VARCHAR DEFAULT 'N',
69 p_log_level IN NUMBER );
70 --
71 --=============================================================================
72 -- PUBLIC PROCEDURE :
73 -- Create_Shipment_Batch
74 --
75 -- PARAMETERS:
76 -- p_organization_id => Orgnaization
77 -- p_customer_id => Consignee/Customer
78 -- p_ship_to_location_id => Ship To Location
79 -- p_transaction_type_id => Sales Order Type
80 -- p_from_order_number => From Order Number
81 -- p_to_order_number => To Order Number
82 -- p_from_request_date => From Request Date
83 -- p_to_request_date => To Request Date
84 -- p_from_schedule_date => From Schedule Date
85 -- p_to_schedule_date => To Schedule Date
86 -- p_shipment_priority => Shipment Priority
87 -- p_include_internal_so => Incude Internal Sales Order
88 -- Bug 14620571: Added parameter p_include_lines_with_hold
89 -- p_include_lines_with_hold => Include order lines with Hold
90 -- x_return_status => Return Status of API (S,W,E,U)
91 --
92 -- COMMENT:
93 -- Based on input parameter values, eligble records from WDD are fetced.
94 -- Records fetched are grouped into Shipment Batches based on grouping
95 -- criteria returned from WSH_CUSTOM_PUB.Shipment_Batch_Group_Criteria
96 -- Custom API. A record is inserted into Wsh_Shipment_Batches table for
97 -- each shipment Batch and corresponding batch name is stamped in WDD.
98 --
99 -- Mandatory grouping criteria for Shipment Batch is
100 -- a) Customer
101 -- b) Ship To Site
102 -- c) Organization
103 -- d) Org (Operating Unit)
104 -- e) Currency Code
105 -- Optional grouping criteria for Shipment Batch is
106 -- a) Invoice To Location
107 -- b) Deliver To Location
108 -- c) Ship To Contact
109 -- d) Invoice To Contact
110 -- e) Deliver To Contact
111 -- f) Ship Method
112 -- g) Freight Terms
113 -- h) FOB
114 -- i) Within/Across Orders
115 --=============================================================================
116 --
117 PROCEDURE Create_Shipment_Batch (
118 p_organization_id IN NUMBER,
119 p_customer_id IN NUMBER,
120 p_ship_to_location_id IN NUMBER,
121 p_transaction_type_id IN NUMBER,
122 p_from_order_number IN VARCHAR2,
123 p_to_order_number IN VARCHAR2,
124 p_from_request_date IN VARCHAR2,
125 p_to_request_date IN VARCHAR2,
126 p_from_schedule_date IN VARCHAR2,
127 p_to_schedule_date IN VARCHAR2,
128 p_shipment_priority IN VARCHAR,
129 p_include_internal_so IN VARCHAR,
130 p_include_lines_with_hold IN VARCHAR DEFAULT 'N',
131 x_return_status OUT NOCOPY VARCHAR2 );
132 --
133 --=============================================================================
134 -- PUBLIC PROCEDURE :
135 -- Cancel_Line
136 --
137 -- PARAMETERS:
138 -- p_document_number => Shipment Batch Document Number
139 -- p_line_number => Shipment Batch Line Number
140 -- p_cancel_quantity => quantity to unassign from Shipment batch
141 -- x_return_status => Return Status of API (S,E,U)
142 --
143 -- COMMENT:
144 -- Delivery line(s) corresponding to document number and document line
145 -- number will be unassigned from Shipment Batch till the cancel quantity
146 -- is met.
147 --
148 --=============================================================================
149 --
150 PROCEDURE Cancel_Line(
151 p_document_number IN VARCHAR2,
152 p_line_number IN VARCHAR2,
153 p_cancel_quantity IN NUMBER,
154 x_return_status OUT NOCOPY VARCHAR2 );
155
156 END WSH_SHIPMENT_BATCH_PKG;