---
schema_version: "1"
id: b0f6fa563e1f3a7a92bf0685fe940832a91a581911811d872bfa919e8a81b021
title: Legal Entity Accounting Period Closure Procedure
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/billing_legal_entity_accounting_periods_close_result.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.billing_legal_entity_accounting_periods_close_result.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: efb57af3f13e9fd95cd0a4507ccc75fb261d1107f55f6dfac41315f155168d00
description: When you close legal entity accounting period, the system runs three Data Processing Engine (DPE) definitions in a sequence.
products:
  - Revenue Cloud
release: "264"
---
# Legal Entity Accounting Period Closure Procedure

When you close legal entity accounting period, the system runs three Data Processing Engine (DPE) definitions in a sequence.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col>
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <p>This feature is available for the Invoice and Credit Memo records, and their
              related records 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 <span>Revenue Management</span> Advanced license or the <span>Revenue Management</span> Billing
                license</a>. </p>
            <p>This feature is available for the Payment, Refund, and Debit Memo
              records, and their related records 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 <span>Revenue Management</span> Billing license</a>. Contact your Salesforce
              account executive for more information.</p>
            <p style="margin-bottom:0;">The Create Transaction Journals for
              Unrealized Foreign Exchange Gains or Losses and Create General Ledger Accounting
              Period Summary Records for Multiple Currencies data processing engines are available
              only 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 <span>Revenue Management</span> Billing license</a>.</p>
          </td>

        </tr>
      </tbody>
    </table>

## DPE Execution Sequence

These Data Processing Engine definitions are executed in this sequence based on the licenses and currency settings in your Salesforce org.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:20%">
          <col style="width:20%">
          <col style="width:20%">
          <col style="width:20%">
          <col style="width:20%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e93">Data Processing Engine</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e96"><span>Revenue Management</span> Advanced License</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e101"><span>Revenue Management</span> Billing License With Single Currency</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e106"><span>Revenue Management</span> Billing License with Multiple Currencies</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e111"><span>Revenue Management</span> Billing License with Advanced Currency Management</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Data Processing Engine" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e93 ">
              <p>Close Legal Entity Accounting Period (Basic) </p>
              <p>Or</p>
              <p style="margin-bottom:0;">Close Legal Entity
                Accounting Period (Advanced)</p>
            </td>

            <td data-label="Revenue Management Advanced License" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e96 ">Close Legal Entity Accounting Period (Basic) DPE runs and closes the legal
              entity accounting period.</td>

            <td data-label="Revenue Management Billing License With Single Currency" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e101 ">Close Legal Entity Accounting Period (Advanced) DPE runs and closes the legal
              entity accounting period.</td>

            <td data-label="Revenue Management Billing License with Multiple Currencies" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e106 ">Close Legal Entity Accounting Period (Advanced) DPE runs and closes the legal
              entity accounting period.</td>

            <td data-label="Revenue Management Billing License with Advanced Currency Management" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e111 ">Close Legal Entity Accounting Period (Advanced) DPE runs and closes the legal
              entity accounting period.</td>

          </tr>
          <tr class="">
            <td data-label="Data Processing Engine" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e93 ">Create Transaction Journals for Unrealized Foreign Exchange Gains or
              Losses</td>

            <td data-label="Revenue Management Advanced License" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e96 ">Not Available</td>

            <td data-label="Revenue Management Billing License With Single Currency" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e101 ">Not Available</td>

            <td data-label="Revenue Management Billing License with Multiple Currencies" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e106 ">Create Transaction Journals for Unrealized Foreign Exchange Gains or Losses DPE
              runs and creates transaction journals.</td>

            <td data-label="Revenue Management Billing License with Advanced Currency Management" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e111 ">
              <p style="margin-bottom:0;">Create Transaction Journals for Unrealized Foreign Exchange Gains or Losses DPE
                runs and creates transaction journals.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Data Processing Engine" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e93 ">
              <p>Create General Ledger Accounting Period Summary Records for Multiple Currencies
              </p>
              <p>Or</p>
              <p style="margin-bottom:0;"> Create General Ledger Accounting Period Summary Records</p>
            </td>

            <td data-label="Revenue Management Advanced License" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e96 ">Not Available</td>

            <td data-label="Revenue Management Billing License With Single Currency" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e101 ">Create General Ledger Accounting Period Summary Records DPE runs and creates
              summary records.</td>

            <td data-label="Revenue Management Billing License with Multiple Currencies" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e106 ">Create General Ledger Accounting Period Summary Records for Multiple Currencies
              DPE runs and creates summary records.</td>

            <td data-label="Revenue Management Billing License with Advanced Currency Management" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e111 ">
              <p style="margin-bottom:0;">Create General Ledger Accounting Period Summaries Using Dated Conversion Rates
                DPE runs and creates summary records.</p>
            </td>

          </tr>
        </tbody>
      </table>

## DPE: Close Legal Entity Accounting Period

The Close Legal Entity Accounting Period DPE starts a batch calculation job that sets the legal entity accounting period's status to Pending Closure and closure stage to Closing Legal Entity Accounting Period. It then evaluates all the billing transactions related to the legal entity accounting period with these field values.

 
| Billing Transaction Record | Field Value |
| --- | --- |
| Invoice | The status is Posted. |
| Invoice Line | The status of the parent invoice is Posted. |
| Invoice Line Tax | The tax processing status is Posted. |
| Credit Memo | The status is Posted. |
| Credit Memo Line | The status is Posted. |
| Credit Memo Line Tax | The calculation status is Complete. |
| Credit Memo Line Invoice Line | All the records related to the legal entity accounting period are evaluated. |
| Payment | The status is Processed. |
| Payment Line Invoice | All the records related to the legal entity accounting period are evaluated. |
| Payment Line Invoice Line | All the records related to the legal entity accounting period are evaluated. |
| Refund | The status is Processed. |
| Refund Line Payment | All the records related to the legal entity accounting period are evaluated. |
| Debit Memo Line | The status of the related debit memo is Posted. |

The DPE definition evaluates the related billing transactions with these statuses. If any of the billing transactions don't have a legal entity accounting period, the batch calculation job assigns a legal entity accounting period to those transactions.

## DPE: Create Transaction Journals for Unrealized Foreign Exchange Gains or Losses

The Create Transaction Journals for Unrealized Foreign Exchange Gains or Losses data processing engine starts a batch calculation job to calculate unrealized foreign exchange gains and losses and create dual transaction journals and dual reversal transaction journals.

- Field update: The DPE batch calculation job sets the Closure Stage field of the legal entity accounting period to Creating Unrealized Gain or Loss Transaction Journals.
- Records considered: All the unsettled and partially settled posted invoices that aren't in corporate currency related to the legal entity accounting period are considered.
- Unrealized foreign exchange gains and losses calculation: The difference between the dated conversion rate value on the invoice date and on the end date of the accounting period of the legal entity is calculated.
- Transaction journals:
    - The calculated unrealized gain or loss amount is captured as debit and credit entry of transaction journals for the unrealized gains, unrealized loss, and account receivable general ledger accounts selected on the Billing Settings page.
    - Two reversal transaction journals are also created on the start date of the next legal entity accounting period. Reversal transaction journals record the same debit and credit amounts as the unrealized transaction journals, but for the opposite general ledger accounts.

See [Use Case: Automatically Capture Unrealized Foreign Exchange Unrealized Gains or Losses](https://help.salesforce.com/s/articleView?id=ind.billing_fgn_exch_unrealized_gains_losses_use_case.htm&language=en_US).

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

Note If multiple currencies aren't enabled in your Salesforce org, then the Create Transaction Journals for Unrealized Foreign Exchange Gains or Losses DPE definition isn't executed.

## DPE: Create General Ledger Accounting Period Summary Records for Multiple Currencies

The Create General Ledger Accounting Period Summary for Multiple Currencies DPE definition starts a batch calculation job to calculate the total credit amount, total debit amount, opening balance amount, and closing balance amount for a general ledger account that has transaction journals related to the legal entity accounting period.

- Field update: The DPE batch calculation job sets the Closure Stage field of the legal entity accounting period to Creating General Ledger Accounting Period Summaries.
- DPE calculation: The DPE definition calculates the amount fields based on the dated conversion rate on the end date of the accounting period related to the legal entity accounting period.
- DPE execution logic: There are three DPE definitions. The currency settings configured in your Salesforce org determine which DPE definition runs.<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:33.33333333333333%">
              <col style="width:33.33333333333333%">
              <col style="width:33.33333333333333%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e411">Org Currency Settings</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e414">Executed DPE</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e417">Filtered Records</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Org Currency Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e411 ">
                  <p style="margin-bottom:0;">Both multiple currency and Advanced currency management are disabled</p>
                </td>

                <td data-label="Executed DPE" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e414 ">
                  <p style="margin-bottom:0;">Create General Ledger Accounting Period Summary Records DPE runs.</p>
                </td>

                <td data-label="Filtered Records" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e417 ">
                  <p style="margin-bottom:0;">The transaction journals are filtered for the legal entity accounting period
                    and opening balance and closing balance are calculated.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Org Currency Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e411 ">Multiple currency is enabled</td>

                <td data-label="Executed DPE" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e414 ">Create General Ledger Accounting Period Summary Records for Multiple
                  Currencies DPE definition runs.</td>

                <td data-label="Filtered Records" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e417 ">
                  <p style="margin-bottom:0;">All transaction journals for the legal entity accounting period are filtered.
                    The debit and credit amounts of transaction journals that are in a currency
                    other than the legal entity currency are converted into the currency of the
                    legal entity using conversion rates, and then the opening and closing balances
                    are calculated.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Org Currency Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e411 ">Advanced currency management is enabled</td>

                <td data-label="Executed DPE" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e414 ">
                  <p style="margin-bottom:0;">Create General Ledger Accounting Period Summaries Using Dated Conversion
                    Rates DPE runs.</p>
                </td>

                <td data-label="Filtered Records" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e417 ">
                  <p style="margin-bottom:0;">All transaction journals for the legal entity accounting period are filtered.
                    The debit and credit amounts of transaction journals that are in a currency
                    other than the legal entity currency are converted into the currency of the
                    legal entity using dated conversion rates, and then the opening and closing
                    balances are calculated.</p>
                </td>

              </tr>
            </tbody>
          </table>
- Result: After the successful execution of the DPE definition, two General Ledger Accounting Period Summary records are created for each general ledger account.
    - A summary record is created for the legal entity accounting period that's being closed.
    - A summary record is created for the next legal entity accounting period where the closing balance amount from the current period's record becomes the opening balance for the next period's record.Go to the related list of the legal entity accounting period to view all the related general ledger accounting period summaries.

## Considerations and Limitations

- You can [manually create a General Ledger Accounting Period Summary record](https://help.salesforce.com/s/articleView?id=ind.billing_general_ledger_accounting_period_summary_create.htm&language=en_US) only when the legal entity accounting period status is Open.
- Only one General Ledger Accounting Period Summary record can exist for a unique combination of a general ledger account and a legal entity accounting period.
- The DPE definition updates any existing General Ledger Accounting Period Summary record with the calculations.
- You can manually update the general ledger accounting period summaries only when the status of the related legal entity accounting period is set to Open, Pending Closure, or Reopened.
- If the Type field isn't selected on the general ledger accounts, the data processing engine fails and a revenue transaction error log is created.

## Result and Error Logs

The fields on the Legal Entity Accounting Period record are updated based on the execution of the DPE definitions.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
          <col style="width:25%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e542">DPE Outcome</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e545">Record Status</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e548">Record Updates</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d102651e551">Notes</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="DPE Outcome" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e542 ">Success</td>

            <td data-label="Record Status" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e545 ">The Closure Stage field is set to Completed and Status field is set to Closed. </td>

            <td data-label="Record Updates" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e548 ">
              <p>The Total Assets Amounts, Total Liabilities Amounts, Total Equities Amount,
                Total Revenue Amounts, and Total Expenses Amount fields on the legal entity
                accounting period are automatically updated.</p>
              <p style="margin-bottom:0;">In a Salesforce org with multiple
                currencies enabled, these fields show values in the legal entity accounting
                period's currency.</p>
            </td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e551 ">The calculation of total assets, liabilities, equity, revenue, and expenses for
              a legal entity accounting period doesn't consider the general ledger accounting
              period summaries created for the foreign exchange realized and unrealized gain and
              loss general ledger accounts that are selected on the Billing Settings page.</td>

          </tr>
          <tr class="">
            <td data-label="DPE Outcome" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e542 ">Error</td>

            <td data-label="Record Status" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e545 ">The Closure Stage field shows the specific DPE definition that encountered the
              error, and Status is set to Error.</td>

            <td data-label="Record Updates" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e548 ">A revenue transaction error log is created.</td>

            <td data-label="Notes" class="slds-cell-wrap" style="vertical-align:top;" headers="d102651e551 ">The revenue transaction error log is found on the related list of the legal
              entity accounting period.</td>

          </tr>
        </tbody>
      </table>

## Monitor Batch Calculation Job

Go to [Monitor Workflow Services](https://help.salesforce.com/s/articleView?id=ind.dpe_monitor.htm&language=en_US) in Setup to check the status of the batch calculation job.

#### See Also

- [Set Up Financial Accounting Features](https://help.salesforce.com/s/articleView?id=ind.billing_setup_financial_accounting_features.htm&release=264.0.0&type=5 "Make sure that every billing transaction is compliant with double-entry accounting principles by automatically generating dual transaction journals, each containing both a credit and a debit entry to maintain balanced records. Select a default Data Processing Engine definition that's run to close legal entity accounting periods when your Billing operations user initiates their closure. Set up Billing to show transaction amounts in both the transactional currency and your corporate currency.")
- [Example: Automatically Capture Unrealized Foreign Exchange Unrealized Gains or Losses](https://help.salesforce.com/s/articleView?id=ind.billing_fgn_exch_unrealized_gains_losses_use_case.htm&release=264.0.0&type=5 "Explore an example to understand how to a set up general ledger accounts on the Salesforce org's default general ledger accounts and create dual transaction journals and reversal transaction journals to capture unrealized gains or losses amount of the invoices during legal entity accounting period closure.")