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