Link between different documents

We created a few documents to enlarge our “winstberekeningen”. We would like to link the sum of one document to a different document. Do we need to “name” the sum we want to link? How do we need to do this?

For example, this is a document and we like to link the endresult to another document.


_**Resultaatrekening per {{ period.year_end_date | date:'%d/%m/%Y' }}**_

**I. Bedrijfsopbrengsten**

{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}

|---------------------|-------15%-------:+
| Omzet {% input custom.detail.omzet as:account_collection range:7 default:'7' accounts_var:omzet %} |_{%=$10+ -1*omzet.value | currency %}_
| Beginvoorraad {% input custom.detail.beginvoorraad as:account_collection range:6,7 accounts_var:beginvoorraad %}| {{ -1*beginvoorraad.value | currency}}
| Handelsgoederen {% input custom.detail.goederen as:account_collection range:6 default:'60' %}     |{{ -1*goederen.value | currency}}
| Eindvoorraad {% input custom.detail.eindvoorraad as:account_collection range:6,7 accounts_var:eindvoorraad %}|{{ -1*eindvoorraad.value | currency}}
| Onderaanneming {% input custom.detail.onderaanneming as:account_collection range:6,7 accounts_var:onderaanneming %}|_{{ -1*onderaanneming.value | currency}}_
| Verkochte voorraad|_{%=$10+ -1*(beginvoorraad.value+goederen.value+eindvoorraad.value+onderaanneming.value) | currency %}_
| Nettoresultaat      | **{{ $10-1 | currency }}**

Document where we need the endresult:


_**RESULTAATREKENING PER {{ period.year_end_date | date:'%d/%m/%Y' }}**_

**KOSTEN**

{% if custom.detail.goederen == blank %}{% assign goederen_range = '60'%}{% else %}{% assign goederen_range = custom.detail.goederen %}{% endif %}
{% assign goederen = period.accounts | range:goederen_range %}

|---------------------|-------15%-------:+
| Afschrijvingen {% input custom.detail.afschrijvingen as:account_collection range:6 default:'63' accounts_var:afschrijvingen %} | {{ afschrijvingen.value| currency}}
| Diverse diensten {% input custom.detail.diversediensten as:account_collection range:6 default:'61' accounts_var:diversediensten %}| {{ diversediensten.value| currency}}
| Personeelskosten {% input custom.detail.personeelskosten as:account_collection range:6 default:'62' accounts_var:personeelskosten %}|{{ personeelskosten.value| currency}}
| Andere bedrijfskosten {% input custom.detail.andere as:account_collection range:6 default:'64' accounts_var:andere %}|{{ andere.value | currency}}
| Financiële kosten {% input custom.detail.financieel as:account_collection range:6 default:'65' accounts_var:financieel %}|{{ financieel.value | currency}}
| Sociale bijdrage {% input custom.detail.socialebijdrage as:account_collection range:6 default:'' accounts_var:socialebijdrage %}|_{{ socialebijdrage.value | currency}}_
| **Totaal kosten**      | **{{ afschrijvingen.value+diversediensten.value+personeelskosten.value+andere.value+financieel.value+socialebijdrage.value | currency }}**
| Kosten weerhouden niet-bedrijfsmatig|{% assign account_range = custom.detail.nietbedrijfsmatig1 %}
| Kosten met fiscale aftrekbeperking {% input custom.detail.aftrekbeperking as:account_collection range:6 default:'64' accounts_var:aftrekbeperking %}|_{{ -1*aftrekbeperking.value | currency}}_
| **Totaal kosten**      | **{{ afschrijvingen.value+diversediensten.value+personeelskosten.value+andere.value+financieel.value+socialebijdrage.value-bedrijfsmatig.value-aftrekbeperking.value | currency }}**
| **Nettowinst van het boekjaar**      |_**{{ opbrengsten-afschrijvingen.value+diversediensten.value+personeelskosten.value+andere.value+financieel.value+socialebijdrage.value-bedrijfsmatig.value-aftrekbeperking.value | currency }}**_
| Bedrijfsopbrengsten {% input custom.detail.opbrengsten as:account_collection range:7 default:'7' accounts_var:opbrengsten %}|{{ -1*opbrengsten.value | currency}}

The documents you’re talking about, are these text documents, or reconciliations?

It’s currently not possible to expose results on text documents (it is possible to do it on reconciliations though, by using a handle)

They are text documents, like the reports in our companies.
In our reports “verslag algemene verhadering” there is data our the report “Bedrijfsparameters” zo it’s possible, I think?
We just need to know how we can use the result in one report, in another report.
Do we need to “name” the result?
Thanks in advance!

Little reminder :slight_smile:

Hi @Fiduciaire.Eulaers,

Just to be clear: you want to link something from text template A to text template B, right? Because that’s not possible for now…

But, the template where the results is defined… Perhaps it’s an option to have that as a reconciliation template instead of a text template? Such things can’t hurt to be in the working papers, I suppose, no?

If that is an option, let me know and I’ll guide you further.

Hi!
I’m having kind off the same question, but in another context.

I’d like to have the agenda from document A (based on different booleans the user selects) to be visible in document automatically B. If I understand this well, it’s not possible to have the results of the coding in doc A appear in doc B and I need to copy the entire code in document B as well instead of just a link between the docs?

Hi @lieels01,

I’m afraid that it is not possible to achieve this with documents, there is no handle to refer to and as such no way to link the documents to one another.

However, you would be able to achieve this by using reconciliation templates and result tags.

Is there a specific reason why you are opting to use documents over reconciliations?

Here is a link to the Result tag section on our website.

Hopefully I have understood your query correctly but if not please supply some further information and I will take another look for you :slight_smile:

Many thanks

Tom

Hi @t0gden

I think you understood well with exception that it’s not between documents, but indeed between the templates. We have some agenda points set up in reconciliation A that should be transferred to B and change as well depending on what the user filled in in A.

But is this is not possible, we of course can copy the entire code I guess :slight_smile:

Hi @lieels01,

To feed information from Template A to Template B you have 2 options:

a) Access data stored in the database

If the agenda points are set up as input fields, you can access them directly in Template B like this:

Let’s assume you have this on Template A:

{% input custom.agenda.points as:boolean %}

Then in Template B you can retrieve the data from that variable like this:

{{ period.reconciliations.template_b_handle.custom.agenda.points }}

You can also do this if you want to be able to edit the same variable in both templates:

{% assign agenda_points_boolean = period.reconciliations.template_b_handle.custom.agenda.points %}

{% input agenda_points_boolean as:boolean %}

b) Use results to access data that is not stored in the database

If the data you want to retrieve from Template A is a series of calculations that are not stored in the database, you can use the result tag to fetch the values like in the example below.

Let’s assume you have the following code in Template A:

{% assign tax_rate = 0.2 %}
{% input custom.current_year.revenue %}
{% assign total_tax = custom.current_year.revenue*0.2 %}
{% result 'total_tax' total_tax %}

Then in template B:

{{ period.reconciliations.template_b_handle.results.total_tax }}

To learn more about results, please take a look at the following community case.

I hope that helped,

Best,
Borja

Hi Borja,

Thank you for the explanation, I tested it out on something and it works well.
However, I’m afraid my case is a bit more difficult as it contains about 50 lines with different formulas and data. Is there perhaps a way to “bind” all these as one piece in template A and then refer to it in template B?

Hi @lieels01 ,

Can you clarify what part of this code you’ld like to show in template B? All code within the unless statement?

If so, can you share how you tried to accomplish this? You might want to start using shared parts, as indeed this is a lot of code that these two templates would share.

Kind regards,

Michiel

Hi Michiel,

Thank you for trying to help, but we are going to set up a call with someone from the developer team to verify this.

Kind regards,