Modify invoice number in field.text

I would like the recipient.code to show in front of the invoice number. Previously I had an html code to show like below which printed 0401-010010. the 0401 is the client code and 010010 is the actual invoice number

{{ strings.invoice_number }}
{{ customer.code }}-{{ reference }}

Whereas now there is the code below


{% for field in fields %}
{{ field.label }}

{{ field.text }}

{% endfor %}

Can someone guide me on how to edit the code so that I will show the client code as part of the invoice number?

You can use (part) of this if you like

<td style="border-right-width: 1px; padding-right: 20px; text-align: right">
                    {% for field in fields %}                            
                        {% if field.label != 'Invoice number' %}
                            <div style="font-weight: bold">{{ field.label }}</div>
                            <div style="margin-bottom: 10px">{{ field.text }}</div>
                        {% endif %}
                        
                        {% if field.label == 'Invoice number' %}
                            <div style="font-weight: bold">{{ field.label }}</div>
                            <div>{% for field in fields %}{% if field.label == 'Invoice date' %}{{ field.text | date:'20%y'}}{% endif %}{% endfor %}{{ field.text }}{{ recipient.code }}</div>                                                                 
                        {% endif %}
                    {% endfor %}                       
                </td>
1 Like

Thanks Frankie… I tried a similar solution and it worked.

                    {% for field in fields %}
                        {% if (field.label != 'Invoice number') %}{% continue %}{% endif %}
                            <div style="font-weight: bold">{{ field.label }}</div>
                            <div style="margin-bottom: none">{{ recipient.code }}-{{ field.text }}</div>
                    {% endfor %}
1 Like

@Frankie & @lonzu_65 thanks for sharing the template codes. Really helps in placing the recipient.code elsewhere. I’m struggling on how to understand using the code though I have the cheatsheet list for liquid.