Showing total for items without VAT

I need to show for each item in invoices the total without VAT, now the item total in inclusive.
How can I modify 'views/invoice_templates/pdf/InvoicePlane.php ’ (and dependencies) to achieve this?

        ...
        <?php
        foreach ($items as $item) { ?>
            <tr>
                <td><?php echo $item->item_name; ?></td>
                <td><?php echo nl2br($item->item_description); ?></td>
                <td class="text-right">
                    <?php echo format_amount($item->item_quantity); ?>
                </td>
                <td class="text-right">
                    <?php echo format_currency($item->item_price); ?>
                </td>
                <?php if ($show_discounts) : ?>
                    <td class="text-right">
                        <?php echo format_currency($item->item_discount); ?>
                    </td>
                <?php endif; ?>
                <td class="text-right">
                  <!-- the next line shows (item-price x quantity) + VAT-->
                   <?php echo format_currency($item->item_total); ?>
                </td>
            </tr>
        <?php } ?>
        ....

These values are available for items:

See Customize Templates - InvoicePlane Wiki

1 Like

Great,
Thanks Kovah,
Can I also get the product FamilyName for each item (it does not appear now using your debug line)?
Do I need for this to create links to other tables?
Sorry to bother you but I am so close to my needs…

PS: And I do not get product_sku unlike in your picture (I have 1.4.10)

Array
(
 [0] => stdClass Object
 (
 [[item_amount_id] => 11
 [item_id] => 11
 [item_subtotal] => 100.00
 [item_tax_total] => 0.00
 [item_discount] => 0.00
 [item_total] => 100.00
 [invoice_id] => 6
 [item_tax_rate_id] => 0
 [item_product_id] => 5
 [item_date_added] => 2017-03-15
 [item_name] => Basic Data QC and delivery
 [item_description] => Basic Data QC reporting and raw data delivery
 [item_quantity] => 1.00
 [item_price] => 100.00
 [item_discount_amount] =>
 [item_order] => 1
 [item_tax_rate_percent] =>
 [item_tax_rate_name] =>
)

I suspect my helpers/pdf_helper.php is not enough equipped to reach these…

Oh sorry ,the product information will be available in InvoicePlane 1.5.0.
I may add the family too.

do not be sorry, you answered my request for the VAT already with the nice debug trick.
I cannot wait until 1.5 is out, we are starting using IP soon and the prod-family is required for our bookkeepers, the SKU would also be nice in invoices indeed to look like pro invoices that show prod-numbers.

Thanks for your great work.
S

I will send you the code that includes product information and family for items tomorrow

1 Like