1 PACKAGE pa_acc_gen_wf_pkg AUTHID CURRENT_USER AS
2 /* $Header: PAXWFACS.pls 120.6.12020000.2 2012/07/19 10:59:38 admarath ship $ */
3
4 /* Bug# 3182416 :Moved the declaration of g_ variables from body to spec */
5
6 g_error_message VARCHAR2(1000) DEFAULT NULL;
7 g_error_stack VARCHAR2(500) DEFAULT NULL;
8 g_error_stage VARCHAR2(100) DEFAULT NULL;
9
10 /* Bug 5233487 - Added new variable to store the the encoded error message */
11 g_encoded_error_message VARCHAR2(2000) := NULL;
12
13 g_invoice_id NUMBER(15) DEFAULT NULL; -- added for bug 13875781
14
15 ----------------------------------------------------------------------------------
16 -- Start of comments
17 --
18 -- API Name : pa_acc_gen_wf_pkg.wf_acc_derive_params
19 --
20 -- Type : Public
21 --
22 -- Pre-reqs : None
23 --
24 -- Function : This procedure is called from the Oracle Payables and Oracle
25 -- Purchasing prior to calling Workflow for account generation.
26 -- The procedure accepts five input parameters and derives
27 -- the value of the other parameters which are then available to the
28 -- calling program. The objective is to provide all the parameters
29 -- (input and output) as attributes with values in them when workflow
30 -- is invoked so that the user does not have to code/call any functions
31 -- to retrieve the values of those variables.
32 --
33 --
34 -- Parameters :
35 -- p_project_id IN NUMBER Required
36 -- p_task_id IN NUMBER
37 -- p_expenditure_type IN VARCHAR2
38 -- p_vendor_id IN NUMBER Required
39 -- p_expenditure_organization_id IN NUMBER
40 -- p_expenditure_item_date IN DATE
41 -- x_class_code OUT VARCHAR2
42 -- x_direct_flag OUT VARCHAR2
43 -- x_expenditure_category OUT VARCHAR2
44 -- x_expenditure_org_name OUT VARCHAR2
45 -- x_project_number OUT VARCHAR2
46 -- x_project_organization_name OUT VARCHAR2
47 -- x_project_organization_id OUT NUMBER
48 -- x_project_type OUT VARCHAR2
49 -- x_public_sector_flag OUT VARCHAR2
50 -- x_revenue_category OUT VARCHAR2
51 -- x_task_number OUT VARCHAR2
52 -- x_task_organization_name OUT VARCHAR2
53 -- x_task_organization_id OUT NUMBER
54 -- x_task_service_type OUT VARCHAR2
55 -- x_top_task_id OUT NUMBER
56 -- x_top_task_number OUT VARCHAR2
57 -- x_vendor_employee_id OUT NUMBER
58 -- x_vendor_employee_number OUT VARCHAR2
59 -- x_vendor_type OUT VARCHAR2
60 --
61 -- Version : Initial version 11.0
62 --
63 -- End of comments
64 ----------------------------------------------------------------------------------
65
66 PROCEDURE wf_acc_derive_params (
67 p_project_id IN pa_projects_all.project_id%TYPE,
68 p_task_id IN pa_tasks.task_id%TYPE,
69 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
70 p_vendor_id IN po_vendors.vendor_id%type,
71 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
72 p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE,
73 x_class_code OUT NOCOPY pa_class_codes.class_code%TYPE,
74 x_direct_flag OUT NOCOPY pa_project_types_all.direct_flag%TYPE,
75 x_expenditure_category OUT NOCOPY pa_expenditure_categories.expenditure_category%TYPE,
76 x_expenditure_org_name OUT NOCOPY hr_organization_units.name%TYPE,
77 x_project_number OUT NOCOPY pa_projects_all.segment1%TYPE,
78 x_project_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
79 x_project_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
80 x_project_type OUT NOCOPY pa_project_types_all.project_type%TYPE,
84 x_task_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
81 x_public_sector_flag OUT NOCOPY pa_projects_all.public_sector_flag%TYPE,
82 x_revenue_category OUT NOCOPY pa_expenditure_types.revenue_category_code%TYPE,
83 x_task_number OUT NOCOPY pa_tasks.task_number%TYPE,
85 x_task_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
86 x_task_service_type OUT NOCOPY pa_tasks.service_type_code%TYPE,
87 x_top_task_id OUT NOCOPY pa_tasks.task_id%TYPE,
88 x_top_task_number OUT NOCOPY pa_tasks.task_number%TYPE,
89 x_vendor_employee_id OUT NOCOPY per_people_f.person_id%TYPE,
90 x_vendor_employee_number OUT NOCOPY per_people_f.employee_number%TYPE,
91 x_vendor_type OUT NOCOPY po_vendors.vendor_type_lookup_code%TYPE);
92
93 --------------------------------------------------------------------------------
94 --
95 -- Start of comments
96 --
97 -- API Name : pa_acc_gen_wf_pkg.wf_acc_derive_er_params
98 --
99 -- Type : Public
100 --
101 -- Pre-reqs : None
102 --
103 -- Function : This procedure is called from the Oracle web expenses
104 -- prior to calling Workflow for account generation.
105 -- The procedure accepts ten input parameters and derives
106 -- the value of the other parameters which are then available to the
107 -- calling program. The objective is to provide all the parameters
108 -- (input and output) as attributes with values in them when workflow
109 -- is invoked so that the user does not have to code/call any functions
110 -- to retrieve the values of those variables.
111 --
112 --
113 -- Parameters :
114 -- p_project_id IN NUMBER Required
115 -- p_task_id IN NUMBER
116 -- p_expenditure_type IN VARCHAR2
117 -- p_vendor_id IN NUMBER Required
118 -- p_expenditure_organization_id IN NUMBER
119 -- p_expenditure_item_date IN DATE
120 -- p_calling_module IN VARCHAR2
121 -- p_employee_id IN NUMBER
122 -- p_employee_ccid IN OUT NUMBER
123 -- p_expense_type IN VARCHAR2
124 -- p_expense_cc IN VARCHAR2
125 -- x_class_code OUT VARCHAR2
126 -- x_direct_flag OUT VARCHAR2
127 -- x_expenditure_category OUT VARCHAR2
128 -- x_expenditure_org_name OUT VARCHAR2
129 -- x_project_number OUT VARCHAR2
130 -- x_project_organization_name OUT VARCHAR2
131 -- x_project_organization_id OUT NUMBER
132 -- x_project_type OUT VARCHAR2
133 -- x_public_sector_flag OUT VARCHAR2
134 -- x_revenue_category OUT VARCHAR2
135 -- x_task_number OUT VARCHAR2
136 -- x_task_organization_name OUT VARCHAR2
137 -- x_task_organization_id OUT NUMBER
138 -- x_task_service_type OUT VARCHAR2
139 -- x_top_task_id OUT NUMBER
140 -- x_top_task_number OUT VARCHAR2
141 -- x_vendor_employee_number OUT VARCHAR2
142 -- x_vendor_type OUT VARCHAR2
143 --
144 -- Version : Initial version 11.0
145 --
146 -- End of comments
147 --------------------------------------------------------------------------------
148 --
149
150 PROCEDURE wf_acc_derive_er_params (
151 p_project_id IN pa_projects_all.project_id%TYPE,
152 p_task_id IN pa_tasks.task_id%TYPE,
153 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
154 p_vendor_id IN po_vendors.vendor_id%type,
155 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
156 p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE,
157 p_calling_module IN VARCHAR2,
158 p_employee_id IN per_people_f.person_id%TYPE,
159 p_employee_ccid IN OUT NOCOPY gl_code_combinations.code_combination_id%TYPE,
160 p_expense_type IN ap_expense_report_lines_all.web_parameter_id%TYPE,
161 p_expense_cc IN ap_expense_report_headers_all.flex_concatenated%TYPE,
162 x_class_code OUT NOCOPY pa_class_codes.class_code%TYPE,
163 x_direct_flag OUT NOCOPY pa_project_types_all.direct_flag%TYPE,
164 x_expenditure_category OUT NOCOPY pa_expenditure_categories.expenditure_category%TYPE,
165 x_expenditure_org_name OUT NOCOPY hr_organization_units.name%TYPE,
166 x_project_number OUT NOCOPY pa_projects_all.segment1%TYPE,
167 x_project_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
168 x_project_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
169 x_project_type OUT NOCOPY pa_project_types_all.project_type%TYPE,
170 x_public_sector_flag OUT NOCOPY pa_projects_all.public_sector_flag%TYPE,
171 x_revenue_category OUT NOCOPY pa_expenditure_types.revenue_category_code%TYPE,
172 x_task_number OUT NOCOPY pa_tasks.task_number%TYPE,
176 x_top_task_id OUT NOCOPY pa_tasks.task_id%TYPE,
173 x_task_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
174 x_task_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
175 x_task_service_type OUT NOCOPY pa_tasks.service_type_code%TYPE,
177 x_top_task_number OUT NOCOPY pa_tasks.task_number%TYPE,
178 x_employee_number OUT NOCOPY per_people_f.employee_number%TYPE,
179 x_vendor_type OUT NOCOPY po_vendors.vendor_type_lookup_code%TYPE,
180 x_person_type OUT NOCOPY VARCHAR2 );
181
182 --------------------------------------------------------------------------------
183 --
184 -- Start of comments
185 --
186 -- API Name : pa_acc_gen_wf_pkg.wf_acc_derive_pa_params
187 --
188 -- Type : Public
189 --
190 -- Pre-reqs : None
191 --
192 -- Function : This procedure is called from the procedures wf_acc_derive_
193 -- params and wf_acc_derive_er_params .
194 -- The procedure accepts five input parameters and derives
195 -- the value of the other project related parameters which
196 -- are then available to the calling program. The objective is
197 -- to provide all the parameters (input and output) as
198 -- attributes with values in them when workflow
199 -- is invoked so that the user does not have to code/call any
200 -- functions to retrieve the values of those variables. This
201 -- procedure derives the projects related attributes.
202 --
203 --
204 -- Parameters :
205 -- p_project_id IN NUMBER Required
206 -- p_task_id IN NUMBER Required
207 -- p_expenditure_type IN VARCHAR2 Required
208 -- p_expenditure_organization_id IN NUMBER Required
209 -- p_expenditure_item_date IN DATE Required
210 -- x_class_code OUT NOCOPY VARCHAR2
211 -- x_direct_flag OUT NOCOPY VARCHAR2
212 -- x_expenditure_category OUT NOCOPY VARCHAR2
213 -- x_expenditure_org_name OUT NOCOPY VARCHAR2
214 -- x_project_number OUT NOCOPY VARCHAR2
215 -- x_project_organization_name OUT NOCOPY VARCHAR2
216 -- x_project_organization_id OUT NOCOPY NUMBER
217 -- x_project_type OUT NOCOPY VARCHAR2
218 -- x_public_sector_flag OUT NOCOPY VARCHAR2
219 -- x_revenue_category OUT NOCOPY VARCHAR2
220 -- x_task_number OUT NOCOPY VARCHAR2
221 -- x_task_organization_name OUT NOCOPY VARCHAR2
222 -- x_task_organization_id OUT NOCOPY NUMBER
223 -- x_task_service_type OUT NOCOPY VARCHAR2
224 -- x_top_task_id OUT NOCOPY NUMBER
225 -- x_top_task_number OUT NOCOPY VARCHAR2
226 --
227 -- Version : Initial version 11.0
228 --
229 -- End of comments
230 --------------------------------------------------------------------------------
231 --
232
233 PROCEDURE wf_acc_derive_pa_params (
234 p_project_id IN pa_projects_all.project_id%TYPE,
235 p_task_id IN pa_tasks.task_id%TYPE,
236 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
237 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
238 p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE,
239 x_class_code OUT NOCOPY pa_class_codes.class_code%TYPE,
240 x_direct_flag OUT NOCOPY pa_project_types_all.direct_flag%TYPE,
241 x_expenditure_category OUT NOCOPY pa_expenditure_categories.expenditure_category%TYPE,
242 x_expenditure_org_name OUT NOCOPY hr_organization_units.name%TYPE,
243 x_project_number OUT NOCOPY pa_projects_all.segment1%TYPE,
244 x_project_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
245 x_project_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
246 x_project_type OUT NOCOPY pa_project_types_all.project_type%TYPE,
247 x_public_sector_flag OUT NOCOPY pa_projects_all.public_sector_flag%TYPE,
248 x_revenue_category OUT NOCOPY pa_expenditure_types.revenue_category_code%TYPE,
249 x_task_number OUT NOCOPY pa_tasks.task_number%TYPE,
250 x_task_organization_name OUT NOCOPY hr_organization_units.name%TYPE,
251 x_task_organization_id OUT NOCOPY hr_organization_units.organization_id %TYPE,
252 x_task_service_type OUT NOCOPY pa_tasks.service_type_code%TYPE,
253 x_top_task_id OUT NOCOPY pa_tasks.task_id%TYPE,
254 x_top_task_number OUT NOCOPY pa_tasks.task_number%TYPE);
255
256
257 --------------------------------------------------------------------------------
258 --
259 -- Start of comments
260 --
261 -- API Name : pa_acc_gen_wf_pkg.Set_Pa_Item_Attr
262 --
263 -- Type : Public
264 --
265 -- Pre-reqs : None
266 --
270 -- generator is invoked it has all the project related
267 -- Function : This API is called from the Oracle Payables and Orcale
268 -- Web Expenses. It assigns values to all project related
269 -- Workflow item attributes so that when workflow account
271 -- attributes to generate the account.
272 --
273 -- Parameters :
274 -- p_itemtype IN VARCHAR2 Required
275 -- p_itemkey IN VARCHAR2 Required
276 -- p_project_id IN NUMBER
277 -- p_task_id IN NUMBER
278 -- p_expenditure_type IN VARCHAR2
279 -- p_expenditure_organization_id IN NUMBER
280 -- p_billable_flag IN VARCHAR2
281 -- p_class_code IN VARCHAR2
282 -- p_direct_flag IN VARCHAR2
283 -- p_expenditure_category IN VARCHAR2
284 -- p_expenditure_org_name IN VARCHAR2
285 -- p_project_number IN VARCHAR2
286 -- p_project_organization_name IN VARCHAR2
287 -- p_project_organization_id IN NUMBER
288 -- p_project_type IN VARCHAR2
289 -- p_public_sector_flag IN VARCHAR2
290 -- p_revenue_category IN VARCHAR2
291 -- p_task_number IN VARCHAR2
292 -- p_task_organization_name IN VARCHAR2
293 -- p_task_organization_id IN NUMBER
294 -- p_task_service_type IN VARCHAR2
295 -- p_top_task_id IN NUMBER
296 -- p_top_task_number IN VARCHAR2
297 -------------------------------------------------------------------------------
298
299 PROCEDURE Set_Pa_Item_Attr(
300 p_itemtype IN VARCHAR2,
301 p_itemkey IN VARCHAR2,
302 p_project_id IN pa_projects_all.project_id%TYPE,
303 p_task_id IN pa_tasks.task_id%TYPE,
304 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
305 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
306 p_expenditure_item_date IN DATE,
307 p_billable_flag IN pa_tasks.billable_flag%TYPE,
308 p_class_code IN pa_class_codes.class_code%TYPE,
309 p_direct_flag IN pa_project_types_all.direct_flag%TYPE,
310 p_expenditure_category IN pa_expenditure_categories.expenditure_category%TYPE,
311 p_expenditure_org_name IN hr_organization_units.name%TYPE,
312 p_project_number IN pa_projects_all.segment1%TYPE,
313 p_project_organization_name IN hr_organization_units.name%TYPE,
314 p_project_organization_id IN hr_organization_units.organization_id %TYPE,
315 p_project_type IN pa_project_types_all.project_type%TYPE,
316 p_public_sector_flag IN pa_projects_all.public_sector_flag%TYPE,
317 p_revenue_category IN pa_expenditure_types.revenue_category_code%TYPE,
318 p_task_number IN pa_tasks.task_number%TYPE,
319 p_task_organization_name IN hr_organization_units.name%TYPE,
320 p_task_organization_id IN hr_organization_units.organization_id %TYPE,
321 p_task_service_type IN pa_tasks.service_type_code%TYPE,
322 p_top_task_id IN pa_tasks.task_id%TYPE,
323 p_top_task_number IN pa_tasks.task_number%TYPE);
324
325
326 ----------------------------------------------------------------------------------
327 -- Start of comments
328 --
329 -- API Name : pa_acc_gen_wf_pkg.ap_inv_generate_account
330 --
331 -- Type : Public
332 --
333 -- Pre-reqs : None
334 --
335 -- Function : This API is called from the AP form for account generation
336 -- generation for Project related AP invoices. It accepts the raw
337 -- parameters from the calling form and calls the wf_acc_derive_params
338 -- procedure to obtain the derive parameters. It sets the attributes
339 -- of the Workflow item and then invokes Workflow for account
340 -- generation.
341 --
342 -- Parameters :
343 -- p_project_id IN NUMBER Required
344 -- p_task_id IN NUMBER Required
345 -- p_expenditure_type IN VARCHAR2 Required
346 -- p_vendor_id IN NUMBER Required
347 -- p_expenditure_organization_id IN NUMBER Required
348 -- p_expenditure_item_date IN DATE Required
349 -- p_billable_flag IN CHAR Required
350 -- p_chart_of_accounts_id IN NUMBER Required
351 -- p_accounting_date IN DATE Required
352 -- p_attribute_category IN VARCHAR2
353 -- p_attribute1 through
354 -- p_attribute15 IN VARCHAR2
355 -- p_dist_attribute_category IN VARCHAR2
356 -- p_dist_attribute1 through
357 -- p_dist_attribute15 IN VARCHAR2
358 -- x_return_ccid OUT NUMBER
359 -- x_concat_segs IN OUT VARCHAR2
360 -- x_concat_ids IN OUT VARCHAR2
361 -- x_concat_descrs IN OUT VARCHAR2
362 -- x_error_message OUT VARCHAR2
363 --
364 -- Version : Initial version 11.0
365 --
366 -- End of comments
367 ----------------------------------------------------------------------------------
368
369 FUNCTION ap_inv_generate_account
370 (
371 p_project_id IN pa_projects_all.project_id%TYPE,
372 p_task_id IN pa_tasks.task_id%TYPE,
373 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
374 p_vendor_id IN po_vendors.vendor_id%type,
375 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
376 p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE,
377 p_billable_flag IN pa_tasks.billable_flag%TYPE,
378 p_chart_of_accounts_id IN NUMBER,
379 p_attribute_category IN ap_invoices_all.attribute_category%TYPE,
380 p_attribute1 IN ap_invoices_all.attribute1%TYPE,
381 p_attribute2 IN ap_invoices_all.attribute2%TYPE,
382 p_attribute3 IN ap_invoices_all.attribute3%TYPE,
383 p_attribute4 IN ap_invoices_all.attribute4%TYPE,
384 p_attribute5 IN ap_invoices_all.attribute5%TYPE,
385 p_attribute6 IN ap_invoices_all.attribute6%TYPE,
386 p_attribute7 IN ap_invoices_all.attribute7%TYPE,
387 p_attribute8 IN ap_invoices_all.attribute8%TYPE,
388 p_attribute9 IN ap_invoices_all.attribute9%TYPE,
389 p_attribute10 IN ap_invoices_all.attribute10%TYPE,
390 p_attribute11 IN ap_invoices_all.attribute11%TYPE,
391 p_attribute12 IN ap_invoices_all.attribute12%TYPE,
392 p_attribute13 IN ap_invoices_all.attribute13%TYPE,
393 p_attribute14 IN ap_invoices_all.attribute14%TYPE,
394 p_attribute15 IN ap_invoices_all.attribute15%TYPE,
395 p_dist_attribute_category IN ap_invoice_distributions_all.attribute_category%TYPE,
396 p_dist_attribute1 IN ap_invoice_distributions_all.attribute1%TYPE,
397 p_dist_attribute2 IN ap_invoice_distributions_all.attribute2%TYPE,
398 p_dist_attribute3 IN ap_invoice_distributions_all.attribute3%TYPE,
399 p_dist_attribute4 IN ap_invoice_distributions_all.attribute4%TYPE,
400 p_dist_attribute5 IN ap_invoice_distributions_all.attribute5%TYPE,
401 p_dist_attribute6 IN ap_invoice_distributions_all.attribute6%TYPE,
402 p_dist_attribute7 IN ap_invoice_distributions_all.attribute7%TYPE,
403 p_dist_attribute8 IN ap_invoice_distributions_all.attribute8%TYPE,
404 p_dist_attribute9 IN ap_invoice_distributions_all.attribute9%TYPE,
405 p_dist_attribute10 IN ap_invoice_distributions_all.attribute10%TYPE,
406 p_dist_attribute11 IN ap_invoice_distributions_all.attribute11%TYPE,
407 p_dist_attribute12 IN ap_invoice_distributions_all.attribute12%TYPE,
408 p_dist_attribute13 IN ap_invoice_distributions_all.attribute13%TYPE,
409 p_dist_attribute14 IN ap_invoice_distributions_all.attribute14%TYPE,
410 p_dist_attribute15 IN ap_invoice_distributions_all.attribute15%TYPE,
411 /* Adding parameter p_input_ccid for bug2348764 */
412 p_input_ccid IN gl_code_combinations.code_combination_id%TYPE default null,
413 x_return_ccid OUT NOCOPY gl_code_combinations.code_combination_id%TYPE,
414 x_concat_segs IN OUT NOCOPY VARCHAR2, -- Bug 5935019
415 x_concat_ids IN OUT NOCOPY VARCHAR2, -- Bug 5935019
416 x_concat_descrs IN OUT NOCOPY VARCHAR2, -- Bug 5935019
417 x_error_message OUT NOCOPY VARCHAR2,
418 X_award_set_id IN NUMBER DEFAULT NULL,
419 /* R12 Changes Start - Added two new parameters Award_Id and Expenditure Item ID */
420 p_accounting_date IN ap_invoice_distributions_all.accounting_date%TYPE default NULL,
421 p_award_id IN NUMBER DEFAULT NULL,
422 p_expenditure_item_id IN NUMBER DEFAULT NULL )
423 /* R12 Changes End */
424
425 RETURN BOOLEAN;
426
427 -- X_award_set_id was added as part of OGM Interface.
428 --------------------------------------------------------------------------------
429 --
430 -- Start of comments
431 --
432 -- API Name : pa_acc_gen_wf_pkg.ap_er_generate_account
433 --
434 -- Type : Public
435 --
436 -- Pre-reqs : None
437 --
438 -- Function : This API is called from the web expenses form for account
439 -- generation for Project related expense reports. It accepts the raw
440 -- parameters from the calling form and calls the wf_acc_derive_er_params
441 -- procedure to obtain the derive parameters. It sets the attributes
442 -- of the Workflow item and then invokes Workflow for account
443 -- generation.
444 --
445 -- Parameters :
446 -- p_project_id IN NUMBER Required
447 -- p_task_id IN NUMBER Required
448 -- p_expenditure_type IN VARCHAR2 Required
449 -- p_vendor_id IN NUMBER
450 -- p_expenditure_organization_id IN NUMBER
451 -- p_expenditure_item_date IN DATE Required
452 -- p_billable_flag IN CHAR Required
453 -- p_chart_of_accounts_id IN NUMBER Required
454 -- p_calling_module IN VARCHAR2 Required
455 -- p_employee_id IN NUMBER Required
456 -- p_employee_ccid IN NUMBER
457 -- p_expense_type IN NUMBER
458 -- p_expense_cc IN VARCHAR2
459 -- p_attribute_category IN VARCHAR2
460 -- p_attribute1 through
461 -- p_attribute15 IN VARCHAR2
462 -- p_line_attribute_category IN VARCHAR2
463 -- p_line_attribute1 through
464 -- p_line_attribute15 IN VARCHAR2
465 -- x_return_ccid OUT NUMBER
466 -- x_concat_ids OUT VARCHAR2
467 -- x_concat_descrs OUT VARCHAR2
468 -- x_error_message OUT VARCHAR2
469 -- x_award_set_id IN NUMBER VERTICAL applications
470 -- interface.
471 --
472 -- Version : Initial version 11.0
473 --
474 -- End of comments
475 --------------------------------------------------------------------------------
476 --
477
478 FUNCTION ap_er_generate_account
479 (
480 p_project_id IN pa_projects_all.project_id%TYPE,
481 p_task_id IN pa_tasks.task_id%TYPE,
482 p_expenditure_type IN pa_expenditure_types.expenditure_type%TYPE,
483 p_vendor_id IN po_vendors.vendor_id%type,
484 p_expenditure_organization_id IN hr_organization_units.organization_id%TYPE,
485 p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE,
489 p_employee_id IN per_people_f.person_id%TYPE,
486 p_billable_flag IN pa_tasks.billable_flag%TYPE,
487 p_chart_of_accounts_id IN NUMBER,
488 p_calling_module IN VARCHAR2,
490 p_employee_ccid IN gl_code_combinations.code_combination_id%TYPE,
491 p_expense_type IN ap_expense_report_lines_all.web_parameter_id%TYPE,
492 p_expense_cc IN ap_expense_report_headers_all.flex_concatenated%TYPE,
493 p_attribute_category IN ap_expense_report_headers_all.attribute_category%TYPE,
494 p_attribute1 IN ap_expense_report_headers_all.attribute1%TYPE,
495 p_attribute2 IN ap_expense_report_headers_all.attribute2%TYPE,
496 p_attribute3 IN ap_expense_report_headers_all.attribute3%TYPE,
497 p_attribute4 IN ap_expense_report_headers_all.attribute4%TYPE,
498 p_attribute5 IN ap_expense_report_headers_all.attribute5%TYPE,
499 p_attribute6 IN ap_expense_report_headers_all.attribute6%TYPE,
500 p_attribute7 IN ap_expense_report_headers_all.attribute7%TYPE,
501 p_attribute8 IN ap_expense_report_headers_all.attribute8%TYPE,
502 p_attribute9 IN ap_expense_report_headers_all.attribute9%TYPE,
503 p_attribute10 IN ap_expense_report_headers_all.attribute10%TYPE,
504 p_attribute11 IN ap_expense_report_headers_all.attribute11%TYPE,
505 p_attribute12 IN ap_expense_report_headers_all.attribute12%TYPE,
506 p_attribute13 IN ap_expense_report_headers_all.attribute13%TYPE,
507 p_attribute14 IN ap_expense_report_headers_all.attribute14%TYPE,
508 p_attribute15 IN ap_expense_report_headers_all.attribute15%TYPE,
509 p_line_attribute_category IN ap_expense_report_lines_all.attribute_category%TYPE,
510 p_line_attribute1 IN ap_expense_report_lines_all.attribute1%TYPE,
511 p_line_attribute2 IN ap_expense_report_lines_all.attribute2%TYPE,
512 p_line_attribute3 IN ap_expense_report_lines_all.attribute3%TYPE,
513 p_line_attribute4 IN ap_expense_report_lines_all.attribute4%TYPE,
514 p_line_attribute5 IN ap_expense_report_lines_all.attribute5%TYPE,
515 p_line_attribute6 IN ap_expense_report_lines_all.attribute6%TYPE,
516 p_line_attribute7 IN ap_expense_report_lines_all.attribute7%TYPE,
517 p_line_attribute8 IN ap_expense_report_lines_all.attribute8%TYPE,
518 p_line_attribute9 IN ap_expense_report_lines_all.attribute9%TYPE,
519 p_line_attribute10 IN ap_expense_report_lines_all.attribute10%TYPE,
520 p_line_attribute11 IN ap_expense_report_lines_all.attribute11%TYPE,
521 p_line_attribute12 IN ap_expense_report_lines_all.attribute12%TYPE,
522 p_line_attribute13 IN ap_expense_report_lines_all.attribute13%TYPE,
523 p_line_attribute14 IN ap_expense_report_lines_all.attribute14%TYPE,
524 p_line_attribute15 IN ap_expense_report_lines_all.attribute15%TYPE,
525 p_input_ccid IN gl_code_combinations.code_combination_id%TYPE default null, /* Bug 5378579 */
526 x_return_ccid OUT NOCOPY gl_code_combinations.code_combination_id%TYPE,
527 x_concat_segs IN OUT NOCOPY VARCHAR2, -- Bug 5935019
528 x_concat_ids IN OUT NOCOPY VARCHAR2, -- Bug 5935019
529 x_concat_descrs IN OUT NOCOPY VARCHAR2, -- Bug 5935019
530 x_error_message OUT NOCOPY VARCHAR2,
531 /* R12 Changes Start - Added two new parameters Award_Id and Expenditure Item ID */
532 X_award_set_id IN NUMBER DEFAULT NULL,
533 p_award_id IN NUMBER DEFAULT NULL,
534 p_expenditure_item_id IN NUMBER DEFAULT NULL )
535 /* R12 Changes End */
536
537 RETURN BOOLEAN;
538
539
540 -- X_award_set_id was added as part of OGM_0.0 interface.
541 ----------------------------------------------------------------------------------
542 -- Start of comments
543 --
544 -- API Name : pa_acc_gen_wf_pkg.ap_inv_upgrade_flex_account
545 --
546 -- API Type : Procedure
547 --
548 -- Type : Public
549 --
550 -- Pre-reqs : None
551 --
552 -- Function : This API is attached to a Workflow function for account
553 -- generation for Project related AP invoices that calls the BUILD
554 -- function generated by the FNDFBPLS utility. The FNDFBPLS utility
555 -- generates a function based on existing FlexBuilder rules for
556 -- generating an account. This function is invoked from Workflow
557 -- during account generation and calls the
558 -- PA_VEND_INV_CHARGE_ACCOUNT.BUILD function. The BUILD function
559 -- generates the account using the same rules as FlexBuilder
560 --
561 -- Parameters :
562 -- p_itemtype IN VARCHAR2 Required
563 -- p_itemkey IN VARCHAR2 Required
564 -- p_actid IN NUMBER Required
565 -- p_funcmode IN VARCHAR2 Required
566 -- x_result OUT VARCHAR2
567 --
568 -- Version : Initial version 11.0
569 --
570 -- End of comments
571 ----------------------------------------------------------------------------------
572
573 PROCEDURE ap_inv_upgrade_flex_account (
574 p_itemtype IN VARCHAR2,
575 p_itemkey IN VARCHAR2,
576 p_actid IN NUMBER,
577 p_funcmode IN VARCHAR2,
578 x_result OUT NOCOPY VARCHAR2);
579
580 ----------------------------------------------------------------------------------
581 -- Start of comments
582 --
583 -- API Name : pa_acc_gen_wf_pkg.ap_inv_acc_undefined_rules
584 --
585 -- API Type : Procedure
586 --
587 -- Type : Public
588 --
589 -- Pre-reqs : None
590 --
591 -- Function : This API is attached to a Workflow function for default
592 -- generation for Project related AP invoices. It is the default that
593 -- is shipped with the product. If the user does not customize account
594 -- generation, this function ensures that an appropriate error message
595 -- is displayed to the user.
596 --
597 -- The function is set to always fail. Users should replace this
598 -- function in Workflow with their own account generation procedure.
599 --
600 -- Parameters :
601 -- p_itemtype IN VARCHAR2 Required
602 -- p_itemkey IN VARCHAR2 Required
603 -- p_actid IN NUMBER Required
604 -- p_funcmode IN VARCHAR2 Required
605 -- x_result OUT VARCHAR2
606 --
607 -- Version : Initial version 11.0
608 --
609 -- End of comments
610 ----------------------------------------------------------------------------------
611
612 PROCEDURE ap_inv_acc_undefined_rules (
613 p_itemtype IN VARCHAR2,
614 p_itemkey IN VARCHAR2,
615 p_actid IN NUMBER,
616 p_funcmode IN VARCHAR2,
617 x_result OUT NOCOPY VARCHAR2);
618
619
620 --------------------------------------------------------------------------------
621 -- Start of comments
622 --
623 -- API Name : pa_acc_gen_wf_pkg.pa_seg_lookup_set_value
624 --
625 -- API Type : Procedure
626 --
627 -- Type : Public
628 --
629 -- Pre-reqs : None
630 --
631 -- Function : This API is attached to a Workflow function for account
632 -- generation for Project related AP invoices. It retrieves the lookup
633 -- value from the PA_SEGMENT_VALUE_LOOKUP_SETS based on the lookup set
634 -- type and code set by the user in Workflow The internal name of the
635 -- corresponding Oracle Workflow function is SEGMENT_LOOKUP_SET.
636 --
637 -- Parameters :
638 -- p_itemtype IN VARCHAR2 Required
639 -- p_itemkey IN VARCHAR2 Required
640 -- p_actid IN NUMBER Required
641 -- p_funcmode IN VARCHAR2 Required
642 -- x_result OUT VARCHAR2
643 --
644 -- Version : Initial version 11.0
645 --
646 -- End of comments
647 ----------------------------------------------------------------------------------
648
649 PROCEDURE pa_seg_lookup_set_value (
650 p_itemtype IN VARCHAR2,
651 p_itemkey IN VARCHAR2,
652 p_actid IN NUMBER,
653 p_funcmode IN VARCHAR2,
654 x_result OUT NOCOPY VARCHAR2);
655
656 --------------------------------------------------------------------------------
657 --
658 -- Start of comments
659 --
660 -- API Name : pa_acc_gen_wf_pkg.pa_aa_function_transaction
661 --
662 -- API Type : Procedure
663 --
664 -- Type : Public
665 --
666 -- Pre-reqs : None
667 --
668 -- Function : This API is attached to a Workflow function for account
669 -- generation for Project related expense reports. It retrieves the Auto
670 -- Accounting function transaction code from PA_FUNCTION_TRANSACTIONS table
671 -- based on the PROJECT_TYPE_CLASS_CODE, PUBLIC_SECTOR_FLAG and BILLABLE_FLAG
672 -- It stores the retrived function transaction code in Workflow Item attribute
673 -- TRANSACTION_CODE( Internal name ). The internal name of the corresponding
674 -- function in Orcale Workflow is AA_FUNCTION_TRANSACTION_CODE
675 --
676 -- Parameters :
677 -- p_itemtype IN VARCHAR2 Required
678 -- p_itemkey IN VARCHAR2 Required
679 -- p_actid IN NUMBER Required
680 -- p_funcmode IN VARCHAR2 Required
681 -- x_result OUT VARCHAR2
682 --
683 -- Version : Initial version 11.0
684 --
685 -- End of comments
686 --------------------------------------------------------------------------------
687 --
688 /*
689 PROCEDURE pa_aa_function_transaction (
690 p_itemtype IN VARCHAR2,
691 p_itemkey IN VARCHAR2,
692 p_actid IN NUMBER,
693 p_funcmode IN VARCHAR2,
694 x_result OUT NOCOPY VARCHAR2);
695
696 */
697 --------------------------------------------------------------------------------
698 --
699 -- Start of comments
700 --
701 -- API Name : pa_acc_gen_wf_pkg.show_error
702 --
703 -- API Type : Function
704 --
705 -- Type : Public
706 --
707 -- Pre-reqs : None
708 --
709 -- Function : This API should be used for debugging WF Functions.
710 -- It accepts error_stack, error_stage, error_message and 2 additional
711 -- arguments, it returns the error message from message dictionary in
712 -- encoded format. 2 additional arguments can be used for more specific
713 -- debugging.
714 --
715 -- Parameters :
716 -- p_error_stack IN VARCHAR2 Required
717 -- p_error_stage IN VARCHAR2 Required
718 -- p_error_message IN VARCHAR2 Required
719 -- p_arg1 IN VARCHAR2
720 -- p_arg2 IN VARCHAR2
721 --
722 -- Return : Varchar2 ( returns encoded error message );
723 --
724 -- Version : Initial version 11.0
725 --
726 -- End of comments
727 --------------------------------------------------------------------------------
728 FUNCTION show_error(
729 p_error_stack IN VARCHAR2,
730 p_error_stage IN VARCHAR2,
731 p_error_message IN VARCHAR2,
732 p_arg1 IN VARCHAR2 DEFAULT NULL,
733 p_arg2 IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2;
734
735 --------------------------------------------------------------------------------
736 --
737 -- Start of comments
738 --
739 -- API Name : pa_acc_gen_wf_pkg.set_error_stack
740 --
741 -- API Type : Procedure
742 --
743 -- Type : Public
744 --
745 -- Pre-reqs : None
746 --
747 -- Function : This API should be used for for settting the error stack
748 -- in the global variable g_error_stack
749 --
750 -- Parameters :
751 -- p_error_stack_msg IN VARCHAR2 Required
752 --
753 -- Return : N/A
754 --
755 -- Version : Initial version 12.0
756 --
757 -- End of comments
758 --------------------------------------------------------------------------------
759 PROCEDURE set_error_stack(p_error_stack_msg IN VARCHAR2);
760
761 --------------------------------------------------------------------------------
762 --
763 -- Start of comments
764 --
765 -- API Name : pa_acc_gen_wf_pkg.set_error_stack
766 --
767 -- API Type : Procedure
768 --
769 -- Type : Public
770 --
771 -- Pre-reqs : None
772 --
773 -- Function : This API should be used for for resettting the error stack
774 -- in the global variable g_error_stack to its previous value
775 --
776 -- Parameters : None
777 --
778 -- Return : N/A
779 --
780 -- Version : Initial version 12.0
781 --
782 -- End of comments
783 --------------------------------------------------------------------------------
784 PROCEDURE reset_error_stack;
785
786 END pa_acc_gen_wf_pkg;