Add extra column to theme

Dears
Is there any way to show vat tax on each line of the invoice records in themes
Like

Item. Qty. unite price. SumBeforeVat. Vat%. SumAfterVat.

Thanks for ur software any Way

Yes there is, but it’s not trivial work. It’s better to hire a developer.

i am a programmer also, can you list me the steps please

Then practice the art rather than ask someone else to do the programming for you.

That is programming.

2 Likes

any one know what is the code to get tax value in theme

{% for row in table.rows %} {% for cell in row.cells %}
        <td class="text-{{ table.columns[forloop.index0].align }} border-start" style="padding: 5px 10px; {% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ cell.text | newline_to_br }}</td>
        {% if forloop.last == true %}
         <td class="text-{{ table.columns[forloop.index0].align }} border-start" style="padding: 5px 10px; {% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width: 80px{% endif %}"></td>
        <td class="text-{{ table.columns[forloop.index0].align }} border-start" style="padding: 5px 10px; {% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width: 80px{% endif %}"></td>
        <td class="text-{{ table.columns[forloop.index0].align }} border-start{% if forloop.last == true %} border-end{% endif %}" style="padding: 5px 10px; {% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width: 80px{% endif %}"></td>
     
       {% endif %}
        
        {% endfor %}
    </tr>

That really depends on what structure you have for your tax codes and what is your naming system for the tax codes.

But you need to first assign a variable i to the tax column index and use that with conditional logic to get the tax rate from the value in row.cells[i] let’s call it r.

You also need to assign a variable j to the taxable amount column index and get the value in row.cells[j] let’s call it base.

Later you can calculate the value for the tax amount by { base | times: r}.

But that’s not enough, you probably need to do something about the loops over table.rows and row.cells because inserting columns in between will mess up the indexes. You will either have to do some conditional logic which is the most efficient route or rebuild the table arrays in case you need to simplify the loops.

Also, you need to consider the scenario where amounts are tax inclusive is checked, because that will change how you calculate the whole thing.

It’s not a small job to ask for free. But maybe if you do more progress, others might be able to improve or debug it for you.

I would get cracking on it if I were you. :grinning:

:grinning: