Equation into a custom field & sum into another custom field

The latest version (18.7.64) allows to set custom field to number type. This allows to do these calculations using custom themes.

Let’s say you have two custom fields:

  • Field 1
  • Field 2

and you want to show on invoice Field 3 which is total of Field 1 and Field 2

All you have to do is inject following lines to your custom theme:

<div style="font-weight: bold; padding-top: 20px">Field 1 + Field 2</div>
<div>{{ custom_fields["Field 1"] | plus: custom_fields["Field 2"] }}</div>

The most important is {{ custom_fields["Field 1"] | plus: custom_fields["Field 2"] }} which shows how to do addition of two custom fields.

And the result:

1 Like