Duplicate Billing - Negative Balances

I recently had an issue with the invoice system where my clients were getting payment failed errors on Stripe even though the transactions went through. This resulted in my invoices now showing negative balances (e.g. -$500) even after I refund the payments.

Is there a way for me to get my invoices back to the correct amount. I’d rather not have to recreate every single invoice.

That’s a serious problem, are you running the latest version of our app?

If you have command line access you can run the following command to check for the problem.

php artisan ninja:check-data

And then to fix it

php artisan ninja:check-data --fix=true

Hello,

Thank you so much for the prompt reply. This issue came up shortly before updating. When I updated however I had some additional issues so I had to roll back. I’ll try upgrading again and then running those commands.

If you can share the errors you’re seeing when updating we’ll try to help.

Right now I have the following:

Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Class log does not exist’ in /home/charles/public_html/invoice/bootstrap/cache/compiled.php:1336 Stack trace: #0 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1336): ReflectionClass->__construct(‘log’) #1 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminate\Container\Container->build(‘log’, Array) #2 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1848): Illuminate\Container\Container->make(‘log’, Array) #3 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1391): Illuminate\Foundation\Application->make(‘Psr\Log\LoggerI…’) #4 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1368): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1354): Illuminate\Container\Container->getDependencies(Array, Array) #6 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminat in /home/charles/public_html/invoice/bootstrap/cache/compiled.php on line 1336

This was with a softalicious upgrade

You most likely have a space in your .env file not wrapped in quotes.

This change was introduced by our upgrade to Laravel 5.2.

You can fix it by changing:

KEY=some value

To

KEY=‘some value’

Hello, I tried enclosing the value (lines below) as instructed but I’m still getting errors. I tried editing each line one at a time and then both, but the software didn’t work.

PHANTOMJS_CLOUD_KEY=‘a-demo-key-with-low-quota-per-ip-address’ (that line was set to that value)

APP_KEY=‘filtered out

Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Class log does not exist’ in /home/charles/public_html/invoice/bootstrap/cache/compiled.php:1336 Stack trace: #0 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1336): ReflectionClass->__construct(‘log’) #1 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminate\Container\Container->build(‘log’, Array) #2 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1848): Illuminate\Container\Container->make(‘log’, Array) #3 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1391): Illuminate\Foundation\Application->make(‘Psr\Log\LoggerI…’) #4 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1368): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1354): Illuminate\Container\Container->getDependencies(Array, Array) #6 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminat in /home/charles/public_html/invoice/bootstrap/cache/compiled.php on line 1336

Note: you only need to add quotes if the value on the line contains a space.

Hello - I fixed the key so there’s no spaces and I’m still getting the following:

Fatal error: Uncaught exception ‘ReflectionException’ with message ‘Class log does not exist’ in /home/charles/public_html/invoice/bootstrap/cache/compiled.php:1336 Stack trace: #0 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1336): ReflectionClass->__construct(‘log’) #1 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminate\Container\Container->build(‘log’, Array) #2 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1848): Illuminate\Container\Container->make(‘log’, Array) #3 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1391): Illuminate\Foundation\Application->make(‘Psr\Log\LoggerI…’) #4 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1368): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1354): Illuminate\Container\Container->getDependencies(Array, Array) #6 /home/charles/public_html/invoice/bootstrap/cache/compiled.php(1290): Illuminat in /home/charles/public_html/invoice/bootstrap/cache/compiled.php on line 1336

Is it possible there’s another space in the file, I’m not aware of another problem which causes this error.

Hello,

Yep, turns out I had an issue with the from name. Sorry about that.

I’m now getting this error: The Process class relies on proc_open, which is not available on your PHP installation.

Just an update - I had the proc service enabled.

When I try entering payments now I get a white page which simply says unauthorized

It sounds like the last database migration may not have completed, can you check what you see when loading /update in your browser.

Hello, thanks for the reply. Is there any way to do a repair install? I rolled back from a backup multiple times maybe that’s why I’m in this position.

If not can I port my invoices into a new install?

If you have a backup you should be able to use it with a new install. You just need to copy over the APP_KEY value from the .env file to make sure the encryption is the same.

This should be fixable though, what do you see on /update.

I’m getting the message below:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘fonts’ already exists (SQL: create table fonts (id int unsigned not null auto_increment primary key, name varchar(255) not null, folder varchar(255) not null, css_stack varchar(255) not null, css_weight smallint not null default ‘400’, google_font varchar(255) not null, normal varchar(255) not null, bold varchar(255) not null, italics varchar(255) not null, bolditalics varchar(255) not null, is_early_access tinyint(1) not null, sort_order int unsigned not null default ‘10000’) default character set utf8 collate utf8_unicode_ci)

Try commenting out the code in the up function in the following file and then try again.

database/migrations/2016_01_06_153144_add_invoice_font_support.php

Actually I think this might be resolved. I just rolled back the files. Redid the update, then redid the ’ ’ fix.

Now it seems like I’m able to make all the needed adjustments.

I think like you mentioned it was a case of me rolling back and not updating properly.

I’ll post if I see any other issues but thanks for your patience!

Actually I’m still getting the unauthorized error and the invoice amounts aren’t keeping in sync with me reconciling the duplicate payments.

Are you seeing any errors when loading /update