Author Topic: Multiple tax rules cannot be saved in product  (Read 3238 times)

seagul

  • Jr. Member
  • **
  • Posts: 77
Multiple tax rules cannot be saved in product
« on: January 10, 2012, 21:51:39 pm »
Hi there,

I have four different tax rules (two with lower and two with higher tax depending on two different countries, i.e. 10%-EU, 10%-A, 20%-EU and 20%-A).
so the default values are all four of them.
If I want to change the tax rule for one product and I want to select manually only two tax rules, only one is saved. I can choose two tax rules and they are shown in the select field (see attachments). As soon as I save the product only one of the two rules is saved. (Both in FF and IE).

This is my link:
http://www.domain.com/administrator/index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id=26
Using Joomla 1.7.3 and VM 2.0.0 (windows 7)
Have my own shop data.

Is there a fix?

Regards,
Seagul


[attachment cleanup by admin]

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #1 on: January 11, 2012, 09:11:52 am »
ok, i did some research myself:
EDIT: (see below)

The problem is the function renderTaxList in helpers/shopfunctions.php
There is no code for multiple select like in the function renderShopperGroupList or renderCountryList.
/**
    * Renders the list for the tax rules
    *
    * @author Max Milbers
    */
   function renderTaxList($selected, $name='product_tax_id', $class='multiple="multiple"') {
......
   }


I just found out:
The problem seems to be that the field "product_tax_id" in the table "virtuemart_product_prices" is an integer. So, it can save only one value.
For example the multiple countries for one calculation methods are saved in a new table. I guess there is the table missing for multiple tax_id saving...


What is the chance that this is fixed rather soon? and Yes, I know everything is urgent  ;)

satnag29

  • Beginner
  • *
  • Posts: 17
  • Skype Name: satish.nagarale
Re: Multiple tax rules cannot be saved in product
« Reply #2 on: January 11, 2012, 09:56:18 am »
you need to modify some code in ps_tax.php file..

whats your site URL ?

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #3 on: January 11, 2012, 10:47:05 am »
not online yet, why would you need that?

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #4 on: January 11, 2012, 11:28:48 am »
I think there is more missing. And there is no file ps_tax.php in VM2.

i.e.
The file tables/product_taxes.php is missing.
And the according functions to save the values.

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3630
  • using Matomo instead of Google Analytics
Re: Multiple tax rules cannot be saved in product
« Reply #5 on: January 11, 2012, 12:29:21 pm »
You need to set up only two tax rates! 10 percent and 20 percent, because only one of the two (austrian?) tax rates is applied to a product, not both. It makes no difference if you have to add 20 percent sales tax because your customer is located in Austria or if you mail the product to Germany or Great Britain or any other EU country. You still have to add 20 percent sales tax.

You probably overlooked that you can select the countries for which the tax is added in your tax configuration. In your case you have to select i.e. all EU countries, when you set up the 10/20 percent tax rules. The sales tax is then calculated depending on the shopper's country. This also covers, that there is no sales tax added when the customer is i.e. located in Switzerland.

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #6 on: January 11, 2012, 15:37:20 pm »
Thanks for your detailed reply! I really appreciate your information.
However, I have a shop with only prices including the tax. So, I would basically need only the final sales price.

But I have a rather complicated system of shipment rates because some products are sent from Austria and some from Sweden. So, I wanted to setup up shipment rates with the tax calculation system of VM2 and rename the label "tax" with shipment with language overrides. That would work perfectly well for this special virtuemart setup, if the multiple tax setup would work for one product. Then I could select a tax rate for a product that is sent from Austria with a tax/shipmet rate for national (Austria) shipment and a tax/shipment rate for EU countries.

For products sent from Sweden I could manually select the other tax/shipment  and save with the product.

I actually need to do it this way because the multivendor-solution of VM2 is not working yet.

But maybe you have another idea to solve this problem. I also thought of adding a new shipment method that is calculated like the standard shipment (weight, country, zip) and additionally with the manufacturer. I thought that would be easier as with the vendor.

Or maybe throught shopper groups? But I don't know how shopper groups can be linked to a user/shopper on signing up automatically.

Do you have an idea?
Thanks a lot in advance!

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #7 on: January 11, 2012, 21:58:27 pm »
For whatever, I am using it.

I still think it is a bug. You should be able to select multiple tax rates/calculations for one product.

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3630
  • using Matomo instead of Google Analytics
Re: Multiple tax rules cannot be saved in product
« Reply #8 on: January 11, 2012, 22:28:58 pm »
If you would assign multiple tax rules to a single product , even if you rename them, VM2 would use it to calculate the tax. How would you calculate/display the correct tax in the cart then? You can do something like this with the other options, i.e. with the 'Discount', if you make it "+" instead of "-", so the discount actually becomes a surcharge.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #9 on: January 11, 2012, 23:07:26 pm »
I am just trying it with discount types and '+' operator. Which works fine but I also can save only one discount type for one product.  And I need i.e. one code for Austria and one for the rest of the EU.

This is the bug because I should be able to save more than one.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multiple tax rules cannot be saved in product
« Reply #10 on: January 13, 2012, 04:31:25 am »
No, you use the rules override.

You dont need to choose for every product the rule. You can do it per category. Just add your product in extra categories, not published. Just for calculation. For example in germany you use Food and nonfood to calculate 19 or 7 % (or is it 8 now?).
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #11 on: January 13, 2012, 09:09:34 am »
That is a really nice idea.

But I cannot select unpublish categories in the products and in the calculation rules. And if I publish the category, make a selection on the product, save the product and unpublish the category again. It works, but only until I next save the product because then the unpublished category is kicked out again.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10018
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multiple tax rules cannot be saved in product
« Reply #12 on: January 13, 2012, 23:27:48 pm »
ahh, okey, hmmm I think I should change then the option :-)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

seagul

  • Jr. Member
  • **
  • Posts: 77
Re: Multiple tax rules cannot be saved in product
« Reply #13 on: January 14, 2012, 00:23:54 am »
Yes, you should  :).

It is working like charm!!! :) I have published the categories now because my "shop main menu item" is linked directly to a category. So the other categories for my shipment rate setup are not shown.

So, for me it is "solved".