VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: Geister on June 18, 2009, 12:48:47 pm

Title: VAT based on shipping address
Post by: Geister on June 18, 2009, 12:48:47 pm
These bugs were not resolved in Virtuemart 1.1.4 RC.

http://forum.virtuemart.net/index.php?topic=49990.msg185691#msg185691
http://forum.virtuemart.net/index.php?topic=56708.msg185729#msg185729
Title: Re: VAT based on shipping address
Post by: aravot on June 19, 2009, 06:10:20 am
I tested both using 1.1.4RC both worked.
Title: Re: VAT based on shipping address
Post by: Geister on June 19, 2009, 09:21:25 am
1. Switch on the tax mode "Based on shipping address" and "Optional Account creation" to make it quick.
2. (Since for this example we'll use a German address, you have to add a new Tax Rate 19% (VAT in Germany) in the Admin panel. Then for the product you choose, you should put VAT Id: 19%)
3. "Add to Cart" this product. = you have the Subtotal and Total prices without taxes.
4. Press "Check out" and create or not create account with an US-address.
5. Press "Send Registration" - you have the Subtotal and Total prices without taxes. If you proceed to payment you will have a Total price with tax total 0.00. That is correct.
6. In the shipping information press "Add a new shipping address"
and use eg. this address:
Peter Mueller, Unter den Linden 1, Berlin 10117 Germany.

7. Press "Save" - you have the same subtotal and total price as without the taxes and you have Tax Total: the sum equal to 19%VAT of the product price.
19% is correct, but this sum is not added to the total price! It's the same bug as in Virtuemart 1.1.3 Stable.


Let's try another scenario.

1. Log out and "Add to cart" the product.
2. Press "Check out" and create or not create account with an EU-address.
(eg. Peter Mueller, Unter den Linden 1, Berlin 10117 Germany.)
3. Press "Send registration" and you will have a Subtotal and total price with added 19% VAT. That is correct. (If you now proceed to payment you will have the correct amount (price+shipping+VAT)).
4. In the "Shipping Information" press "Add a new shipping address" and use a US-address.
5. Press "Save" - you will have Tax Total=0.00, but this was not subtracted from the Total Price! If you now proceed to payment you will have the amount= Product Price + shipping + 19%VAT(!wrong!). And in the Tax Total field we see 0.00.

Again, it's the same bug as in Virtuemart 1.1.3 Stable.

Try the all above with EU-mode to see other variants of the same problem, namely:

1. If your billing address is in Germany (in other words: in EU), but you ship to the US (IOW: outside EU), the VAT must be subtracted, but it's not).

2. If your billing address is in the US (IOW outside EU), but you ship to Germany (or EU), the total price will be without VAT(must be with VAT), although in the field "Tax Total" we see the amount equal to 19%VAT (or other amount depending in which country the EU-business is located)!
Again, it's the same bug as in Virtuemart 1.1.3 Stable.



To my opinion, it's the most serious bug in Virtuemart now. It makes the program useless or illegal to use for EU-businesses who ship all over the world. As someone said here, "it's a show stopper"...  ::)
Title: Re: VAT based on shipping address
Post by: Bruce Morgan on June 19, 2009, 16:09:09 pm
I agree.  There is a similar problem relating to taxable/nontaxable items shipping to different locations within the USA.  The whole system has major holes in it. With my onw webs ite I have had to decide which mode to use based on guessing which one will screw up the fewest transactions.  I wonder if the whole handling of taxation should be rebuilt from the ground up.

Bruce
www.pepper-passion.com
Title: Re: VAT based on shipping address
Post by: mauri on June 19, 2009, 17:07:03 pm
OK. Now I get it. You are right.
I see if I find solution
Title: Re: VAT based on shipping address
Post by: mauri on June 19, 2009, 20:59:33 pm
These attached files is only demo.
Backup first files:
/administrator/components/com_virtuemart/classes/
Then unzip attached files and upload/overwrite on your server.

Give feedback.


EDIT ALL files 20.06.2009 3:24
files fixes wrong tax shipping_address and EU mode.
wrong tax when in backend adds new product or change item price in existing order http://dev.virtuemart.net/cb/issue/2502

EDIT ALL files 20.06.2009 21:09
fixes:
-if checkout layer "Tax Total contains" product tax 0, we don´t need to show it.
-if backend order edit change price (shopper is eu and shipping is out of eu, tax is wrong
-some undefined variables.

EDIT ALL files 22.06.2009 19:33

Files are in Virtuemart 1.1.4 ->
Title: Re: VAT based on shipping address
Post by: Geister on June 19, 2009, 22:44:27 pm
this test was true before the previous post was edited: "EDIT ALL files 20.06.2009 3:24"

Highlighted red differs from my previous test.

1. Switch on the tax mode "Based on shipping address" and "Optional Account creation" to make it quick.
2. (Since for this example we'll use a German address, you have to add a new Tax Rate 19% (VAT in Germany) in the Admin panel. Then for the product you choose, you should put VAT Id: 19%)
3. "Add to Cart" this product. = you have the Subtotal and Total prices without taxes.
4. Press "Check out" and create or not create account with an US-address.
5. Press "Send Registration" - you have the Subtotal and Total prices without taxes. If you proceed to payment you will have a Total price with tax total 0.00. That is correct.
6. In the shipping information press "Add a new shipping address"
and use eg. this address:
Peter Mueller, Unter den Linden 1, Berlin 10117 Germany.

7. Press "Save" - you have the subtotal and total price with the tax 19% and you have Tax Total: the sum equal to 19%VAT of the product price.
19% is added to the total price! That is correct.
If proceed to payment we have Subtotal with VAT+shipping = Total with VAT and shipping. In the Tax Total we see the sum equal to VAT. That is correct.
No bug found!

Let's try another scenario.

1. Log out and "Add to cart" the product.
2. Press "Check out" and create or not create account with an EU-address.
(eg. Peter Mueller, Unter den Linden 1, Berlin 10117 Germany.)
3. Press "Send registration" and you will have a Subtotal and total price with added 19% VAT. That is correct. (If you now proceed to payment you will have the correct amount (price+shipping+VAT)).
4. In the "Shipping Information" press "Add a new shipping address" and use a US-address.
5. Press "Save" - you will have Tax Total=0.00, and VAT was subtracted from the Total Price! If you now proceed to payment you will have the amount= Product Price + shipping (!correct!). And in the Tax Total field we see 0.00.

No bug found!

Try the all above with EU-mode:

1. If your billing address is in Germany (in other words: in EU), but you ship to the US (IOW: outside EU), the VAT must be subtracted, but it's not. The total price = Product price + VAT + shipping. The Tax Total shows the sum equal to 19%VAT.

!!! Bug still found !!!

2. If your billing address is in the US (IOW outside EU), but you ship to Germany (or EU), the total price is with VAT, and in the field "Tax Total" we see the amount equal to 19%VAT.

No bug found!
Title: Re: VAT based on shipping address
Post by: aravot on June 20, 2009, 00:29:58 am
Confirmed Mauri's fix works for tax mode base on shipping address.

Have not checked with EU mode or tax mode base on vendor address.
Title: Re: VAT based on shipping address
Post by: mauri on June 20, 2009, 02:32:27 am
I have edit files in previous post.
files fixes wrong tax shipping_address and EU mode.
wrong tax when in backend adds new product or change item price in existing order. http://dev.virtuemart.net/cb/issue/2502

Hope these works, pleace test xD
Title: Re: VAT based on shipping address
Post by: Geister on June 20, 2009, 10:37:05 am
Yes, now it all seems to work. To me it's a breakthrough!!! Many thanks!
Title: Re: VAT based on shipping address
Post by: mauri on June 20, 2009, 20:26:55 pm
I have edit files again, in post with attached files.

pleace test, edit order backend(change product price, add item)
and give feedback.
Title: Re: VAT based on shipping address
Post by: Geister on June 20, 2009, 21:15:03 pm
Flaws found:

1) in the "based on shipping mode" after first putting an EU-address, the Total price is correct, but the raw TAX TOTAL with the VAT is not shown.
It appears when you proceed to Payment method. (I don't remember if it was shown before, but after ADDING A NEW SHIPPING US-ADDRESS (before going to Payment method), the raw TAX TOTAL appears with 0.00 as it should be). (In EU-mode the raw TAX TOTAL is displayed OK)

If you UPDATE BILLING ADDRESS and put again EU-address, the raw TAX TOTAL disappears again.

2). Czech Republic, France  are not recognized as EU-countries. With Germany it's all right, but if I put the address in Prague or Paris, the system does not add VAT as if that's a US-address. I did not check other countries. I used Czech Republic and France just casually, the first that came to my mind.
(as far as I remember it was OK in the previous versions of the files)


In EU-mode no bugs found.
Title: Re: VAT based on shipping address
Post by: Geister on June 22, 2009, 12:56:38 pm
One more bug

1. Create a product or open an existing test product without a discount.
2. Enter a product price (eg. 20 GBR) and save.
3. Go to the shop and open that product. You will see 20 GBR.
4. Go back to the product admin and add any Discount Type (eg. 6 GBR). Save.
5. Go back to the shop and refresh. You will see product price 20 GBR-6GBR=14 GBR.
so far so good...

6. Go back to the product admin and remove the Discount Type (none). Save. The Discounted Price disappears and again the product price must be 20 GBR.
7. Go to the shop and open that product again. You will see that the product price is still 20 GBR-6GBR=14 GBR.

The only way to remove the discount price is to delete the product completely and create it from the beginning.
Title: Re: VAT based on shipping address
Post by: mauri on June 22, 2009, 16:28:55 pm
Flaws found:

1) in the "based on shipping mode" after first putting an EU-address, the Total price is correct, but the raw TAX TOTAL with the VAT is not shown.
It appears when you proceed to Payment method. (I don't remember if it was shown before, but after ADDING A NEW SHIPPING US-ADDRESS (before going to Payment method), the raw TAX TOTAL appears with 0.00 as it should be). (In EU-mode the raw TAX TOTAL is displayed OK)

If you UPDATE BILLING ADDRESS and put again EU-address, the raw TAX TOTAL disappears again.

2). Czech Republic, France  are not recognized as EU-countries. With Germany it's all right, but if I put the address in Prague or Paris, the system does not add VAT as if that's a US-address. I did not check other countries. I used Czech Republic and France just casually, the first that came to my mind.
(as far as I remember it was OK in the previous versions of the files)


In EU-mode no bugs found.
1)This is OK. I have 'test based on shipping mode' with original files, and Total tax shows only when you select shipping address.

Should we add the registered customer shipping address, before select shipping address?

2)Can´t confirm. If you have set Czech Republic and France taxrates in backend, they should show :o
Title: Re: VAT based on shipping address
Post by: Geister on June 22, 2009, 16:58:15 pm
2)Can´t confirm. If you have set Czech Republic and France taxrates in backend, they should show :o

No, I haven't...:) Thanks!
Title: Re: VAT based on shipping address
Post by: mauri on June 22, 2009, 18:37:23 pm
When use "based on shipping address", there must be taxrate in all countries where you want tax.
EU mode you don´t need taxrates in eu countries, because these taxed based on vendor address(your shop country)

I have updete ALL files again. There is basket.php, to "show registered customer shipping address tax" before he select shipping address, if user is registered and "based on shipping mode"
Title: Re: VAT based on shipping address
Post by: Geister on June 23, 2009, 11:20:02 am
I have updete ALL files again.

To make sure that I understood you right. Do you mean you updated the LIST of all files or ALL the files?
I've downloaded all files, but the first 3 files seem to be dated 20 June around 15:48. I had those files since the previous update. Only basket.php was added.
Title: Re: VAT based on shipping address
Post by: Geister on June 23, 2009, 18:45:05 pm


-------------------------

And just to outline the last, but not least, this is how the taxation should work really to fully comply with the legislation in EU:

http://forum.virtuemart.net/index.php?topic=57171.msg186952#msg186952

Title: Re: VAT based on shipping address
Post by: mauri on June 23, 2009, 20:46:01 pm
You can set shipping vat when you edit a Shipping Rate.
Title: Re: VAT based on shipping address
Post by: Geister on June 23, 2009, 21:15:40 pm
You can set shipping vat when you edit a Shipping Rate.

Ups... Correct. :)
It's a new field.
Title: Re: VAT based on shipping address
Post by: agrupe on August 28, 2009, 12:14:55 pm
Hi,
I have tried the new code but it does not work for EU-customers with VAT-ID (tax has to be "0%" in that case). VAT is always displayed (in the checkout area) on German 19% which is correct for EU-endusers but not for EU-companies with VAT-ID.

I'm working in EU-mode.

Thanks for any help

Andreas
Title: Re: VAT based on shipping address
Post by: Geister on August 30, 2009, 13:07:51 pm
Hi,
I have tried the new code but it does not work for EU-customers with VAT-ID (tax has to be "0%" in that case). VAT is always displayed (in the checkout area) on German 19% which is correct for EU-endusers but not for EU-companies with VAT-ID.

I'm working in EU-mode.

Thanks for any help

Andreas

http://forum.virtuemart.net/index.php?topic=57171.0;topicseen
Title: Re: VAT based on EU tax mode
Post by: mauri on September 04, 2009, 18:57:38 pm
Hi,
I have tried the new code but it does not work for EU-customers with VAT-ID (tax has to be "0%" in that case). VAT is always displayed (in the checkout area) on German 19% which is correct for EU-endusers but not for EU-companies with VAT-ID.

I'm working in EU-mode.

Thanks for any help

Andreas
Hi agrupe and others who have the euvat id issue.
Can you test this fix.
Download and unzip the attached file.
Backup or rename the file:
/administrator/components/com_virtuemart/classes/ps_product.php
Upload unzipped (ps_product.php) to:
/administrator/components/com_virtuemart/classes/
Test and give feedback.

UPDATED attached file!!!!!
UPDATED again - Now it checks if customer country and vendor country are in EU.
Checks if customer country and vendor country are not same EU country.
UPDATED If customer outside of EU, no VAT. The topic subject is wrong, this fix is only if shop taxmode is european tax mode
UPDATED with all EU_VAT rules
UPDATED
FILE IS DELETED, BECAUSE THIS IS FIXED IN NIGHTLY BUILD 1.1 AND SOON COMING 1.1.4 VERSION







Title: Re: VAT based on EU tax mode
Post by: mauri on September 06, 2009, 10:03:15 am
In first attached file there is a test row.
Delete test row 1556:
 echo TAX_MODE.'TAX_MODE'.$auth["user_id"].' '.$vat_id;
or Dowload updated attached file
Title: Re: VAT based on EU tax mode
Post by: mauri on September 06, 2009, 16:43:45 pm
File updatet again,I think the new attached file hanles the euVatId TAX problem.
There is one thing to do, if customer have valid EUVATID and changes the shipping address to non EU country or same country as vendor, VAT must add to the product prices.
Title: Re: VAT based on shipping address
Post by: lumix1991 on September 07, 2009, 10:41:34 am
File updatet again,I think the new attached file hanles the euVatId TAX problem.
There is one thing to do, if customer have valid EUVATID and changes the shipping address to non EU country or same country as vendor, VAT must add to the product prices.

Dear Mauri,
We have tested this in the European Union mode, the updated file downloaded today but found some issues that remain and have a correction on the VAT that you are going to fix. Here are our short test results with :
1. Private customer from EU (incl. vendor's country): must pay VAT. [OK]
2. Private and business customer from outside EU: no VAT. [NOT OK, shows 19% VAT where it should be 0%]
3. Business customer from EU, but not from the vendor's country: no VAT. [NOT OK, shows 19% VAT with VIES validated VAT number]
4. Business customer from EU and from the vendor's country: must pay VAT. [OK]

We must also note that VAT is always set by the billing address and has nothing to do with the shipping address. The ILS tax system only accounts for the billing address. It would not be logical to charge taxes because the buyer shipping adress is outside the suppliers country and within the EU. Also if he ships it outside the EU then still the regular billing address rules apply. You really should not be changing this because we would have to ask you to how to undo this!

We would appreciate fixes for items 2 and 3.
Title: Re: VAT based on EU tax mode
Post by: mauri on September 07, 2009, 17:31:59 pm
Hi lumix1991
Is this right:
When using European Union mode:
All customers from outside EU don´t pay VAT, if have valid EUVATID or not.
Title: Re: VAT based on EU tax mode
Post by: mauri on September 07, 2009, 19:06:35 pm
OK, the file is updated.If customer is outside of EU, no VAT.
Give feedback  ;D
Title: Re: VAT based on shipping address
Post by: lumix1991 on September 08, 2009, 09:01:44 am
Hi lumix1991
Is this right:
When using European Union mode:
All customers from outside EU don´t pay VAT, if have valid EUVATID or not.


Hi Mauri,

Yeah! that works fine now! all customers (private and bussiness) from outside EU don't have to pay VAT.
But one point is still not working:
"3. Business customer from EU, but not from the vendor's country: no VAT. [NOT OK, shows 19% VAT with VIES validated VAT number]"

If you can fix this point, the whole VAT system is working fine!
Title: Re: VAT based on shipping address
Post by: mauri on September 08, 2009, 10:27:12 am
Hi lumix1991
Is this right:
When using European Union mode:
All customers from outside EU don´t pay VAT, if have valid EUVATID or not.


Hi Mauri,

Yeah! that works fine now! all customers (private and bussiness) from outside EU don't have to pay VAT.
But one point is still not working:
"3. Business customer from EU, but not from the vendor's country: no VAT. [NOT OK, shows 19% VAT with VIES validated VAT number]"

If you can fix this point, the whole VAT system is working fine!

In my test site, it works.
Business customer from EU, but not from the vendor's country: no VAT, with VIES validated VAT number
Title: Re: VAT based on shipping address
Post by: mauri on September 08, 2009, 12:32:23 pm
lumix1991 , what is your shop country when you test the file?
Title: Re: VAT based on shipping address
Post by: praymond on September 09, 2009, 07:44:45 am
Hi Mauri,

I'm in Australia and has similar issue with GST instead of VAT. 

THis is a major problem across VM and needs fixing in the core files.

Anyway, I have installed your files and tested.  All good so far as far as not applying GST to orders from other countries.  However the "Tax/GST Total" displayed in checkout is not adding the Tax from the products only tax from the shipping. The total of the products, tax and shipping is correct. I'm sure this is a minor fix but I'm not sure what code needs fixing.

Title: Re: VAT based on shipping address
Post by: praymond on September 09, 2009, 11:04:08 am
Mauri, one more thing I picked up with this hack.  After running through testing this hack I noticed that the shop front prices have reverted back to displaying price (ex tax/GST) and the text doesn't display "inclusive of XX% tax" which is not good since here in Australia  by law, Australian businesses selling to consumers are required to display prices that include, or clearly show, the Goods and Services Tax (GST) component.

The problem with your hack is unless you are logged in you don't get the price displayed with the inclusive or exclusive tax.  I need it to display the Australian price inclusive of GST by default.

Any help you can provide would be really greatful.

Regards
Paul

Title: Re: VAT based on shipping address
Post by: mauri on September 10, 2009, 20:11:52 pm
Hi praymond, This fix is only EU countries and EU_VAT_ID.
Can you tell me what is GST?

EU VAT :

EU Customers, valid EU_VAT_ID   ,Shipping address in the shop country   ,VAT yes
Customers from outside the EU   ,Shipping address inside the EU      ,VAT yes
Other EU customers      ,Shipping address inside the EU      ,VAT yes

Customers from outside the EU   ,Shipping address outside the EU  ,VAT no
EU Customers, valid EU_VAT_ID   ,Shipping address outside the EU  ,VAT no
EU Customers, valid EU_VAT_ID   ,Shipping address inside the EU, but not the shop country ,VAT no
Other EU customers      ,Shipping address outside the EU   ,VAT no
Title: Re: VAT based on shipping address
Post by: rian on September 21, 2009, 07:31:15 am
does this fix only work in rc1.1.4 or also in 1.1.3, i have exactly the same problem with eu-tax-mode and i am looking for a quick solution

thank you very much!!
Title: Re: VAT based on shipping address
Post by: rian on September 21, 2009, 11:00:03 am
i tried it with the newest nightly build, with or without the modified files it still displays vat, altough i updated my user with a correct number and changed the country.

maybe that has something to do with that the user also doesn't get moved to the defined shopper group after updating a vat-number?
Title: Re: VAT based on shipping address
Post by: mauri on September 21, 2009, 16:07:31 pm
OK, file updated.
http://forum.virtuemart.net/index.php?topic=56983.msg197079#msg197079
Title: Re: VAT based on shipping address
Post by: rian on September 21, 2009, 17:04:44 pm
thank you very much for your quick response.

ok, dont know, if i am doing something wrong: here's what i am doing.
1.) i have one user (no vat-number, same country as shop --> adds vat --> correct
2.) change the user-detail, add vat-number, still same country as shop --> adds vat --> correct
3.) change the country of the user to another eu-country, no vat-number --> adds vat --> correct
4.) add a vat-number to this user (that now has different country than shop, but also eu) --> still adds vat!! this case should be no vat!

5.) add country of the user to switzerland --> no vat --> correct
Title: Re: VAT based on shipping address
Post by: mauri on September 21, 2009, 19:01:50 pm
thank you very much for your quick response.
ok, dont know, if i am doing something wrong: here's what i am doing.

4.) add a vat-number to this user (that now has different country than shop, but also eu) --> still adds vat!! this case should be no vat![/b]

Have you add the same country vat-number, what user country is?
e.g. DEXXXXXXXX - user country Germany.
Title: Re: VAT based on shipping address
Post by: rian on September 22, 2009, 06:24:48 am
yes of course!
what i did not test, is what happens with new users, i only checked with updates of one existing user.

thank you!
Title: Re: VAT based on shipping address
Post by: hotelathome on October 04, 2009, 04:00:53 am
I downloaded the 4 files to my site, it fixed the tax problem i was having when making adjustments an order in the back end, it now adds the tax, but i now have a warning that appears in the back end:
Warning: unknown TAX_MODE "13"
this warning now also appears all over my website, when customers click on any of my products.  Ahhhh,
what does this mean, and how do I fix it.

******SOLVED************
I KNOW THE FOLLOWING IS FOR AUSTRALIAN GST NOT VAT BUT...

Fixed adding gst to orders in back end when adding or altering orders
For me at least.
I have an aussie website and used the fixes in this forum to set up for GST http://forum.virtuemart.net/index.php?topic=54517.30
I then downoaded 3 files only from this forum
http://forum.virtuemart.net/index.php?topic=56983.0
ps_product
ps_order change
basket
If I installed the ps_checkout I got a TAX ERROR "13" on my website.
Worked for me, Hope it works for you too.
Title: Re: VAT based on shipping address
Post by: mauri on October 04, 2009, 12:18:36 pm
hotelathome. There is no TAX_MODE 13. The tax mode is stored wrong in database.
There are only three modes:
TAX_MODE 0   Based on shipping address
TAX_MODE 1   Based on vendor address
TAX_MODE 17749   EU_MODE

Try this. Go backend (VM-Admin-Configuration)and change tax mode to 'EU_MODE', Apply or Save. Change tax mode back to 'Based on shipping address' and Save.
Title: Re: VAT based on shipping address
Post by: pepe2907 on October 07, 2009, 17:32:37 pm
  /*Guys help me on this please:

My shop /www.famasalescoffee.com/ uses Joomla 1.5.14 and VM 1.1.3

For my checkout I use files of mauri /reply No 5/ with his updated ps_product.php file
and it works good for me. It returns products without taxes, calculates the subtotal, adds shipping /on second page - I use 2 stages checkout/, calculates total value /without tax, $order_total_display/ which I noted as "Total Without Tax" and separately returns the total tax /I noted it Sales Tax, it's $tax_display global variable/.
To this point it works fine for me. I use tax based on shipping address with only two values - 0.00 for interstate shipment and  8.xx percent tax for instate shipment. I don't have any discounts.

The only thing I need is a total value of Total Without Tax + Sales Tax.
I need to add it at the end noted as Full Total. But as $order_total_display and  $tax_display contain strings I can't just calculate the sum.
This sum is mostly important for this page.

May somebody help me to get this sum from somewhere or to calculate it?

I'll be very grateful if somebody helps me on this.
Thanks */

Guys,
Sorry I bothered You. I solved it by myself.
It was a stupid mistake. I put one of the files on a wrong place and begin to edit it and as nothing happened as expected I went crazy unable to understand why it isn't working as it should :).
Title: Re: VAT based on shipping address
Post by: hotelathome on March 31, 2010, 00:37:30 am
I have discovered another issue with this.
If you add a discount in the back-end. The tax isnt getting changed.
The original tax amount is still showing.
Title: Re: VAT based on shipping address
Post by: mauri on April 02, 2010, 22:27:40 pm
I have discovered another issue with this.
If you add a discount in the back-end. The tax isnt getting changed.
The original tax amount is still showing.
In VirtueMart configuration you can select:
Subtract payment discount before tax/shipping
Title: Re: VAT based on shipping address
Post by: hotelathome on April 08, 2010, 01:42:01 am
I cannot select the Subtract payment discout. It messes with the totals in the customer order view and the backend view when using coupon discounts. The amounts dont match up. It looks fine for the customer at check out, but if they log in to look at their order or pay via paypal the amounts get mucked up.
Title: Re: VAT based on shipping address
Post by: ozswisssurf on May 31, 2010, 23:47:45 pm
Mauri,

We use VM 1.1.4, the store is based in switzerland (incl. VAT), we ship international and we've configured VAT based on shipping address and found a bug (Total Tax: is wrong) when no shipping address is given because the user checks "Same as Billing address".

Check this post: http://forum.virtuemart.net/index.php?topic=70966.0


Maybe you can help us, it's urgent we want to go online in 10 days.

Best regards,
Mark
Title: Re: VAT based on shipping address
Post by: mauri on June 01, 2010, 18:37:36 pm
ozswisssurf
In VM backend. What taxrates have you set to :
- switzerland
- other countries
Title: Re: VAT based on shipping address
Post by: ozswisssurf on June 08, 2010, 16:15:35 pm
Mauri,

GREAT you responded. We go online in 4 days the time is running.

Originaly I set to "Switzerland" and then I added "France" with 0.0000 for test purpuses.

Thanks for your help
ozswisssurf
Title: Re: VAT based on shipping address
Post by: bmizes on July 30, 2010, 21:52:39 pm
Mauri,

I have a related problem that was mentioned at the beginning of the thread but never actually addressed.  In the US, many states require tax to be calculated on the cost of the item plus shipping; that is, the shipping is to be taxed as well.  Virtuemart seems to assume that in all states in the US, shipping is not part of the tax calculation.  How can we get virtuemart to base the tax on the total of shipping plus the cost of the items?  Thanks.  Barry
Title: Re: VAT based on shipping address
Post by: mauri on August 01, 2010, 14:56:09 pm
Go virtuemart backend, and :
Store -> Shipping Module List -> Klick the modulename you are use
Find tax class or tax ID.
If you use Standard Shipping Module, klick all rates and add tax in tax ID
Title: Re: VAT 7,6 for SWITZERLAND CRITICAL!
Post by: vale on September 16, 2010, 12:46:07 pm
Hello,

i found a problem.
i want to add to the tax tab for SWITZERLAND 7,6 and is not working.

how i add 0.7,600 to the tax tab.

Thanks

Regards
Vale
Title: Re: VAT based on shipping address
Post by: mauri on September 16, 2010, 15:46:26 pm
0.076

The tax rate, as a decimal value. For example, 7.6% would be entered as 0.076
Title: Re: VAT based on shipping address
Post by: tcherno on October 27, 2010, 01:50:27 am
Hey!

Thank you very much for this little but VERY useful hack!

For Switzerland, we only need to apply 7.6% VAT if delivered in CHE and remove VAT if delivered outside CHE. So simple ;)

Just a "little" problem: your hack give us the ability to display prices with VAT if customer not logged in BUT the child products aren't displayed the same way (with VAT) if we didn't entered the price and VAT% in EACH child product.
The price is displayed without tax.

All the infos are supposed to be the same as the parent product.

Is there a way to display child products price with VAT the same way?
Without having to enter infos for each?

Thank you very much!
Title: Re: VAT based on shipping address
Post by: hotelathome on October 27, 2010, 01:55:59 am
I had to add the price and vat (our tax is GST) for EACH child product to get it to work. Lots of data entry, but worth it to get it to work.
Title: Re: VAT based on shipping address
Post by: tcherno on October 27, 2010, 23:26:15 pm
Hello!

Thank you :)

Yes, I understand if we enter price and VAT for each child it will work, but is there a way to not have to do it?

I'm sure people will forget some product and it will be the start of big trouble... ;)

Maybe we can apply the same idea to the child products price display?
But we have to know where to do it.

Thank you!
Title: Re: VAT based on shipping address
Post by: mauri on October 30, 2010, 12:17:48 pm
Hi tcherno.
Make litle hack in:
/administrator/components/com_virtuemart/classes/ps_product.php

Find Rows 1598-1599:
Code: [Select]
$tax_rate_id = ps_product::get_field($product_id, 'product_tax_id');
if( $tax_rate_id == 0 ) {
Hack like this:
Code: [Select]
$tax_rate_id = ps_product::get_field($product_id, 'product_tax_id');
$product_parent_id = ps_product::get_field($product_id, 'product_parent_id');
if( $tax_rate_id == 0 && $product_parent_id ) {
$tax_rate_id = ps_product::get_field($product_parent_id, 'product_tax_id');
}
if( $tax_rate_id == 0 ) {


ADDED:
And make sure in Rows 1484-1486:
Code: [Select]
else {
$_SESSION['taxrate'][$ps_vendor_id] = 0;
}
Are hacked like this:
Code: [Select]
else {
// $_SESSION['taxrate'][$ps_vendor_id] = 0;

// let's get the store's tax rate
$q = "SELECT `tax_rate` FROM #__{vm}_vendor, #__{vm}_tax_rate ";
$q .= "WHERE tax_country=vendor_country AND #__{vm}_vendor.vendor_id=1 ";
// !! Important !! take the highest available tax rate for the store's country
$q .= "ORDER BY `tax_rate` ASC";
$db->query($q);
if ($db->next_record()) {
$_SESSION['taxrate'][$ps_vendor_id] = $db->f("tax_rate");
}
else {
$_SESSION['taxrate'][$ps_vendor_id] = 0;
}
return $_SESSION['taxrate'][$ps_vendor_id];

}
Title: Re: VAT based on shipping address
Post by: tcherno on November 02, 2010, 11:53:32 am
Hi mauri!

I will try it today.

THANK YOU so much!
Title: Re: VAT based on shipping address
Post by: tcherno on November 03, 2010, 17:06:54 pm
Youhoooouuuuu!

It seems to work! :D

Thank you very much!

This will be useful for a lot of people in Switzerland.
Title: Re: VAT based on shipping address
Post by: zanardi on February 13, 2011, 15:43:38 pm
People, i considered including this in Virtuemart 1.1.8 but i think it should remain an external hack. I think someone may want to be able to have different taxes for different child products.
Title: Re: VAT based on shipping address
Post by: kleinbaas on April 16, 2011, 02:35:55 am
Hi tcherno.
Make litle hack in...

Hi Mauri. Any chance you can give me a copy of your original hacked files, they have been removed as this issue should be fixed in version 1.1.5, but its still not working for me.
I am hoping if I can see where you made changes if would give me a clue to fix my problem (shipping tax applied only on one checkout screen and then never again).

Thanks
Title: Re: VAT based on shipping address
Post by: Liewilyn on August 26, 2011, 11:15:40 am
I'm running a VM 1.1.4 can you please send me back the hacked files for this bug... Just really in need... thanks in advance
Title: Re: VAT based on shipping address
Post by: vowels_pupil on January 24, 2013, 22:49:35 pm
I have virtue mart 1.1.4 , and default language is portugues, i place an order  in final confirmation order  total price for instance is 100.50 including all options and vat then its not actually saving in order confirmation, when i check order placed  total price is not comming. how can i fix this one. please help