> For the complete documentation index, see [llms.txt](https://docs.phocassoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phocassoftware.com/financial-statements/managing-statements/map-the-retained-earnings-account-s.md).

# Map the Retained Earnings account(s)

{% hint style="info" icon="key" %}
Permission: **Financial Statements** > **Manage custom statements**
{% endhint %}

During each database build, Phocas takes all Profit & Loss (P\&L) transactions and maps them to a Balance Sheet account. By default, this account is the system Retained Earnings account, which might have been set during your implementation. You can update this mapping or choose to distribute the P\&L transactions across multiple accounts.

<details>

<summary>How Retained Earnings works in Phocas</summary>

Retained Earnings appears in the Balance Sheet stream. It is the net sum of all Profit and Loss (P\&L) transactions from the database start date to the end of the period displayed.\
Your Financial Statements setup determines which account displays the value:

* **Unmapped:** The value is shown in the Retained Earnings system account. No transactions can be posted to this account, so it contains only the net P\&L value.
* **Mapped (to one or more accounts):** The calculated value is added to any balance already posted to the mapped account, such as an opening balance or dividends paid. If you map by dimension (for example, Company), the net P\&L for each dimension entity is added to the account mapped to that entity.

In Financial Statements, if a financial year end is set, the current financial year’s P\&L is shown in the Current Year Earnings row rather than in Retained Earnings. If you are viewing the values in Analytics then the total value shows in Retained Earnings.

</details>

To change the mapped account(s):

1. Click the **Settings** button > **Retained Earnings** in the top-right corner.
2. Choose whether to map to one account or multiple accounts:
   * **One account**:\
     Select an account from the list or enter an account code. If left blank, the system will use the default Retained Earnings account.<br>

     <div align="left"><figure><img src="https://content.gitbook.com/content/KhoFIsurMPEjkuBz9YkN/blobs/RF4Mb1yeGrgrF5OIcAMR/image.png" alt="" width="312"><figcaption></figcaption></figure></div>
   * **Multiple accounts**:\
     Select the dimension, such as Company, to which to allocate the P\&L transactions. Then map each dimension entity to an account by selecting from the list or entering an account code. If left blank, the system will use the default Retained Earnings account for that dimension entity.<br>

     <div align="left"><figure><img src="https://content.gitbook.com/content/KhoFIsurMPEjkuBz9YkN/blobs/hMxLodiFuQOp7dB7HNTC/image.png" alt="" width="333"><figcaption></figcaption></figure></div>
3. Select one of these options:
   * Click **Save and close** to save your changes without triggering a database build. Your changes will take effect on the next database build.
   * Click **Build Now** to rebuild the database immediately and apply your changes. After a successful build, you’ll receive a message asking you to refresh the page, and then you’ll see the new dimensions.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.phocassoftware.com/financial-statements/managing-statements/map-the-retained-earnings-account-s.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
