Unable to create invoice

v1.6.1 PHP 8.1 Hostinger

I installed v1.6.1 in a subdirectory and created a fresh database. I then imported my database sql from another hosting provider. I am able to see all my invoices and clients.

Viewing works for all items. I am able to create a Client and add a payment. I can also add producs and tasks.

I am unable to create an Invoice or a Quote. Doesn’t matter where I try and create it from. Clicking on the New button does not produce any results. I enabled debug and nothing appears in the log. Nothing appears in the web browser console log.

I noticed that the URL does not change in the browser when I click on the add/new invoice button. This occurs in both Firefox and Chrome browsers.

Any ideas?

1 Like

That’s a great place to start looking.
When you hover over the button, nothing happens in the status bar at the bottom either, correct?

How about when you use the menu options?
I’m interested in what shows at that status bar and whether clicking on that menu option gives you the correct result.

The console log… did you go to the Network tab or just the Javascript tab?
I think that New button is a link, styled as a button, but i’ll have to look at that coming weekend.

You are correct. When I hover over the create invoice or create quote, nothing appears in the status bar. I get the same results from the menu bar as I do from clicking on the buttons. Mouseover does not seem to work for either of those actions.

When you mouseover the menu item, the status bar will display whatever url you were using at the time. That is, if you were on view clients or view quotes, it would display that URL. Create quote and create invoice are the only two items where I see the problem.

1 Like

Check your PM.
When you hover over the button and nothing happens, right-click on that button and see if it belongs to a form.

The menu-items you said were showing something in the status-bar.
But when you click on them, will you still end up at that new page? Or also no response?

If I inspect the buttons or menu items that don’t work, they all have href=“#”

Button to create invoice
<a class="create-invoice btn btn-sm btn-primary" href="#">
            <i class="fa fa-plus"></i> New        </a>

Menu create invoice
<a href="#" class="create-invoice">Create Invoice</a>

I also tried:

  • Firefox private window
  • InvoicePlane 1.6.0 from github
  • PHP 8.2

I retired 3 years ago as a Software Quality Assurance Engineer and my skills are a little rusty but they are coming back the more I work on this.

1 Like

Aha! InvoicePlane isn’t compatible with PHP 8.2.
Let’s go for PHP 8.1 first, please

InvoicePlane 1.6.0 from github
Version 1.6.1 doesn’t have the solution, but may i suggest to go to version 1.6.1 from Github anyway?

ah, you misunderstood. I kept my original install at 1.6.1 PHP 8.1 and then I created a second temporaty install varying things like PHP version and InvoicePlane version. When I saw that neither resolved my problem, I deleted the secondary install.

1 Like

Open up ipconfig.php, you’ll be doing most of the fixing of this problem here …

### START HERE
# Set your URL without trailing slash here, e.g. http://your-domain.com
# If you use a subdomain, use http://subdomain.your-domain.com
# If you use a subfolder, use http://your-domain.com/subfolder
IP_URL=

The href with the # (sortof) triggers an ajax function:

$(document).on('click', '.create-invoice', function () {
            $('#modal-placeholder').load("...your-private-url-in-a-subfolder..index.php/invoices/ajax/modal_create_invoice");
        });

So try to load that Url: ..your-private-url-in-a-subfolder..index.php/invoices/ajax/modal_create_invoice, it should show some entries in your apache or nginx logs.

try to figure out if you’re using Apache or Nginx as your webserver.
If you’re using Apache, then you need to change the .htaccess file

Just got back and started looking at this again. I made progress. I had the shared hosting provider install invoicePlane using their package installer and had it create an empty database. They installed v6.0 and with a clean database, I was able to create an invoice. I then updated that instance to V6.1 and I was still able to create an invoice.

Pointing the new instance to my other database produced the error. So the issue is associated with the database and not the program instance.

The thing that is different about the database that does not work is that it was a transfer from a different hosting provider. I exported the database on the old server using SQL through PHP MyAdmin and then imported it on the new server. While everything shows up properly and I am able to view all my data as it appeared on the old hosting provider, creating an invoice or creating a new client does not seem to work.

My next step is to export the data into a csv and import it using the import feature. I am hoping that the import function will ignore the extra fields that are included when I export the database tables.

So … if you can make an extra instance pointing to your old database, then you’ll have a reproducible problem.
I could look at that this weekend, but i need debug mode on and i need to see that logging.

[quote=“slyskawa, post:9, topic:10648”]
My next step is to export the data into a csv and import it using the import feature.[/quote]

I wouldn’t do that yet.
When you have access to a tool like phpmyadmin, you can copy over the tables 1 by 1.
I would do “data only”
That way you’ll have thr structure that works and the data comes over from the old tables

I can answer that for you:
After exporting the tables from your old database, make sure you leave only the columns that are shown in the example files.

In short: it’s going to be a bloody mess, after you’re exporting 20 columns and want to import 5 columns “hoping” that those 15 columns will be forgotten about

I was able to import using csv files. I do not have access to the original database because it was located on a hosting provider that I no longer have an account with. The problem is easily reproducible. Just create a couple of invoices, export as SQL using default PHPAdmin values, then import them into a new empty database. I’ve done it multiple times with both 1.6.0 and 1.6.1 with the same results.

When I have time, I’ll try removing the structure statements from the SQL export and see if just importing the values fixes the problem.

It would be nice if there was an export function that creates a file or files which allows you to import the data without having to modify them.

1 Like

It’s a feature request, that’s already on the list for V2 of InvoicePlane: Exporting Data for backup using CSV or any other method. · Issue #919 · InvoicePlane/InvoicePlane · GitHub