Intermediate [Exercise 3: Registers] (Training slides exercise)

Create Fixed Asset register with a table and a fori loop to show additions and disposals and add totals at the bottom using registers ($). The table should look like the one below:

Solution:

{% stripnewlines %}
| Description
| Additions
| Disposals
| Total
{% newline %}
|--------
|--------
|--------
|--------#
{% newline %}
{% fori item in custom.fixed_assets %}
  |{% input item.description placeholder:'Description' %}
  |{%=$1+input item.additions as:currency placeholder:0 %}
  |{%=$2+input item.disposals as:currency placeholder:0 %}
  |**{{ item.additions+item.disposals | currency }}**
  {% newline %}
{% endfori %}
|**Total**
|**{{ $1 | currency }}**
|**{{ $2 | currency }}**
|**{{ $1+$2 | currency }}**

{% endstripnewlines %}