Author Topic: Shipping Tax in Invoice email not being added to Tax Total  (Read 9801 times)

stevevm

  • Beginner
  • *
  • Posts: 5
Shipping Tax in Invoice email not being added to Tax Total
« on: September 28, 2008, 00:09:09 am »
Have found a slight issue in my VM 1.1.2 
After placing an order and checking out, the invoice emailed to the customer and store admin doesn't add the shipping tax to the Tax Total , the Grand total shows the correctly calculated amount.

tax rate 5%

SubTotal : $39.00
Shipping and Handling Fee : $18.00
Tax Total : $5.02 (Suppose to be $7.34)
Total:  $64.34

SubTotal:      $39.00
Tax Total:    $5.02
Shipping and Handling Fee:    $18.00
Shipping Tax:    $2.32
Total:    $64.34


AS you can see the tax on shipping which is $2.32 hasnt been added to the tax total, but has been added to the Grand Total which is correct.

When the invoice is viewed via the admin area all is shown correctly, its only the emails that are not correct.

SubTotal:      $39.00
Tax Total:    $5.02
Shipping and Handling Fee:    $18.00
Shipping Tax:    $2.32
Total:    $64.34

Can anybody help?

stevevm

  • Beginner
  • *
  • Posts: 5
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #1 on: October 23, 2008, 22:52:11 pm »
Alway the same problem

Can anybody help?

stevevm

  • Beginner
  • *
  • Posts: 5
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #2 on: October 24, 2008, 00:01:11 am »
after some test i find this and is work.

In virtuemart 1.1.2 in /administrator/components/com_virtuemart/classes/ps_checkout.php in line 1788  i change

$order_shipping = $db->f("order_shipping");
$order_shipping_tax = $db->f("order_shipping_tax");
$order_tax = $db->f("order_tax");

to this

$order_shipping = $db->f("order_shipping");
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");

This modification work good for me



SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #3 on: December 16, 2008, 20:00:53 pm »
Thank you so much for your solution! It was very helpful! :D

Bznsman

  • Beginner
  • *
  • Posts: 4
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #4 on: January 23, 2009, 16:02:07 pm »
Thanks for the fix! According to my opinion this should be solved in the next release of VirtueMart.

alibroon

  • Beginner
  • *
  • Posts: 43
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #5 on: January 27, 2009, 14:21:19 pm »
Many thanks for sharing that.
Has this been implemented into the new release?

volksman3

  • Jr. Member
  • **
  • Posts: 91
    • Akira Studio
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #6 on: June 22, 2009, 17:36:53 pm »
Hi,

The fix worked for me and sorted the emails but i still have the problem when i print out orders using the print function in the admin back end cpanel. Is there another section i need to change to alter this so the printed orders show the correct tax output?

Thanks in advance, volksman3
Parachutes are like minds, they only work when they are open!
http://www.akirastudio.co.uk

volksman3

  • Jr. Member
  • **
  • Posts: 91
    • Akira Studio
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #7 on: June 22, 2009, 20:45:09 pm »
Hi Again, I found the fix i needed here - http://forum.virtuemart.net/index.php?topic=52860.msg186829#msg186829

Regards

Volksman3
Parachutes are like minds, they only work when they are open!
http://www.akirastudio.co.uk

biltong

  • Jr. Member
  • **
  • Posts: 116
    • Starfish Websites
  • VirtueMart Version: 3.2.2
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #8 on: April 19, 2011, 14:00:35 pm »
after some test i find this and is work.

In virtuemart 1.1.2 in /administrator/components/com_virtuemart/classes/ps_checkout.php in line 1788  i change

$order_shipping = $db->f("order_shipping");
$order_shipping_tax = $db->f("order_shipping_tax");
$order_tax = $db->f("order_tax");

to this

$order_shipping = $db->f("order_shipping");
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");

This modification work good for me


This change worked for me in VM 1.1.8 and Joomla! 1.5.23 but to be more specific on where to change the code:

In /administrator/components/com_virtuemart/classes/ps_checkout.php

Look for this code at around line 1868:

Code: [Select]
if ($auth["show_price_including_tax"] == 1) {

$order_shipping = $db->f("order_shipping");
$order_shipping += $db->f("order_shipping_tax");
$order_shipping_tax = 0;
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");
}
else {

$order_shipping = $db->f("order_shipping");
$order_shipping_tax = $db->f("order_shipping_tax");
$order_tax = $db->f("order_tax");

}

and replace with this:

Code: [Select]
if ($auth["show_price_including_tax"] == 1) {

$order_shipping = $db->f("order_shipping");
$order_shipping += $db->f("order_shipping_tax");
$order_shipping_tax = 0;
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");
}
else {

$order_shipping = $db->f("order_shipping");
$order_shipping_tax = $db->f("order_shipping_tax");
// $order_tax = $db->f("order_tax");
$order_tax = $db->f("order_tax") + $db->f("order_shipping_tax");

}

I also had a problem with the Sub Total including the item tax in the Purchase Order email sent to the shopper and vendor.

In /administrator/components/com_virtuemart/classes/ps_checkout.php

Look for this code at around line 2028:

Code: [Select]
if ($auth["show_price_including_tax"] == 1) {
  $sub_total += ($dboi->f("product_quantity") * $dboi->f("product_final_price"));
  $shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_final_price"), '', $db->f('order_currency'));
 } else {
  $sub_total += ($dboi->f("product_quantity") * $dboi->f("product_final_price"));
  $shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_item_price"), '', $db->f('order_currency'));
 }

to

Code: [Select]
if ($auth["show_price_including_tax"] == 1) {
  $sub_total += ($dboi->f("product_quantity") * $dboi->f("product_final_price"));
  $shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_final_price"), '', $db->f('order_currency'));
 } else {
  $sub_total += ($dboi->f("product_quantity") * $dboi->f("product_item_price"));
  $shopper_message .= $CURRENCY_DISPLAY->getFullValue($dboi->f("product_item_price"), '', $db->f('order_currency'));
 }

Notice we have changed product_final_price to product_item_price. This must be a bug because product_final_price includes tax and the sub_total should not include tax in the 'else' condition.
Currently using VM 3.2.2 on Joomla 3.7.3 PHP 7.0.17

CreativeDesigns

  • Jr. Member
  • **
  • Posts: 219
    • Creative Designs Studio
  • Skype Name: creative.designs.za
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #9 on: September 14, 2011, 11:30:17 am »
You are AMAZING!!!!!!!!!!!!!!!!!! thank you thank you thank you!!!
Biltong, you saved my life! :) Truly!

CreativeDesigns

  • Jr. Member
  • **
  • Posts: 219
    • Creative Designs Studio
  • Skype Name: creative.designs.za
Re: Shipping Tax in Invoice email not being added to Tax Total
« Reply #10 on: September 14, 2011, 20:08:09 pm »
Since I implemented the above, all of a sudden the prices on the front end of the website are completely wrong. Any idea how or why this would happen?
I started a new post about it here: http://forum.virtuemart.net/index.php?topic=90931.0
All my backend settings seem to be correct..
Any ideas? Please?