1 PACKAGE PO_DOCUMENT_UPDATE_PVT AS
2 /* $Header: POXVCPOS.pls 120.2 2005/09/05 03:26:00 arudas noship $*/
3
4 -------------------------------------------------------------------------------
5 --Start of Comments
6 --Name: update_document
7 --Function:
8 -- Validates and applies the requested changes and any derived
9 -- changes to the Purchase Order, Purchase Agreement, or Release.
10 --Note:
11 -- For details, see the package body comments.
12 --End of Comments
13 -------------------------------------------------------------------------------
14 PROCEDURE update_document (
15 p_api_version IN NUMBER,
16 p_init_msg_list IN VARCHAR2,
17 x_return_status OUT NOCOPY VARCHAR2,
18 p_changes IN OUT NOCOPY PO_CHANGES_REC_TYPE,
19 p_run_submission_checks IN VARCHAR2,
20 p_launch_approvals_flag IN VARCHAR2,
21 p_buyer_id IN NUMBER,
22 p_update_source IN VARCHAR2,
23 p_override_date IN DATE,
24 x_api_errors OUT NOCOPY PO_API_ERRORS_REC_TYPE,
25 p_approval_background_flag IN VARCHAR2 DEFAULT NULL,
26 p_mass_update_releases IN VARCHAR2 DEFAULT NULL -- Bug 3373453
27 );
28
29 -- Bug 3605355 START
30 -------------------------------------------------------------------------------
31 --Start of Comments
32 --Name: launch_po_approval_wf
33 --Function:
34 -- Launches the Document Approval workflow for the given document.
35 --Note:
36 -- For details, see the package body comments for
37 -- PO_DOCUMENT_UPDATE_PVT.launch_po_approval_wf.
38 --End of Comments
39 -------------------------------------------------------------------------------
40 PROCEDURE launch_po_approval_wf (
41 p_api_version IN NUMBER,
42 p_init_msg_list IN VARCHAR2,
43 x_return_status OUT NOCOPY VARCHAR2,
44 p_document_id IN NUMBER,
45 p_document_type IN PO_DOCUMENT_TYPES_ALL_B.document_type_code%TYPE,
46 p_document_subtype IN PO_DOCUMENT_TYPES_ALL_B.document_subtype%TYPE,
47 p_preparer_id IN NUMBER,
48 p_approval_background_flag IN VARCHAR2,
49 p_mass_update_releases IN VARCHAR2,
50 p_retroactive_price_change IN VARCHAR2
51 );
52 -- Bug 3605355 END
53
54 -- Parameter value constants:
55
56 G_PARAMETER_YES VARCHAR2(1) := PO_CORE_S.G_PARAMETER_YES;
57 G_PARAMETER_NO VARCHAR2(1) := PO_CORE_S.G_PARAMETER_NO;
58
59 -- Constants for the p_update_source parameter of update_document:
60
61 G_UPDATE_SOURCE_OM CONSTANT VARCHAR2(10) := 'OM'; -- OM (Drop Ship Integration)
62
63 -- Entity type constants:
64
65 G_ENTITY_TYPE_CHANGES CONSTANT VARCHAR2(30) := 'PO_CHANGES_REC_TYPE';
66 G_ENTITY_TYPE_LINES CONSTANT VARCHAR2(30) := 'PO_LINES_REC_TYPE';
67 G_ENTITY_TYPE_SHIPMENTS CONSTANT VARCHAR2(30) := 'PO_SHIPMENTS_REC_TYPE';
68 G_ENTITY_TYPE_DISTRIBUTIONS CONSTANT VARCHAR2(30)
69 := 'PO_DISTRIBUTIONS_REC_TYPE';
70
71 -- Use this constant in the change object to indicate that a field should be
72 -- set to NULL.
73 G_NULL_NUM CONSTANT NUMBER := 9.99E125; -- (See FND_API.G_MISS_NUM.)
74
75 G_CALL_MOD_HTML_CONTROL_ACTION CONSTANT VARCHAR2(30) :='HTML_CONTROL_ACTION';
76 -------------------------------------------------------------------------------
77 --Start of Comments
78 --Name: init_change_indexes
79 --Function:
80 -- Clears the change indexes, including the line changes index, the
81 -- shipment changes index, etc.
82 --End of Comments
83 -------------------------------------------------------------------------------
84 PROCEDURE init_change_indexes;
85
86 -------------------------------------------------------------------------------
87 --Start of Comments
88 --Name: add_line_change_to_index
89 --Function:
90 -- Adds the i-th line change in p_chg to the line changes index.
91 -- Raises a duplicate_change_exception if the index already has a change
92 -- for the same PO_LINE_ID.
93 --End of Comments
94 -------------------------------------------------------------------------------
95 PROCEDURE add_line_change_to_index (
96 p_chg IN PO_CHANGES_REC_TYPE,
97 i IN NUMBER
98 );
99
100 -------------------------------------------------------------------------------
101 --Start of Comments
102 --Name: add_ship_change_to_index
103 --Function:
104 -- Adds the i-th shipment change in p_chg to the shipment changes index.
105 -- Raises a duplicate_change_exception if the index already has a change
106 -- for the same LINE_LOCATION_ID.
107 --End of Comments
108 -------------------------------------------------------------------------------
109 PROCEDURE add_ship_change_to_index (
110 p_chg IN PO_CHANGES_REC_TYPE,
111 i IN NUMBER
112 );
113
114 -------------------------------------------------------------------------------
115 --Start of Comments
116 --Name: add_dist_change_to_index
117 --Function:
118 -- Adds the i-th distribution change in p_chg to the distribution changes
119 -- index. Raises a duplicate_change_exception if the index already has a
120 -- change for the same PO_DISTRIBUTION_ID.
121 --End of Comments
122 -------------------------------------------------------------------------------
123 PROCEDURE add_dist_change_to_index (
124 p_chg IN PO_CHANGES_REC_TYPE,
125 i IN NUMBER
126 );
127
128 -------------------------------------------------------------------------------
129 --Start of Comments
130 --Name: get_line_change
131 --Function:
132 -- Returns the index of the line change for p_po_line_id.
133 -- If none exists, returns NULL.
134 --End of Comments
135 -------------------------------------------------------------------------------
136 FUNCTION get_line_change (
137 p_po_line_id IN PO_LINES.po_line_id%TYPE
138 ) RETURN NUMBER;
139
140 -------------------------------------------------------------------------------
141 --Start of Comments
142 --Name: find_line_change
143 --Function:
144 -- Returns the index of the line change for p_po_line_id.
145 -- If none exists, adds a line change for p_po_line_id and returns its index.
146 --End of Comments
147 -------------------------------------------------------------------------------
148 FUNCTION find_line_change (
149 p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
150 p_po_line_id IN PO_LINES.po_line_id%TYPE
151 ) RETURN NUMBER;
152
153 -------------------------------------------------------------------------------
154 --Start of Comments
155 --Name: get_ship_change
156 --Function:
157 -- Returns the index of the shipment change for p_po_line_id.
158 -- If none exists, returns NULL.
159 --End of Comments
160 -------------------------------------------------------------------------------
161 FUNCTION get_ship_change (
162 p_line_location_id IN PO_LINE_LOCATIONS.line_location_id%TYPE
163 ) RETURN NUMBER;
164
165 -------------------------------------------------------------------------------
166 --Start of Comments
167 --Name: find_ship_change
168 --Function:
169 -- Returns the index of the shipment change for p_line_location_id.
170 -- If none exists, adds a shipment change for p_line_location_id and
171 -- returns its index.
172 --End of Comments
173 -------------------------------------------------------------------------------
174 FUNCTION find_ship_change (
175 p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
176 p_line_location_id IN PO_LINE_LOCATIONS.line_location_id%TYPE
177 ) RETURN NUMBER;
178
179 -------------------------------------------------------------------------------
180 --Start of Comments
181 --Name: get_dist_change
182 --Function:
183 -- Returns the index of the distribution change for p_po_distribution_id.
184 -- If none exists, returns NULL.
185 --End of Comments
186 -------------------------------------------------------------------------------
187 FUNCTION get_dist_change (
188 p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
189 ) RETURN NUMBER;
190
191 -------------------------------------------------------------------------------
192 --Start of Comments
193 --Name: find_dist_change
194 --Function:
195 -- Returns the index of the distribution change for p_po_distribution_id.
196 -- If none exists, adds a distribution change for p_po_distribution_id and
197 -- returns its index.
198 --End of Comments
199 -------------------------------------------------------------------------------
200 FUNCTION find_dist_change (
201 p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
202 p_po_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE
203 ) RETURN NUMBER;
204
205 -------------------------------------------------------------------------------
206 --Start of Comments
207 --Name: get_split_ship_change
208 --Function:
209 -- Returns the index of the split shipment change for p_parent_line_location_id
210 -- and p_split_shipment_num. If none exists, returns NULL.
211 --End of Comments
212 -------------------------------------------------------------------------------
213 FUNCTION get_split_ship_change (
214 p_chg IN PO_CHANGES_REC_TYPE,
215 p_po_line_id IN PO_LINES.po_line_id%TYPE,
216 p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
217 p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
218 ) RETURN NUMBER;
219
220 -------------------------------------------------------------------------------
221 --Start of Comments
222 --Name: get_split_dist_change
223 --Function:
224 -- Returns the index of the split distribution change for
225 -- p_parent_distribution_id and p_split_shipment_num.
226 -- If none exists, returns NULL.
227 --End of Comments
228 -------------------------------------------------------------------------------
229 FUNCTION get_split_dist_change (
230 p_chg IN PO_CHANGES_REC_TYPE,
231 p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
232 p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
233 p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
234 ) RETURN NUMBER;
235
236 -------------------------------------------------------------------------------
237 --Start of Comments
238 --Name: find_split_dist_change
239 --Function:
240 -- Returns the index of the split distribution change for
241 -- p_parent_distribution_id and p_split_shipment_num.
242 -- If none exists, adds a distribution change for this split distribution
243 -- and returns its index.
244 --End of Comments
245 -------------------------------------------------------------------------------
246 FUNCTION find_split_dist_change (
247 p_chg IN OUT NOCOPY PO_CHANGES_REC_TYPE,
248 p_parent_distribution_id IN PO_DISTRIBUTIONS.po_distribution_id%TYPE,
249 p_parent_line_loc_id IN PO_LINE_LOCATIONS.line_location_id%TYPE,
250 p_split_shipment_num IN PO_LINE_LOCATIONS.shipment_num%TYPE
251 ) RETURN NUMBER;
252
253 -------------------------------------------------------------------------------
254 --Start of Comments
255 --Name: add_error
256 --Function:
257 -- Adds an error message to p_api_errors.
258 --End of Comments
259 -------------------------------------------------------------------------------
260 PROCEDURE add_error
261 ( p_api_errors IN OUT NOCOPY PO_API_ERRORS_REC_TYPE,
262 x_return_status OUT NOCOPY VARCHAR2,
263 p_message_name IN VARCHAR2,
264 p_message_text IN VARCHAR2 DEFAULT NULL,
265 p_table_name IN VARCHAR2 DEFAULT NULL,
266 p_column_name IN VARCHAR2 DEFAULT NULL,
267 p_entity_type IN VARCHAR2 DEFAULT NULL,
268 p_entity_id IN NUMBER DEFAULT NULL,
269 p_token_name1 IN VARCHAR2 DEFAULT NULL,
270 p_token_value1 IN VARCHAR2 DEFAULT NULL,
271 p_token_name2 IN VARCHAR2 DEFAULT NULL,
272 p_token_value2 IN VARCHAR2 DEFAULT NULL,
273 p_module IN VARCHAR2 DEFAULT NULL,
274 p_level IN VARCHAR2 DEFAULT NULL,
275 p_message_type IN VARCHAR2 DEFAULT NULL
276 );
277
278 -------------------------------------------------------------------------------
279 --Start of Comments
280 --Name: add_message_list_errors
281 --Function:
282 -- Adds all the messages on the standard API message list to p_api_errors.
283 --End of Comments
284 -------------------------------------------------------------------------------
285 PROCEDURE add_message_list_errors
286 ( p_api_errors IN OUT NOCOPY PO_API_ERRORS_REC_TYPE,
287 x_return_status OUT NOCOPY VARCHAR2,
288 p_start_index IN NUMBER DEFAULT NULL,
289 p_entity_type IN VARCHAR2 DEFAULT NULL,
290 p_entity_id IN NUMBER DEFAULT NULL
291 );
292
293 --<HTML Agreements R12 Start>
294 PROCEDURE validate_delete_action( p_entity IN VARCHAR2
295 ,p_doc_type IN VARCHAR2
296 ,p_doc_header_id IN NUMBER
297 ,p_po_line_id IN NUMBER
298 ,p_line_loc_id IN NUMBER
299 ,p_distribution_id IN NUMBER
300 ,x_error_message OUT NOCOPY VARCHAR2);
301
302 PROCEDURE process_delete_action( p_init_msg_list IN VARCHAR2
303 ,x_return_status OUT NOCOPY VARCHAR2
304 ,p_calling_program IN VARCHAR2
305 ,p_entity IN VARCHAR2
306 ,p_entity_row_id IN ROWID
307 ,p_doc_type IN VARCHAR2
308 ,p_doc_subtype IN VARCHAR2
309 ,p_doc_header_id IN NUMBER
310 ,p_ga_flag IN VARCHAR2
311 ,p_conterms_exist_flag IN VARCHAR2
312 ,p_po_line_id IN NUMBER
313 ,p_line_loc_id IN NUMBER
314 ,p_distribution_id IN NUMBER
315 ,x_error_msg_tbl OUT NOCOPY PO_TBL_VARCHAR2000);
316 --<HTML Agreements R12 End>
317 END PO_DOCUMENT_UPDATE_PVT;