PDF Shipping cost

Hello all. I just recently ran across InvoicePlane and I think its awesome. Has all the feature I need except for one important function, “Shipping Cost” Unfortunately I’m not a first rate developer but more a copy & paste developer.

I’m trying to figure out how to add shipping cost to the balance in the pdf. I have created a custom shipping field (invoice_custom_shipping) and figure out how to add it to the pdf invoice (/application/views/invoice_templates/pdf/InvoicePlane.php)

            <td <?php echo($show_discounts ? 'colspan="5"' : 'colspan="4"'); ?> class="text-right">
                <?php echo trans('Shipping'); ?>
            <td class="text-right">
                <?php echo format_currency($invoice->invoice_custom_shipping); ?>

So far so good.

I am stuck on how to add invoice_custom_shipping to invoice_balance to get the total balance.

Any help would be very much appreciated. I know this only adds shipping to the pdf only but it’s better than nothing.

Thank you all.

At some point of the template you should see $invoice->invoice_total or similar. If you don’t use any invoice taxes you may simply add your shipping to this amount.

$invoice->invoice_total = $invoice->invoice_total + $invoice->invoice_custom_shipping

However, the system will not be able to calculate paid invoices and balances anymore.

If it’s a simple amount, why not add it as an item?

Thanks. It seems that in CA a business is required to charge tax on shipping and handling which then makes adding shipping as an item the perfect solution. Thanks for all your help and suggestion.