VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: untiponormale on November 22, 2015, 17:06:09 PM

Title: Show subtotal in invoice
Post by: untiponormale on November 22, 2015, 17:06:09 PM
Hello,

I googled everywhere and searched in the forum but I still couldn't find an answer to an apparently trivial question.
I live in Italy and here we need to have invoices with clear distinction between:

Subtotal (or net price)
VAT (IVA, calculated as a percentage on the subtotal)
Total (Subtotal + IVA)

In other terms, we have to show the subtotal in all the invoices.

I am a Virtuemart 1.5 user for another website and I don't have any problem with that: the orders created show clearly the subtotal, the vat (calculated as a percentage on the sum of the products, shipping costs and payment fees) and the total. For the invoice I simply copy and paste the print view of the order and that's it.

However I found this simple task a lot trickier in the new VM3.
The orders view shows a Tax, Discount and Total columns, but there is not a subtotal column (or field) with the sum of the net prices.
This is a huge limitation for italian (and I suppose EU) users which needs to clearly show the subtotal sum.

Is it possible to implement this in some way?

I use VirtueMart 3.0.8
Title: Re: Show subtotal in invoice
Post by: GJC Web Design on November 22, 2015, 17:27:28 PM
You should be on 3.0.12

all the sum totals are available in the invoice templates so study how they are coded and make an over rides to achieve what you want
Title: Re: Show subtotal in invoice
Post by: untiponormale on November 22, 2015, 17:41:43 PM
Thanks for your reply.
Could you please tell me which files should I edit?
Thanks,
Title: Re: Show subtotal in invoice
Post by: GJC Web Design on November 22, 2015, 17:45:03 PM
they are self explanatory... 

components\com_virtuemart\views\invoice\tmpl\....

and components\com_virtuemart\views\cart\tmpl\default_pricelist.php if in cart as well
Title: Re: Show subtotal in invoice
Post by: AH on November 23, 2015, 12:30:26 PM
I use this for the net subtotal:-


<?php if ( VmConfig::get('show_tax')) { ?>
                    <td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax,$this->currency,$qtt)."</span>" ?></td>
                    <?php // quorvia added net total ?>
                    <td align="right" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_discountedPriceWithoutTax,$this->currency,$qtt)."</span>" ?></td>
                <?php ?>