btcpayserver icon indicating copy to clipboard operation
btcpayserver copied to clipboard

Exporting invoices to CSV or JSON provides empty results when invoices that aren't complete are selected

Open woutersamaey opened this issue 3 years ago • 10 comments

Describe the bug Exporting invoices to CSV or JSON doesn't work. Empty results.

To Reproduce the bug Steps to reproduce the reported bug:

  1. Go to "Invoices" in the backoffice
  2. Select some invoices or all, doesn't matter
  3. Click Export
  4. Choose "CSV" or "JSON"
  5. You get an empty CSV or an empty JSON

Expected behavior The invoice data should be there for the items I selected.

Screenshots image

image

Your BTCPay Environment (please complete the following information):

  • BTCPay Server Version: 1.1.2.0
  • Deployment Method: Docker
  • Browser: Chrome latest

woutersamaey avatar Jun 18 '21 07:06 woutersamaey

Seems to be working fine for me both for JSON and CSV in v1.1.2.0 in prod deployment.

bolatovumar avatar Jun 19 '21 01:06 bolatovumar

That's very strange.

The only think I can add is that I run BTCPay behind an Nginx load balancer and use SSL offloading, but this has never been an issue.

woutersamaey avatar Jun 19 '21 05:06 woutersamaey

@woutersamaey just tried this again and noticed that only those invoices which have status "complete" will show up in the export (not sure if this is intentional, probably yes?). If you don't have any "complete" invoices yet you will get an empty result set when exporting.

bolatovumar avatar Jun 20 '21 04:06 bolatovumar

Ok so it seams by design then. If this is the case, I'd propose we change this and add a link or button to "Select all complete". It could even be a dropdown with all states, so you can select any status you need. That way, you can easily select the completed invoices first, then export without thinking about the status.

If you guys agree, I can do it with some simple jQuery code or maybe even vanilla JS is that's preferred.

woutersamaey avatar Jun 20 '21 05:06 woutersamaey

@woutersamaey I think it will export just the "complete" status invoices no matter what you selected.

bolatovumar avatar Jun 20 '21 16:06 bolatovumar

Yes. That's why I suggest maybe we should change this behavior or at least make it more idiot proof

woutersamaey avatar Jun 20 '21 16:06 woutersamaey

Yes. That's why I suggest maybe we should change this behavior or at least make it more idiot proof

I agree, it should focus on the current filter in the UI.

Kukks avatar Jun 21 '21 06:06 Kukks

Concept ACK. When a user manually selects an invoice we should obey that selection, because we cannot know or assume why they may need invoices that aren't complete.

pavlenex avatar Jun 21 '21 10:06 pavlenex

@rustywave you can take on this one if you want :)

pavlenex avatar Jul 19 '22 14:07 pavlenex

Submitted a PR for this @pavlenex @Kukks - https://github.com/btcpayserver/btcpayserver/pull/4060

HamroRamro avatar Aug 20 '22 05:08 HamroRamro

Done in #4060 🎉

pavlenex avatar Sep 28 '22 08:09 pavlenex

Guys or Gals I remember investing this and have screen shots from last year when I did this

acapanther avatar Nov 19 '22 20:11 acapanther

It was stolen from my cash app account

acapanther avatar Nov 19 '22 20:11 acapanther