Because i did not see the use of showing the paid amount and invoice balance on a first invoice, i made a change to the pdf-template to have these lines printed only when the amount paid (invoice_paid) was greater then 0.
Below you see the code i used to get the result i wanted. Only the first and last line are inserted by me to get the conditional print of this part of the table.
<?php if ($invoice->invoice_paid > 0){ ?>
<tr>
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
<?php _trans('paid'); ?>
</td>
<td class="text-right">
<?php echo format_currency($invoice->invoice_paid); ?>
</td>
</tr>
<tr>
<td <?php echo($show_item_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
<b><?php _trans('balance'); ?></b>
</td>
<td class="text-right">
<b><?php echo format_currency($invoice->invoice_balance); ?></b>
</td>
</tr>
<?php } else{} ?>
The invoice pdf is okay when i download the pdf. But when the pdf is sent via e-mail, the paid amount and invoice balance lines are still printed.
Anyone out there who could explain the difference in the downloaded and sent template?