1 PACKAGE PO_SHIPMENTS_SV1 AUTHID CURRENT_USER as
2 /* $Header: POXPOS1S.pls 115.2 2002/11/25 22:39:35 sbull ship $ */
3
4 /*===========================================================================
5 PACKAGE NAME: PO_SHIPMENTS_SV1
6
7 DESCRIPTION: Contains the server side Shipment APIS
8
9 CLIENT/SERVER: Server
10
11 LIBRARY NAME: NONE
12
13 OWNER: KPOWELL
14
15 PROCEDURES/FUNCTIONS:
16 get_shipment_num()
17 get_planned_ship_info()
18 val_ship_num_unique()
19 get_quantity_ordered()
20 get_quantity_released()
21 val_quantity_released()
22
23
24 ===========================================================================*/
25
26 /*===========================================================================
27 PROCEDURE NAME: get_shipment_num
28
29 DESCRIPTION: Gets the next shipment number to be defaulted for
30 a line or a release.
31
32 For a release, pass in release_id
33 For a po, rfq, quote, pass in line_id
34
35 PARAMETERS: X_po_release_id IN NUMBER
36 X_po_line_id IN NUMBER
37 X_shipment_num IN OUT NUMBER
38
39 DESIGN REFERENCES:
40
41
42 ALGORITHM: Get the maximum shipment number associated with
43 a release or a line.
44
45 If a value is not returned, then no shipments
46 have been created to date and the value should
47 be set to 1.
48
49 NOTES:
50
51 OPEN ISSUES:
52
53 CLOSED ISSUES:
54
55 CHANGE HISTORY: KPOWELL 4/20 Created
56
57 ===========================================================================*/
58 PROCEDURE get_shipment_num
59 (X_po_release_id IN NUMBER,
60 X_po_line_id IN NUMBER,
61 X_shipment_num IN OUT NOCOPY NUMBER);
62
63
64 /*===========================================================================
65 PROCEDURE NAME: get_planned_shipment_info
66
67 DESCRIPTION: Gets the planned shipment information when
68 creating a scheduled release shipment against
69 the planned shipment.
70
71 PARAMETERS: X_source_shipment_id IN NUMBER,
72 X_set_of_books_id IN NUMBER,
73 X_ship_to_location_code IN OUT VARCHAR2,
74 X_ship_to_location_id IN OUT NUMBER,
75 X_ship_to_org_code IN OUT VARCHAR2,
76 X_ship_to_organization_id IN OUT NUMBER,
77 X_quantity IN OUT NUMBER
78
79 DESIGN REFERENCES:
80
81
82 ALGORITHM: Get the information from the planned shipment.
83
84 Get the location code associated with the
85 planned ship to location id.
86
87 Get the organization code associated with the
88 planned ship to organization id.
89
90 NOTES:
91
92 OPEN ISSUES: DEBUG. Need to include the calls to the
93 location and organization routines. (KP - 5/4)
94
95
96 CLOSED ISSUES:
97
98 CHANGE HISTORY: KPOWELL 5/4 Created
99 SIYER 6/6 Added the calls to location
100 and org rtns.
101 Needed an additional parameter
102 X_set_of_books_id.
103 ===========================================================================*/
104 PROCEDURE get_planned_ship_info
105 (X_source_shipment_id IN NUMBER,
106 X_set_of_books_id IN NUMBER,
107 X_ship_to_location_code IN OUT NOCOPY VARCHAR2,
108 X_ship_to_location_id IN OUT NOCOPY NUMBER,
109 X_ship_to_org_code IN OUT NOCOPY VARCHAR2,
110 X_ship_to_organization_id IN OUT NOCOPY NUMBER,
111 X_quantity IN OUT NOCOPY NUMBER,
112 X_price_override IN OUT NOCOPY NUMBER,
113 X_promised_date IN OUT NOCOPY DATE,
114 X_need_by_date IN OUT NOCOPY DATE,
115 X_taxable_flag IN OUT NOCOPY VARCHAR2,
116 X_tax_name IN OUT NOCOPY VARCHAR2,
117 X_enforce_ship_to_location IN OUT NOCOPY VARCHAR2,
118 X_allow_substitute_receipts IN OUT NOCOPY VARCHAR2,
119 X_receiving_routing_id IN OUT NOCOPY NUMBER ,
120 X_qty_rcv_tolerance IN OUT NOCOPY NUMBER ,
121 X_qty_rcv_exception_code IN OUT NOCOPY VARCHAR2 ,
122 X_days_early_receipt_allowed IN OUT NOCOPY NUMBER ,
123 X_last_accept_date IN OUT NOCOPY DATE,
124 X_days_late_receipt_allowed IN OUT NOCOPY NUMBER ,
125 X_receipt_days_exception_code IN OUT NOCOPY VARCHAR2 ,
126 X_invoice_close_tolerance IN OUT NOCOPY NUMBER,
127 X_receive_close_tolerance IN OUT NOCOPY NUMBER,
128 X_accrue_on_receipt_flag IN OUT NOCOPY VARCHAR2,
129 X_receipt_required_flag IN OUT NOCOPY VARCHAR2,
130 X_inspection_required_flag IN OUT NOCOPY VARCHAR2);
131
132
133
134 /*===========================================================================
135 FUNCTION NAME: get_sched_released_qty
136
137 DESCRIPTION: Gets the quantity released against a planned
138 purchase order shipment or planned purchase
139 order line.
140
141 PARAMETERS: X_source_id IN NUMBER,
142 X_entity_level IN VARCHAR2,
143 X_shipment_type IN VARCHAR2
144
145 DESIGN REFERENCES:
146
147
148 ALGORITHM: If this is for a planned purchase order line,
149 get the quantity released as the sum of
150 quantity ordered - quantity cancelled for
151 all scheduled release shipments against
152 the planned purchase order line.
153
154 If this is for a planned purchase order shipment,
155 get the quantity released as the sum of
156 quantity ordered - quantity cancelled for
157 all scheduled release shipments against
158 the planned purchase order shipment.
159
160 If this is for a scheduled purchase order shipment,
161 1. get the planned purchase order shipment
162 number that it is create from
163 2. get the quantity released as the sum
164 of quantity ordered - quantity cancelled for
165 all scheduled release shipments against
166 the planned purchase order shipment.
167 NOTES:
168
169 OPEN ISSUES:
170
171 CLOSED ISSUES:
172
173 CHANGE HISTORY: KPOWELL 5/1 Created
174
175 ===========================================================================*/
176 FUNCTION get_sched_released_qty
177 (X_source_id IN NUMBER,
178 X_entity_level IN VARCHAR2,
179 X_shipment_type IN VARCHAR2) RETURN NUMBER;
180
181 /*===========================================================================
182 FUNCTION NAME: val_sched_released_qty
183
184 DESCRIPTION: Verify if the quantity released is greater
185 than the quantity ordered. If it is,
186 the form needs to display a message to the
187 user.
188
189 PARAMETERS: X_entity_level IN VARCHAR2,
190 X_line_id IN NUMBER,
191 X_line_location_id IN NUMBER,
192 X_shipment_type IN VARCHAR2,
193 X_quantity_ordered IN NUMBER,
194 X_source_shipment_id IN NUMBER
195
196 DESIGN REFERENCES:
197
198
199 ALGORITHM: This routine can be called either from the
200 planned purchase order line or shipment or
201 the scheduled release.
202
203 If this is called for a planned purchase order
204 shipment, the user should pass in the
205 quantity ordered on the purchase order shipment.
206 We will then call the routine to get the
207 total quantity released for the planned purchase
208 order shipment.
209
210 If this is called for a scheduled shipment,
211 the user will need to get the quantity ordered
212 on the planned purchase order shipment and
213 then the total quantity released against the
214 planned purchase order shipment.
215
216 If this is called for a planned purchase order
217 line, the user should pass in the quantity
218 ordered on the purchase order line.
219 We will then call the routine to get the
220 total quantity released for the planned purchase
221 order line.
222
223 If the quantity released is greater than the
224 quantity ordered, return failure.
225
226 NOTES:
227
228 OPEN ISSUES:
229
230 CLOSED ISSUES:
231
232 CHANGE HISTORY: KPOWELL 5/1 Created
233
234 ===========================================================================*/
235 FUNCTION val_sched_released_qty
236 (X_entity_level IN VARCHAR2,
237 X_line_id IN NUMBER,
238 X_line_location_id IN NUMBER,
239 X_shipment_type IN VARCHAR2,
240 X_quantity_ordered IN NUMBER,
241 X_source_shipment_id IN NUMBER ) RETURN BOOLEAN;
242
243 END PO_SHIPMENTS_SV1;