Under certain circumstances (both, vendor and client are commercial entities with a VAT number residing in the EU, but in different countries) there is a need to put the client’s VAT number on an invoice (along with a VAT reverse charge notification).
The client VAT number is part of the client-details div stack, so I can enable showing the client’s VAT in Settings → Invoice Design → Client Details and it will appear directly under the clients address.
Given the widespread use of windowed envelopes this placement is inconvenient, as the VAT number would then be visible in the window. Therefore I have tried moving the client VAT number to the entity-details stack. In Settings → Invoice Design → Invoice Details the client’s VAT is not available, so I resorted to a custom design.
In Settings → Invoice Design → Customize & Preview → Edit → Body I changed
<table id="entity-details" cellspacing="0"></table>
to
<table id="entity-details" cellspacing="0"> <tr> <th data-ref="entity_details-client.vat_number_label">Customer VAT ID</th> <th data-ref="entity_details-client.vat_number">$client.vat_number</th> </tr> </table>
This gets me the clients VAT number as the first item in the invoice details.
Unfortunately, this of course always outputs the customer VAT ID label. I’d rather want to see this only if the client VAT number is populated. Then I could populate the clients VAT number only for those clients residing in the EU, but not in Germany (where I am).
Ideas how to improve?