commerceguys / tax

A PHP 5.5+ tax library.
MIT License
275 stars 39 forks source link

New version for Canadian Taxes #73

Open Fluotonic opened 4 years ago

Fluotonic commented 4 years ago

Hey everyone,

I live in Canada and I had to work on something reliable for taxes here. I've seen a previous work (4 years ago) that had been left as is. The base was already good but a few errors were left in zones and tax types. I've done some cleanup and now it works well in my app.

The resolver was also not taking into account the fact that, in Canada, you can't charge provincial taxes to a client in another province if your business is not registered there. Why? Simply because you could not remit your collected tax to the government at the end of you exercise (your need your tax numbers for that).

The new logic now takes care of this, as well as making sure Federal taxes are always applied inside Canada.

Please let me know if anything is missing. If all is good, feel free to merge this with the master branch.

Thanks!

bojanz commented 4 years ago

Closed https://github.com/commerceguys/tax/pull/31 in favor of this one.

Archanium commented 4 years ago

Looks great IMO @Fluotonic. I didn't have that much knowledge about the Canadian tax system when I made #31 :)

Fluotonic commented 4 years ago

Hey @Archanium ! Yeah, taxes are a real challenge, honestly... Your work was really helpful anyway so thank you for that :-)

bojanz commented 4 years ago

@Fluotonic You need to rebase your branch, you can't just recommit changes like you did in https://github.com/commerceguys/tax/pull/73/commits/6dc30f91b12a93da62a50169ec6563eeb6376d9e

Also, you can't specify a version in composer.json, the maintainer decides when to tag a release and how to number it, it has no relation to what's in the files.

Fluotonic commented 4 years ago

Hey @bojanz, sorry about the version number. That was intended for my other branch only but I've still to learn more about how Git works ;-)

I tried to rebase the master as you aksed me to. Can you let me know if it worked?

Thanks!

Fluotonic commented 4 years ago

I also just fixed the conflicts that were mentioned here. I hope all is good now :-)