cancel
Showing results for 
Search instead for 
Did you mean: 

Canada Taxes: Separate GST / PST

SOLVED

Canada Taxes: Separate GST / PST

Hi,

 

I'm working on upgrading a store 1.7.0.2 to 1.9.4.0. 

 

One of the reasons for the upgrade was fixing tax display for Canada. 

 

Magento should be separating the GST / PST tax into separate lines (which it does) and separating costs into GST and PST (which it does not) .

 

From what I see, this is STILL not possible?

 

Here is current setup displaying the pricing:

SUBTOTAL: $10

GST: $1.2

PST

 

TOTAL TAX: $1.2

TOTALS (WITH TAX): $11.2

 

^^^ This is wrong.

 

This is the correct display of taxes:

 

SUBTOTAL: $10

GST: $0.5

PST: $0.7

 

TOTAL TAX: $1.2

TOTALS (WITH TAX): $11.2

 

Am I doing something wrong with settings? I have gone through a ton of tutorials on this topic and none of them mention separation of costs for taxes.

 

Any ideas?

 

PS: there is a Demac Taxfix plugin that we use on 1.7.0.2 to fix this, but it's in the way of our Edit Order plugin and always requires modification of code. 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Canada Taxes: Separate GST / PST

I found a solution:

Since the two tax rate display only works when you use compounding (GST priority 1, PST priority 2), I decided to change it to just use normal calculation instead of compounding tax on top of Subtotal.

 

More on compound tax: https://docs.magento.com/m1/ce/user_guide/tax/tax-compound.html

 

CHANGES (CE 1.9.4.0):

 

File:

app/code/Mage/Tax/Model/Resource/Calculation.php

 

Around line 190:

 

if (!empty($rates[$i]['calculate_subtotal'])) {
    $row['percent'] = $currentRate;
    $totalPercent += $currentRate;
}

else {
   $row['percent'] = $this->_collectPercent($totalPercent, $currentRate);
   $totalPercent += $row['percent'];

}

 

replace:

$row['percent'] = $this->_collectPercent($totalPercent, $currentRate);
$totalPercent += $row['percent'];

 

with:

$row['percent'] = $currentRate;
$totalPercent += $currentRate;

 

 

Then the tax rate for 2nd tax will be correct and display will be correct too.

 

I'm not sure what effects this will have on your store, but from my testing it looks ok.

View solution in original post

1 REPLY 1

Re: Canada Taxes: Separate GST / PST

I found a solution:

Since the two tax rate display only works when you use compounding (GST priority 1, PST priority 2), I decided to change it to just use normal calculation instead of compounding tax on top of Subtotal.

 

More on compound tax: https://docs.magento.com/m1/ce/user_guide/tax/tax-compound.html

 

CHANGES (CE 1.9.4.0):

 

File:

app/code/Mage/Tax/Model/Resource/Calculation.php

 

Around line 190:

 

if (!empty($rates[$i]['calculate_subtotal'])) {
    $row['percent'] = $currentRate;
    $totalPercent += $currentRate;
}

else {
   $row['percent'] = $this->_collectPercent($totalPercent, $currentRate);
   $totalPercent += $row['percent'];

}

 

replace:

$row['percent'] = $this->_collectPercent($totalPercent, $currentRate);
$totalPercent += $row['percent'];

 

with:

$row['percent'] = $currentRate;
$totalPercent += $currentRate;

 

 

Then the tax rate for 2nd tax will be correct and display will be correct too.

 

I'm not sure what effects this will have on your store, but from my testing it looks ok.