Page 1 of 1
Change way Tax percent is shown on invoice
Posted: Fri Apr 01, 2022 2:46 pm
by 14Steve14
I am wanting to change the way the VAT tax percentage is shown in the admin/invoice.php file.
It is this bit of code here
Code: Select all
echo '<td class="text-right">' . tep_display_tax_value($product['tax']) . '%</td>';
Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.
Re: Change way Tax percent is shown on invoice
Posted: Fri Apr 01, 2022 2:57 pm
by ecartz
Code: Select all
echo '<td class="text-right">' . Tax::format($product['tax'], 0) . '%</td>';
I think it should work the same way with tep_display_tax_value.
Re: Change way Tax percent is shown on invoice
Posted: Fri Apr 01, 2022 3:07 pm
by heatherbell
14Steve14 wrote: ↑Fri Apr 01, 2022 2:46 pm
Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.
I guess you do not charge any tax rates that have a fraction? That is, all your tax rates are whole numbers?
Currently, they all are in U.K. (20, 5 and 0)
In which case, why would the decimal places be needed anywhere?
Simplest is admin>Configuration>My Store>Tax Decimal Places - set to 0
Re: Change way Tax percent is shown on invoice
Posted: Fri Apr 01, 2022 3:24 pm
by 14Steve14
heatherbell wrote: ↑Fri Apr 01, 2022 3:07 pm
14Steve14 wrote: ↑Fri Apr 01, 2022 2:46 pm
Currently the percentage shows as 20.00%, and I would lie it to show as 20%, so without the decimal places. I only need it changed in this one file to make a custom invoice look a little better.
I guess you do not charge any tax rates that have a fraction? That is, all your tax rates are whole numbers?
Currently, they all are in U.K. (20, 5 and 0)
In which case, why would the decimal places be needed anywhere?
Simplest is admin>Configuration>My Store>Tax Decimal Places - set to 0
I did think about doing that but wondered if it would affect anything else. Just wasnt confident to give it a try. Seems to work anyway. Thanks.