InvoicePlane v1.1.1 update

Hi, i’ve updated InvoicePlane to v1.1.1, i’ve copied files, go through setup, and now i can see an error after login:

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.00') AS invoice_item_subtotal, IFNULL(ip_invoice_amounts.invoice_item_tax_tot' at line 1

SELECT SQL_CALC_FOUND_ROWS ip_invoice_custom.*, ip_client_custom.*, ip_user_custom.*, ip_users.user_name, ip_users.user_company, ip_users.user_address_1, ip_users.user_address_2, ip_users.user_city, ip_users.user_state, ip_users.user_zip, ip_users.user_country, ip_users.user_phone, ip_users.user_fax, ip_users.user_mobile, ip_users.user_email, ip_users.user_web, ip_users.user_vat_id, ip_users.user_tax_code, ip_clients.*, ip_invoice_amounts.invoice_amount_id, IFNULL(ip_invoice_amounts.invoice_item_subtotal, ip_'0.00') AS invoice_item_subtotal, IFNULL(ip_invoice_amounts.invoice_item_tax_total, ip_'0.00') AS invoice_item_tax_total, IFNULL(ip_invoice_amounts.invoice_tax_total, ip_'0.00') AS invoice_tax_total, IFNULL(ip_invoice_amounts.invoice_total, ip_'0.00') AS invoice_total, IFNULL(ip_invoice_amounts.invoice_paid, ip_'0.00') AS invoice_paid, IFNULL(ip_invoice_amounts.invoice_balance, ip_'0.00') AS invoice_balance, (CASE WHEN ip_invoices.invoice_status_id NOT IN (1, 4) AND DATEDIFF(NOW(), invoice_date_due) > 0 THEN 1 ELSE 0 END) is_overdue, DATEDIFF(NOW(), invoice_date_due) AS days_overdue, (CASE (SELECT COUNT(*) FROM ip_invoices_recurring WHERE ip_invoices_recurring.invoice_id = ip_invoices.invoice_id and ip_invoices_recurring.recur_next_date <> '0000-00-00') WHEN 0 THEN 0 ELSE 1 END) AS invoice_is_recurring, ip_invoices.* FROM (`ip_invoices`) JOIN `ip_clients` ON `ip_clients`.`client_id` = `ip_invoices`.`client_id` JOIN `ip_users` ON `ip_users`.`user_id` = `ip_invoices`.`user_id` LEFT JOIN `ip_invoice_amounts` ON `ip_invoice_amounts`.`invoice_id` = `ip_invoices`.`invoice_id` LEFT JOIN `ip_client_custom` ON `ip_client_custom`.`client_id` = `ip_clients`.`client_id` LEFT JOIN `ip_user_custom` ON `ip_user_custom`.`user_id` = `ip_users`.`user_id` LEFT JOIN `ip_invoice_custom` ON `ip_invoice_custom`.`invoice_id` = `ip_invoices`.`invoice_id` ORDER BY `ip_invoices`.`invoice_date_created` DESC LIMIT 10

Filename: /home/xxxxxxxxxx/public_html/invoice/core/MY_Model.php

Line Number: 91

How to fix it?

A the setup: was there a message that the database was upgraded?

Yes, all of installation was accomplished. I can PM You domain with setup link.

OK, i can’t see a way to send You PM, is there a way to fix this database?

The error is caused by this: ip_'0.00' All those occurences have to be replaced with just '0.00'. You can find the SQL query in the file /application/modules/invoices/models/mdl_invoices.php line 53.
Maybe you should check all files, because this does not exist normally.

Ok, it look’s like this:

   $this->db->select("
        SQL_CALC_FOUND_ROWS ip_invoice_custom.*,
        ip_client_custom.*,
        ip_user_custom.*,
        ip_users.user_name,
  	ip_users.user_company,
  	ip_users.user_address_1,
  	ip_users.user_address_2,
  	ip_users.user_city,
  	ip_users.user_state,
  	ip_users.user_zip,
  	ip_users.user_country,
  	ip_users.user_phone,
  	ip_users.user_fax,
  	ip_users.user_mobile,
  	ip_users.user_email,
  	ip_users.user_web,
  	ip_users.user_vat_id,
  	ip_users.user_tax_code,
  	ip_clients.*,
  	ip_invoice_amounts.invoice_amount_id,
  	IFNULL(ip_invoice_amounts.invoice_item_subtotal, '0.00') AS invoice_item_subtotal,
  	IFNULL(ip_invoice_amounts.invoice_item_tax_total, '0.00') AS invoice_item_tax_total,
  	IFNULL(ip_invoice_amounts.invoice_tax_total, '0.00') AS invoice_tax_total,
  	IFNULL(ip_invoice_amounts.invoice_total, '0.00') AS invoice_total,
  	IFNULL(ip_invoice_amounts.invoice_paid, '0.00') AS invoice_paid,
  	IFNULL(ip_invoice_amounts.invoice_balance, '0.00') AS invoice_balance,
        (CASE WHEN ip_invoices.invoice_status_id NOT IN (1,4) AND DATEDIFF(NOW(), invoice_date_due) > 0 THEN 1 ELSE 0 END) is_overdue,
  	DATEDIFF(NOW(), invoice_date_due) AS days_overdue,
        (CASE (SELECT COUNT(*) FROM ip_invoices_recurring WHERE ip_invoices_recurring.invoice_id = ip_invoices.invoice_id and ip_invoices_recurring.recur_next_date <> '0000-00-00') WHEN 0 THEN 0 ELSE 1 END) AS invoice_is_recurring,
  	ip_invoices.*", FALSE);

There’s no: “ip_‘0.00’” - what should i fix here?

OK, the same error i have on new, clean database after install. Strange. Any ideas how to fix it?

Hey, I’m having semester exams right now. I’ll get back to you later, at the latest in two weeks, when all exams are over. Sorry for that :smile:

Maybe try to install it on a new server, with a new server? (At least as temporary solution…)

Btw. what PHP version are you using?
Can you post the configuration and/or post a link to phpinfo? (or mail it to me to jadaw1n@invoiceplane.com )

For phpinfo, create a new file “phpinfo.php” with this content:

<?php phpinfo(); ?>