Can't delete credit

Hi

Having trouble deleting a mystery credit that’s appeared on a client - it’s showing as “Credit created by payment” When I try to delete it, I get a notification to say that the credit has been deleted but it’s still in the list.

If I try to edit it, I get an exception. Checking the logs, I see the following:
[2019-04-03 15:34:14] production.ERROR: Illuminate\Auth\Access\AuthorizationException [0] : /var/www/invoiceninja/vendor/laravel/framework/src/Illuminate/Auth/Access/HandlesAuthorization.php [Line 28] => This action is unauthorized. {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“xxxxxxx”,“method”:“GET”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36”,“locale”:“en”,“ip”:“xx.xx.xx.xx”,“count”:4,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“credits/4/edit”} []

I’m logged in as the main admin user. Any ideas?

Sorry for the late response, my email notification was in my spam folder.

It sounds like the credit was created by overpaying for an invoice. Not sure about the error, I’ll try to reproduce it.

I have exactly the same problem.

Hillel, could you find a solution?

I haven’t been able to reproduce the issue

We both don’t know how did it happen, but it seems we have same problem.

Maybe there’s some workaround, checking DB for broken links or just some way to delete this record manually from DB?
We are using not the self-hosted version, we need your help. :slight_smile:

I can provide more details, so we could address our problem specifically for our setup.

Thank you in advance.

Best regards
Max

Thanks for report, we’ll try to replicate it.

Hi Hillel!

It seems I am beginning to understand when it happens.

We create payment towards a invoice.
Then we find out it was false and delete the payment, assuming it will be deleted completely and balance is back to where it was before.

The balance is back, but it leaves the amount of the payment hanging as credit, which can not be deleted anymore, since it references the deleted payment.

Can we do something about it?

Thanks!

You can always delete the payment manually in the DB

Yes, Randy, but it can be dangerous. Anyways in our case we can’t - we don’t have our own hosted instance.

Maybe if you restore the deleted payment you’ll be able to delete the credit?

I tried, no luck… :frowning:

Any new about the new version?

We hope to release the first alpha in about a month