8 Using Currency

This chapter contains the following topics:

Enterprises that do business internationally require additional accounting considerations and added complexity. This complexity arises from doing business in different currencies and the obligation to follow different reporting and accounting requirements. Some fundamental requirements for an international enterprise include:

8.1 Currency Implementation

This section provides overviews of:

  • Currency implementation.

  • Advantages of developers controlling currency.

  • Working with currency.

8.1.1 Understanding Currency Implementation

JD Edwards EnterpriseOne currency implementation includes these features:

  • Currency retrieval

    Accomplished through database triggers and table event rules.

  • Currency retrieval logic

    Handled using business functions.

  • System Application Programming Interface modules (APIs)

    Assist you in accessing cached tables.

8.1.2 Advantages of Developers Controlling Currency

JD Edwards EnterpriseOne enables developers to control currency retrieval. Enabling developers, instead of the system, to control currency, provides greater flexibility and easier maintenance. Some of the advantages of enabling developers to control currency are:

  • The addition of currency tables does not require changes to system modules. Only new business functions need to be added.

  • Business logic is captured in business functions, rather than in system modules that assume knowledge of business logic.

  • Table event rules enable you to attach currency retrieval logic at the table object level.

  • Table event rules are triggered by table events instead of application events.

  • Any application that uses the table that has currency business functions attached to it receives the same logic, so you do not need to modify each application.

  • No hard-coded logic is embedded in the runtime engine.

8.1.3 Working with Currency

When identified amounts are written to or retrieved from a database, or when they are used in calculations during processing, proper decimal placement is extremely important. Currency implementation is needed to adjust decimal placement on Math_Numeric currency fields according to a specified currency. Common applications of currency implementation include conversion of currency amounts and revaluation of currency due to fluctuations in exchange rates.

Implementing currency involves:

  • Performing currency setup.

  • Creating a business function that contains logic to retrieve currency information. Currency business functions are known as currency triggers.

  • Attaching a currency trigger to the Currency Conversion event in Table Event Rules (TER).

  • Designing TER functions through Event Rules Design. The system then converts the event rules to C and compiles them into a consolidated DLL through the Object Management Workbench (OMW) application.

  • Modifying applications as necessary.

The JD Edwards EnterpriseOne database middleware then calls the appropriate TER function when the Currency Conversion event is triggered.

8.1.3.1 Understanding the Build Triggers Option

The Build Triggers option performs these steps:

  • Converts event rules to C source code.

    This creates the files OBNM.c and OBNM.hxx (where OBNM is the Object Name). The source file will contain one function per TER event.

    For example, if you are working with the F0411 table, the Build Triggers option creates a C source member called F0411.c. You can browse through the C code and ensure that all of the parameters are set up correctly. The system generates an error log if an error occurs during the ER-to-C conversion. The error log is called eF0411.log.

  • Compiles the new functions and adds them to JDBTRIG.DLL. This is the consolidated DLL that contains TER functions.

8.1.3.2 Understanding How Table Event Rules Work with Currency Processing

The Currency Conversion event runs if currency processing is enabled.

Table triggers for currency run after the record is fetched and before the record is added to the database.

This process flow illustrates the currency conversion process:

Figure 8-1 Currency conversion process

Description of Figure 8-1 follows
Description of "Figure 8-1 Currency conversion process"

On FETCH: On ADD/UPDATE:
1. Application requests data. 1. Application sends data.
2. Is currency on? 2. Is currency on?
3. If yes, run currency trigger. 3. If yes, run currency trigger.
4. Currency Trigger calls TER, The TER:
  • Executes the business function.

  • Performs the business logic.

  • Scrubs data accordingly.

4. Currency Trigger calls TER. The TER:
  • Executes the business function.

  • Performs the business logic.

  • Scrubs data accordingly.

5. Return data to database, and then to application 5. Update database.

When passing Math_Numeric currency fields into a business function, the currency values in the respective data structure must be populated. Math_Numeric work fields that contain currency values also need the proper currency information.

You can copy currency information to controls (work fields or others) in event rules by using the system function Copy Currency Info. You can call the currency triggers from within an application's event rules or from another business function.

8.2 Implementing Currency Conversion

This section discusses how to:

  • Set up currency conversion.

  • Show currency-sensitive controls.

  • Create a currency conversion trigger.

8.2.1 Understanding Currency in Applications and Tables

If your business uses more than one currency, you must designate the method of currency conversion to use.

When you design an application, you can decide whether to hide or show currency-sensitive controls at runtime.

If the table that you are using for the application contains currency fields, you must specify how many decimal places exist in each column. When the source or destination fields are currency fields and you have not created a currency trigger, problems might arise if the value is used in a calculation. If you do not create a currency conversion trigger, the system cannot determine where to locate the decimal within a field.

8.2.2 Prerequisites

Create a project in Object Management Workbench. Create an interactive application or locate an interactive application that you want to modify for currency conversion and add it to the project.

8.2.3 Forms Used to Work With Currency Conversion

Form Name FormID Navigation Usage
System Setup W0000A JD Edwards EnterpriseOne Menus, Multi-Currency Setup (G1141), Set Multi Currency Option Set up currency conversion.
General Accounting Constants W0000B System Setup, click General Accounting Constants Set up currency conversion.
Form Design Aid NA Object Management Workbench, select an interactive application and click the Design button. Show currency sensitive controls
Object Management Workbench W98220A Type OMW in the Fast Path field of Solution Explorer Create a currency conversion trigger.

8.2.4 Setting Up Currency Conversion

Access the General Accounting Constants form.

Multi-Currency Conversion (Y, N, Z)

Select a code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use:

Codes are:

N Do not use multi-currency accounting. Use this option if you enter transactions in only one currency for all companies. The multi-currency fields do not appear on forms. The system supplies a value of N if you do not enter a value.

Y Activate multi-currency accounting and use multipliers to convert currency. The system multiplies the foreign amount by the exchange rate to calculate the domestic amount.

Z Activate multi-currency accounting and use divisors to convert currency. The system divides the foreign amount by the exchange rate to calculate the domestic amount.

8.2.5 Showing Currency-Sensitive Controls

Check out and open an interactive application in Form Design Aid.

  1. Double-click the control that you want to appear on the form.

  2. Select the Control Options tab.

  3. If you want to display currency fields, verify that the No Display if Currency is Off option is deselected.

    When the No Display if Currency is Off option is selected, currency-sensitive controls do not appear. If the No Display if Currency is Off option is deselected, currency fields are visible.

You must exit the current JD Edwards EnterpriseOne session and begin a new one to apply currency conversion changes.

8.2.6 Creating a Currency Conversion Trigger

Access Object Management Workbench

  1. Move the table to which you want to attach the currency trigger into the project.

  2. Check out the table.

  3. Ensure that the table is highlighted, and then click the Design button in the center column.

  4. On Table Design, select the Design Tools tab, and then click Start Table Trigger Design Aid.

  5. On Event Rules Design, select the Currency Conversion event and attach the currency trigger business function that you want to use.

  6. Click the Business Functions button.

  7. On Business Function Search form, use the query by example (QBE) line to search for business functions.

    You can use Category CUR or System Code 11 to find existing currency business functions. To read notes that describe the purpose of the business function, its parameters, and program requirements, click the Attachments button.

  8. Select the business function with which you want to work, and then click Select.

  9. On Business Functions, attach the table columns to the business function data structure, and then click OK.

    The available objects that appear are for table column only.

  10. On Event Rules Design, click Save, and then click OK.

  11. On Table Design, select the Table Operations tab, and then click Generate Table.

  12. Select the data source for the table, and then click OK.

  13. On Table Design, select the Design Tools tab, and then click Build Table Triggers.

    The system creates the table event rule (TER). The newly created or modified table event rule functions are now called from the JD Edwards EnterpriseOne system whenever the corresponding event occurs against the table.