Adding custom fields to the invoices table

Hello,

I am trying to add a custom field column to the invoices table. Current version is 1.5.5.

I have added the column to the table as below however in the column I get a errror “Message: Undefined property: stdClass::$invoice_custom_invoice_to”

Note: I am modifying the file here /application/modules/invoices/views/partial_invoice_table.php

		<td class="amount">
			<?php echo ($invoice->invoice_custom_invoice_to); ?>
		</td>

I notice in the documentation it states that you use the column value but I am not sure how to work this out since it does not display in my view on the website. My custom field is on the ‘invoice’ table and the label is ‘Invoice To’.

Appreciate any help and advice.

Many Thanks

Hello,

According to what you say you modify directly in the database and into the code ? DON’T DO THIS.
It will be loss at every update and it’s totally not safe.

Did you follow this procedure to add a custom field ? https://wiki.invoiceplane.com/en/1.5/settings/custom-fields

What are you trying to achieve exactly ?

This was already asked here: Custom fields in partial_invoice_table.php

1 Like

Sorry for not finding that topic first.

I have used the advice there and now I have the invoices table working however when I go to view a client which has invoices against them I get the following error:
Message: Call to undefined method Custom_Fields::get_values_for_fields()
Filename: views/partial_invoice_table.php

Could you assist with that?

Many thanks