Add multiple tax rates by default to an invoice

Hello!

Well I am very impressed with this application, I was having a look and I found that I can not apply two tax amount to an invoice by default,

I am in Montreal Quebec, Canada and we have two taxes GST (5%), QST(9.975%) and I need to be able to differentiate them, I have to charge these taxes at all times.

Is there a workaround, or coming up feature like this??
Thank you

Last Update: 05.07.2018

1 Like

Ohh I forgot to say that our tax is 9.975 % and the system rounds it up automatically to 9.78, just wanted to know if this is only on the view option or if there is a change on the tax rate I am inputting in.

Thank you.

The only way to add two invoice taxes to an invoice is by using the “Add Invoice Tax” in the options dropdown of an invoice.
But I’ll take a look if this is easy to implement.

awesome thanks


I have found a workaround that seems to work fine (would be great to be added to the official version eventually).

I found out that the tax amount are being stored in the database with only 2 decimal places (data type: DECIMAL(5,2)). I have updated the data type to DECIMAL(5,3) but the application is still displaying only 2 decimal places.

So I went in

/application/helpers/number_helper.php

and changed the following line under the format_amount function:

return number_format($amount, ($decimal_point) ? 2 : 0, $decimal_point, $thousands_separator);

to:

return number_format($amount, ($decimal_point) ? 3 : 0, $decimal_point, $thousands_separator);

Once I did that, I went back in the Tax settings and set the tax rate to 9.975 and the value remained exactly as I typed it.

I have since created a few test invoices and confirmed that the right amount is being calculated.

1 Like

@Kovah

I’m having the same issue as OP decribed. Did you end up checking if it was easy to implement?

Almost all canadian provinces have two “default invoice taxes”, the provincial one and the federal. They are not item taxes and cannot be presented this way to a customer.

Adding one of them on each order is kinda cumbersome. Thanks and good work btw!

Hi guys,

Went into the same problem, without a pre-built solution so I made my own:

  • Create TPS and TVQ in admin interface as usual

  • Update field to 3 decimals in DB:
    ALTER TABLE ip_tax_rates CHANGE tax_rate_percent tax_rate_percent decimal(5,3) NOT NULL AFTER tax_rate_name;

  • Update TVQ to 9.975 directly in record ip_tax_rates.tax_rate_percent
    UPDATE ip_tax_rates SET tax_rate_percent = '9.975' WHERE tax_rate_name = 'TVQ';

  • Add second setting in DB for second tax:
    insert into ip_settings (setting_key) values ('default_invoice_tax_rate2')

  • Add field to taxes admin section by duplicating lines 12 to 26 underneath in:
    application/modules/settings/views/partial_settings_taxes.php
    and replace in the copied code
    every default_invoice_tax_rate to default_invoice_tax_rate2 .

  • In both invoice models here:
    application/modules/invoices/models/mdl_invoices.php
    application/modules/invoices/models/Mdl_invoices.php
    duplicate lines 181 to 190 and replace
    default_invoice_tax_rate for default_invoice_tax_rate2

  • Go to tax settings and assign TPS to the first, and TVQ to the second.

It still displays 9.98% on the invoice but totals are good :slight_smile:

@Kovah ; I could provide the commit on my side if you’d like, cheers!

1 Like

@Kovah can you please confirm whether a second tax rate feature is being added to the InvoicePlane or not.

Could you please tell me what file did you edit? DB is not a file :smile:

sorry, I got it, awesome thanks a lot

Hi everyone. I’m currently using the version 1.4.6 and aslo need to get the tax rate per group printed at the bottom of the quote and the invoice when I select tax rate per item. Such as in many countries, in France, this is mandatory.

I read some way to fix it manually by modifying invoice template but it’s often sensitive to customize it because of risk of incompatibility with future updates.

Has it been implemented or planned for future version ?

Many thanks in advance

BTW, congrats for the software ! Very efficient !

1 Like

can you please tell me how did you do it.?