Custom invoice theme

Are you asking about sales invoice custom fields or sales invoice line item custom fields? The first cannot be inserted into line items. The second can only be adjusted in presentation order after the description. Read about this in the Guides.

Sale invoice custom fields displaying right after description i want to change its position

the line item custom fields will always appear after Description field.
you can easily change the position between the custom field themselves which has been explained in the relevant guide.
positioning them anywhere else would require a custom theme which is the responsibility of the user. there is a similar guide and there have been many examples discussed on the forum too which would easily help any user with basic programming skills. if you do not have the necessary coding skills to do it yourself, please hire a local programmer to do it for you.

1 Like

Plz help me i cannot hire a developer i am also a developer i am trying to make some changes but it is going in wrong sequence i want Sub total text to be replaced with amount exluding GST
And total to be replaced with Amount including GST.
@Tut
@lubos
@sharpdrivetek

Then you should know it is pointless to show a screen shot including only portions of the lines of code. Furthermore, this forum is not the place to troubleshoot your custom themes. They are your responsibility.

Tax amount per line item is not included in the variable arrays defined for any transaction form. So you will not be able to include the additional column. Themes can only be used to show information already defined for a transaction form.

Amounts excluding tax are already on the form, as long as you have not checked the box for the transaction to be tax-inclusive.

To replace a label in a theme, you need a replacement filter in the relevant for-loop.

use the replace command

See this topic:

It explains how to rename sub-totals.

@lubos thank you so much it really helped me out

Hello, I need to replace the finale name “Balance due” to a custome name.
I’m using Manager in italian, so the themes are in italian too but I need to make a custom theme completely in english. The only way I found is to rename using “replace” for each name.
I was able to change all the names, but not the total label of the balance.

{{ total.label | replace: “Totale”,“TOTAL” | replace: “Importo Pagato”,“Amount Paid” | replace: “Ammontare Dovuto”, “Balance Due” }}

How can I do?

The filter is is case sensitive. “Balance due”, not “Balance Due”.

But honestly, is it not easier to switch language when needed rather than use custom themes?

but I have to switch the language of the whole software…

anyway, I was very carefully about case sensitive, it does not depend by it.

Maybe I misunderstood what you wrote. Are you saying that in the totals section of the theme your custom theme works except for the very final line (Ammontare Dovuto in Italian, Balance due in English)? Or are you saying that none of the total.label replacements work?

exactly, work all except the final line.

if I set:

{{ total.label | replace: “Totale”,“TOTAL” | replace: “Importo Pagato”,“Amount Paid” }}

I have this result:
it-parziale

But if I set:

{{ total.label | replace: “Totale”,“TOTAL” | replace: “Importo Pagato”,“Amount Paid” | replace: “Ammontare Dovuto”,“Balance Due” }}

I have this:

This isn’t a coding forum but your syntax looks correct.
But that isn’t necessarily what you have in your theme so it is not possible to say any more

so there is no way to change that name?

No, what @Joe91 said is that your question cannot be answered without seeing the entire theme. That is one reason this is not the place to get your code debugged. Users are responsible for their own custom themes.

the custom theme I’m editing is the smooth blue and I’m adding only the “replace”.
no other changes.

You need to post a copy of the theme.

I think you have not modified correctly

@sket, against my better judgment, I will tell you that your approach will never work. The total.label array has more elements than are displayed on your simplistic example invoice. But they are not constant. Once your replace filtering skips an expected element, the rest of your filtering is ignored. Some of the elements are suppressed when they are zero. The tax total happens to be one of them. So your lack of a tax code had no effect. But if tax totals were not ignored when zero, your replacement with “Amount Paid” would not have worked.

However, later totals in the array are not ignored, even though they are zero in your example. So by the time the theme came to “Ammontare Dovuto,” it was ignoring your code. But it generated the error concerning number of parameters.

What this means is that your theme would partially work in some circumstances, but not work at all in others. Since some of the invisible labels are not fixed, but are variable themselves, it is not possible to write a theme that accounts for them all. An example of why this is so comes from the possibilities of multiple late payment fees, multiple receipts against the invoice, and so forth.

I go back to my original suggestion: switch languages to generate a sales invoice in English; then switch back to Italian. That involves a total of only three clicks.

I think I will do.
thx