Post by josee225 » Tue Dec 27, 2011 10:46 pm

I am looking into changing my store from Zen-Cart to OpenCart, but obviously, the tax situation is a major need for us in Montreal. I need to know if this will be supported any time soon in the core version, or if maybe a module will be created ?

I have a problem with Zen-Cart, the original developer hacked a lot of core modules, and I do not want to repeat this, in order to be able to upgrade. If this is not something that will be supported in any way, I would like to know right now.

Thank you very much for your time!

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by dwlamb » Mon Jan 30, 2012 5:53 am

Could someone offer an update of whether this issue of applying 2 taxes in Quebec is resolved. I am using opencart 1.5.1.3.1

Yes, 33¢ on $100 purchase and the current way taxes are calculated is not a big deal. But there's an issue of ethics and ensuring the product of a fully functional and legal web site I build for a client is correct.

With the way the government is getting about collecting taxes and everything up to the letter of the law, it would not surprise me if they start to audit web sites and tax business operators through fines for not having calculations 100% accurate.

Work-arounds of mark-ups to cover deficiencies in code are unacceptable.

Newbie

Posts

Joined
Mon Jan 30, 2012 5:34 am

Post by OpenCart Addons » Tue Jan 31, 2012 12:28 am

I manual configuration would be to add the tax into the tax order total extension manually.

Example:
in catalog / model / total / tax.php

Code: Select all

<?php
class ModelTotalTax extends Model {
	public function getTotal(&$total_data, &$total, &$taxes) {
		foreach ($taxes as $key => $value) {
			if ($value > 0) {
				$total_data[] = array(
					'code'       => 'tax',
					'title'      => $this->tax->getRateName($key), 
					'text'       => $this->currency->format($value),
					'value'      => $value,
					'sort_order' => $this->config->get('tax_sort_order')
				);

				$total += $value;
			}
		}
	}
}
?>
Replace With:

Code: Select all

<?php
class ModelTotalTax extends Model {
	public function getTotal(&$total_data, &$total, &$taxes) {
		foreach ($taxes as $key => $value) {
			if ($value > 0) {
				$total_data[] = array(
					'code'       => 'tax',
					'title'      => $this->tax->getRateName($key), 
					'text'       => $this->currency->format($value),
					'value'      => $value,
					'sort_order' => $this->config->get('tax_sort_order')
				);

				$total += $value;
			}
		}
$cumulative = round(($this->cart->getTotal() * 0.095), $this->currency->getDecimalPlace());
$total_data[] = array(
					'code'       => 'tax',
					'title'      => 'QST (9.5%)', 
					'text'       => $this->currency->format($cumulative),
					'value'      => $cumulative,
					'sort_order' => $this->config->get('tax_sort_order')
				);

				$total += $cumulative;
	}
}
?>
Make sure to disable the current cumulative tax that you may have already created.

Simply change 'QST (9.5%)' to the name of your tax, and 0.095 to the tax rate. (decimal form, not percentage)

*Edit: Updated rate to 9.5% to match the current Quebec QST rate)*

Regards,
Joel.
Last edited by OpenCart Addons on Tue Jan 31, 2012 1:04 am, edited 1 time in total.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by straightlight » Tue Jan 31, 2012 12:36 am

@Opencart Addons:

Thank you for posting this modification. This will also be practical for Quebec taxes calculation purposes. Although, since this month in Canada, taxes has increased so: 0.075 would no longer be true unfortunately. :/

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by OpenCart Addons » Tue Jan 31, 2012 1:05 am

Hey Straightlight,

Thanks for letting me know. I've updated the rate to 9.5% to match Quebec's current QST rate.

In Ontario we now have the wonderful HST, which means we avoid the cumulative tax, but also means we are charged taxes on items that used to be exempt from one tax or the other.


Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by straightlight » Tue Jan 31, 2012 1:10 am

No problem. However, if the HST and cumulative tax could be calculated from API since the Canadian policy is unbalanced between Ontario and Quebec Government, it would be a unique opportunity to Canadian merchants not only to allow auto-update on currencies but also on HST and cumulative taxes. I would love to this that coming.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by OpenCart Addons » Tue Jan 31, 2012 1:24 am

I tried doing a quick google search to see if Canada has a tax rate database but couldn't find anything.

Maybe someone else will have some luck finding one.

Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by straightlight » Tue Jan 31, 2012 1:30 am

Right now in Canada, I don't know if other than manufactured payment gateways or financial institutions does have access to the database tax rate reports but if there's at least one of them, it would really save the time consuming by simply combining the results so to balance all the products not only financially but also politically.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by agaudreau » Sat Feb 11, 2012 3:39 pm

There's actually an error with the code Joel posted atleast in my install.

this:

Code: Select all

$cumulative = round(($this->cart->getTotal()* 0.095), $this->currency->getDecimalPlace());
should be this:

Code: Select all

$cumulative = round(($total * 0.095), $this->currency->getDecimalPlace());
or you need to update $this->cart's total as it isn't being updated prior to calling getTotal() which results in the QST being calculated simply on the initial total and not TOTAL+GST.

I'll have a look and see how involved it would be to add a simple compound tax feature to opencart based off of a single boolean to mark a tax as being taxable and on a tax order integer value.

I haven't checked the opencart code before but it should be a rather simple mod.

Thanks Joel for the code!

Solutions I.D.S.
Alain Gaudreau
Propriétaire/Consultant
http://www.solutionsids.ca
Vente et réparation d'ordinateur de maison, portable, serveurs, pièces et logiciels
Administration de systèmes UNIX (Sun, BSD) et Linux
Conception de logiciels et Programmation (Java, C, C++, C#, PHP, PIC32 C/ASM)
Hébergement de serveurs et de site web


Newbie

Posts

Joined
Sat Feb 11, 2012 3:20 pm

Post by agaudreau » Wed Mar 07, 2012 7:21 am

Hello,

I have implemented the compound tax feature in opencart.

What is the preferred method to post or submit a modification which involves 4-5 core files and adding a field to one of the database tables so that it will be as pain free as possible for less technical people to implement?

Should I create a vqmod for it or a simple diff based patch file and instructions on the command for mysql to alter the right table?

Solutions I.D.S.
Alain Gaudreau
Propriétaire/Consultant
http://www.solutionsids.ca
Vente et réparation d'ordinateur de maison, portable, serveurs, pièces et logiciels
Administration de systèmes UNIX (Sun, BSD) et Linux
Conception de logiciels et Programmation (Java, C, C++, C#, PHP, PIC32 C/ASM)
Hébergement de serveurs et de site web


Newbie

Posts

Joined
Sat Feb 11, 2012 3:20 pm

Post by straightlight » Wed Mar 07, 2012 7:27 am

Creating a VQMod file would be the best solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Cougar » Sun Mar 11, 2012 5:38 am

Awesome!!

Im located in Quebec and have been struggling to have a cart that supported canadian taxes.

I was wondering, with this mod, are you able to charge compounded taxes to shipping also?


Thank You

Merci

Newbie

Posts

Joined
Sun Mar 11, 2012 5:34 am

Post by josee225 » Mon Mar 12, 2012 8:12 am

Could you please let us know when the vqmod is ready? I can't wait to use this one! Thanks! Merci!

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by straightlight » Mon Mar 12, 2012 8:34 am

josee225 wrote:Could you please let us know when the vqmod is ready? I can't wait to use this one! Thanks! Merci!
Le voici / Here you go.

Remember to revert the changes from the original file above before using this XML.

Attachments


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by josee225 » Mon Mar 12, 2012 8:40 am

Thank you!!!

Will this work with 1.5.1.3?

New member

Posts

Joined
Tue Dec 27, 2011 10:42 pm

Post by straightlight » Mon Mar 12, 2012 8:53 am

According to both versions from comparison, there shouldn't be any problems since no changes were made from the core since v1.5.1.3.1 within v1.5.2.1 for this file. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Cougar » Mon Mar 12, 2012 9:10 am

Ok ive installed the mod did a quick test thought qst show above the gst which should be the opposite. Havent tested this but is the shipping taxes are calculated also with this mod?

Is this mod the same that agaudreau talked about or its a diffrent one?

Thx

Newbie

Posts

Joined
Sun Mar 11, 2012 5:34 am

Post by straightlight » Mon Mar 12, 2012 9:13 am

The XML simply reproduces what was stated on the above included the cumulative calculation fix. Although, no shipping calculations are involved on the topic yet ... :|

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by norlink » Fri Apr 06, 2012 3:34 am

Would this work the same for PEI's sales taxes? From what I can see on taxtips.ca, PEI is similar to Quebec with the way the taxes are calculated where GST is 5% and the PST is 10% of the selling price + GST

** EDITED **
Looks like this doesn't pertain to me. I'm setting up a shopping cart for a client in Ontario and I'm working on setting up the tax rates. Any suggestion on what to put for Quebec & PEI so it calculates properly?

Taxes make my head hurt almost as much as IE quirks.

Newbie

Posts

Joined
Fri Apr 06, 2012 3:32 am

Post by Tcalp » Sun Apr 15, 2012 9:11 pm

I've put together a proper solution which provides any tax compound support. Every tax on the back-end will have the option to be compounded.

You can view it here: http://www.opencart.com/index.php?route ... on_id=5976

Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite

Image
irc.freenode.net #opencart


User avatar
Active Member

Posts

Joined
Wed Jul 06, 2011 1:49 pm
Who is online

Users browsing this forum: No registered users and 81 guests