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