Hi,
I would just let you know that the total-amount of an item does not take the discount into account in the standard pdf template of quote and invoice.
solution:
Instead of using:
<td class="text-right">
<?php echo format_currency($item->item_subtotal); ?>
</td>
use:
<td class="text-right">
<?php echo format_currency($item->item_total); ?>
</td>