Try the Demo

Magento Forum

   
Page 1 of 3
Show 2 taxes with Priority 1 (2013 Canadian taxes update)
 
priape
Jr. Member
 
Total Posts:  2
Joined:  2011-02-15
 

Hello,
in 2013, some canadians taxes will change. Fist one is Quebec taxe (TVQ) and it is causing troubles with Magento.

In 2012, the TVQ was charged on the subtotal + GST amount. In Magento, GST was Priority 1 and TVQ Priority 2. This set up makes both taxes appears with their respective amount in the checkout page. For ex:

GST (5%) :  2.00$
TVQ (9.5%) : 3.00$

In 2013, the TVQ will no longer be charged on the subtotal+GST, but on the subtotal only with a raise at 9.975%. We just have to set TVQ to Priority 1 in the Tax Rules.

Problem is Magento combines both tax amounts in only one amount. For ex:

GST (5%) : 5.00$
TVQ (9.975%) :

According to laws, we must show both GST and TVQ amounts. The main issue is that native Magento cannot show 2 taxes with Priority 1. This point has been confirmed to me by the Magento Support and unfortunately there is nothing they can do about it.

A custom development must be done on both Model and Block classes of the Tax module in order to show both amounts (GST and TVQ).

Anybody has any clue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ccobbel
Jr. Member
 
Total Posts:  5
Joined:  2011-03-09
 

+1

I am also interested by a solution that will display 2 taxes with the same priority.
All the non harmonized provinces in Canada have the same problem, I am sure some USA states have the same problem too.

Somebody can help ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
patricebois
Jr. Member
 
Total Posts:  1
Joined:  2011-10-15
 

+1

I need solution me too

 
Magento Community Magento Community
Magento Community
Magento Community
 
ryanlb
Jr. Member
 
Total Posts:  6
Joined:  2012-09-11
USA/Canada/Worldwide
 

+1

This sounds pretty serious, you don’t want to wind up on the wrong side of Revenue Canada!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dialoguenet
Jr. Member
 
Total Posts:  19
Joined:  2009-05-13
 

Me too!

I hope some developer will be interested wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
lmcbmai
Jr. Member
 
Total Posts:  5
Joined:  2012-11-04
 

I created what I call “dirty fix”, or simply a hack for version 1.7.0.2. So far works for frontend only. Admin Panel under Sales Orders still shows 9.5%. You can try it on your own risk. No warranty what so ever.

The fix is based on the fact that the actual amount of QST did not change. So, we can keep the old rule of calculating QST as a compound 9.5% tax and just change the label from (9.5%) to (9.975%). To do this we need to modify the following files:

/app/design/adminhtml/default/default/template/sales/order/create/totals/tax.phtml
/app/design/frontend/base/default/template/checkout/total/tax.phtml
/app/design/frontend/base/default/template/tax/checkout/tax.phtml
/app/design/frontend/base/default/template/tax/order/tax.phtml
/app/design/frontend/default/iphone/template/tax/order/tax.phtml

Start with backing up each of these files (remember if you screw up - you are on your own). In each of these files find the following set of lines:

<?php echo $this->escapeHtml($rate['title']); ?>
<?php 
if (!is_null($rate['percent'])): ?>
(<?php echo (float)$rate['percent']?>%)
<?php endif; ?>

Replace these lines with:

<?php  
if (strpos($this->escapeHtml($rate['title']),'QST') === false{
  
echo $this->escapeHtml($rate['title']);
  if (!
is_null($rate['percent'])) 
    
echo ' (' . (float)$rate['percent''%)';
  

else {
  
echo ('QST (9.975%)');  

?>


Make sure your Quebec Tax identification is QST or modify both appearances of string QST in the replacement code to match your identifier.
You can see the result of my changes on http://modernlamps.ca

Again, this fix is for Magento version 1.7.0.2 only and may not work with other versions.

NOTE: This change will apply to old orders too, i.e. if customer logs in from frontend and checks his pre-2013 orders, he will see the label QST (9.975%).

 
Magento Community Magento Community
Magento Community
Magento Community
 
lmcbmai
Jr. Member
 
Total Posts:  5
Joined:  2012-11-04
 

UPDATE:

Here is how to apply the hack with less changes to the original code. This also fixes the tax label appearance in Admin area.

Files to be modified:

/app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml
/app/design/adminhtml/default/default/template/sales/order/create/totals/tax.phtml
/app/design/frontend/base/default/template/checkout/total/tax.phtml
/app/design/frontend/base/default/template/tax/checkout/tax.phtml
/app/design/frontend/base/default/template/tax/order/tax.phtml
/app/design/frontend/default/iphone/template/tax/order/tax.phtml

1. In file /app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml around line 76 find the line that ends with

(<?php echo (float)$info['percent']?>%)<br /></td>
Insert the following code right above this line:
<?php if ($this->escapeHtml($info['title']) == 'QST'$info['percent'9.975;  //  QST fix ?>

2. In all other files listed above around line 40 or line 50 find the line containing:
(<?php echo (float)$rate['percent']?>%)
Insert the following code right above this line:
<?php if ($this->escapeHtml($rate['title']) == 'QST'$rate['percent'9.975;  //  QST fix ?>


Don’t forget to backup original files before doing these changes.
Please let us know if this worked for you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
macfred
Jr. Member
 
Total Posts:  15
Joined:  2008-05-17
 

Thanks for this solution! It works fine!

If you also have a french version of your site, don\’t forget to add this line in each files:

<?php if ($this->escapeHtml($info[\'title\']) == \'TVQ\'$info[\'percent\'9.975;  //  TVQ fix ?>

 Signature 

Designer Baby Clothing
Vêtements de luxe pour bébés

 
Magento Community Magento Community
Magento Community
Magento Community
 
MortomerSn
Jr. Member
 
Total Posts:  10
Joined:  2012-03-08
 

The patch proposed here is a solution for Quebec only and will only be valid until next tax increase - likely in January 2014.
In addition to this, the same problem exists for Canadian provinces Saskatchewan and Manitoba because they follow the same set of rules:

- two levels of taxes applied (federal and provincial)
- taxes are not compounded (ie: magento tax priority settings are the same)
- Canadian tax laws require that both taxes are shown on all sent to customer and stored by company.

A better fix, at least from Canadian (CA) perspective, would be to force all applicable taxes to be shown on documents regardless of tax priority used in setup.

Related discussion can be found at the bottom of this page
innoveight.ca/magento-taxes-setup/

Logic that controls tax display seems to be around here:
\app\code\core\Mage\Tax\Block\Sales\Order\Tax.php
\app\code\core\Mage\Tax\Model\Config.php

functions?
displayFullSummary()
displaySalesFullSummary()

 
Magento Community Magento Community
Magento Community
Magento Community
 
RedRave
Jr. Member
 
Total Posts:  9
Joined:  2012-10-14
 

Hi all,

Before I apply this fix, any news if a “cleaner” way to make this change?

By the way Macfred, your site is sweet...nice and clean template, good job!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MortomerSn
Jr. Member
 
Total Posts:  10
Joined:  2012-03-08
 

I tried this approach and it works so far.

Just a few points.

1. Maybe put all your logic in one place, so you don’t have to fix 5 places when the rules change and add this to rach tax.phtml file

<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/app/etc/mytaxfix.php'; ?>

Even better would be to add a new field to tax_calculation_rate table, so any changes can be handled from admin consule.

2. It is not just Quebec, but Saskatchewan and Manitoba with the same problem - depending on where you are based.

3. tax rate equivalents for Saskatchewan and Manitoba are more complicated than Quebec, you may want to fix the field to accomodate the rate

ALTER TABLE tax_calculation_rate CHANGE `rate` `rate` DECIMAL(12,9) NOT NULL;

Note that this is an ugly hack. Please send Magento a Defect Report if it affects your organization. It should be fixed at the source or an appropriate module created.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RedRave
Jr. Member
 
Total Posts:  9
Joined:  2012-10-14
 
MortomerSn - 30 January 2013 11:07 AM

I tried this approach and it works so far.

Just a few points.

1. Maybe put all your logic in one place, so you don’t have to fix 5 places when the rules change and add this to rach tax.phtml file

<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/app/etc/mytaxfix.php'; ?>

Even better would be to add a new field to tax_calculation_rate table, so any changes can be handled from admin consule.

2. It is not just Quebec, but Saskatchewan and Manitoba with the same problem - depending on where you are based.

3. tax rate equivalents for Saskatchewan and Manitoba are more complicated than Quebec, you may want to fix the field to accomodate the rate

ALTER TABLE tax_calculation_rate CHANGE `rate` `rate` DECIMAL(12,9) NOT NULL;


Note that this is an ugly hack. Please send Magento a Defect Report if it affects your organization. It should be fixed at the source or an appropriate module created.

I agree, not sure I want to make changes to the database like that…

By the way, how DO we file a change request to the Magento Core team? I looked everywhere and couldn’t find anything on that.

As a temporary measure, I will do the fixes above and hope for a more permanent solution from Magento soon.

Thanks again.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MortomerSn
Jr. Member
 
Total Posts:  10
Joined:  2012-03-08
 

This line will probably not give you desired results
<?php require_once $_SERVER[\'DOCUMENT_ROOT\'] . \'/app/etc/mytaxfix.php\'; ?>

Try this instead…
<?php include $_SERVER[\'DOCUMENT_ROOT\'] . \'/app/etc/mytaxfix.php\'; ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
MortomerSn
Jr. Member
 
Total Posts:  10
Joined:  2012-03-08
 

To add a bug or comment on existing bug with Magento:

http://www.magentocommerce.com/bug-tracking

Issue #28618 - http://www.magentocommerce.com/bug-tracking/issue/?issue=14621
Quebec new taxes

Issue #28598 - http://www.magentocommerce.com/bug-tracking/issue?issue=14598
Show 2 taxes with Priority

 
Magento Community Magento Community
Magento Community
Magento Community
 
RedRave
Jr. Member
 
Total Posts:  9
Joined:  2012-10-14
 

thanks for issue lists...lets hope they fix this in the next release.

As for applying the fix above, no luck on my end…

Will double check every file to make sure I applied the changes the proper way....

 
Magento Community Magento Community
Magento Community
Magento Community
 
RedRave
Jr. Member
 
Total Posts:  9
Joined:  2012-10-14
 

Ok...enough. I think I need some help lol...I\’m running Magento 1.7.0.2.

Here is what I did; I changed the following files.

app/design/adminhtml/default/default/template/sales/order/totals/tax.phtml
app/design/adminhtml/default/default/template/sales/order/create/totals/tax.phtml
app/design/frontend/base/default/template/checkout/total/tax.phtml
app/design/frontend/base/default/template/tax/checkout/tax.phtml
app/design/frontend/base/default/template/tax/order/tax.phtml
app/design/frontend/default/grayscale/iphone/template/tax/order/tax.phtml

First file:
<tr class=\"summary-details<?php if ($isTop): echo \' summary-details-first\'; endif; ?>\” style=\"display:none;\">
<?php if (!is_null($info[\'percent\'])): ?>
<?php if ($this->escapeHtml($info[\'title\']) == \'QST\') $info[\'percent\'] = 9.975; // QST fix ?>
<td class=\"label\"><?php echo $this->escapeHtml($info[\'title\']); ?> (<?php echo (float)$info[\'percent\']; ?>%)<br /></td>
<?php else: ?>

All the rest:
<?php if (!is_null($rate[\'percent\'])): ?>
<?php if ($this->escapeHtml($rate[\'title\']) == \'QST\') $rate[\'percent\'] = 9.975; // QST fix ?>
(<?php echo (float)$rate[\'percent\']; ?>%)
<?php endif; ?>

And yet, when I try it online, it changes absolutely nothing…

Any help is appreciated.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3