Previous  Next          Contents  Index  Navigation  Glossary  Library

Writing Labor Transaction Extensions

Oracle Projects provides a template package and procedure that you use as the basis of your labor transaction extension procedures. The name of the package is PA_Client_Extn_Txn, the name of the procedure is Add_Transactions.

Print out and review the following files before you begin writing labor transaction extensions. The files are located in the Oracle Projects admin/sql directory.

PAXCCETB.pls. Labor Transaction Extension Package Body Template. This file contains the procedure that you modify to implement labor transaction extensions. You can define as many procedures as you like within this package or within the predefined procedure.
PAXCCETS.pls Labor Transaction Extension Package Specification Template. If you create procedures within the package outside the predefined procedure, you must also modify this file.
Oracle Projects also provides two public procedures that you use within the Add_Transactions procedure for the following purposes:

Suggestion: After you write the procedure, do not forget to compile it and store it in the database. See: Storing Your Procedures.

Adding Transactions

Use the Add_Transactions procedure to add related transactions for source transactions. Within this procedure, you write logic to create related new transactions and update the raw cost of related transactions when they are marked for cost recalculation. You calculate the raw cost of related transactions in this procedure only; Oracle Projects does not calculate the raw cost of related transactions in any other way. Use the two procedures discussed later in this section for processing related transactions within this procedure.

Package.Procedure

PA_Client_Extn_Txn.Add_Transactions

Table 1 - 107 lists the parameters that Oracle Projects provides for the add related transactions procedure.

Parameter Usage Type Description
x_expenditure_item_id IN NUMBER The identifier of the source transaction.
x_sys_linkage_function IN VARCHAR2 The expenditure type class of the source transaction.
x_status IN OUT NUMBER The status of the procedure.

Creating Related Transactions

Use this procedure to create related transactions within the logic of the Add Transactions procedure. This procedure exists in the pa_transactions package; you cannot change this procedure.

The related transaction is linked to the same employee's timecard as the source transaction. The transaction is created with a quantity of 0, in order to maintain the proper number of hours for the employee's timecard, even when related transactions exist.

Package.Procedure

pa_transactions.CreateRelatedItem

Table 1 - 108 listed the parameters that Oracle Projects provides for the create related transactions procedure.

Parameter Usage Type Description
x_source_exp_item_id IN NUMBER The identifier of the source transaction.
x_project_id IN NUMBER The identifier of the project to charge the related transaction to.
x_task_id IN NUMBER The identifier of the task.
x_expenditure_type IN VARCHAR2 The expenditure type of the related transaction.
x_raw_cost IN NUMBER The raw cost amount of the related transaction.
x_raw_cost_rate IN NUMBER The raw cost rate of the related transaction.
x_override_to_org_id IN NUMBER The identifier of the organization that overrides the expenditure organization used by the source transaction.
x_userid IN NUMBER The identifier of the user that entered the source transaction.
x_attribute_category IN VARCHAR2 Descriptive flexfield context.
x_attribute1 - 10 IN VARCHAR2 Descriptive flexfield segments.
x_comment IN VARCHAR2 Expenditure item comment.
x_status OUT NUMBER Status of the procedure.
x_outcome OUT VARCHAR2 Outcome of the procedure.

Updating Related Transactions

Use this procedure to update the raw cost amount of existing related transactions within the logic of your labor transaction extension when related transactions are marked for cost recalculation. This procedure exists in the pa_transactions package; you cannot change this procedure.

Package.Procedure

pa_transactions.UpdateRelatedItem

Table 1 - 109 lists the parameters that Oracle Projects provides for the update related transactions procedure.

Parameter Usage Type Description
x_expenditure_item_id IN NUMBER The identifier of the related expenditure item.
x_raw_cost IN NUMBER The new raw cost of the related transaction.
x_raw_cost_rate IN NUMBER The new raw cost rate of the related transaction.
x_status OUT NUMBER Status of the procedure.

Additional Information About Parameters

Using Project and Task in the CreateRelatedItem Procedure

You can optionally pass the project and task parameter values to the CreateRelatedItem procedure.

If you do not pass project and task information, Oracle Projects charges the related transaction to the same project and task that the source transaction is charged to.

If you do pass project and task information, Oracle Projects uses these values to ensure that the transaction can be charged based on the transaction control validation for that project and task. If the related transaction passes all transaction control rules, then the related transaction is created with that project and task. You must pass both a project and task value to override the source transaction's project and task.

Using Userid in the CreateRelatedItem procedure

You must provide an input value for the X_userid parameter for the CreateRelatedItem procedure. Oracle Projects passes this value to the transaction control procedure, which is called before the related transaction is created. You may have defined logic in your transaction control extensions that uses the userid value. You typically pass the user of the person who created the source transaction, but you can pass any userid that you want to the CreateRelatedItem procedure.

Using an Override Organization in CreateRelatedItem Procedure

Use the x_override_to_org_id to override the source transaction's expenditure organization to another organization, such as the project organization for the related transaction.

If a value is provided for this parameter when calling the create related transactions procedure, and it is a valid organization, then that value is stored as the expenditure item's override organization regardless of the existence of any other cost distribution overrides defined for the project.

This organization is then used when calculating burdened amounts for the related transaction. It is also used as the input value for any AutoAccounting rules that use the expenditure organization parameter.

However, the source transaction expenditure organization is what the create related transaction procedure passes to the transaction controls procedure for validation. This is done to retain consistency with expenditure entry forms which always send the incurred by (or expenditure organization) organization value. The expenditure organization parameter is used in Transaction Control Extensions by clients who want to control expenditure entry by what organization is charging to the project.

Therefore, the override organization value is used only for burdening and AutoAccounting.

Using Outcome in the CreateRelatedItem Procedure

Oracle Projects uses the X_outcome parameter to pass back the rejection reason encountered in the application logic of the CreateRelatedItem procedure. For example, if the related transaction is rejected by the transaction controls validation called in the CreateRelatedItem procedure, then the reason is assigned to the X_outcome parameter.

Using Status in both Procedures

Use the x_status parameter to handle error conditions for your procedure. This parameter indicates the processing status of your extension as follows:

x_status = 0 The extension executed successfully.
x_status < 0 An Oracle8 error occurred and the process did not complete. Oracle Projects writes an error message to the process log file.
x_status > 0 An application error occurred. Oracle Projects writes a rejection reason to PA_EXPENDITURE_ITEMS.COST_ DIST_REJECTION_CODE and does not cost the source and related transactions. You can review the rejection reason in the labor cost distribution exception report.
The two related transaction procedures pass your labor transaction procedure the outcome of their processing in this same way as you pass the outcome of your labor transaction extension procedure to the labor distribution process.


         Previous  Next          Contents  Index  Navigation  Glossary  Library