1 PACKAGE PA_TRANSACTIONS_PUB AUTHID CURRENT_USER AS
2 /* $Header: PAXTTCPS.pls 120.5 2011/04/18 12:14:55 speddi ship $ */
3
4 --------------------------------------------------------------------------------
5 --
6 -- Start of comments
7 --
8 -- API Name : pa_transactions_pub.validate_transaction
9 --
10 -- Type : Public
11 --
12 -- Pre-reqs : None
13 --
14 -- Function : This procedure performs basic transaction validation(project
15 -- status is not closed, task is chargeable, transaction date
16 -- between project/task start and end dates), it then performs
17 -- validation against any existing transaction controls. If the
18 -- transaction passes the validation, it calls the transaction
19 -- control client extension(PACTX.tc_extension).
20 --
21 -- Parameters :
22 -- X_project_id IN NUMBER
23 -- X_task_id IN NUMBER
24 -- X_ei_date IN DATE
25 -- X_expenditure_type IN VARCHAR2
26 -- X_non_labor_resource IN VARCHAR2
27 -- X_person_id IN NUMBER
28 -- X_quantity IN NUMBER
29 -- X_denom_currency_code IN VARCHAR2
30 -- X_acct_currency_code IN VARCHAR2
31 -- X_denom_raw_cost IN NUMBER
32 -- X_acct_raw_cost IN NUMBER
33 -- X_acct_rate_type IN VARCHAR2
34 -- X_acct_rate_date IN DATE
35 -- X_acct_exchange_rate IN NUMBER
36 -- X_transfer_ei IN NUMBER
37 -- X_incurred_by_org_id IN NUMBER
38 -- X_nl_resource_org_id IN NUMBER
39 -- X_transaction_source IN VARCHAR2
40 -- X_calling_module IN VARCHAR2
41 -- X_vendor_id IN NUMBER
42 -- X_entered_by_user_id IN NUMBER
43 -- X_attribute_category IN VARCHAR2
44 -- X_attribute1 IN VARCHAR2
45 -- X_attribute2 IN VARCHAR2
46 -- X_attribute3 IN VARCHAR2
47 -- X_attribute4 IN VARCHAR2
48 -- X_attribute5 IN VARCHAR2
49 -- X_attribute6 IN VARCHAR2
50 -- X_attribute7 IN VARCHAR2
51 -- X_attribute8 IN VARCHAR2
52 -- X_attribute9 IN VARCHAR2
53 -- X_attribute10 IN VARCHAR2
54 -- X_attribute11 IN VARCHAR2
55 -- X_attribute12 IN VARCHAR2
56 -- X_attribute13 IN VARCHAR2
57 -- X_attribute14 IN VARCHAR2
58 -- X_attribute15 IN VARCHAR2
59 -- X_msg_application IN OUT VARCHAR2
60 -- X_msg_type OUT VARCHAR2
61 -- X_msg_token1 OUT VARCHAR2
62 -- X_msg_token2 OUT VARCHAR2
63 -- X_msg_token3 OUT VARCHAR2
64 -- X_msg_count OUT NUMBER
65 -- X_msg_data OUT VARCHAR2
66 -- X_billable_flag OUT VARCHAR2
67 --
68 -- Version : Initial version 11.1
69 /*----------------------------------------------------------------------------
70 The processing flow of the Transaction Controls package follows the description
71 in the "Using Transaction Controls" essay in the Release 11 Oracle Projects
72 Reference Manual.
73
74 If the transaction passes all of the basic validation checks ( project status
75 is not closed, task is chargeable, transaction date between project/task start
76 and end dates), then the transaction is checked against any existing
77 transaction controls.
78
79 The transaction is first validated against any task-level transaction controls.
80 Task-level transaction controls always override any project-level transaction
81 controls. If an applicable transaction control is found at the task level, and
82 the item passes this control, then the item is valid. Likewise, if it fails,
83 then the item is invalid.
84
85 If no applicable transaction control is found at the task level, then one of
86 the following occurs:
87 - if the limit to transaction controls flag for the task is set to 'Yes',
88 then the item is invalid and is rejected
89 - if the flag is set to 'No', then the item is validated against any
90 applicable project-level transaction controls.
91
92 There may be several transaction controls that are applicable for a given item.
93 However, transactions are evaluated ONLY against the applicable transaction
94 control with the highest level of precedence. The order of precedence is as
95 follows:
96
97 1. Person - Expenditure Category - Expenditure Type - [Non-Labor Resource]
98 2. Person - Expenditure Category*
99 3. Expenditure Category - Expenditure Type - [Non-Labor Resource]
100 4. Expenditure Category
101
102 *If a transaction control specifies that a person CAN charge, but does not
103 specify an expenditure category, then the procedure looks for any applicable
104 transaction controls (the most granular control matching the transaction's
105 expenditure category) that do not specify a particular person and then takes
106 the intersection of these two transaction controls. This is illustrated below
107 in Example #2 below.
108
109
110
111 Example 1
112 ---------
113
114 Transaction controls defined:
115
116 Employee Expend Cat Expend Type NLR Chargeable?
117 ----------- ----------- ----------- ----------- -----------
118 -- Expense -- -- Yes
119 -- Assets -- -- Yes
120 Robinson Expense Meals -- Yes
121 Robinson -- -- -- No
122 -- Labor Clerical -- Yes
123 -- Expense Meals -- No
124
125 If the transaction being entered is a 'Meals' item for Robinson, then the
126 following transaction controls are all applicable:
127
128 Employee Expend Cat Expend Type NLR Chargeable?
129 ----------- ----------- ----------- ----------- -----------
130 Robinson Expense Meals -- Yes
131 -- Expense -- -- Yes
132 Robinson -- -- -- No
133 -- Expense Meals -- No
134
135 But given the precedence above, only one control is used to validate the item:
136
137 Employee Expend Cat Expend Type NLR Chargeable?
138 ------------- ------------- ------------- ------------- -------------
139 Robinson Expense Meals -- Yes
140
141 Outcome: The transaction is valid.
142
143
144 If the transaction being entered is an 'Air Travel' item for Robinson, then the
145 following transaction controls are both applicable:
146
147 Employee Expend Cat Expend Type NLR Chargeable?
148 ----------- ----------- ----------- ----------- -----------
149 Robinson -- -- -- No
150 -- Expense -- -- Yes
151
152 But given the precedence above, only one control is used to validate the item:
153
154 Employee Expend Cat Expend Type NLR Chargeable?
155 ----------- ----------- ----------- ----------- -----------
156 Robinson -- -- -- No
157
158 Outcome: The item is invalid.
159
160 NOTE: An intersection of the two applicable transaction controls is not used in
161 this case because Robinson is not chargeable.
162
163
164 Example 2
165 ---------
166
167 Transaction Controls defined:
168
169 Employee Expend Cat Expend Type NLR Chargeable?
170 ----------- ----------- ----------- ----------- -----------
171 Robinson -- -- -- Yes
172 -- Expense -- -- No
173 -- Expense Meals -- Yes
174
175 Again, if the transaction being entered is a 'Meals' item for Robinson, then
176 all of the transaction controls are applicable. Transaction controls involving
177 a person take precedence over others, so the transaction is validated against
178 the following control:
179
180 Employee Expend Cat Expend Type NLR Chargeable?
181 ----------- ----------- ----------- ----------- -----------
182 Robinson -- -- -- Yes
183
184 But, since the person is chargeable, but an expenditure category is not
185 specified in this transaction control, then the procedure will check for any
186 existing transaction controls that match the expenditure category for 'Meals'
187 and take the INTERSECTION of the two transaction controls. The following are
188 applicable:
189
190 Employee Expend Cat Expend Type NLR Chargeable?
191 ----------- ----------- ----------- ----------- -----------
192 -- Expense -- -- No
193 -- Expense Meals -- Yes
194
195 Since the most granular transaction control is the only control used to
196 validate the item, the following control is used in the intersection with
197 the 'person' control:
198
199 Employee Expend Cat Expend Type NLR Chargeable?
200 ----------- ----------- ----------- ----------- -----------
201 -- Expense Meals -- Yes
202
203 Outcome: The item is valid.
204
205
206 If the item being entered is an 'Air Travel' item for Robinson, then the
207 following transaction controls are all applicable:
208
209 Employee Expend Cat Expend Type NLR Chargeable?
210 ----------- ----------- ----------- ----------- -----------
211 Robinson -- -- -- Yes
212 -- Expense -- -- No
213
214 Again an INTERSECTION is necessary. In this case, however, the item is invalid.
215
216 ------------------------------------------------------------------------------
217
218 Parameter Description
219 ---------------------- ---------------------------------------------
220 X_project_id The identifier of the project
221
222 X_task_id The identifier of the task
223
224 X_ei_date The date of expenditure item
225
226 X_expenditure_type The type of expenditure
227
228 X_non_labor_resource The non-labor resource, for usage items only
229
230 X_person_id Identifier of the person incurring the
231 transaction
232
233 X_quantity The quantity of the transaction
234
235 X_denom_currency_code The transaction currency code of the transaction
236
237 X_acct_currency_code The functional currency code of the transaction
238
239 X_denom_raw_cost The transaction currency raw cost
240
241 X_acct_raw_cost The functional currency raw cost. The value of this
242 parameter will not be available for transactions
243 that are uncosted or unaccounted. If autorate
244 functionality is enabled in Oracle Payables then
245 X_acct_raw_cost may not be available.
246
247 X_acct_rate_type The conversion rate type used to convert the
248 transaction raw cost to functional raw cost.
249
250 X_acct_rate_date The conversion rate date used to convert the
251 transaction raw cost to functional raw cost.
252
253 X_acct_exchange_rate Exchange rate used to convert the transaction
254 raw cost to functional raw cost. The value of this
255 parameter will not be available for transactions
256 that are uncosted or unaccounted. If autorate
257 functionality is enabled in Oracle Payables then
258 X_acct_exchange_rate may not be available.
259
260 X_transfer_ei The idenitifier of the original expenditure item
261 from which this transaction originated.
262
263 X_incurred_by_org_id The organization incurring the transaction.
264
265 X_nl_resource_org_id The identifier of the non-labor resource organization
266 For usageges only.
267
268 X_transaction_source The transaction source of the items imported using
269 transaction import.
270
271 X_calling_module The module calling the API. List of possible values
272 for X_calling_modules are:
273
274 APXINENT (Invoice Work bench form)
275 CreateRelatedItem ( Procedure )
276 PAVVIT ( Interface supplier invoices from payables)
277 PAXTREPE (Pre-Approved Expenditures form)
278 PAXTRTRX ( Transaction import)
279 PAXEXCOP ( Copy Pre-Approved timecards )
280 PAXTEXCB ( Copy Expenditures )
281 PAXPRRPE (Adjust Project Expenditures )
282 POXPOEPO ( Purchase Orders form)
283 POXRQERQ ( Requisitions Form in Oracle Purchasing)
284 POXPOERL ( Release form in Oracle Purchasing)
285 POXPOPRE ( Preferences form in Oracle Purchasing)
286 SelfService ( Web Wxpenses SelfService Application)
287
288 All values for X_calling_module are case sensitive.
289
290 X_vendor_id Identifier of the vendor.
291
292 X_entered_by_user_id Identifier of the user that entered the transaction
293
294 X_attribute_category Expenditure item descriptive flexfield context
295 for transactions created in Orcale projects.
296 Invoice distributions descriptive flexfield context
297 for supplier invoices.
298 For project related requisitions and purchase orders
299 this will be equal to requisition/purchase order
300 distributions descriptive flexfield context
301
302 X_attribute[1-15] Expenditure item descriptive flexfield segments
303 ( attribute1-10) for transactions created in Oracle
304 Projects.
305 Invoice distributions descriptive flexfields for
306 supplier invoices.
307 For project related requisitions and purchase orders
308 this will be equal to requisition/purchase order
309 distributions descriptive flexfields.
310 Attributes[11-15] are available for modules outside
311 Oracle Projects like AP,PO.
312
313 X_msg_application The application short name of the message owning
314 application
315
316 X_msg_type The outcome type of the procedure.
317 Valid Values: W for Warning, E for Errors
318
319 X_msg_token[1-3] Additional outcome tokens of the procedure. Used to
320 provide more descriptive error messages
321
322 X_msg_count Future Use. This is introduced to support multiple
323 messages in future. In current release we support
324 only 1 message
325
326 X_msg_data The outcome of the procedure. The value of this
327 parameter will be equal to the message name.
328
329 X_billable_flag determine weather or not a transaction is billable
330 or capitalizable
331
332 p_projfunc_currency_code Project Functional currency code
333
334 p_projfunc_cost_rate_type Project functional rate type is used to derive the project
335 functional raw and burden cost
336
337 p_projfunc_cost_rate_date Project functional rate date is used to derive the project
338 functional raw and burden cost
339
340 p_projfunc_cost_exchg_rate Project functional exchange rate is used to derive the project
341 functional raw and burden cost
342
343 p_assignment_id identifier of the Assignment
344
345 p_work_type_id identifier of the work type
346 ---------------------------------------------------------------------------- */
347 -- Warning Processing in calling programs:
348 --
349 -- The following examples describe the usage of API and how to process warning
350 -- codes returned by the API in calling programs.
351 --
352 -- Example:
353 --
354 -- Usage in calling module:
355 --
356 -- pa_transactions_pub.validate_transaction( X_project_id => 121222
357 -- , X_task_id => 1038
358 -- , X_ei_date => '12-JAN-97'
359 -- , X_expenditure_type => 'Supplies'
360 -- , X_non_labor_resource => ''
361 -- , X_person_id => 1211
362 -- , X_quantity => 120
363 -- , X_denom_currency_code => 'INR'
364 -- , X_acct_currency_code => 'USD'
365 -- , X_denom_raw_cost => 120
366 -- , X_acct_raw_cost => 3
367 -- , X_acct_rate_type => 'Corporate'
368 -- , X_acct_rate_date => '12-FEB-97'
369 -- , X_acct_exchange_rate => .025
370 -- , X_transfer_ei => ''
371 -- , X_incurred_by_org_id => 129
372 -- , X_nl_resource_org_id => ''
373 -- , X_transaction_source => 'AP EXPENSE'
374 -- , X_calling_module => 'PAXTRTRX'
375 -- , X_vendor_id => 11222
376 -- , X_entered_by_user_id => 29
377 -- , X_attribute_category => ''
378 -- , X_attribute1 => ''
379 -- , X_attribute2 => ''
380 -- , X_attribute3 => ''
381 -- , X_attribute4 => ''
382 -- , X_attribute5 => ''
383 -- , X_attribute6 => ''
384 -- , X_attribute7 => ''
385 -- , X_attribute8 => ''
386 -- , X_attribute9 => ''
387 -- , X_attribute10 => ''
388 -- , X_attribute11 => ''
389 -- , X_attribute12 => ''
390 -- , X_attribute13 => ''
391 -- , X_attribute14 => ''
392 -- , X_attribute15 => ''
393 -- , X_msg_application => X_msg_application
394 -- , X_msg_type => X_msg_type
395 -- , X_msg_token1 => X_msg_token1
396 -- , X_msg_token2 => X_msg_token2
397 -- , X_msg_token3 => X_msg_token3
398 -- , X_msg_count => X_msg_count
399 -- , X_msg_data => X_msg_data
400 -- , X_billable_flag => X_billable_flag);
401 --
402 -- After the call to the API, handle any Errors/Warnings returned
403 -- by the API. Lets assume that the API has returned with the following
404 -- values in the OUT parameters.
405 --
406 -- --------------------------------------------------------------------
407 -- X_msg_type = 'W'
408 -- X_msg_data = 'TK_TRANS_CURR_IS_NULL'
409 -- X_msg_application = 'TK'
410 -- where TK is application short name for custom application
411 -- X_msg_token1 = 1038 --Task id
412 -- X_msg_token2 = 100 -- Functional raw cost
413 -- X_msg_token3 = 80 -- Transaction Raw cost
414 -- ----------------------------------------------------------------------
415 -- The following section shows how to handle Warnings in calling programs
416 --
417 -- If X_msg_type = 'W' and X_msg_data is Not NULL then
418 --
419 -- if X_msg_application != 'PA' then
420 --
421 -- Please do not customize messages owned by Oracle Projects. If
422 -- you want to customize a message, create a new message in your
423 -- custom application.
424 --
425 --
426 -- FND_MESSAGE.SET_NAME(X_msg_application,X_msg_data);
427 -- FND_MESSAGE.SET_TOKEN( patc_msg_token1,X_msg_token1)
428 -- FND_MESSAGE.SET_TOKEN(patc_msg_token2,X_msg_token2)
429 -- FND_MESSAGE.SET_TOKEN(patc_msg_token3,X_msg_token3)
430 --
431 -- else -- for seeded messages, i.e messages owned by PA
432 --
433 -- Tokens are not supported in Seeded messages
434 --
435 -- FND_MESSAGE.set_name(X_msg_application,X_msg_data)
436 --
437 -- end if;
438 --
439 -- Display the Question Alert. Ask if the user wants to continue or
440 -- abort the processing. If the user chooses to continue, ignore
441 -- the warning and continue, otherwise stop processing.
442 --
443 -- End if;
444 --
445 -- Note: Since warning's involves user interaction which is not possible
446 -- in batch programs, hence batch programs will ignore warnings
447 -- For Example: In Transaction Import, if validatte_transaction
448 -- API returned a Warning, Transaction import would
449 -- ignore the warning and continue as if the API
450 -- completed successfully.
451 ------------------------------------------------------------------------------
452 -- Error processing in calling programs:
453 --
454 -- The following examples describe how to process error codes returned by
455 -- validate_transaction procedure in calling programs.
456 --
457 -- Example:
458 -- pa_transactions_pub.validate_transaction( X_project_id => 121222
459 -- , X_task_id => 1038
460 -- , X_ei_date => '12-JAN-97'
461 -- , X_expenditure_type => 'Supplies'
462 -- , X_non_labor_resource => ''
463 -- , X_person_id => 1211
464 -- , X_quantity => 120
465 -- , X_denom_currency_code => 'INR'
466 -- , X_acct_currency_code => 'USD'
467 -- , X_denom_raw_cost => 120
468 -- , X_acct_raw_cost => 3
469 -- , X_acct_rate_type => 'Corporate'
470 -- , X_acct_rate_date => '12-FEB-97'
471 -- , X_acct_exchange_rate => .025
472 -- , X_transfer_ei => ''
473 -- , X_incurred_by_org_id => 129
474 -- , X_nl_resource_org_id => ''
475 -- , X_transaction_source => 'AP EXPENSE'
476 -- , X_calling_module => 'PAXTRTRX'
477 -- , X_vendor_id => 11222
478 -- , X_entered_by_user_id => 29
479 -- , X_attribute_category => ''
480 -- , X_attribute1 => ''
481 -- , X_attribute2 => ''
482 -- , X_attribute3 => ''
483 -- , X_attribute4 => ''
484 -- , X_attribute5 => ''
485 -- , X_attribute6 => ''
486 -- , X_attribute7 => ''
487 -- , X_attribute8 => ''
488 -- , X_attribute9 => ''
489 -- , X_attribute10 => ''
490 -- , X_attribute11 => ''
491 -- , X_attribute12 => ''
492 -- , X_attribute13 => ''
493 -- , X_attribute14 => ''
494 -- , X_attribute15 => ''
495 -- , X_msg_application => X_msg_application
496 -- , X_msg_type => X_msg_type
497 -- , X_msg_token1 => X_msg_token1
498 -- , X_msg_token2 => X_msg_token2
499 -- , X_msg_token3 => X_msg_token3
500 -- , X_msg_count => X_msg_count
501 -- , X_msg_data => X_msg_data
502 -- , X_billable_flag => X_billable_flag);
503 --
504 -- After the call to the API, handle the any Errors/Warnings returned
505 -- by the API. Lets assume that the API has returned with the following
506 -- values in the OUT parameters.
507 --
508 -- -------------------------------------------------------------------
509 -- X_msg_type = 'E'
510 -- X_msg_data = 'TK_QTY_IS_NULL'
511 -- X_msg_application = 'TK'
512 -- where TK is application short name for custom application that
513 -- owns the message
514 -- X_msg_token1 = 110034 -- Project Id
515 -- X_msg_token2 =1038 -- Task Id
516 -- X_msg_token3 = Supplies -- Expenditure Type
517 -- --------------------------------------------------------------------
518 -- The following section shows how to handle Warnings in calling programs
519 --
520 -- If X_msg_type = 'E' and X_msg_data is not null then
521 --
522 -- if X_msg_application !='PA' then
523 --
524 -- FND_MESSAGE.SET_NAME(X_msg_application,X_msg_data);
525 -- FND_MESSAGE.SET_TOKEN(patc_msg_token1,X_msg_token1);
526 -- FND_MESSAGE.SET_TOKEN(patc_msg_token2,X_msg_token2);
527 -- FND_MESSAGE.SET_TOKEN(patc_msg_token3,X_msg_token3);
528 -- else
529 -- FND_MESSAGE.set_name(X_msg_application,X_msg_data);
530 -- end if;
531 --
532 -- Display Error Alert.( Similar to release 11 error handling).
533 -- Abort the processing.
534 -- End if;
535 --
536 -------------------------------------------------------------------------------
537 -- Custom Error/Warning Messages:
538 --
539 -- Prior to release 11.1 users were allowed to store customized error messages
540 -- for transaction control extension in Oracle Projects, However with release
541 -- 11.1 customized messages for transaction control extension will not be
542 -- upgraded. Users should move all customized messages to a different custom
543 -- application. All custom messages should follow the following standards.
544 --
545 -- Transaction control custom messages should always have 3 tokens defined in
546 -- the message text( Even if you do not intend to use the tokens).
547 --
548 -- Names of the tokens should be patc_msg_token1, patc_msg_token2 and
549 -- patc_msg_token3.
550 --
551 -- Examples of messages in release 11.0 and prior versions:
552 -- -------------------------------------------------------
553 -- Application Name: Oracle Projects
554 -- Message Name: PATXC_QTY_IS_NULL
555 -- Message text: Quantity is null
556 --
557 -- Examples of Error messages in release 11.1
558 -- ------------------------------------------
559 -- Application Name: <Custom Application>
560 -- Message Name: TK_QTY_IS_NULL
561 -- Message text: Quantity is null.
562 -- Project id is <patc_msg_token1>
563 -- Task_id is <patc_msg_token2>
564 -- Expenditure Type is <patc_msg_token3>
565 --
566 -- Examples of Warning Messages in release 11.1
567 -- --------------------------------------------
568 -- Application Name: <Custom Application>
569 -- Message Name: TK_TRANS_CURR_IS_NULL
570 -- Message text: Transaction Currency is null. Do you want to continue?.
571 -- Task Id is <patc_msg_token1>
572 -- Functional currency raw cost is <patc_msg_token2>
573 -- Transaction currency raw cost is <patc_msg_token3>
574
575 -------------------------------------------------------------------------------
576 PROCEDURE validate_transaction(
577 X_project_id IN NUMBER
578 , X_task_id IN NUMBER
579 , X_ei_date IN DATE
580 , X_expenditure_type IN VARCHAR2
581 , X_non_labor_resource IN VARCHAR2
582 , X_person_id IN NUMBER
583 , X_quantity IN NUMBER DEFAULT NULL
584 , X_denom_currency_code IN VARCHAR2 DEFAULT NULL
585 , X_acct_currency_code IN VARCHAR2 DEFAULT NULL
586 , X_denom_raw_cost IN NUMBER DEFAULT NULL
587 , X_acct_raw_cost IN NUMBER DEFAULT NULL
588 , X_acct_rate_type IN VARCHAR2 DEFAULT NULL
589 , X_acct_rate_date IN DATE DEFAULT NULL
590 , X_acct_exchange_rate IN NUMBER DEFAULT NULL
591 , X_transfer_ei IN NUMBER DEFAULT NULL
592 , X_incurred_by_org_id IN NUMBER DEFAULT NULL
593 , X_nl_resource_org_id IN NUMBER DEFAULT NULL
594 , X_transaction_source IN VARCHAR2 DEFAULT NULL
595 , X_calling_module IN VARCHAR2 DEFAULT NULL
596 , X_vendor_id IN NUMBER DEFAULT NULL
597 , X_entered_by_user_id IN NUMBER DEFAULT NULL
598 , X_attribute_category IN VARCHAR2 DEFAULT NULL
599 , X_attribute1 IN VARCHAR2 DEFAULT NULL
600 , X_attribute2 IN VARCHAR2 DEFAULT NULL
601 , X_attribute3 IN VARCHAR2 DEFAULT NULL
602 , X_attribute4 IN VARCHAR2 DEFAULT NULL
603 , X_attribute5 IN VARCHAR2 DEFAULT NULL
604 , X_attribute6 IN VARCHAR2 DEFAULT NULL
605 , X_attribute7 IN VARCHAR2 DEFAULT NULL
606 , X_attribute8 IN VARCHAR2 DEFAULT NULL
607 , X_attribute9 IN VARCHAR2 DEFAULT NULL
608 , X_attribute10 IN VARCHAR2 DEFAULT NULL
609 , X_attribute11 IN VARCHAR2 DEFAULT NULL
610 , X_attribute12 IN VARCHAR2 DEFAULT NULL
611 , X_attribute13 IN VARCHAR2 DEFAULT NULL
612 , X_attribute14 IN VARCHAR2 DEFAULT NULL
613 , X_attribute15 IN VARCHAR2 DEFAULT NULL
614 , X_msg_application IN OUT NOCOPY VARCHAR2
615 , X_msg_type OUT NOCOPY VARCHAR2
616 , X_msg_token1 OUT NOCOPY VARCHAR2
617 , X_msg_token2 OUT NOCOPY VARCHAR2
618 , X_msg_token3 OUT NOCOPY VARCHAR2
619 , X_msg_count OUT NOCOPY NUMBER
620 , X_msg_data OUT NOCOPY VARCHAR2
621 , X_billable_flag OUT NOCOPY VARCHAR2
622 , P_ProjFunc_Currency_Code IN VARCHAR2 default null
623 , P_ProjFunc_Cost_rate_Type IN VARCHAR2 default null
624 , P_ProjFunc_Cost_rate_Date IN DATE default null
625 , P_ProjFunc_Cost_Exchg_Rate IN NUMBER default null
626 , P_Assignment_Id IN NUMBER default null
627 , P_Work_type_Id IN NUMBER default null
628 , P_Sys_Link_Function IN VARCHAR2 default null
629 , P_Po_Header_Id IN NUMBER default null
630 , P_Po_Line_Id IN NUMBER default null
631 , P_Person_Type IN VARCHAR2 default null
632 , P_Po_Price_Type IN VARCHAR2 default null
633 , P_Document_Type IN VARCHAR2 default null
634 , P_Document_Line_Type IN VARCHAR2 default null
635 , P_Document_Dist_Type IN VARCHAR2 default null
636 -- 10253400: Payroll integration enhancement for 12.2..start
637 , P_Job_Id IN NUMBER default null
638 , P_Location_Id IN NUMBER default null
639 , P_Pay_Element_Type_Id IN NUMBER default null
640 , P_payroll_accrual_flag IN VARCHAR2 default null ---- Added for payroll billable_flag changes for 12.2 bug#12344689
641 -- 10253400: Payroll integration enhancement for 12.2..end
642 , P_pa_ref_num1 IN NUMBER default null
643 , P_pa_ref_num2 IN NUMBER default null
644 , P_pa_ref_num3 IN NUMBER default null
645 , P_pa_ref_num4 IN NUMBER default null
646 , P_pa_ref_num5 IN NUMBER default null
647 , P_pa_ref_num6 IN NUMBER default null
648 , P_pa_ref_num7 IN NUMBER default null
649 , P_pa_ref_num8 IN NUMBER default null
650 , P_pa_ref_num9 IN NUMBER default null
651 , P_pa_ref_num10 IN NUMBER default null
652 , P_pa_ref_var1 IN VARCHAR2 default null
653 , P_pa_ref_var2 IN VARCHAR2 default null
654 , P_pa_ref_var3 IN VARCHAR2 default null
655 , P_pa_ref_var4 IN VARCHAR2 default null
656 , P_pa_ref_var5 IN VARCHAR2 default null
657 , P_pa_ref_var6 IN VARCHAR2 default null
658 , P_pa_ref_var7 IN VARCHAR2 default null
659 , P_pa_ref_var8 IN VARCHAR2 default null
660 , P_pa_ref_var9 IN VARCHAR2 default null
661 , P_pa_ref_var10 IN VARCHAR2 default null);
662
663
664 -- DFF Upgrade -----------------------------------------------------------
665
666 -- The following record type is used to record for each context code,
667 -- which segment is enabled.
668
669 TYPE dff_segments_enabled_record IS RECORD (
670 context_code fnd_descr_flex_contexts.descriptive_flex_context_code%TYPE,
671 context_name fnd_descr_flex_contexts_vl.descriptive_flex_context_name%TYPE,
672 is_global boolean,
673 attribute1_enabled boolean,
674 attribute2_enabled boolean,
675 attribute3_enabled boolean,
676 attribute4_enabled boolean,
677 attribute5_enabled boolean,
678 attribute6_enabled boolean,
679 attribute7_enabled boolean,
680 attribute8_enabled boolean,
681 attribute9_enabled boolean,
682 attribute10_enabled boolean
683 );
684
685 ----------------------------------------------------------------------------
686
687 -- This table type is used to record, for a descriptive flex field, which
688 -- context code has which enabled segments.
689
690 TYPE dff_segments_enabled_table IS TABLE OF dff_segments_enabled_record
691 INDEX BY BINARY_INTEGER;
692
693 ----------------------------------------------------------------------------
694
695 -- This Global Variable is used mainly by validate_dff API to keep track of,
696 -- for a descriptive flexfield, which context code has which enabled segments.
697 -- We want to record all these information for performance purpose. By storing
698 -- these information in a table, we do not need to call ATG API each time if
699 -- we want to find out which segments are enabled for a particular context code.
700
701 G_dff_segments_enabled_table dff_segments_enabled_table;
702
703
704 ------------------------------------------------------------------------------
705 -- Start of Comments
706 -- API Name : pop_dff_segments_enabled_table
707 -- Type : Public
708 -- Pre-Reqs : None
709 -- Type : Procedure
710 -- Function : Initialize the global variable G_dff_segments_enabled_table
711 -- Parameters : None
712
713 /*----------------------------------------------------------------------------*/
714
715 PROCEDURE pop_dff_segments_enabled_table;
716
717
718 /*----------------------------------------------------------------------------*/
719 -- Start of Comments
720 -- API Name : populate_segments
721 -- Type : Public
722 -- Pre-Reqs : None
723 -- Type : Procedure
724 -- Function : This API is called by pop_dff_segments_enabled_table. It is
725 -- called in a loop by the number of context codes for a
726 -- descriptive flexfield. By giving the segment detail info of
727 -- a context code, this API initialize one record of
728 -- G_dff_segments_enabled_table with the enabled segments of that
729 -- context code.
730 -- Parameters :
731 -- IN
732 -- p_segment_detail fnd_dflex.segments_dr
733 -- IN/OUT
734 -- p_dff_segments_enabled_record dff_segments_enabled_record
735
736 /*----------------------------------------------------------------------------*/
737
738 PROCEDURE populate_segments (
739 p_segment_detail IN fnd_dflex.segments_dr,
740 /* Start of bug# 2672653 */
741 /* p_dff_segments_enabled_record IN OUT dff_segments_enabled_record); */
742 p_dff_segments_enabled_record IN OUT NOCOPY dff_segments_enabled_record);
743 /* End of bug# 2672653 */
744
745
746
747 --------------------------------------------------------------------------------
748 --
749 -- Start of comments
750 --
751 -- API Name : pa_transactions_pub.validate_dff
752 --
753 -- Type : Public
754 --
755 -- Pre-reqs : None
756 --
757 -- Function : This procedure performs the following two tasks:
758 -- 1. Call pop_dff_segments_enabled_table to initialize
759 -- G_dff_segments_enabled_table if it hasn't been initialized
760 -- 2. Validate DFF segments
761 -- 3. Pass out enabled segment values in p_attribute_x parameters
762 -- segments which are not enabled are pass out as NULL in p_attribute_x
763 -- parameters
764 -- Parameters:
765 -- IN
766 -- p_dff_name fnd_descriptive_flexs_vl.descriptive_flexfield_name%TYPE
767 -- p_attribute_category pa_expenditure_items_all.attribute_category%TYPE
768 --
769 -- IN/OUT
770 -- p_attribute1 IN OUT pa_expenditure_items_all.attribute1%TYPE
771 -- p_attribute2 IN OUT pa_expenditure_items_all.attribute2%TYPE
772 -- p_attribute3 IN OUT pa_expenditure_items_all.attribute3%TYPE
773 -- p_attribute4 IN OUT pa_expenditure_items_all.attribute4%TYPE
774 -- p_attribute5 IN OUT pa_expenditure_items_all.attribute5%TYPE
775 -- p_attribute6 IN OUT pa_expenditure_items_all.attribute6%TYPE
776 -- p_attribute7 IN OUT pa_expenditure_items_all.attribute7%TYPE
777 -- p_attribute8 IN OUT pa_expenditure_items_all.attribute8%TYPE
778 -- p_attribute9 IN OUT pa_expenditure_items_all.attribute9%TYPE
779 -- p_attribute10 IN OUT pa_expenditure_items_all.attribute10%TYPE
780 --
781 -- OUT
782 -- x_status_code OUT VARCHAR2
783 -- x_error_message OUT VARCHAR2
784 --
785 PROCEDURE validate_dff (
786 p_dff_name IN fnd_descriptive_flexs_vl.descriptive_flexfield_name%TYPE,
787 p_attribute_category IN pa_expenditure_items_all.attribute_category%TYPE,
788 p_attribute1 IN OUT NOCOPY pa_expenditure_items_all.attribute1%TYPE,
789 p_attribute2 IN OUT NOCOPY pa_expenditure_items_all.attribute2%TYPE,
790 p_attribute3 IN OUT NOCOPY pa_expenditure_items_all.attribute3%TYPE,
791 p_attribute4 IN OUT NOCOPY pa_expenditure_items_all.attribute4%TYPE,
792 p_attribute5 IN OUT NOCOPY pa_expenditure_items_all.attribute5%TYPE,
793 p_attribute6 IN OUT NOCOPY pa_expenditure_items_all.attribute6%TYPE,
794 p_attribute7 IN OUT NOCOPY pa_expenditure_items_all.attribute7%TYPE,
795 p_attribute8 IN OUT NOCOPY pa_expenditure_items_all.attribute8%TYPE,
796 p_attribute9 IN OUT NOCOPY pa_expenditure_items_all.attribute9%TYPE,
797 p_attribute10 IN OUT NOCOPY pa_expenditure_items_all.attribute10%TYPE,
798 x_status_code OUT NOCOPY VARCHAR2,
799 x_error_message OUT NOCOPY VARCHAR2);
800
801 /*--------------------------------------------------------------------------------
802 --
803 -- Start of comments
804 --
805 -- API Name : check_adjustment_of_proj_transactions
806 --
807 -- Type : Public
808 --
809 -- Pre-reqs : None
810 --
811 -- Function : This procedure can be called from an external system
812 -- to check if an item imported to Projects from an external
813 -- system through Transaction Import has been adjusted in Projects.
814 --
815 -- The API will check the pa_expenditure_items_all.net_zero_adjustment_flag for
816 -- the item in Projects.
817 --
818 -- If the net_zero_adjustment_flag = 'Y'then the item has been adjusted
819 -- in Projects and the API will return x_adjustment_status = 'Adjusted'.
820 --
821 -- If the net_zero_adjustment_flag <> 'Y' then item has NOT been adjusted in
822 -- Projects and the API will return x_adjustment_status = 'Not Adjusted'.
823
824 -- If the item cannot be found in Projects based upon the parameters
825 -- passed into the API then the API will return
826 -- x_adjustment_status = 'Not Found'.
827 --
828 -- This API is NOT customizable.
829 --
830 -- Parameters:
831 --
832 -- IN
833 -- x_transaction_source IN VARCHAR2
834 -- x_orig_transaction_reference IN VARCHAR2
835 -- x_expenditure_type_class IN VARCHAR2
836 -- x_expenditure_type IN VARCHAR2
837 -- x_expenditure_item_id IN NUMBER DEFAULT NULL
838 -- x_expenditure_item_date IN DATE
839 -- x_employee_number IN VARCHAR2 DEFAULT NULL
840 -- x_expenditure_organization_name IN VARCHAR2 DEFAULT NULL
841 -- x_project_number IN VARCHAR2
842 -- x_task_number IN VARCHAR2
843 -- x_non_labor_resource IN VARCHAR2 DEFAULT NULL
844 -- x_non_labor_resource_org_name IN VARCHAR2 DEFAULT NULL
845 -- x_quantity IN NUMBER
846 -- x_raw_cost IN NUMBER DEFAULT NULL
847 -- x_attribute_category IN VARCHAR2 DEFAULT NULL
848 -- x_attribute1 IN VARCHAR2 DEFAULT NULL
849 -- x_attribute2 IN VARCHAR2 DEFAULT NULL
850 -- x_attribute3 IN VARCHAR2 DEFAULT NULL
851 -- x_attribute4 IN VARCHAR2 DEFAULT NULL
852 -- x_attribute5 IN VARCHAR2 DEFAULT NULL
853 -- x_attribute6 IN VARCHAR2 DEFAULT NULL
854 -- x_attribute7 IN VARCHAR2 DEFAULT NULL
855 -- x_attribute8 IN VARCHAR2 DEFAULT NULL
856 -- x_attribute9 IN VARCHAR2 DEFAULT NULL
857 -- x_attribute10 IN VARCHAR2 DEFAULT NULL
858 -- x_org_id IN NUMBER DEFAULT NULL
859 --OUT
860 -- x_adjustment_status OUT VARCHAR2
861 -- x_adjustment_status_code OUT VARCHAR2
862 -- x_return_status OUT VARCHAR2
863 -- x_message_data OUT VARCHAR2
864 --
865 --
866
867 ------------------------------------------------------------------------------
868
869 Parameter Description
870 ---------------------- ---------------------------------------------
871 X_transaction_source Identifies the external system from which the item
872 imported by Transaction Import originated.
873
874 X_orig_transaction_reference Value used to identify the transaction in the external system from
875 which the imported item originated.
876
877 X_expenditure_type_class System Linkage function of the expenditure item.
878
879 X_expenditure_type The type of expenditure.
880
881 X_expenditure_item_id Unique identifier of the item in Projects.
882
883 X_expenditure_item_date Date of the expenditure item.
884
885 X_employee_number The employee number of the person who incurred
886 the expenditure.
887
888 X_expenditure_org_name The name of the organization that incurred the
889 expenditure.
890
891 X_project_number Number identifying the project to which the
892 transaction is charged.
893
894 X_task_number Number identifying the task to which the
895 transaction is charged.
896
897 X_non_labor_resource The non-labor resource. For usage items only.
898
899 X_non_labor_resource_org_name The name of the organization that owns the non-labor
900 resource utilized. For usage items only.
901
902 X_quantity Number of units for the transaction.
903
904 X_raw_cost The total raw cost for the transaction as calculated by the
905 original, external system.
906
907 X_attribute_category Expenditure item descriptive flexfield context
908 for transactions created in Orcale projects.
909 Invoice distributions descriptive flexfield context
910 for supplier invoices.
911 For project related requisitions and purchase orders
912 this will be equal to requisition/purchase order
913 distributions descriptive flexfield context
914
915 X_attribute[1-10] Expenditure item descriptive flexfield segments
916 (attribute1-10).
917
918 X_adjustment_status Indicates if the item has been adjusted in Projects.
919 'Adjusted' - Adjusted in Projects
920 'Not Adjusted' - Not Adjusted in Projects
921 'Not Found' - Not Found in Projects based upon the
922 parameters passed to the API.
923
924 X_adjustment_status_code Code indicating if the item has been adjusted in
925 Projects. Possible values are:
926 'A' - Adjusted in Projects
927 'NA' - Not Adjusted in Projects
928 'NF' - Not Found in Projects based upon the
929 parameters passed to the API.
930
931 X_return_status Indicates the status of the procedure. Possible values
932 are:
933
934 'S' - Success
935 'E' - Expected Error
936 'U' - Unexpected Error
937
938 If the parameters passed to the API do not uniquely identify
939 the transaction in Projects then the API will return
940 X_return_status = 'E' (Expected Error).
941
942 X_msg_data Will contain the error message if x_return_status = 'E' or 'U'.
943 Will be NULL if x_return_status = 'S'.
944
945
946 Please note that this API is NOT customizable.
947
948 The following IN paramters are required:
949
950 x_transaction_source
951 x_orig_transaction_reference
952 x_expenditure_type_class
953 x_expenditure_type
954 x_expenditure_item_date
955 x_project_number
956 x_task_number
957 x_quantity
958
959 The required parameters, along with any other parameters needed to uniquely identify
960 the transaction in Projects, should be passed to the API.
961
962
963 ---------------------------------------------------------------------------- */
964
965 PROCEDURE check_adjustment_of_proj_txn(
966 x_transaction_source IN VARCHAR2,
967 x_orig_transaction_reference IN VARCHAR2,
968 x_expenditure_type_class IN VARCHAR2,
969 x_expenditure_type IN VARCHAR2,
970 x_expenditure_item_id IN NUMBER DEFAULT NULL,
971 x_expenditure_item_date IN DATE,
972 x_employee_number IN VARCHAR2 DEFAULT NULL,
973 x_expenditure_org_name IN VARCHAR2 DEFAULT NULL,
974 x_project_number IN VARCHAR2,
975 x_task_number IN VARCHAR2,
976 x_non_labor_resource IN VARCHAR2 DEFAULT NULL,
977 x_non_labor_resource_org_name IN VARCHAR2 DEFAULT NULL,
978 x_quantity IN NUMBER,
979 x_raw_cost IN NUMBER DEFAULT NULL,
980 x_attribute_category IN VARCHAR2 DEFAULT NULL,
981 x_attribute1 IN VARCHAR2 DEFAULT NULL,
982 x_attribute2 IN VARCHAR2 DEFAULT NULL,
983 x_attribute3 IN VARCHAR2 DEFAULT NULL,
984 x_attribute4 IN VARCHAR2 DEFAULT NULL,
985 x_attribute5 IN VARCHAR2 DEFAULT NULL,
986 x_attribute6 IN VARCHAR2 DEFAULT NULL,
987 x_attribute7 IN VARCHAR2 DEFAULT NULL,
988 x_attribute8 IN VARCHAR2 DEFAULT NULL,
989 x_attribute9 IN VARCHAR2 DEFAULT NULL,
990 x_attribute10 IN VARCHAR2 DEFAULT NULL,
991 x_org_id IN NUMBER DEFAULT NULL,
992 x_adjustment_status OUT NOCOPY VARCHAR2,
993 x_adjustment_status_code OUT NOCOPY VARCHAR2,
994 x_return_status OUT NOCOPY VARCHAR2,
995 x_message_data OUT NOCOPY VARCHAR2);
996
997
998 /*--------------------------------------------------------------------------------
999 --
1000 -- Start of comments
1001 --
1002 -- API Name : allow_adjustment_extn
1003 --
1004 -- Type : Public
1005 --
1006 -- Pre-reqs : None
1007 --
1008 -- Function : This client extension will be called when a user attempts to make an adjustment
1009 -- in Projects to an item which was imported from an external system through Transaction Import.
1010 -- The extension can be used by customers to determine if adjustments in Projects
1011 -- should be allowed on those items.
1012 --
1013 -- For example, if the item has been adjusted in the external system then you may
1014 -- not want to allow adjustments to that item in Projects.
1015 --
1016 -- By default, the extension will return pa_transaction_sources.allow_adjustment_flag for
1017 -- p_transaction source.
1018 --
1019 -- If the client extension returns x_allow_adjustment_code = 'Y' (Yes) then the adjustment
1020 -- in Projects will be allowed.
1021 --
1022 -- If the client extension returns x_allow_adjustment_code = 'N' (No) then the adjustment
1023 -- in Projects will NOT be allowed.
1024 --
1025 -- Parameters:
1026 --
1027 -- IN
1028 -- p_transaction_source IN VARCHAR2
1029 -- p_allow_adjustment_flag IN VARCHAR2
1030 -- p_orig_transaction_reference IN VARCHAR2
1031 -- p_expenditure_type_class IN VARCHAR2
1032 -- p_expenditure_type IN VARCHAR2
1033 -- p_expenditure_item_id IN NUMBER
1034 -- p_expenditure_item_date IN DATE
1035 -- p_employee_number IN VARCHAR2
1036 -- p_expenditure_org_name IN VARCHAR2
1037 -- p_project_number IN VARCHAR2
1038 -- p_task_number IN VARCHAR2
1039 -- p_non_labor_resource IN VARCHAR2
1040 -- p_non_labor_resource_org_name IN VARCHAR2
1041 -- p_quantity IN NUMBER
1042 -- p_raw_cost IN NUMBER
1043 -- p_attribute_category IN VARCHAR2
1044 -- p_attribute1 IN VARCHAR2
1045 -- p_attribute2 IN VARCHAR2
1046 -- p_attribute3 IN VARCHAR2
1047 -- p_attribute4 IN VARCHAR2
1048 -- p_attribute5 IN VARCHAR2
1049 -- p_attribute6 IN VARCHAR2
1050 -- p_attribute7 IN VARCHAR2
1051 -- p_attribute8 IN VARCHAR2
1052 -- p_attribute9 IN VARCHAR2
1053 -- p_attribute10 IN VARCHAR2
1054 -- p_org_id IN NUMBER
1055 --OUT
1056 -- x_allow_adjustment_code OUT VARCHAR2
1057 -- x_return_status OUT VARCHAR2
1058 -- x_application_code OUT VARCHAR2,
1059 -- x_message_code OUT VARCHAR2,
1060 -- x_token_name1 OUT VARCHAR2,
1061 -- x_token_val1 OUT VARCHAR2,
1062 -- x_token_name2 OUT VARCHAR2,
1063 -- x_token_val2 OUT VARCHAR2,
1064 -- x_token_name3 OUT VARCHAR2,
1065 -- x_token_val3 OUT VARCHAR2);
1066 --
1067 --
1068
1069 Parameter Description
1070 ---------------------- ---------------------------------------------
1071 p_transaction_source Identifies the external system from which the item
1072 imported by Transaction Import originated.
1073
1074 p_orig_transaction_reference Value used to identify the transaction in the external system from
1075 which the imported item originated.
1076
1077 p_expenditure_type_class System Linkage function of the expenditure item.
1078
1079 p_expenditure_type The type of expenditure.
1080
1081 p_expenditure_item_id Unique identifier of the item in Projects.
1082
1083 p_expenditure_item_date Date of the expenditure item.
1084
1085 p_employee_number The employee number of the person who incurred
1086 the expenditure.
1087
1088 p_expenditure_org_name The name of the organization that incurred the
1089 expenditure.
1090
1091 p_project_number Number identifying the project to which the
1092 transaction is charged.
1093
1094 p_task_number Number identifying the task to which the
1095 transaction is charged.
1096
1097 p_non_labor_resource The non-labor resource. For usage items only.
1098
1099 p_non_labor_resource_org_name The name of the organization that owns the non-labor
1100 resource utilized. For usage items only.
1101
1102 p_quantity Number of units for the transaction.
1103
1104 p_raw_cost The total raw cost for the transaction as calculated by the
1105 original, external system.
1106
1107 p_attribute_category Expenditure item descriptive flexfield context
1108 for transactions created in Orcale projects.
1109 Invoice distributions descriptive flexfield context
1110 for supplier invoices.
1111 For project related requisitions and purchase orders
1112 this will be equal to requisition/purchase order
1113 distributions descriptive flexfield context
1114
1115 p_attribute[1-10] Expenditure item descriptive flexfield segments
1116 (attribute1-10).
1117
1118 p_org_id Operating unit identifier for multi-organization
1119 installations.
1120
1121 x_allow_adjustment_code Code indicating if the item may been adjusted in
1122 Projects. Possible values are:
1123 'Y' - Yes (Adjustment is allowed)
1124 'N' - No (Adjustment not allowed)
1125
1126 X_return_status Indicates the status of the procedure. Possible values
1127 are:
1128
1129 'S' - Success
1130 'W' - Warning
1131 'E' - Error
1132
1133 X_application_code The application short name of the message owning
1134 application.
1135
1136 X_message_code The message name.
1137
1138 X_token_name[1-3] Name of the tokens in the message.
1139
1140 X_token_val[1-3] Value of the tokens in the message.
1141
1142 --------------------------------------------------------------------------------------
1143
1144 --The following examples describe the usage of API and how to process error/warning
1145 --codes returned by the API in calling programs.
1146
1147 --Example:
1148
1149 --allow_adjustment_extn is called from pa_adjustments.allow_adjustment
1150
1151 --PA_TRANSACTIONS_PUB.Allow_Adjustment_Extn(
1152 -- p_transaction_source => 'customer transaction source',
1153 -- p_allow_adjustment_flag => 'Y',
1154 -- p_orig_transaction_reference => 'Timecard-123',
1155 -- p_expenditure_type_class => 'ST',
1156 -- p_expenditure_type => 'Professional',
1157 -- p_expenditure_item_id => '',
1158 -- p_expenditure_item_date => '01-JAN-99',
1159 -- p_employee_number => '',
1160 -- p_expenditure_org_name => 'Consulting',
1161 -- p_project_number => '123',
1162 -- p_task_number => '456',
1163 -- p_non_labor_resource => '',
1164 -- p_non_labor_resource_org_name => '',
1165 -- p_quantity => 8,
1166 -- p_raw_cost => '',
1167 -- p_attribute_category => '',
1168 -- p_attribute1 => '',
1169 -- p_attribute2 => '',
1170 -- p_attribute3 => '',
1171 -- p_attribute4 => '',
1172 -- p_attribute5 => '',
1173 -- p_attribute6 => '',
1174 -- p_attribute7 => '',
1175 -- p_attribute8 => '',
1176 -- p_attribute9 => '',
1177 -- p_attribute10 => '',
1178 -- p_org_id => '',
1179 -- x_allow_adjustment_code => x_allow_adjustment_code,
1180 -- x_return_status => x_return_status,
1181 -- x_application_code => x_application_code,
1182 -- x_message_code => x_message_code,
1183 -- x_token_name1 => x_token_name1,
1184 -- x_token_val1 => x_token_val1,
1185 -- x_token_name2 => x_token_name2,
1186 -- x_token_val2 => x_token_val2,
1187 -- x_token_name3 => x_token_name3,
1188 -- x_token_val3 => x_token_val3);
1189 --
1190 --
1191 --
1192 --
1193 --
1194 --ERROR HANDLING
1195 --
1196 --After the call to the client extension, handle any Errors
1197 --returned by the extension. Assume the OUT parameters have the
1198 --following values:
1199 --
1200 --X_return_status = 'E'
1201 --X_application_code = 'AB' (AB is not application short name for the customer application)
1202 --X_message_code = 'AB_ITEM_NOT_FOUND'
1203 --X_token_name1 = 'TRANSACTION_SOURCE'
1204 --X_token_val1 = 'Customer Transaction Source'
1205 --X_token_name2 = 'EXTERNAL_ID'
1206 --X_token_val2 = 'Timecard-123'
1207 --X_Token_name3 = ''
1208 --X_Token_val3 = ''
1209 --
1210 --The calling program will handle errors in the following way.
1211 --
1212 -- If X_return_status = 'E' and X_msg_data is NOT NULL THEN
1213 --
1214 -- if X_msg_application != 'PA' THEN
1215 --
1216 -- Please do not customize messages owned by Oracle Projects. If
1217 -- you want to customize a message, create a new message in your
1218 -- custom application.
1219 --
1220 --
1221 -- FND_MESSAGE.SET_NAME(X_application_code,X_message_code);
1222 -- FND_MESSAGE.SET_TOKEN(X_token_name1,X_token_val1)
1223 -- FND_MESSAGE.SET_TOKEN(X_token_name2,X_token_val2)
1224 -- FND_MESSAGE.SET_TOKEN(X_token_name3,X_token_val3)
1225 --
1226 -- ELSE -- for seeded messages, i.e messages owned by PA
1227 --
1228 -- Tokens are not supported in Seeded messages
1229 --
1230 -- FND_MESSAGE.set_name(X_msg_application,X_msg_data)
1231 --
1232 -- end if;
1233 --
1234 -- End if;
1235 --
1236 -- Assume that the message_text for 'AB_ITEM_NOT_FOUND' is
1237 --
1238 -- 'Unable to find <EXTERNAL_ID> in <TRANSACTION_SOURCE>'
1239 --
1240 -- The error message will then be displayed as follows, and the adjustment will be aborted.
1241 --
1242 -- 'Unable to find Timecard-123 in Customer Transaction Source'
1243 --
1244 --
1245 --WARNING HANDLING
1246 --
1247 --After the call to the client extension, handle any Warnings
1248 --returned by the extension. Assume the OUT parameters have the
1249 --following values:
1250 --
1251 --X_return_status = 'W'
1252 --X_application_code = 'AB' (AB is not application short name for the customer application)
1253 --X_message_code = 'AB_ITEM_ALREADY_BILLED'
1254 --X_token_name1 = 'TRANSACTION_SOURCE'
1255 --X_token_val1 = 'Customer Transaction Source'
1256 --X_token_name2 = 'EXTERNAL_ID'
1257 --X_token_val2 = 'Timecard-123'
1258 --X_Token_name3 = ''
1259 --X_Token_val3 = ''
1260 --
1261 --Assume that the message_text for 'AB_ITEM_ALREADY_BILLED' is
1262 --
1263 -- '<EXTERNAL_ID> from <TRANSACTION_SOURCE> has already been billed. Are you sure
1264 -- you want to adjust this item?'
1265 --
1266 --
1267 --The calling program will handle warnings in the following way.
1268 --
1269 -- If X_return_status = 'W' and X_msg_data is NOT NULL THEN
1270 --
1271 -- if X_msg_application != 'PA' THEN
1272 --
1273 -- Please do not customize messages owned by Oracle Projects. If
1274 -- you want to customize a message, create a new message in your
1275 -- custom application.
1276 --
1277 --
1278 -- FND_MESSAGE.SET_NAME(X_application_code,X_message_code);
1279 -- FND_MESSAGE.SET_TOKEN(X_token_name1,X_token_val1)
1280 -- FND_MESSAGE.SET_TOKEN(X_token_name2,X_token_val2)
1281 -- FND_MESSAGE.SET_TOKEN(X_token_name3,X_token_val3)
1282 --
1283 -- ELSE -- for seeded messages, i.e messages owned by PA
1284 --
1285 -- Tokens are not supported in Seeded messages
1286 --
1287 -- FND_MESSAGE.set_name(X_msg_application,X_msg_data)
1288 --
1289 -- end if;
1290 --
1291 -- End if;
1292 --
1293 -- Assume that the message_text for 'AB_ITEM_ALREADY_BILLED' is
1294 --
1295 -- '<EXTERNAL_ID> from <TRANSACTION_SOURCE> has already been billed. Are you sure
1296 -- you want to adjust this item?'
1297 --
1298 -- The warning message will then be displayed as follows:
1299 --
1300 -- 'Timecard-123 from Customer Transaction Source has already been billed.
1301 -- Are you sure you want to adjust this item?'
1302 --
1303 -- The user will have be able to continue with the adjustment or abort the adjustment.
1304
1305 ----------------------------------------------------------------------------------------*/
1306
1307
1308
1309 PROCEDURE allow_adjustment_extn(
1310 p_transaction_source IN VARCHAR2,
1311 p_allow_adjustment_flag IN VARCHAR2,
1312 p_orig_transaction_reference IN VARCHAR2,
1313 p_expenditure_type_class IN VARCHAR2,
1314 p_expenditure_type IN VARCHAR2,
1315 p_expenditure_item_id IN NUMBER,
1316 p_expenditure_item_date IN DATE,
1317 p_employee_number IN VARCHAR2,
1318 p_expenditure_org_name IN VARCHAR2,
1319 p_project_number IN VARCHAR2,
1320 p_task_number IN VARCHAR2,
1321 p_non_labor_resource IN VARCHAR2,
1322 p_non_labor_resource_org_name IN VARCHAR2,
1323 p_quantity IN NUMBER,
1324 p_raw_cost IN NUMBER ,
1325 p_attribute_category IN VARCHAR2 ,
1326 p_attribute1 IN VARCHAR2 ,
1327 p_attribute2 IN VARCHAR2 ,
1328 p_attribute3 IN VARCHAR2 ,
1329 p_attribute4 IN VARCHAR2 ,
1330 p_attribute5 IN VARCHAR2 ,
1331 p_attribute6 IN VARCHAR2 ,
1332 p_attribute7 IN VARCHAR2 ,
1333 p_attribute8 IN VARCHAR2 ,
1334 p_attribute9 IN VARCHAR2 ,
1335 p_attribute10 IN VARCHAR2 ,
1336 p_org_id IN NUMBER ,
1337 x_allow_adjustment_code OUT NOCOPY VARCHAR2,
1338 x_return_status OUT NOCOPY VARCHAR2,
1339 x_application_code OUT NOCOPY VARCHAR2,
1340 x_message_code OUT NOCOPY VARCHAR2,
1341 x_token_name1 OUT NOCOPY VARCHAR2,
1342 x_token_val1 OUT NOCOPY VARCHAR2,
1343 x_token_name2 OUT NOCOPY VARCHAR2,
1344 x_token_val2 OUT NOCOPY VARCHAR2,
1345 x_token_name3 OUT NOCOPY VARCHAR2,
1346 x_token_val3 OUT NOCOPY VARCHAR2);
1347
1348
1349
1350 /*Bug 8574986 BEGIN*/
1351
1352 PROCEDURE validate_task(
1353 X_project_id IN NUMBER
1354 , X_task_id IN NUMBER
1355 , X_msg_type OUT NOCOPY VARCHAR2
1356 , X_msg_token1 OUT NOCOPY VARCHAR2
1357 , X_msg_count OUT NOCOPY NUMBER
1358 , X_msg_data OUT NOCOPY VARCHAR2
1359 );
1360
1361 /*Bug 8574986 END*/
1362
1363 END PA_TRANSACTIONS_PUB;