Add multiple tax rates by default to an invoice


#1

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


Multiple Taxes Rate
#2

[size=10]Last Update: 02.06.2016[/size]


#3

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.


#4

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.


#5

awesome thanks


#6

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.


#7

@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!


#8

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!


#9

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