Académique Documents
Professionnel Documents
Culture Documents
CustomCalculateAmount
Extension for Use in Oracle
Internet Expenses – Fixed Rate
An Oracle White Paper
June 2001
11i Mileage Calculation - CustomCalculateAmount
Extension for Use in Oracle Internet Expenses –
Fixed Rate
FOCUS
1
SCOPE
In order to utilize mileage calculation in Internet Expenses, a descriptive flexfield
must be set up, and a package must be customized and recompiled against the
database.
TECHNICAL SETUP
Try this first in your test database.
The package.procedure that needs to be edited is
AP_WEB_CUST_DFLEX_PKG.CustomCalculateAmount.
The file should be located in $AP_TOP/patch/115/sql/apwdfcfb.pls
If the file is not here, obtain the latest OIE (Oracle Internet Expenses) patchset
from MetaLink.
Backup the seeded package. Modify the seeded package.
Edit the package, removing the section on the PROCEDURE
CustomCalculateAmount, and replacing it with the edited procedure provided
below. Save your changes to the package.
For these changes to take effect in the database, you need to recompile the
package. From the directory the modified package is in,
connect to sqlplus as apps/<password> and run the following:
@apwdfcfb.pls <return>
-----------------------------------------------
PROCEDURE CustomCalculateAmount(
p_exp_header_info IN OUT
AP_WEB_DFLEX_PKG.ExpReportHeaderRec,
p_exp_line_info IN OUT
AP_WEB_DFLEX_PKG.ExpReportLineRec,
p_custom_fields_array IN
AP_WEB_DFLEX_PKG.CustomFields_A)
-----------------------------------------------
IS
l_miles NUMBER;
l_rate_per_mile NUMBER;
l_debug_info VARCHAR2(2000);
l_curr_calling_sequence VARCHAR2(200)
:= 'CustomCalculateAmount';
BEGIN
2
-----------------------------------------------
-- Example code: Mileage
--
IF (upper(p_exp_line_info.expense_type) =
'MILEAGE') THEN
l_miles :=
AP_WEB_DFLEX_PKG.GetCustomFieldValue('MILES',
p_custom_fields_array);
-- l_rate_per_mile :=
AP_WEB_DFLEX_PKG.GetCustomFieldValue('RATE PER
MILE',
p_custom_fields_array);
p_exp_line_info.calculated_amount :=
l_miles * 2;
p_exp_line_info.copy_calc_amt_into_receipt_amt
:= 'Y';
-- ELSIF
(upper(p_exp_line_info.expense_type) = 'PER
DIEM') THEN
-- NULL;
-- ELSE IF ...
END IF;
-----------------------------------------------
EXCEPTION
WHEN OTHERS THEN
FND_MESSAGE.SET_NAME('SQLAP','AP_DEBUG');
FND_MESSAGE.SET_TOKEN('ERROR',SQLERRM);
FND_MESSAGE.SET_TOKEN('CALLING_SEQUENCE',
l_curr_calling_sequence);
FND_MESSAGE.SET_TOKEN('DEBUG_INFO',l_debug_info
);
AP_WEB_UTILITIES_PKG.DisplayException(fnd_messa
ge.get);
END CustomCalculateAmount;
3
FUNCTIONAL SETUP
4
Set up Descriptive Flexfield
Oracle Payables -> Setup -> Flexfield -> Descriptive -> Segments
Query up the Title "Expense Report Line".
Unfreeze the flexfield.
Create and enable a new Context Field Value as it appears below for "Mileage".
Choose the Segments button.
5
The segments form will open.
Create a Segment just like the below screenshot.
You may need to choose a different attribute column, depending on what is
available. Chose the Value Set that was created earlier in this document.
Once this is done, save your changes.
Choose the Open button at the bottom of the screen.
6
The screen should look like the screenshot below.
If it does not, make any necessary changes.
A description is required for the flexfield to display in Internet Expenses.
Once this is completed, save your changes, and close this form and the
Segments form, so you are now back on the Descriptive Flexfield Segments form.
Freeze and recompile the flexfield.
7
Set up Expense Template:
8
TESTING:
Notice the calculate amount button next to the field labeled MILES.
For this screenshot:
1 day was entered.
Mileage was chosen as the expense type.
“5” was entered in the miles field.
The calculate amount button was chosen.
This populated the 10.00 receipt amount, daily rate, and reimbursable
amount.
9
After the information is chosen on the details form, and the details form
is closed, information will display similar to the following:
10
11i Mileage Calculation – CustomCalculateAmount Extension for Use in Oracle Internet Expenses – Fixed Rate
June 2001
Author: Leigh Lindquist
Copyright © Oracle Corporation 2001
All Rights Reserved Printed in the U.S.A.
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Worldwide Inquiries:
415.506.7000
Fax 415.506.7200
11