selected_accounts_and_reconciliation_texts

Root: export

This drop can only be used in the Detail text section within "Style settings".

Methods

MethodReturn typeDescription
accountsaccounts dropReturns an accounts drop with all the accounts selected on the export.
assetsarrayReturns only reconciliations and accounts of type "assets".
equityarrayReturns only reconciliations and accounts of type "equity".
empty?booleanReturns true if no accounts or reconciliations are selected.
expensesarrayReturns only reconciliations and accounts of type "expense".
incomesarrayReturns only reconciliations and accounts of type "income".
include_zerosarraySame as the 'include_zeros' method in accounts
is_accountbooleanReturns true if the selected item is an account.
liabilitiesarrayReturns only reconciliations and accounts of type "liabilities".
namestringReturns the account/reconciliation name.
p_and_larrayReturns only reconciliations and accounts of type "profit and loss".
reconciliation_textsarrayReturns a reconciliation drop with all the reconciliations selected on the export.
rendered_templatetemplatePrints the selected account/reconciliation template on the PDF export.
unreconciled_value
(accounts only)
decimalReturns the amount pending to be reconciled in the account template.
value
(accounts only)
decimalReturns the value of the selected account.

Example

The below code was entered in the Detail Text section within a Style. Silverfin will print the information from all the selected accounts that are "liabilities". You will note the code is structured into 3 parts: A top and bottom table which are coded directly into the Detail Text and in the middle the original template code is called, which exists outside of the Detail Text code.

{% for account_or_text in export.selected_accounts_and_reconciliation_texts.liabilities %}
  {::group}
  {% if account_or_text.is_account %}
    {% capture top_table %}
    <table>
      <tbody>
        <tr>
          <td class="usr-width-85 usr-line-bottom"><b>{{ account_or_text.number }} {{ account_or_text.name }}</b></td>
          <td class="usr-width-15 usr-line-bottom"><b>{{ account_or_text.value | currency }}</b></td>
        </tr>
      </tbody>
    </table>
    {% endcapture %}
    {% capture bottom_table %}
    <table>
      <tbody>
        <tr>
          <td class="usr-width-85"><b>Difference</b></td>
          <td class="usr-width-15"><font color="{{ export.highlight_alt_text_color }}"><b>{{ account_or_text.unreconciled_value | currency }}</b></font></td>
        </tr>
      </tbody>
    </table><br><br>
    {% endcapture %}
    {{ top_table }}{{ account_or_text.rendered_template }}{{ bottom_table }}
  {% endif %}
  {:/group}
{% endfor %}

In the code, you will note the following methods have been used on the drop “selected_accounts_and_reconciliation_texts”:

  • .liabilities to only display templates of type liability
  • .is_account in control flow to only display templates which are accounts
  • .value in top table and .unreconciled_value in bottom table

Finally, in terms of the separation between template and Detail Text code, we can see this clearly demonstrated by the use of font colour for the unreconciled value of 393.00. This is coded using the variable {{ export.highlight_alt_text_color }} which is unique to the Style, and renders the text in a color which is selected within the Style configuration itself.