---
schema_version: "1"
id: 60359ea7696a54c719ec76ecc86bfde927a2626a73c3db762be1bec231c51cb3
title: "Example: Automatically Capture Foreign Exchange Realized Gains or Losses"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/billing_fgn_exch_realized_gains_losses_use_case.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.billing_fgn_exch_realized_gains_losses_use_case.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7d276ab956874a342acfaf84a80e720debda9b0ea01b2f5484bc1a5a368a0489
description: Explore an example to understand how general ledger accounts are set up and how dual transaction journals are created when Payments or Credit Memo records are created and applied to the invoices.
products:
  - Revenue Cloud
release: "264"
---
# Example: Automatically Capture Foreign Exchange Realized Gains or Losses

Explore an example to understand how general ledger accounts are set up and how dual transaction journals are created when Payments or Credit Memo records are created and applied to the invoices.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions with <a href="https://help.salesforce.com/s/articleView?id=ind.revenue_licenses_areas_and_features.htm&amp;release=264.0.0&amp;type=5">the Revenue Cloud Billing license</a>. Contact your Salesforce account executive for more information.</td></tr></tbody></table>

## Smartbytes Scenario: Initial Setup and Configuration

Smartbytes is a US-based large enterprise company with multiple legal entities. Their Billing admin enables advanced currency management, edits dated conversion rates, turns on the Create Transaction Journals for Transactions, and Create Transaction Journals for Foreign Exchange Gains or Losses features in their Salesforce org. Then, their Accounting admin creates the general ledger accounts for realized gains, realized losses, and account receivables, and sets them as their Salesforce’s org defaults.

- Realized Gain General Ledger Account: 01-900-9000 Realized Gain
- Realized Losses General Ledger Account: 01-901-9000 Realized Loss
- Account Receivable General Ledger Account: 01-100-1001 Accounts Receivable

![Foreign exchange gain loss org default values](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/revenue/images/billing/billing_fgn_exch_org_default_value.png)

## Foreign Exchange Realized Gain or Loss Calculation

Let's look at a specific transaction to see how foreign exchange realized gains or losses are calculated.

Invoice creation: On invoice date August 27, 2025, Smartbytes creates an invoice for their Indian customer with an invoice's balance of 10,000 INR.

![Invoice record](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/revenue/images/billing/billing_fgn_exch_invoice.png)

The system automatically converts the balance to the corporate currency (USD) using the conversion rate on the invoice date.

- Dated conversion rate on the invoice date: 1 USD = 87.66 INR
- Corporate currency equivalent of the balance amount on August 27, 2025: 10,000/87.66 = 114.07 USD

Payment and settlement: On September 3, 2025, a full payment is made for 10,000 INR. When the payment is applied to an invoice, a Payment Line Invoice record is created and the invoice is settled.

![Payment record](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/revenue/images/billing/billing_fgn_exch_payment_record.png)

- Dated conversion rate on the payment's effective date: 1 USD = 88.07 INR
- Corporate Currency equivalent of the paid amount on the payment's effective date = 113.54 USD

![Dated exchange rates](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/revenue/images/billing/billing_fgn_exch_dated_exchange_rate.png)

Foreign exchange realized gain or loss calculation: The foreign exchange realized gains or losses are calculated by taking the payment's corporate currency value and subtracting the invoice's corporate currency value. The loss recorded for this transaction is 0.53 USD.

## Automatic Transaction Journal Creation

As soon as the payment is processed, the corresponding invoice settlement status is updated to Settled. Dual transaction journals are automatically created to record the foreign exchange realized loss of 0.53 USD.

- A transaction journal is created for the 01-100-1001 Accounts Receivable account with the realized loss amount as the credit amount.
- A transaction journal is created for the 01-901-9000 Realized Loss account with the realized loss amount as the debit amount.

![Realized transaction journals](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/revenue/images/billing/billing_fgn_exch_realized_transaction_journals.png)

If the calculations result in foreign exchange realized gain, then these two transaction journals are created.

- A transaction journal is created for the 01-100-1001 Accounts Receivable account with the realized gain amount as the debit amount.
- A transaction journal is created for the 01-900-9000 Realized Gain account with the realized gain amount as the credit amount.