btcpayserver
btcpayserver copied to clipboard
Exporting invoices to CSV or JSON provides empty results when invoices that aren't complete are selected
Describe the bug Exporting invoices to CSV or JSON doesn't work. Empty results.
To Reproduce the bug Steps to reproduce the reported bug:
- Go to "Invoices" in the backoffice
- Select some invoices or all, doesn't matter
- Click Export
- Choose "CSV" or "JSON"
- You get an empty CSV or an empty JSON
Expected behavior The invoice data should be there for the items I selected.
Screenshots
Your BTCPay Environment (please complete the following information):
- BTCPay Server Version: 1.1.2.0
- Deployment Method: Docker
- Browser: Chrome latest
Seems to be working fine for me both for JSON and CSV in v1.1.2.0
in prod deployment.
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 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.
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 I think it will export just the "complete" status invoices no matter what you selected.
Yes. That's why I suggest maybe we should change this behavior or at least make it more idiot proof
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.
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.
@rustywave you can take on this one if you want :)
Submitted a PR for this @pavlenex @Kukks - https://github.com/btcpayserver/btcpayserver/pull/4060
Done in #4060 🎉
Guys or Gals I remember investing this and have screen shots from last year when I did this
It was stolen from my cash app account