So I turned app_debug=true on the old V4.5.19 prior to going through migration. I received the following error message in the laravel.log on the old version:
production.ERROR: ErrorException [0] : /var/www/tools/ninja/storage/framework/views/2dda033f1f1cc1b5912a4fbf9e6449082afd9145.php [Line 4] => Array to string conversion (View: /var/www/tools/ninja/resources/views/migration/includes/errors.blade.php) (View: /var/www/tools/ninja/resources/views/migration/includes/errors.blade.php) {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Curtis Fuller”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36”,“locale”:“en”,“ip”:“35.141.98.216”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/auth”} []
I have started over again, removed everything and changed the database user / password to the admin account and that seems to have helped. Apparently the database user must be the same between the two installations as well. Also, I had to select the “Force Migration” option on the v4.5.19 migration tool to get it to work.
I am now able to get into v5. All of the clients are listed, and their total due. However, there is no “Invoice” listed in the menu, and I can’t find any way of listing the actual invoices. When I switch back to the original “Unititled” business that was added during installation, invoices are listed there.
In the Laravel.log file during the migration an error was logged:
production.ERROR: Division by zero {"userId":1,"exception":"[object] (ErrorException(code: 0): Division by zero at /data/www/live/ninja5/app/Helpers/Invoice/InvoiceItemSum.php:233)
I looked back at the old database and we do have some invoices with either Amt $0 or Qty 0 which could have made the subtotal $0, which could have caused the divide by zero error on that line of the code.
Could this error have caused the invoice option to not be available in V5? Is there anything I can do to restore it?
I tried running php artistan optimize as well as php artisan ninja:check-data and they did not fix, but the later did create many errors which were: “balances do not match Invoice Amount”
Also, I don’t know if I’m missing it, but I can’t find a way to log out of V5.
(The second change was because it was trying to do this on Null for something that wasn’t loaded correctly).
I then had to go in to Settings and account management, and then click on the “Modules” tab and turn on invoices and reoccurring invoices.
I am now having a problem that it will not generate the PDF invoices, but I’ll search the forum for others and if I can’t find anything I’ll start a new thread.
Thanks for the update! Yes, the div/0 looks like a bug picked up on your migration, i’ll add this into the backlog for fixes.
In regards to the PDF, does your system have NPM/Node installed? The most common issue we see in regards to PDF generation is either permissions issues, or NPM/puppeteer not installed correctly on the system, we do have a section for this in the install guide here: