Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Tax rate label adjust #1669

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

This PR allows to easily customize the label display in an tax line item. Right now it is always set to the name of the tax category. In Canada however, and certainly in other countries, a product can be subject to more than one tax (PST and GST for instance) and we need 2 lines with two tax-rates. For legal reasons (and also traceability for the buyer) the label displayed cannot be the same on both lines.

A Canadian shop could easily create a decorator for the TaxRate model and simply override with a class_eval the create_label method instead of overriding the whole adjust(order) method.

Let me know if it needs more clarification

Michael

Michael Sevestre add create label method in TaxRate so that label can be overriden in …
…extensions without having to override the adjust method
7e6112b
Member

joneslee85 commented Jun 20, 2012

@msevestre can you please give me one example?

Example of override: https://gist.github.com/2925678
I have changed the TaxRate model and added a property name to the class.
https://gist.github.com/2925704

That way I can give a name to the association "TaxCategory, Rate"
For instance in Manitoba, a product is subject to GST and PST. The same product is in Ontario however subject to HST.
I would define 3 Tax Rates, names GST , PST and HST with appropriate zone for the TaxCategory "TAX" and the shop is legally ok for a Canadian shop.

@radar radar added a commit that referenced this pull request Jun 21, 2012

@radar Michael Sevestre + radar add create label method in TaxRate so that label can be overriden in …
…extensions without having to override the adjust method

Merges #1669
5baf6d7

@radar radar added a commit that referenced this pull request Jun 21, 2012

@radar Michael Sevestre + radar add create label method in TaxRate so that label can be overriden in …
…extensions without having to override the adjust method

Merges #1669
2659e7c
Member

radar commented Jun 21, 2012

I think this is a great idea. Merged to master with @2659e7c837f003e74d73dfa38fd21ebabc326878 and 1-1-stable with @5baf6d76d1bf5ee3f90d3c5c6ce4df10ca41bb64.

@radar radar closed this Jun 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment