Author Topic: Remove VAT from Subtotal in e-mail  (Read 90496 times)

SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Remove VAT from Subtotal in e-mail
« on: December 08, 2008, 02:50:39 AM »
Hello everyone!

I have a huge problem which I have much difficulties with solving. I have spent several hours on trying to solve this, and now need your help! I am very grateful if anyone can help me!

The problem in that the value of Subtotal in the e-mail confirmation is including VAT, when it should be excluding VAT!

Please see the following images.

This is how it looks in the cart on the website.


This is how it looks in the confirmation e-mail.


The problem is that $order_subtotal in components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php is including VAT! How do I remove VAT from $order_subtotal?

I am not the only one with this problem. People in these threads have the same problem:
http://forum.virtuemart.net/index.php?topic=42804.0
http://forum.virtuemart.net/index.php?topic=47037.0

I am very grateful for any answer!

SnakeDragon

bubster

  • Beginner
  • *
  • Posts: 19
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #1 on: December 09, 2008, 11:11:15 AM »
Hi,

I have the very same problem.  If anyone can help it would be much appreciated.

Our UK based online store is busy and our customers are getting emails with the subtotal including vat.

I need the subtotal without vat please.

regards,

Bub

bubster

  • Beginner
  • *
  • Posts: 19
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #2 on: December 09, 2008, 14:46:09 PM »
Hi,

Could any please advise how I can remove the tax being applied to $order_subtotal in the html and text email confirmation please

Here is the coding for the email confirmation found at components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php

<tr class="Stil1">
<td colspan=4 align=right>&nbsp;&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="Stil1">
<td colspan=4 align=right><?php echo $VM_LANG->_('PHPSHOP_ORDER_PRINT_SUBTOTAL') ?> :</td>
<td><?php echo $order_subtotal ?></td>
</tr>


This shows the Subtoal inclusive of tax.  I need this to be exclusive.

If anyone could just please point me to the file that provides the $order_subtotal I can try to remove the tax myself, just unsure where to edit and I've got our company accountant spitting fire!!!

Any help is much appreciated.

Regards,

Bub


SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #3 on: December 09, 2008, 15:04:00 PM »
The file that provides $order_subtotal is located in joomla_root/administrator/components/com_virtuemart/classes/ps_checkout.php.

I have tried to modify it myself but did not succeed. If you solve it, please let me/us know the solution!

klout

  • Beginner
  • *
  • Posts: 1
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #4 on: December 09, 2008, 23:46:50 PM »
Same problem here. 

I'm in the UK and urgently require vat removing from the Sub Total in both HTML and Text emails.  All is ok in Print View.

Not happy to set our site live before this is resolved.

I've come across several post requesting the same issue with no solution.

Can anyone help please.

SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #5 on: December 12, 2008, 15:29:15 PM »
Has anyone found a solution to this problem yet? If so, please share your information!

dwsmart

  • Beginner
  • *
  • Posts: 7
    • Website Centre
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #6 on: December 16, 2008, 17:18:24 PM »
in administrator/components/com_virtuemart/classes/ps_checkout.php you'll find this following code around line 1941 (was in mine)
Code: [Select]
} 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'));
}

Change it to:
Code: [Select]
} 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'));
}

You might also like to see the following post about correcting the tax total to account for shipping fees.

http://forum.virtuemart.net/index.php?topic=46209.0

hope that helps, it fixed my clients j1.5.7 vm1.1.2 site
Website Development : http://www.websitecentre.co.uk

SnakeDragon

  • Jr. Member
  • **
  • Posts: 61
Re: PLEASE HELP! - Remove VAT from Subtotal in e-mail - URGENT!
« Reply #7 on: December 16, 2008, 19:50:30 PM »
Wow!! Thank you so much! You are a savior! :D

RassinNL

  • Beginner
  • *
  • Posts: 13
Re: Remove VAT from Subtotal in e-mail
« Reply #8 on: May 27, 2009, 16:30:36 PM »
I tried the solution but now the subtotal is 0.00 Were is my bad?

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: Remove VAT from Subtotal in e-mail
« Reply #9 on: June 10, 2009, 12:34:51 PM »
I have this issue on confirmation text email: the subtotal is wrong rounded (with few cents addition).

Anyone pls confirm and maybe help fix?
Danny

briggs

  • Beginner
  • *
  • Posts: 6
Re: Remove VAT from Subtotal in e-mail
« Reply #10 on: February 11, 2010, 22:02:29 PM »
Hi I am in UK too and I am having this problem..

My web was fine all this time for last few months. in UK for last year we had VAT 15% now change back to 17.5%. so I thought it would be so simple of going in admin panel, virtuemart and than change tax rate.I have manage to do so how ever after the change the cart behaving weird.

I have got 4 step simple cart. the 4th step (preview order page is absolutely fine) but on page (steps of checkout cart) page 1,2,3 the sub total is wrong.

unit prices is right which is £10.00   VAT (tax) is right which £1.75 BUT SUBTOTAL is wrong £10.22 and again Subtotal: is wrong £10.22
    
Total VAT:   £1.75 OK
Total:   £11.97 The Calculation is ok

this happens to checkout steps 1, 2, and 3 the 4th step is fine....

also after changing tax the checkout steps and last step the tax showing ok but when I get confirmation email, the tax on that is still showing old 15% and not 17.5%

Please help

Thanks in advance

Briggs

bvega

  • Beginner
  • *
  • Posts: 2
Re: Remove VAT from Subtotal in e-mail
« Reply #11 on: July 02, 2010, 19:05:52 PM »
dwsmart, friend, I'll be eternally grateful for this salucion, had hours to be modifying the file that I could not figure it out, THANKS and thanks a million times, I tested and works perfectly, VirtueMart 1.1.4 stable version

in administrator/components/com_virtuemart/classes/ps_checkout.php you'll find this following code around line 1941 (was in mine)
Code: [Select]
} 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'));
}

Change it to:
Code: [Select]
} 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'));
}

You might also like to see the following post about correcting the tax total to account for shipping fees.

http://forum.virtuemart.net/index.php?topic=46209.0

hope that helps, it fixed my clients j1.5.7 vm1.1.2 site


bvega

  • Beginner
  • *
  • Posts: 2
Re: Remove VAT from Subtotal in e-mail
« Reply #12 on: July 02, 2010, 19:12:33 PM »
example of how it turned out my confirmation email

Artículos
Cantidad    Nombre    SKU    Precio    Subtotal
1    Panda Global Protection 2010 - Retail Box - 3L    A12GP10    $44.98    $44.98
1    Panda Internet Security 2010 - Retail Box - 3L    A12IS10    $39.98    $39.98
1    Panda Antivirus Pro 2010 - Retail Box - 3L    A12AP10    $24.98    $24.98
1    Panda Antivirus for Ultra Portables - Retail Mini Box 1 L    A12PNTMB1    $11.50    $11.50
1    NANO BLUETOOTH USB DONGLE    NW200NXT03    $12.50    $12.50
1    ADAPTADOR USB LAN 54 MBPS INALÁMBRICO    NW230NXT27    $17.60    $17.60
100    ROUTER INALAMBRICO SOLARIS 300    ARN02304U1    $60.77    $6,077.00
1    ROUTER INALAMBRICO STEALTH 300    ARN00304U1    $63.71    $63.71
      
Subtotal :    $6,292.24
Envío :    $0.00
Impuesto total :    $817.99
Total:    $7,110.23

chong

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: Remove VAT from Subtotal in e-mail
« Reply #13 on: November 03, 2015, 11:26:43 AM »
Hi,

You can do some custom on the invoice files (/var/www/sitename/components/com_virtuemart/views/invoice/tmpl).
You can call Virtuemart Class and get the cart's subtotal amount.

Example :

$cart = VirtueMartCart::getCart();
$pricewithouttax = $cart->pricesUnformatted['priceWithoutTax'];

not sure about "pricesUnformatted['priceWithoutTax']" if it's correct. try print_r($cart) to view all the data to make sure.

Hope it helps.