Copy quote followed by convert to invoice leads to corrupted invoice PDF

Copy quote seems to work
I then edit the copy to reflect changes in the new quote and save it OK
I then convert to invoice OK
I check the invoice which looks OK in browse mode

But

when I open the invoice PDF, the product description column reports PHP errors

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: pdf/nucleomics-billing_proposal.php
Line Number: 161
Backtrace:
File: /var/lib/invoiceplane-1.5.4-nucleomics/application/views/invoice_templates/pdf/nucleomicsbilling_proposal.php
Line: 161
Function: _error_handler
File: /var/lib/invoiceplane-1.5.4-nucleomics/application/third_party/MX/Loader.php
Line: 404
Function: include
File: /var/lib/invoiceplane-1.5.4-nucleomics/application/third_party/MX/Loader.php
Line: 365
Function: _ci_load
File: /var/lib/invoiceplane-1.5.4-nucleomics/application/helpers/pdf_helper.php
Line: 119
Function: view
File: /var/lib/invoiceplane-1.5.4-nucleomics/application/modules/invoices/controllers/Invoices.php
Line: 285
Function: generate_invoice_pdf
File: /var/lib/invoiceplane-1.5.4-nucleomics/index.php
Line: 327
Function: require_once

If I add the PDF footer with debug fields I see that the values for

            <td><?php _trans($item->family_info->family_name); ?></td>

value is replaced by the PHO error block above

and

            <td><?php _trans($item->product_sku); ?></td>

is empty

It seems that the transfer from the original to the copy did not work as expected for these fields; any other user seing this?

PS: When I convert a manually created quote to invoice, all goes right.

Thanks

PPS: i suspect that the copy did not handle custom fields related to the original. Can someone please point me to the php that needs edits and maybe help a bit
Thanks

upgraded to 1.5.9 and the error still is there.

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: pdf/nucleomics-billing_proposal.php
Line Number: 161
Backtrace:
File: /var/www/html/InvoicePlane_v1.5.9/application/views/invoice_templates/pdf/nucleomicsbilling_proposal.php
Line: 161
Function: _error_handler
File: /var/www/html/InvoicePlane_v1.5.9/application/third_party/MX/Loader.php
Line: 464
Function: include
File: /var/www/html/InvoicePlane_v1.5.9/application/third_party/MX/Loader.php
Line: 416
Function: _ci_load
File: /var/www/html/InvoicePlane_v1.5.9/application/helpers/pdf_helper.php
Line: 113
Function: view
File: /var/www/html/InvoicePlane_v1.5.9/application/modules/invoices/controllers/Invoices.php
Line: 269
Function: generate_invoice_pdf
File: /var/www/html/InvoicePlane_v1.5.9/index.php
Line: 325
Function: require_once

How can I unsure that my two extra fields are copied to the clone of the original quote and then found when creating the invoice thereof?

Thanks for any hint to improve the cloning and include:

  • $item->family_info->family_name
  • $item->product_sku

I found this in application/modules/quotes/controllers/Ajax.php ??

 public function modal_copy_quote()
    {
        $this->load->module('layout');

        $this->load->model('quotes/mdl_quotes');
        $this->load->model('invoice_groups/mdl_invoice_groups');
        $this->load->model('tax_rates/mdl_tax_rates');
        $this->load->model('clients/mdl_clients');

        $data = [
            'invoice_groups' => $this->mdl_invoice_groups->get()->result(),
            'tax_rates' => $this->mdl_tax_rates->get()->result(),
            'quote_id' => $this->input->post('quote_id'),
            'quote' => $this->mdl_quotes->where('ip_quotes.quote_id', $this->input->post('quote_id'))->get()->row(),
            'client' => $this->mdl_clients->get_by_id($this->input->post('client_id')),
        ];

        $this->layout->load_view('quotes/modal_copy_quote', $data);
    }

    public function copy_quote()
    {
        $this->load->model('quotes/mdl_quotes');
        $this->load->model('quotes/mdl_quote_items');
        $this->load->model('quotes/mdl_quote_tax_rates');

        if ($this->mdl_quotes->run_validation()) {
            $target_id = $this->mdl_quotes->save();
            $source_id = $this->input->post('quote_id');

            $this->mdl_quotes->copy_quote($source_id, $target_id);

            $response = [
                'success' => 1,
                'quote_id' => $target_id,
            ];
        } else {
            $this->load->helper('json_error');
            $response = [
                'success' => 0,
                'validation_errors' => json_errors(),
            ];
        }

        echo json_encode($response);
    }

Will take a look at this.