[Solved] How to use default terms field

Hello dear invoiceplane community.

first of all, thanks to all contributers, it seems a great tool. I just started working with it.
What I would like to do, is a creating invoices with default terms (something like: "dear client, please pay invoice_total to my bank account until invoice_date_due)…
Therefore I have two questions:
how can I display my default terms? I just don´t get it. Whats wrong with the following

<?php echo nl2br($invoice->default_invoice_terms); ?>

I checked the database, the entry is there unter the name “default_invoice_terms”… Any ideas?
also… can I enter php commands in the default terms field (also in other fields)?

best and thank you so much

In Settings you can define your default terms text. Which will be applied to all invoices by default. I am not quite sure if you can use placeholders for total’s since I didn’t try.

However when you check the template for invoice you can find everything and adjust it to your needs.

            <?php if ($invoice->invoice_terms) { ?>
                

<?php echo lang('terms'); ?>

<?php echo nl2br($invoice->invoice_terms); ?>

<?php } ?>

This code above is displaying the invoice terms which are entered at each invoice.

You could adjust your invoice template to have something like that.

You can find most things in the template as well such as

                                    <?php echo format_currency($invoice->invoice_total); ?>

so you could pretty much just html some text and use several echo’s to your needs.

Cheers.

Hi carsten
thanks for your reply. the thing is, that I can display the invoice_terms, but not the default_invoice_terms… they are different fields. the latter is set on the global invoice settings, the other one individually for each invoice…

??

You can call it with the following:

        <?php echo $this->mdl_settings->setting('default_invoice_terms'); ?> 

I guess usually people do not call the default invocie terms as i guess somewhere in the code when creating a new invoice it’ll set the invoice_terms to what is entered in the default_invoice_terms settings. I haven’t looked up into the code that far though.

So to answer you question. If you want to Print the default_invoice_terms anywhere, you could do it with the code above…

( As well have Seperate Terms as the default can be diffrent from the actual terms )

1 Like

that worked for me. thank you so much :slight_smile: