VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Lapskaus on January 29, 2015, 08:33:57 AM

Title: Order Confirmation mail Tax listings
Post by: Lapskaus on January 29, 2015, 08:33:57 AM
Hi,

im using joomla 3.3.6 and VM 3.02 and i got some strange tax positions  listed in my confirmation E-mail.
The only tax i set up in the backend is 19% and it gets added to every product price correctly. My cart also shows only my baseprice, the 19% tax and the final price with tax. everything is calculated correctly.

But the emails i receive all list up different numbers of 20% Tax positions, they just show some values but dont effect the product / final price.

So where do those postitions come from, how to get rid of them ?
Title: Re: Order Confirmation mail Tax listings
Post by: jenkinhill on January 29, 2015, 11:04:42 AM
Are you using any overrides?
Title: Re: Order Confirmation mail Tax listings
Post by: Lapskaus on January 29, 2015, 11:44:17 AM
Not for the mails. At least im not overriding anything in the invoice folder and if im not mistake thats where the magic happens  ;)
Title: Re: Order Confirmation mail Tax listings
Post by: Lapskaus on January 29, 2015, 13:45:42 PM
Now i am :


<?php /* 
foreach($this->orderDetails['calc_rules'] as $rule){
  if ($rule->calc_kind == 'DBTaxRulesBill' or $rule->calc_kind == 'DATaxRulesBill') { ?>

    <tr >
      <td colspan="6" align="right" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
      <?php if ( VmConfig::get('show_tax')) { ?>
      <td align="right"> </td>
  <?php ?>
      <td align="right"> <?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?></td>
      <td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?> </td>
    </tr>
    <?php
} elseif ($rule->calc_kind == 'taxRulesBill' or $rule->calc_kind == 'VatTax' ) { ?>

    <tr >
      <td colspan="6"  align="right" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
      <?php if ( VmConfig::get('show_tax')) { ?>
      <td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?></td>
      <?php ?>
      <td align="right"></td>
      <td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?></td>
    </tr>
  <?php
  
}
} */ 
?>



commenting out those lines in the invoice_items.php did the trick.
It seems to me that for each tax rule and item the tax amount is listed up again in the sum at the end of the bill ... but here some questions.
#1 Why list up the tax amounts again in the sum when they are already show for each ordered item and summed up in the "COM_VIRTUEMART_ORDER_PRINT_PRODUCT_PRICES_TOTAL" - Tablerow.?
#2 Where did those 20% Taxes come from, as i said above i did only create a 19% rule.
Title: Re: Order Confirmation mail Tax listings
Post by: p.barg on April 17, 2015, 10:03:56 AM
I do need this listing because the shop handles 2 different tax rates. So I think it's necessary to list them there in this case
(the rates are correct in my case b.t.w.). But what's not nice is that the VAT amounts are not summed up for the different rates. I.E. if
you buy 10 products belonging to 2 different tax groups you get 10 lines (instead of 2 sums) which makes the invoice look very messy...

I'll probably make an override for this, but maybe this can be amended in the core?

Petra
Title: Re: Order Confirmation mail Tax listings
Post by: Frans D on April 17, 2015, 10:57:05 AM
I agree, that the invoice/email parts needs some urgent cleaning up, as it now looks like this (used the pic of another topic);

(http://forum.virtuemart.net/index.php?action=dlattach;topic=129354.0;attach=61957;image)

The invoice_items.php calls for this data, which is also shown in the invoice pdf.

I ripped a lot out of the invoice_items.php so it would look a lot cleaner and the sums add up properly.
However I have only one VAT rule, which makes it easier.

Invoice before;

(http://i.imgur.com/VnAfuq0.jpg)

Invoice now:

(http://i.imgur.com/QK2yLWZ.jpg)

I've enclosed my adapted invoice_items.php if someone wants to use it.
It is of VM version 3.0.6.2.

PS: I also got rid of the discount fields as we don't use them, if someone needs them I can add them and upload an extra version.
Title: Re: Order Confirmation mail Tax listings
Post by: p.barg on April 17, 2015, 12:01:58 PM
Additionally, I just discovered that the displayed amounts aren't correct if the product quantity is more than 1....
The quantity seems not to be taken into account.
Title: Re: Order Confirmation mail Tax listings
Post by: Frans D on April 17, 2015, 14:55:37 PM
I don't have that problem.
I just did a test order of 5 pieces and the calculations and total amounts are correct.
Title: Re: Order Confirmation mail Tax listings
Post by: p.barg on April 17, 2015, 16:35:32 PM
But in your solution you don't have those single listings any longer...
The problem doesn't occur for the complete tax amount, but only in the listings below for the different tax rates.
Or did I misunderstand you?
Title: Re: Order Confirmation mail Tax listings
Post by: Frans D on April 17, 2015, 16:40:05 PM
Nope, I misunderstood you. ;)