1 PACKAGE OKC_CONTRACT_DOCS_GRP AUTHID CURRENT_USER AS
2 /* $Header: OKCGCONTRACTDOCS.pls 120.0 2005/05/25 19:22:59 appldev noship $ */
3
4 G_COPY_PROGRAM_ID CONSTANT NUMBER := -99999;
5 G_ATTACH_ENTITY_NAME CONSTANT VARCHAR2(100) := 'OKC_CONTRACT_DOCS';
6 G_CURRENT_VERSION CONSTANT NUMBER := -99;
7
8
9 ---------------------------------------------------------------------------
10 -- Procedures and Functions
11 ---------------------------------------------------------------------------
12
13 PROCEDURE Insert_Contract_Doc(
14 p_api_version IN NUMBER,
15 p_init_msg_list IN VARCHAR2 ,
16 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
17 p_commit IN VARCHAR2 := FND_API.G_FALSE,
18
19 x_return_status OUT NOCOPY VARCHAR2,
20 x_msg_count OUT NOCOPY NUMBER,
21 x_msg_data OUT NOCOPY VARCHAR2,
22
23 p_business_document_type IN VARCHAR2,
24 p_business_document_id IN NUMBER,
25 p_business_document_version IN NUMBER,
26 p_attached_document_id IN NUMBER,
27 p_external_visibility_flag IN VARCHAR2,
28 p_effective_from_type IN VARCHAR2,
29 p_effective_from_id IN NUMBER,
30 p_effective_from_version IN NUMBER,
31 p_include_for_approval_flag IN VARCHAR2 := 'N',
32 p_create_fnd_attach IN VARCHAR2 := 'Y',
33 p_program_id IN NUMBER,
34 p_program_application_id IN NUMBER,
35 p_request_id IN NUMBER,
36 p_program_update_date IN DATE,
37 p_parent_attached_doc_id IN NUMBER := NULL,
38 p_generated_flag IN VARCHAR2 := 'N',
39 p_delete_flag IN VARCHAR2 := 'N',
40
41 p_primary_contract_doc_flag IN VARCHAR2 := 'N',
42 p_mergeable_doc_flag IN VARCHAR2 := 'N',
43 p_versioning_flag IN VARCHAR2 := 'N',
44
45 x_business_document_type OUT NOCOPY VARCHAR2,
46 x_business_document_id OUT NOCOPY NUMBER,
47 x_business_document_version OUT NOCOPY NUMBER,
48 x_attached_document_id OUT NOCOPY NUMBER
49
50 );
51
52
53
54 PROCEDURE Update_Contract_Doc(
55 p_api_version IN NUMBER,
56 p_init_msg_list IN VARCHAR2 ,
57 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
58 p_commit IN VARCHAR2 := FND_API.G_FALSE,
59
60 x_return_status OUT NOCOPY VARCHAR2,
61 x_msg_count OUT NOCOPY NUMBER,
62 x_msg_data OUT NOCOPY VARCHAR2,
63
64 p_business_document_type IN VARCHAR2,
65 p_business_document_id IN NUMBER,
66 p_business_document_version IN NUMBER,
67 p_attached_document_id IN NUMBER,
68 p_external_visibility_flag IN VARCHAR2,
69 p_effective_from_type IN VARCHAR2,
70 p_effective_from_id IN NUMBER,
71 p_effective_from_version IN NUMBER,
72 p_include_for_approval_flag IN VARCHAR2 := 'N',
73 p_program_id IN NUMBER,
74 p_program_application_id IN NUMBER,
75 p_request_id IN NUMBER,
76 p_program_update_date IN DATE,
77 p_parent_attached_doc_id IN NUMBER,
78 p_generated_flag IN VARCHAR2 := 'N',
79 p_delete_flag IN VARCHAR2 := 'N',
80 p_primary_contract_doc_flag IN VARCHAR2 := NULL,
81 p_mergeable_doc_flag IN VARCHAR2 := NULL,
82 p_object_version_number IN NUMBER,
83 p_versioning_flag IN VARCHAR2 := 'N'
84 );
85
86 PROCEDURE Delete_Contract_Doc(
87 p_api_version IN NUMBER,
88 p_init_msg_list IN VARCHAR2 ,
89 p_commit IN VARCHAR2 := FND_API.G_FALSE,
90
91 x_return_status OUT NOCOPY VARCHAR2,
92 x_msg_count OUT NOCOPY NUMBER,
93 x_msg_data OUT NOCOPY VARCHAR2,
94
95 p_business_document_type IN VARCHAR2,
96 p_business_document_id IN NUMBER,
97 p_business_document_version IN NUMBER,
98 p_attached_document_id IN NUMBER,
99 p_doc_approved_flag IN VARCHAR2 := 'N',
100
101 p_object_version_number IN NUMBER
102 );
103
104
105
106 -- Start of comments
107 -- API name : Version_Attachments
108 -- Type : Group
109 -- Pre-reqs : None.
110 -- Function : This API moves current attachments to the specified business
111 -- document version..
112 -- Parameters:
113 -- IN :p_api_version IN NUMBER Required
114 -- The API version number
115 -- p_init_msg_list IN NUMBER
116 -- Message list initialization flag
117 -- p_validation_level IN NUMBER
118 -- Validation level of in the API
119 -- p_commit IN NUMBER
120 -- Transaction commit flag
121 -- p_business_document_type IN VARCHAR2 Required
122 -- The business document type.
123 -- p_business_document_id IN NUMBER Required
124 -- The business document identifier
125 -- p_business_document_version IN NUMBER Required
126 -- The business document version
127 -- OUT :x_return_status OUT VARCHAR2
128 -- Overall return status
129 -- x_msg_count OUT NUMBER
130 -- number of messages in the API message list
131 -- x_msg_data OUT VARCHAR2
132 -- The message in an encoded format
133 -- Version:Current version 1.0
134 -- End of comments
135 PROCEDURE Version_Attachments(
136 p_api_version IN NUMBER,
137 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
138 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
139 p_commit IN VARCHAR2 := FND_API.G_FALSE,
140
141 x_return_status OUT NOCOPY VARCHAR2,
142 x_msg_count OUT NOCOPY NUMBER,
143 x_msg_data OUT NOCOPY VARCHAR2,
144
145 p_business_document_type IN VARCHAR2,
146 p_business_document_id IN NUMBER,
147 p_business_document_version IN NUMBER,
148 p_include_gen_attach IN VARCHAR2 DEFAULT 'Y'
149 );
150
151
152
153 -- Start of comments
154 -- API name : Delete_Doc_Attachments
155 -- Type : Group
156 -- Pre-reqs : None.
157 -- Function : Deletes attachments of all versions of a business document.
158 -- Parameters:
159 -- IN :p_api_version IN NUMBER Required
160 -- The API version number
161 -- p_init_msg_list IN NUMBER
162 -- Message list initialization flag
163 -- p_validation_level IN NUMBER
164 -- Validation level of in the API
165 -- p_commit IN NUMBER
166 -- Transaction commit flag
167 -- p_business_document_type IN VARCHAR2 Required
168 -- The business document type.
169 -- p_business_document_id IN NUMBER Required
170 -- The business document identifier
171 -- OUT :x_return_status OUT VARCHAR2
172 -- Overall return status
173 -- x_msg_count OUT NUMBER
174 -- number of messages in the API message list
175 -- x_msg_data OUT VARCHAR2
176 -- The message in an encoded format
177 -- Version:Current version 1.0
178 -- End of comments
179 PROCEDURE Delete_Doc_Attachments(
180 p_api_version IN NUMBER,
181 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
182 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
183 p_commit IN VARCHAR2 := FND_API.G_FALSE,
184
185 x_return_status OUT NOCOPY VARCHAR2,
186 x_msg_count OUT NOCOPY NUMBER,
187 x_msg_data OUT NOCOPY VARCHAR2,
188
189 p_business_document_type IN VARCHAR2,
190 p_business_document_id IN NUMBER
191
192 );
193
194
195 -- Start of comments
196 -- API name : Delete_Ver_Attachments
197 -- Type : Group
198 -- Pre-reqs : None.
199 -- Function : Deletes attachments of a business document version.
200 -- Parameters:
201 -- IN :p_api_version IN NUMBER Required
202 -- The API version number
203 -- p_init_msg_list IN NUMBER
204 -- Message list initialization flag
205 -- p_validation_level IN NUMBER
206 -- Validation level of in the API
207 -- p_commit IN NUMBER
208 -- Transaction commit flag
209 -- p_business_document_type IN VARCHAR2 Required
210 -- The business document type.
211 -- p_business_document_id IN NUMBER Required
212 -- The business document identifier
213 -- p_business_document_version IN NUMBER Required
214 -- The business document version
215 -- OUT :x_return_status OUT VARCHAR2
216 -- Overall return status
217 -- x_msg_count OUT NUMBER
218 -- number of messages in the API message list
219 -- x_msg_data OUT VARCHAR2
220 -- The message in an encoded format
221 -- Version:Current version 1.0
222 -- End of comments
223 PROCEDURE Delete_Ver_Attachments(
224 p_api_version IN NUMBER,
225 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
226 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
227 p_commit IN VARCHAR2 := FND_API.G_FALSE,
228
229 x_return_status OUT NOCOPY VARCHAR2,
230 x_msg_count OUT NOCOPY NUMBER,
231 x_msg_data OUT NOCOPY VARCHAR2,
232
233 p_business_document_type IN VARCHAR2,
234 p_business_document_id IN NUMBER,
235 p_business_document_version IN NUMBER
236
237 );
238
239 -- Start of comments
240 -- API name : Copy_Attachments
241 -- Type : Group
242 -- Pre-reqs : None.
243 -- Function : Copies attachments of a business document version to another business
244 -- document version.
245 -- If p_copy_for_amendment = 'Y'
246 -- copy all categories
247 -- else if p_copy_primary_doc_flag = 'Y"
248 -- Copy PCD (in ref copy)
249 -- Copy contract category docs (in deep copy)
250 -- else if p_from_bus_doc_type = p_to_bus_doc_type
251 -- Copy only Contract and Support documents
252 -- else
253 -- copy all categories
254 -- Parameters:
255 -- IN :p_api_version IN NUMBER Required
256 -- The API version number
257 -- p_init_msg_list IN NUMBER
258 -- Message list initialization flag
259 -- p_validation_level IN NUMBER
260 -- Validation level of in the API
261 -- p_commit IN NUMBER
262 -- Transaction commit flag
263 -- p_from_bus_doc_type IN VARCHAR2 Required
264 -- The business document type of the document to be copied.
265 -- p_from_bus_doc_id IN NUMBER Required
266 -- The business document identifier of the document to be copied.
267 -- p_from_bus_doc_version IN NUMBER Required
268 -- The business document version of the document to be copied.
269 -- p_to_bus_doc_type IN VARCHAR2 Required
270 -- The business document type of the new document.
271 -- p_to_bus_doc_id IN NUMBER Required
272 -- The business document identifier of the new document.
273 -- p_to_bus_doc_version IN NUMBER Required
274 -- The business document version of the document of the new document.
275 -- p_copy_by_ref IN VARCHAR2 Optional
276 -- The flag indicates whether the destination sttachments should be
277 -- created as reference attachments.
278 -- p_copy_primary_doc_flag IN VARCHAR2 Optional
279 -- p_copy_primary_doc_flag='Y' will now copy 'Contract' category documents only.
280 -- p_copy_for_amendment IN VARCHAR2 Optional
281 -- The flag indicates whether this API has been called for for creating
282 -- a new version in sourcing and quoting applications
283 -- OUT :x_return_status OUT VARCHAR2
284 -- Overall return status
285 -- x_msg_count OUT NUMBER
286 -- number of messages in the API message list
287 -- x_msg_data OUT VARCHAR2
288 -- The message in an encoded format
289 -- Version:Current version 1.0
290 -- End of comments
291 PROCEDURE Copy_Attachments(
292 p_api_version IN NUMBER,
293 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
294 p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
295 p_commit IN VARCHAR2 := FND_API.G_FALSE,
296
297 x_return_status OUT NOCOPY VARCHAR2,
298 x_msg_count OUT NOCOPY NUMBER,
299 x_msg_data OUT NOCOPY VARCHAR2,
300
301 p_from_bus_doc_type IN VARCHAR2,
302 p_from_bus_doc_id IN NUMBER,
303 p_from_bus_doc_version IN NUMBER := G_CURRENT_VERSION,
304 p_to_bus_doc_type IN VARCHAR2,
305 p_to_bus_doc_id IN NUMBER,
306 p_to_bus_doc_version IN NUMBER := G_CURRENT_VERSION,
307 p_copy_by_ref IN VARCHAR2 := 'Y',
308 p_copy_primary_doc_flag IN VARCHAR2 := 'N',
309 p_copy_for_amendment IN VARCHAR2 := 'N'
310
311 );
312
313
314 PROCEDURE qa_doc(
315 p_api_version IN NUMBER,
316 x_return_status OUT NOCOPY VARCHAR2,
317 x_msg_count OUT NOCOPY NUMBER,
318 x_msg_data OUT NOCOPY VARCHAR2,
319
320 p_doc_type IN VARCHAR2,
321 p_doc_id IN NUMBER,
322
323 x_qa_result_tbl OUT NOCOPY OKC_TERMS_QA_GRP.qa_result_tbl_type,
324 x_qa_return_status OUT NOCOPY VARCHAR2
325 );
326
327 FUNCTION Is_Primary_Terms_Doc_Mergeable(
328 p_document_type IN VARCHAR2,
329 p_document_id IN NUMBER
330 ) RETURN VARCHAR2;
331
332 FUNCTION Get_Primary_Terms_Doc_File_Id(
333 p_document_type IN VARCHAR2,
334 p_document_id IN NUMBER
335 ) RETURN NUMBER;
336
337 FUNCTION Has_Primary_Contract_Doc(
338 p_document_type IN VARCHAR2,
339 p_document_id IN NUMBER
340 ) RETURN VARCHAR2;
341
342 PROCEDURE Clear_Primary_Doc_Flag(
343 p_document_type IN VARCHAR2,
344 p_document_id IN NUMBER,
345 x_return_status OUT NOCOPY VARCHAR2
346 );
347
348 END OKC_CONTRACT_DOCS_GRP;