Labels from stack

I assume this is a newbie question, but I’m unable to find the answer in the documentation or on the forum.
How do I get the labels of a stack to show up on my invoice?

I want to print the company-info stack, including labels.

Likewise, I am unable to figure out why the $entity-detail stack is printing with labels.

Depends a bit on which design you used as a starting point. I use Plain.

In body I have redefined

<div id="company-details"></div>

to

<div>
<p data-ref="company_details-company.email">Email: $company.email</p>
<p data-ref="company_details-company.phone">Phone: $company.phone</p>
<p data-ref="company_details-company.website">Web: $company.website</p>
<p data-ref="company_details-company.vat_number">VAT ID: $company.vat_number</p>
</div>

to get labels for the company-details stack.

To get rid of the labels in the entity-details stack, you could replace

<table id="entity-details" cellspacing="0" dir="$dir"></table>

with a variant of the above

<div>
<p data-ref="...">$entity....</p>
...
</div>

1 Like

Hi, i´am relativly new on invoiceninja, can you tell me how you edit the body

Hi,

You can customize the invoice template by creating a custom design on Settings > Invoice Design.

Thanks, xoo.
That obviously works, but I’m looking for a way to use the actual labels, since I have a multi-language requirement.
According to the documentation, the variables hold both label and value.
image

I used the entity details as an example for where it does work.

                <div class ="entity-detail-wrapper">
                    <table id="entity-details" cellspacing="0" dir="$dir"></table>
                 </div>

Somehow this code produces both labels and values of the invoice-detail stack, but how? why? and can I do the same with company-details?

I was lazy, when I set this up a while back, but for a multi-language setup you should use:

<p data-ref="company_details-company.email">$email_label: $company.email</p>
<p data-ref="company_details-company.phone">$phone_label: $company.phone</p>
<p data-ref="company_details-company.website">$website_label: $company.website</p>
<p data-ref="company_details-company.vat_number">$vat_number_label: $company.vat_number</p>

1 Like

Thanks. That supplies a workaround, but I’m still left with the question why the invoice-details explode into label plus value, but the company-details won’t.

(just trying to grasp the concept here)