Everyone,
This case was presented on our FastForward-event 2018 in Belgium, and as promised, we would provide the whole code to build something like this:
This is the code to generate this completely:
{% comment %}
Below code gives a header with an automatically check for an user to check-off, that will impact the reconciliation as well
{% endcomment %}
{% stripnewlines %}
|
|
|
|
{% newline %}
|----15%----:
|----35%----
|----15%----:
|----35%----+#
{% newline %}
| {% t "Name client" %}
| {{ company.name | upcase }}
| {% t "Period working papers" %}
| {{ period.end_date | date:"%d-%m-%Y" }}
{% newline %}
| {% t "Prepared by:" %}
{% input custom.prepared.check as:boolean %}
{% if custom.prepared.check == "true" %}
{% assign check_prep = 0 %}
{% else %}
{% assign check_prep = 1 %}
{% endif %}
| {% unexplained check_prep as:indicator %}
{{ custom.prepared.check.updated_by.name }}
| {% t "Prepared on:" %}
| {{ custom.prepared.check.updated_at | date:"%d/%m/%Y" }}
{% newline %}
| {% t "Review by:" %}
{% input custom.review.check as:boolean %}
{% if custom.review.check == "true" %}
{% assign check_review = 0 %}
{% else %}
{% assign check_review = 1 %}
{% endif %}
| {% unexplained check_review as:indicator %}
{{ custom.review.check.updated_by.name }}
| {% t "Review on:" %}
| {{ custom.review.check.updated_at | date:"%d/%m/%Y" }}
{% endstripnewlines %}
{% comment %}
below code is random text in an infotag;
it can also give an overview of related templates that need to be linked to (linkto-tag)
- to use a linkto-tag, you will need the handle-name of a recon-template (click on a template to discover that name)
- replace the last part of "period.reconciliations.vaste_activa" in the handle-name you need f.i.: "period.reconciliations.belastingberekening"
- each recon-template should have an unique handle which can be used!
- a check is added as well in case the template does not exist in the working papers, to give a proper warning
- want a second linkto? just copy the code between {% if ... %} and {% endif %}, and add it below just before the {:/infotext}
{% endcomment %}
{% ic %}
{::infotext}
Deze checklist dient vervolledigd te worden vooraleer XML ingediend wordt
Volgende templates dienen gecontroleerd en afgewerkt te worden:
{% if period.reconciliations.btw_saldo != blank %}{% linkto period.reconciliations.btw_saldo %}{% t "BTW saldo" %}{% endlinkto %}{% else %}**{% t "The template BTW saldo is not present in the working papers - please add them to the working papers" %}**{% endif %}
{% if period.reconciliations.omzetvergelijking != blank %}{% linkto period.reconciliations.omzetvergelijking %}{% t "omzetvergelijking" %}{% endlinkto %}{% else %}**{% t "The template omzetvergelijking is not present in the working papers - please add them to the working papers" %}**{% endif %}
{:/infotext}
{% endic %}
{% comment %}
use below code to create an array of questions / checks
- the first part is to create the actual questions, separated by a ";"
- the second part is used to loop over each question / check (separated by a ";")
Want to add questions?? => Be sure to add the question in the first part, and add in the second part an unique word (key) for that question.
Respect order in both arrays!!
Split on ";"
{% endcomment %}
{% assign array_checks = "Has every invoice been delivered by the customer?;Are the sales invoices been booked and finalized?;Are the purchase voices been booked and finalized?;Is BTW terugbroderbaar via bankuitreksels?;Are there any invoices that are related to a previous VAT-period?" | split:";" %}
{% assign array_keys = "delivered;sales_finalized;purchases_finalized;financial;previous_vat" | split:";" %}
<!---------- actual template ---------->
{% stripnewlines %}
|
|
| {% t "VAT-check" %}
| {% t "Extra comments" %}
{% newline %}
|----5%----
|----5%----
|----35%---
|----------+
{% for check in array_keys %}
{% newline %}
| {% input custom.[check].check_mark as:boolean %}
{% comment %}Below will make the templates reconciliation needed{% endcomment %}
{% if custom.[check].check_mark == true %}
{% assign check_ind = 0 %}
{% else %}
{% assign check_ind = 1 %}
{% endif %}
| {% unexplained check_ind as:indicator %}
| {{ array_checks[forloop.index0] }}
| {% input custom.[check].extra_info as:text size:mini placeholder:"Extra info" %}
{% endfor %}
{% endstripnewlines %}
{% comment %}
below code gives the option to either input some extra info or add a file, or both
when nothing is added, this section will not be exported
- change the name of custom.some.thing into something proper like "custom.VAT.additional_info" and "custom.VAT.additional_file" for instance
{% endcomment %}
<br>
{% ifi custom.some.thing.document or custom.some.thing_2 != blank %}
{% stripnewlines %}
|----
|----
{% newline %}
| **{% t "Additional information" %}**
| {% input custom.some.thing as:file_collection %}
{% endstripnewlines %}
{% input custom.some.thing_2 as:text placeholder:'extra info' %}
{% endifi %}
This is taken directly from following cases: