Liquid variables doesn't work while customising themes

@lubos any liquid mathematical syntax doesn’t work while customizing themes .

  1. Plus operator doesn’t work.

  2. Minus or any mathematical operator doesn’t work.

  3. {{ balance_due_in_words }} doesn’t work.
    4 . Your link to invoice variables also doesn’t work .

    When i using {{ total.text | plus : 1000 }}
    ( let say ) it only appends total.text instead of addition.

{{ to_integer }} also doesn’t work .

What are you trying to achieve? My idea of themes to be about presentation, not changing figures etc.

1 Like
  1. I wanna get invoice no and book no such that when invoice no is 101 book no will be 3 .
    When invoice no is 151 book no will be 4 .
    I.e. on each 50 increament book no should be {{ invoice no | divided by : 50 | plus :1 }}

  2. I wanna show total amount in words
    As in previous versions of manager when there was view template {{ balance_due_in_words }} was worked . So how to show in this version ???

3 . [quote=“lubos, post:2, topic:7938”]
What are you trying to achieve?

I wanna show (amount before tax = total amount - vat amount ).
Just below sub total ( in case of tax inclusive.)

  1. In liquid documentation if I’m not wrong these variables shouldn’t affect internal structure . Right ???

@lubos I think there should be freedom to do some mathematics using other variables .

  1. On applying custom tax as that is also tax {{ title }} should write ’ Tax invoice ’ instead of only invoice.

You can make this change yourself. See this guide:

Bro u Didn’t get what i am talking about .

I’m saying that , like when we use in built taxes invoice turns into tax invoice .

So likewise when we use custom taxes in that case also invoics should turns into tax invoice . Because custom tax is also type of tax .

If i will create as u said then there is chance of mistakes . In that case i have to switch back and forth between two themes again and again . And at any time some invoice will print with wrong titles… as because then i have to select that manually

I completely understood you, @ShubSingh39. But the use of custom tax codes does not necessarily mean the user wants to change titles of forms. In the case of some built-in tax codes, the local law is known to require substitution of Tax Invoice for Invoice. But that is not true everywhere. And the program has no way of knowing you want such a change for your custom tax code. So the Guide explains how to do it and the program allows you (and others) flexibility.


Got you point @Tut . Thanks a lot !!

And what about {{ balance_due_in_words }} ?

It dosen’t work .

1 Like

In custom Theme, Is it possible to write Amount in Words ??? As like in View Template, You provide variable {{ Balance_due_in_words }}.
As like that any variable available for custom Theme also?
Because I hardly set Invoice format by View Template, (I still used View template). Please provide variable for " amount due in words " if possible.

In the latest version (17.1.67), you can spell out any number in custom theme. For example, to spell out “Balance due” total, you will need to loop through all totals to find “Balance due” total and then just spell out its number by using Liquid filter spell_out. I’m also using capitalize filter so the first letter of spelled out number is capitalized too.

{% for total in table.totals %}
  {% if total.label == 'Balance due' %}
    {{ total.number | spell_out | capitalize }}
  {% endif %}
{% endfor %}

Is there any way to localize the output of SPELL_OUT. I am trying to use the above code in Macedonian language, but the output is always in English.

No. The function returns English because that is the way Liquid is written.