How to get separate Subtotal for Standard rated item and Zero rated item?

I am looking for help how to get the subtotal for SR item and ZR item as I was requested by the authorities to make Tax summary (as shown in the photo) in my Tax Invoice.

Currently i am using backward method which get {{tax_component.amount}} / 0.06 i should be able to get the Sub Total for SR item. However, the tax_component.amount is rounded to 2 decimal, therefore i may get the Sub Total for SR item wrongly as shown in my table.

Is there any variable or method to get Sub Total for SR item only?

Sorry, can’t see the screenshot. Could you re-upload?

Sorry, the attachment is like this:

At the Tax Summary part, I could’t get the exact amount before tax for ZRL & SR.

GST after rounded 4,025.29 / 0.06 —> 67,088.17 which is against the actual SR item amount 67,088.15.

I am requesting is there any variable to get the Subtotal for each Tax code item.

Thanks.

Can paste the code you’ve done so far to show “tax summary” part? Don’t paste the whole HTML template, only the part that generates “tax summary” section.

{% for tax_component in tax_components %}

                        {% assign ttotal = tax_component.amount %}
                        {% assign stdstotal = ttotal | divided_by:0.06 %}
                        {% assign stdtotal = stdstotal | plus:ttotal %}
                        {% assign zerostotal = subtotal | minus:stdstotal %}
                        {% assign zerototal = total | minus:stdtotal %}
                    <tr>
                        <td style="font-size: 12px; font-weight: bold; text-align: right; padding: 15px 10px">&nbsp;</td>
                    </tr>
                      <tr>
                        <td style="font-size: 12px; font-weight: bold; text-align: right; padding: 0px 10px">Tax Summary :</td>
                        <td style="background-color: #eee; font-size: 10px; border: 1px dotted #000;text-align: center; padding: 0px 10px">Tax Code</td>
                        <td style="background-color: #eee; font-size: 10px; border: 1px dotted #000;text-align: right; text-align: center; padding: 0px 5px">Amount (MYR)</td>
                        <td style="background-color: #eee; font-size: 10px; border: 1px dotted #000;text-align: right; text-align: center; padding: 0px 5px">GST (MYR)</td>
                        <td style="background-color: #eee; font-size: 10px; border: 1px dotted #000;text-align: right; text-align: center; padding: 0px 5px">Amt. Incl. GST (MYR)</td>
                    </tr>
                    <tr>
                        <td style="font-size: 10px; text-align: right; padding: 0px 10px">Standard rated supplies (6%)</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: center; padding: 0px 10px">SR </td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 5px">{{stdstotal | round: 2 | money}}</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 10px">{{ttotal | round: 2 | money}}</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 18px">{{stdtotal | round: 2 | money}}</td>
                    </tr>  
                        <td style="font-size: 10px; text-align: right; padding: 0px 10px">Zero rated supplies</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: center; padding: 0px 10px">ZRL </td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 5px">{{zerostotal | round: 2 | money}}</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 10px">0.00</td>
                        <td style="font-size: 10px; border: 1px dotted #000;text-align: right; padding: 0px 18px">{{zerototal | round: 2 | money}}</td>
                    {% endfor %}

any feedback on this?

In the latest version (16.8.22), I’ve added new variable called tax_exclusive_amount to tax_component object.

So the line which says:

{% assign stdstotal = ttotal | divided_by:0.06 %}

replace with:

{% assign stdstotal = tax_component.tax_exclusive_amount %}

1 Like