Previous  Next          Contents  Index  Navigation  Glossary  Library

Views and Procedures You Can Use

Oracle Projects provides public, predefined procedures and views that you can use within your billing extension procedures for the Generate Draft Revenue and Generate Draft Invoice processes to derive amounts and create events. These procedures are created in a package named pa_billing_pub.

Note: You cannot use the public billing extension procedures or views by themselves or from any other client extension.

In the pages that follow, we provide you with a description of each procedure, information about the parameters available for the procedure, and any additional information you need to use the procedure in your billing extension. Use these procedures and views to:

Calculating Amounts

Oracle Projects provides two views that you can use to identify detail expenditure items included on draft revenue and draft invoices processed in a given run. Use these views in your calculations for transaction dependent billing extensions. The views display the detail transactions processed for the context in which a billing extension is called, which consists of a project, a top task (if task level assignment), a calling place, and a request ID.

Identifying Process Run Information

Oracle Projects provides four views that you can use to identify the detail revenue and invoice transactions processed in the current run.

Inserting Events

Use the insert_events procedure to create automatic events in the events table. You must use this procedure when creating events using billing extensions, as it contains validation that ensures the data integrity of the events that you create.

If this procedure encounters an error, it displays an error message in the log file of the process that called the procedure and does not create an event.

Package.Procedure

pa_billing_pub.insert_event

Listed below are the parameters available for the insert_event procedure.

Parameter Usage Type Description
X_rev_amt IN REAL Revenue amount of event.
X_bill_amt IN REAL Bill amount of event.
X_project_id IN NUMBER ID of the project to which the event is assigned.
X_event_type IN VARCHAR2 Event type of event. If a default is not specified, you must provide a value. Event type must have an event type classification of AUTOMATIC.
X_top_task_id IN NUMBER ID of the top task to which the event is assigned.
X_organization_id IN NUMBER ID of event organization.
X_completion_ date IN DATE Completion date of event.
X_event_ description IN VARCHAR2 Description of event. If you do not specify a default event description, you must provide a value here.
X_event_num_ reversed IN NUMBER Original automatic event number.
X_attribute_ category IN VARCHAR2 Descriptive flexfield context.
X_attribute1-10 IN VARCHAR2 Descriptive flexfield segments.
X_audit_ amounts1-10 IN NUMBER Audit amounts for events.
X_cost_budget_ type_code IN VARCHAR2 Audit cost budget type code.
X_rev_budget_ type_code IN VARCHAR2 Audit revenue budget type code.
X_error_message OUT VARCHAR2 Error message text.
X_status OUT NUMBER Status indicating whether an error occurred. Valid values are: =0 Successful validation <0 Oracle error (message will be written into a log file) >0 Application error

Note: If the billing extension is called by revenue generation only, you must set the revenue amount to a nonzero number. You can also set the bill amount. If the revenue amount is positive, the bill amount must also be positive.

Note: If the billing extension is called by invoice generation, you must set the bill amount to a nonzero number. You can also set the revenue amount. If the bill amount is positive, the revenue amount must also be positive.

Note: Oracle Projects provides a view that you can use to identify to original automatic event information of the current project, top task, and the credited invoices of the current request:

Retrieving Budget Amounts

Use the get_budget_amount procedure to retrieve baselined budgeted cost or revenue amounts for use in your calculations.

Package.Procedure

pa_billing_pub.get_budget_amount

Listed below are the parameters available for the get_budget_amount procedure. You must specify a value for the X2_project_id parameter for this procedure. You can optionally use the X2_task_id parameter to derive the budget amount for a task.

The parameters include input and output parameters for cost and revenue budget type codes.

Parameter Usage Type Description
X2_project_id IN NUMBER ID of project to retrieve baselined budget amounts.
X2_task_id IN NUMBER ID of top task to retrieve current budget amounts; you must also specify the project ID when you use this parameter.
X2_revenue_amount OUT REAL Baselined revenue budget amount for project or task.
X2_cost_amount OUT REAL Baselined cost budget amount for project or task.
p_cost_budget_ type_code IN VARCHAR2 Cost budget type code to be used for calculating cost budget amount. If this value is not specified, the cost budget type in the billing extension setup table is used.
If no value is entered in the billing extension setup table, the Approved Cost Budget is used.
p_rev_budget_ type_code> IN VARCHAR2 Revenue budget type code to be used for calculating revenue budget amount. If this value is not specified, the revenue budget type in the billing extension setup table is used.
If no value is entered in the billing extension setup table, the Approved Revenue Budget is used.
X_cost_budget_ type_code OUT VARCHAR2 Cost budget type code that was used for calculating the cost budget in this public API.
X_rev_budget_ type_code OUT VARCHAR2 Revenue budget type code that was used for calculating the revenue budget in this public API.
X_error_message OUT VARCHAR2 Error message text.
X_status OUT NUMBER Status indicating whether an error occurred. Valid values are: =0 Successful validation <0 Oracle error (message will be written into a log file) >0 Application error

Error Handling

Use the insert_message procedure to create debugging and error messages in the PA_BILLING_MESSAGES table. When you encounter a problem with billing extensions, you can review these messages in the log file of the revenue and invoice processes that call the billing extension, or you can review the error message table. See the Oracle Projects Technical Reference Manual Addendum for more information.

Package.Procedure

pa_billing_pub.insert_message

Listed below are the parameters available for the insert_message procedure.

Parameter Usage Type Description
X_inserting_
procedure_name
IN VARCHAR2 Name of procedure that is inserting the message.
X_message IN VARCHAR2 The free text to display as the message in the log file.
X_attribute1-15 IN VARCHAR2 Descriptive flexfield segments of billing message. These attributes appear in the billing messages table only.
X_error_message OUT VARCHAR2 Error message text.
X_status OUT NUMBER Status indicating whether an error occurred. Valid values are: =0 Successful validation <0 Oracle error (message will be written into a log file) >0 Application error


         Previous  Next          Contents  Index  Navigation  Glossary  Library