Different custom invoice fields

Is there a way to design an invoice in such a way that the first custom field displays the title and the second custom field does not?

Currently, the custom field code for official themes is:

 {% for field in custom_fields %}
 <tr>
     <td colspan="99">
         <div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
         <div>{{ field.text | newline_to_br }}</div>
     </td>
</tr>
{% endfor %}

But, it applies this same pattern to all custom fields which have been defined for customers.
Is it possible to use custom field position identifiers to apply different designs to each one? e.g.

 {% for field in custom_fields at position 1 %}
 <tr>
     <td colspan="99">
         <div style="font-weight: bold; padding-top: 20px">{{ field.label }} {{ field.text}}</div>
     </td>
</tr>
{% endfor %}

{% for field in custom_fields at position 2 %}
 <tr>
     <td colspan="99">
         <div style="font-weight: bold; padding-top: 20px">{{ field.text}}</div>
     </td>
</tr>
{% endfor %}

If not, is there another way to implement this?

custom fields are identified by their headers and not by their positions. you need to use if statement to get your desired result.

Thank you. I thought as much when I read about how the themes are implemented.
For future reference, anybody who also needs this functionality, you need to learn Liquid language.

out of curiosity, why would you need custom fields without a heading? such data can be typed in the Notes field.

In Estonia, it is customary for businesses to include on their invoices their registration number

Reg. nr. XXXXXXX 

and also their bank accounts

Swedbank  XXXXXXXXXX
SEB bank  XXXXXXXXXX
Nordea bank  XXXXXXXXXX

In the case of the registration number, we can use the custom field title for “Reg. nr.”, but nobody uses

Bank accounts
Swedbank  XXXXXXXXXX
SEB bank  XXXXXXXXXX
Nordea bank  XXXXXXXXXX

because the title “Bank accounts” is redundant.

you can set your registration number as a default in Manager. Go to Business Details under settings. Your registration number is the Business Identifier.

this details can be entered in the Notes field and set as default too.

I guess I could use Business Identifier field to store the registration number, but businesses who
are obligated to pay VAT tax must also include their VAT registration number on their invoices

"KMKR. XXXXXXXXXX" 

So it becomes

Business name
Address
Reg. nr.
KMKR.
Firstbank
Secondbank
Thirdbank

But no worries, I’ll acquaint myself with the Liquid language and sort it out later.
I assume it won’t be that difficult to implement.

Just insert all those comma separated.

For example

Reg. nr. XXXXXXX, KMKR. XXXXXXXXXX

All (or almost all) fields in Manager accept HTML code. So all the different information can, in fact, be inserted into the Business Identifier field in Business Details under Settings. That will display without any heading.

You can, as @sharpdrivetek suggested, use if conditionals to leave out headings, too. Personally, I’ve found it easier to use unless. Here, for example, if a snippet from a slight modification of the default, Plain, theme that eliminates the Notes field heading but lets any others you may have show:

            <td colspan="99">
                <div style="font-weight: bold; padding-top: 20px; padding-bottom: 10px">{% unless field.label == 'Notes' %}{{ field.label }}{% endunless %}</div> 
                <div>{{ field.text | newline_to_br }}</div>
            </td>
1 Like