Total Tax Per Tax Group on Quotes and Invoices

Hi

In Croatia we need to show total VAT per VAT group on Invoice/qoute… Invoice is not valid unless tax is shown in that way … it mandatory by law

Is it posibble (i did not go customizing to check for strings yet) to have it show in total VAT per VAT Group

so lets say you have one item with 5% tax, one with 13% tax and one with 25% tax…

Sorry about my writing :wink: wrote with mouse :smiley:

This is correct, example from Tax Agency site…

Before 1 is total amout without taxes

  1. Is total of line items that are taxable with 10% tax
  2. Is total of line items that are taxable with 25% tax
  3. Total tax in 10% group
  4. Total tax in 25% group
  5. Total TAX
    After this is total amount with taxes…

This is all minimum information that must be on invoice (discount does not, but this is correct way of displaying it)

I know more and more are geting fiscalisation so i think you need prepare for this especialy in v2…

v1 needs just update if its possible in qoute/invoice template i guess… cose there is information for items in wich tax group they belong… so it should be posible to get it this way…

1 Like

Yes tax rates should be displayed per item… I’ll take a look at this and it will be included in one of the following versions.

did you take a look

in 1.3 its not also like this…

if you saw… under total tax it should have total tax per tac group… like i wrote and gave example…

i see all data is there in db… maybe i can get it just out on invoice, but how can i get sum tax for items in tax group with 5% , sum of tax for items in tax group with 10% tax and etc … and display it on invoice…?

Also i did not get payment method on invoice, i get only ID of payment method…

Yes but I can’t work on all feature requests at the same time. Maybe the next release.

heh language barrier ;/

i meant can i access thru invoice template that data to implement my self? or its needed to make chamges in system… i see all the data in db, just need a pointers how to access it …

Oh sorry, too much to read at the moment… ^^

Place this at the bottom of the template and you’ll get all data you can access:

<pre><?php print_r($invoice); ?></pre>

is there a list of all things i can access this way?

i see i can access also

<?php print_r($item); ?>

Anything else?

Maybe it would be good (well i know you are overworked as it is) to have somwhere list of thing we can access… on wiki somewhere :slight_smile: it would be easier to customize templates that way

i see i can make now some kind of loop

create (hard coded for now) string in php for each tax group and use if the to sum each tax group and print it on invoice :wink:

heh… well hope i’ll learn enough to help, not just ask and give you some work :smiley:

At least all different variables that are used in the templates

yes … that would help a lot :smiley:

i know when i finish customizing i’ll donate this to this project if you want to inclued it in some future version :smiley:

[size=10]Last Update 19.04.2015[/size]

1 Like

@Kovah @andrej

I have a quick fix for this. Its not the best way but it works.

Code:

<?php
$tax_percentages = array();
foreach($items as $item):
	$tax_percentages[$item->item_tax_rate_percent] += $item->item_tax_total;
endforeach;
?>

And show the lines with this:

<?php if ($invoice->invoice_item_tax_total > 0) { ?>
                            <tr>
                                <td class="text-right color-n">
									<?php foreach($tax_percentages as $percentage => $amount) { ?>
										<?php echo lang('item_tax_rate_percent') . " " . $percentage . "%<br>\n"; ?>
									<?php } ?>
                                </td>
                                <td class="text-right color-n">
									<?php foreach($tax_percentages as $percentage => $amount) { ?>
										<?php echo format_currency($amount) . "<br>\n"; ?>
									<?php } ?>										
                                </td>
                            </tr>
                        <?php } ?>

It works for me, i hope this will help with further developing.

regards…

1 Like

*Where can I find this file / page

'and can I get a complete version of the edited file :smiley: ? ’

Hello
Try this Invoice template for (not only) Italian Financial Rules (several tax rates)
I did it according to latest Italian Financial Rules
BR
gsolina

But where can I find the template of the Invoice? (so I can edit it)

hello
at the bottom of my mentioned post there is the link for downloading my template.
then you can store it into the folder views/invoices/pdf

I have this now and I have it almost, but I am stuck

I have the productname Description, Price, Total
But lets see

The product hosting Large

Amount is one, price is €3,72 then you see the tax, but that is the total price and afther that you see the 21% tax and the last one is the total product amount but that is twice €42,78?

Hire I have the script

I want to make it like this
'Product, Description, Amount, Price, Tax (like 21%), total exc tax …, total inc tax
Would be awsome :blush:
rsl.php (13.2 KB)

It’s an old post but it seems that the problem still exist.
I fixed it by adding the selection of the item tax rate name in the file mdl_items.php at row 28.

Before was:

$this->db->select('ip_invoice_item_amounts.*, ip_invoice_items.*, item_tax_rates.tax_rate_percent AS item_tax_rate_percent);

Now is:

$this->db->select('ip_invoice_item_amounts.*, ip_invoice_items.*, item_tax_rates.tax_rate_percent AS item_tax_rate_percent, item_tax_rates.tax_rate_name AS item_tax_rate_name');

and then add this code to the invoice template (I’m using the InvoicePlane template), after the “Subtotal” row:

<?php if ($invoice->invoice_item_tax_total > 0) { ?> 
    <?php $taxes = array();  ?>
    <?php foreach ($items as $item) : ?>
        <?php $taxes[$item->item_tax_rate_name] = $taxes[$item->item_tax_rate_name]+$item->item_tax_total ?>
    <?php endforeach ?>
    
    <?php foreach ($taxes as $tax_name => $tax_amount) : ?>
        <tr>
             <td colspan="5" class="text-right">
                 <?php echo $tax_name; ?>
             </td>
             <td class="text-right">
                 <?php echo format_currency($tax_amount, 3); ?>
             </td>
        </tr>
    <?php endforeach ?>
<?php } ?>

Sorry if it’s not the cleanest way but it works. I’m not good with MVC patterns and I don’t have the time now to elaborate a cleaner code.

Hope it helps.

HI
Was this ever implemented (Tax per item column)
I have added tax rate per item column but client is wanting to display tax amount per item
If not imlemented can anyon eplease rived constant for disply
ie - to display tax rate I have added

<?php echo format_amount($item->item_tax_rate_percent); ?>

What would be the string for tax amount?
Thanks
Iain

Found it

<?php echo format_currency($item->item_tax_total); ?>

Thank you and hoe this may help others