Page 1 of 2

Multiple Tax Fields in Prices Section

Posted: 13 Jun 2019, 08:01
by superscotty19
Hi,

(This might be a development request - if I'm posting in the wrong area, sorry, please direct me to the proper channel(s).)

Here in Canada we have 2 taxes - federal and provincial - and businesses are required to clearly indicate/separate the two. Now, Aimeos' "Products > Prices" section only has "tax rate in %" (i.e. 1 total amount for tax). Is it possible to have "tax 1 rate in % ... tax 2 rate in % ..." etc.?

Thanks!
-Scott.

Re: Multiple Tax Fields in Prices Section

Posted: 13 Jun 2019, 08:21
by aimeos
Is it only the second tax rate that must be additionally shown or is the second tax rate required for calculation too?

Re: Multiple Tax Fields in Prices Section

Posted: 13 Jun 2019, 16:13
by superscotty19
Good question.

Ideally, it would be nice if it was both shown and calculated. However, I guess we could show them (for example, GST = 5%, PST = 6%) but use the total tax rate (11%) for calculations.

Having said that, what do you recommend?
-S.

Re: Multiple Tax Fields in Prices Section

Posted: 14 Jun 2019, 08:49
by superscotty19
Update:
Tax people say it must be shown: GST is 5% and amounts to $x, PST is 6% and amounts to $y.
:-(

Re: Multiple Tax Fields in Prices Section

Posted: 14 Jun 2019, 09:40
by aimeos
OK, this is going to be a bit of work, maybe you can help :-)
First of all, we will implement properties for price items so tax rates for different purposes can be stored. Afterwards, we have to adapt the frontend and the price calculation and there we would need a bit of help from you.

Re: Multiple Tax Fields in Prices Section

Posted: 14 Jun 2019, 18:09
by superscotty19
Happy to help in any way I can!

Re: Multiple Tax Fields in Prices Section

Posted: 14 Jun 2019, 21:31
by aimeos
It's now possible to store multiple tax rates as price properties in dev-master. Next is price calculation and displaying in the frontend. Maybe you can help in the later part?

Re: Multiple Tax Fields in Prices Section

Posted: 14 Jun 2019, 22:19
by superscotty19
Wow, that was fast!
Anything I can do to help I will. What do you need to me do?

Re: Multiple Tax Fields in Prices Section

Posted: 15 Jun 2019, 11:49
by aimeos
Can you please create a PR for aimeos/ai-client-html that renders the tax rates in the price partial, basket and checkout summary? There's now a $priceItem->getTaxRates() method available that returns all tax rates as array with the tax types as key so they can be translated e.g. from "taxrate-pst" to "PST 5%".

You can add arbitrary tax rates as price properties to price items by creating new price property types that begin with "taxrate" (currently, "taxrate-local" has beed defined).

Re: Multiple Tax Fields in Prices Section

Posted: 16 Jun 2019, 04:56
by superscotty19
Hi,

While I'm certainly willing to do that, I'm embarrassed to admit that I don't know what you're talking about. I don't know the blueprint of the aimeos file structure (I've only been a user for a couple weeks, and FAR from a "under the hood" developer) - so I don't even know where to find the file/function you've mentioned let alone connect it/them to other functions/files ... and I don't know what a PR is ... :-/

-S.