Getting New Error after flawless operation

Discuss bugs related to Logic Invoice.
Post Reply
cmurphy060960
Posts: 54
Joined: Mon May 16, 2016 9:51 am

Getting New Error after flawless operation

Post by cmurphy060960 » Tue Oct 04, 2016 10:42 am

Hi Esmond
It's been a while - no news is good news! Been loving Logic Invoice - running smoothly. I check the error logs on occasion and found this today. Not sure why - nothing has changed in the script on my end. I did not upgrade to the latest version by the way.

2016-09-29 14:35:22 - PHP Notice: Undefined index: total in /logic/admin/model/billing/invoice.php on line 18
2016-09-29 14:35:22 - PHP Notice: Undefined index: totals in /logic/admin/model/billing/invoice.php on line 26
2016-09-29 14:35:22 - PHP Warning: Invalid argument supplied for foreach() in /logic/admin/model/billing/invoice.php on line 26

Line 18:

Code: Select all

        $this->db->query("INSERT INTO " . DB_PREFIX . "invoice SET customer_id = '" . (int)$data['customer_id'] . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', company = '" . $this->db->escape($data['company']) . "', website = '" . $this->db->escape($data['website']) . "', email = '" . $this->db->escape($data['email']) . "', payment_firstname = '" . $this->db->escape($data['payment_firstname']) . "', payment_lastname = '" . $this->db->escape($data['payment_lastname']) . "', payment_company = '" . $this->db->escape($data['payment_company']) . "', payment_address_1 = '" . $this->db->escape($data['payment_address_1']) . "', payment_address_2 = '" . $this->db->escape($data['payment_address_2']) . "', payment_city = '" . $this->db->escape($data['payment_city']) . "', payment_postcode = '" . $this->db->escape($data['payment_postcode']) . "', payment_country = '" . $this->db->escape($data['payment_country']) . "', payment_zone = '" . $this->db->escape($data['payment_zone']) . "', total = '" . (float)$data['total'] . "', payment_code = '" . $this->db->escape($data['payment_code']) . "', payment_name = '" . $this->db->escape($data['payment_name']) . "', payment_description = '" . $this->db->escape($data['payment_description']) . "', currency_code = '" . $this->db->escape($data['currency_code']) . "', currency_value = '" . (float)$data['currency_value'] . "', comment = '" . $this->db->escape($data['comment']) . "', status_id = '" . (int)$data['status_id'] . "', date_issued = NOW(), date_due = '" . $this->db->escape($data['date_due']) . "', date_modified = NOW()");
Line 26:

Code: Select all

        foreach ($data['totals'] as $total) {
            $this->db->query("INSERT INTO " . DB_PREFIX . "invoice_total SET invoice_id = '" . (int)$invoice_id . "', code = '" . $this->db->escape($total['code']) . "', title = '" . $this->db->escape($total['title']) . "', value = '" . (float)$total['value'] . "', sort_order = '" . (int)$total['sort_order'] . "'");
Is undefined index related to the database? If so why would something be different all of the sudden. I've made no changes in the past several months to the database.

Any ideas?

Thanks
Chris

User avatar
Esmond
Site Admin
Posts: 285
Joined: Tue Sep 15, 2015 3:08 pm
Location: Singapore
Contact:

Re: Getting New Error after flawless operation

Post by Esmond » Tue Oct 04, 2016 1:49 pm

Do check admin > extensions > totals and ensure that the default total, sub-total etc are enabled. That may be the issue if it's not enabled.

cmurphy060960
Posts: 54
Joined: Mon May 16, 2016 9:51 am

Re: Getting New Error after flawless operation

Post by cmurphy060960 » Tue Oct 04, 2016 9:46 pm

Sub-total and total are enabled. I have Tax disabled as we don't charge tax. These settings have been from the beginning of using Logic so not sure why all the sudden it's throwing errors.

User avatar
Esmond
Site Admin
Posts: 285
Joined: Tue Sep 15, 2015 3:08 pm
Location: Singapore
Contact:

Re: Getting New Error after flawless operation

Post by Esmond » Wed Oct 05, 2016 8:08 am

Hmm... are there plenty of items in the invoice? That may be the cause, so you will need to open up php.ini file, and change your max_input_vars value to a larger number for your PHP.

cmurphy060960
Posts: 54
Joined: Mon May 16, 2016 9:51 am

Re: Getting New Error after flawless operation

Post by cmurphy060960 » Wed Oct 05, 2016 9:47 am

Thanks Esmond - will give it a try and let you know how it goes

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests