Jump to content

Problem with invoices


Recommended Posts

Hello, I have a problem with whmcs invoices.

First, I had these errors:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous in /var/www/clients/vendor/illuminate/database/Connection.php:333

 

Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'status' in where clause is ambiguous (SQL: select IFNULL(total, 0) as total, IFNULL(SUM(amountin), 0) as amount_in, IFNULL(SUM(amountout), 0) as amount_out from tblinvoices inner join tblinvoiceitems on tblinvoiceitems.invoiceid = tblinvoices.id left join tblaccounts on tblaccounts.invoiceid = tblinvoices.id where tblinvoices.userid = 1 and status = Unpaid and type != Invoice group by tblinvoices.id) in /var/www/clients/vendor/illuminate/database/Connection.php:713

Then I was advised to do, which now gives these errors:

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'where clause' in /var/www/clients/vendor/illuminate/database/Connection.php:333

 

Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'status' in 'where clause' (SQL: select IFNULL(total, 0) as total, IFNULL(SUM(amountin), 0) as amount_in, IFNULL(SUM(amountout), 0) as amount_out from tblinvoices left join tblaccounts on tblaccounts.invoiceid = tblinvoices.id where tblinvoices.userid = 1 and status = Unpaid and 1 = 1 group by tblinvoices.id) in /var/www/clients/vendor/illuminate/database/Connection.php:713

Does anyone have a solution?

Regards.

Link to comment
Share on other sites

  • 3 months later...
  • WHMCS Support Manager

Hi there,

We've determined that similar errors to this have been caused by modifications to the MySQL database schema - presumably the result of an after-market module.

In the cases our technical support team have handled, one or more of the following additional columns had been added to the tblinvoiceitems table:

  • status
  • created_at
  • updated_at

We also found evidence of some custom triggers added to tblinvoices and tblorders.

Please consult with the vendor of your after-market module vendor on the presence of these tables and suitability of removing them. At the time of writing, these fields are not used by a stock WHMCS installation.

The standard schema for these tables is described by the schema.sql files in the /resources/sql/install/ directory.

I recommend consulting with a qualified database administrator to restore the modified table schemas to their original state.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated