consolidated_companies
This drop allow access to consolidation data in a multi-company file.
The consolidated_companies drop provides limited information from the consolidated companies.
Methods
Method | Return type | Description |
|---|---|---|
file_code | string | The file number from the consolidated company settings. |
name | string | The company name from the consolidated company settings. |
period | drop | Period information from the consolidated company: accounts and adjustments. Limited to year_end_date. |
join_date | date | Returns the date the company joined the consolidation, as specified in the "Consolidation" screen. |
exit_date | date | Returns the date the company exited the consolidation, as specified in the "Consolidation" screen. |
parent | boolean | Returns true if the company is selected as the Parent company in the Consolidation screen; otherwise returns false. |
currency | string | Returns the currency as specified in the consolidated company settings. |
Consolidated company period
| Method | Return type | Description |
|---|---|---|
| accounts | drop | The external company accounts information |
| adjustments | adjustments drop | The external company adjustments attached to this period. |
Consolidated company period accounts
| Method | Return type | Description |
|---|---|---|
| name | string | Returns the name of the first account in this drop. |
| return_values_in_millions | account drop | The values of the account drops in the created accounts drop will be shown in millions. |
| return_values_in_ones | account drop | The values of the account drops in the created accounts drop will be shown in ones. |
| return_values_in_thousands | account drop | The values of the account drops in the created accounts drop will be shown in thousands. |
| value | decimal | The sum of all values for all accounts in this accounts drop for this period. |
Consolidated company period account
| Method | Return type | Description |
|---|---|---|
| id | integer | The unique id for the account. |
| link | string with link | The number and name of the account with a link to the account itself. |
| name | string | The name of the account. |
| mapped_number | string | The mapped account number. |
| number | string | The number of the account defined in an account collection. Could be the original number or the mapped number, depending on the client's configuration. |
| original_name | string | The original name of the account (before mapping). |
| original_number | string | The original number of the account (before mapping). |
| value | decimal | Returns the value of the account in the current period. |
Consolidated company adjustments
| Method | Return type | Description |
|---|---|---|
| count | integer | Returns the amount of adjustment drops. |
| external | Adjustments drop | Returns an adjustments drop with only the external adjustments. |
| first | Adjustment drop | Returns the first adjustment drop of the adjustments drop. |
| internal | Adjustments drop | Returns an adjustments drop with only the internal adjustments. |
Consolidated company adjustment
| Method | Return type | Description |
|---|---|---|
| name | string | Name of the adjustment. |
| period | period | The period this adjustment is in. |
| transactions | array | Returns an array of items with value description and account attributes. |
| number | integer | The number of the adjustment (numbers of external and internal adjustments can overlap). |
| tags | array | Returns an array of items with name attribute. |
| purpose | string | Purpose of the adjustment |
| external? | boolean | True when external, false when internal. |
| internal? | boolean | True when internal, false when external. |
| from_reverse? | boolean | True when this adjustment was created by reversing another adjustment. |
| from_forward? | boolean | True when this adjustment was created by forwarding another adjustment. |
| from_copy? | boolean | True when this adjustment was created by copying another adjustment. |
| forward_account | accounts drop | The equity account that was used to do a roll forward. |
Consolidated company transactions
Method | Return type | Description |
|---|---|---|
value | decimal | Value of the transaction. |
date | date | Booking date of the transaction. |
relation | string | Name of the relation of the transaction. |
account | Access the methods for accounts drops (eg. account.name, account.value) and get the information of the account related to the transaction. | |
eg. journal_id, journal_type, description | Other fields: |
Example 1
The list of companies included in the consolidation can be found under “Edit Client” → “Consolidation” tab. In this screen, users can add or remove companies and must select the parent company as well as the join and exit dates for each.
To print the details of each company:
{% for c in company.consolidated_companies %}
<table>
<thead>
<tr>
<th class="usr-line-bottom"><b>Method</b></th>
<th class="usr-line-bottom"><b>Output</b></th>
</tr>
</thead>
<tbody>
<tr>
<td><b>name</b></td>
<td>{{ c.name }}</td>
</tr>
<tr>
<td><b>file_code</b></td>
<td>{{ c.file_code }}</td>
</tr>
<tr>
<td><b>join_date</b></td>
<td>{{ c.join_date }}</td>
</tr>
<tr>
<td><b>exit_date</b></td>
<td>{{ c.exit_date }}</td>
</tr>
<tr>
<td><b>parent</b></td>
<td>{{ c.parent }}</td>
</tr>
<tr>
<td><b>currency</b></td>
<td>{{ c.currency }}</td>
</tr>
</tbody>
</table>
<br/>
{% endfor %}
Output:
Example 2
Accessing period data and adjustments of the parent company:
{% comment %}Assigning account and adjustment drops for the parent company's data.{% endcomment %}
{% for c in company.consolidated_companies %}
{% if c.parent == true %}
{% assign parent_company_name = c.parent_company.name %}
{% assign parent_company_accounts = c.period.accounts %}
{% assign parent_company_adjustments = c.period.adjustments %}
{% break %}
{% endif %}
{% endfor %}
{% comment %}Display of the selected account for the parent company (shown in ones, with rounding differences applied).{% endcomment %}
{% assign parent_company_accounts = parent_company_accounts.return_values_in_ones | add_rounding_difference %}
{% assign accounts_range_4 = parent_company_accounts | range:'4' %}
Selected accounts of the parent company: {{ accounts_range_4 | currency, invert:true }}
{% comment %}Displaying adjustments for the parent company.{% endcomment %}
{% for adjustment in parent_company_adjustments %}
{% if forloop.first %}
<b><u>Parent company adjustments</u></b>
{% endif %}
Adjustment {{ adjustment.number }}
{% for transaction in adjustment.transactions %}
<b>Description:</b> {{ transaction.description }}
<b>Account mapped number:</b> {{ transaction.account.mapped_number }}
<b>Value:</b> {{ transaction.value | currency }}
{% endfor %}
{% endfor %}Output:
Updated about 7 hours ago
