Vat Number For Vendor On Invoice

Good morning,

to comply with the sales taxes rules in germany it is necessary to mention our vat number and the vendors vat number on b2b invoices.

We did manage to add a new input field and implement it for the documents.

Our workaround to post both vat numbers only for b2b invoices is to check if is our own shop

{% if == "our shop name" %} 
{% else %} 
{{ c.tax_number }} 
{% endif %}

This one works in mostcases. However: If we additionaly check for in the "bill to"-block to add the vat number for our vendors below their adress, the c.tax_number variable is left blank.

Anyone got a suggestion?

Best regards