awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
866 stars 474 forks source link

Export data to show actions taken in time period #5950

Open vegasgeek opened 7 years ago

vegasgeek commented 7 years ago

When using Reports -> Export -> Export Payment History, the report doesn't take into account when a new action has happened to an order. For example, let's say I have a customer who purchased a product at the end of July. On August 1st, I run my reports to close out July and that should be that.

If the client asks for a refund sometime in August, running a report for the month of August is not going to show that the refund took place. It will, instead, have updated the record from July by changing the status from complete to refunded. This means running the July report again would have different totals than when I ran it on August 1st.

I don't have an exact solution on how I would go about fixing this. One thought I had was if the data for a sale was stored as a transaction, but then a change to that order could be stored as a separate record, each with their own time-stamp, you'd be able to run a report that showed the number of specific actions that took place in the time frame: sales, refunds, renewals, renewal_refunds, etc.

cklosowski commented 7 years ago

@vegasgeek I think this will be far more feasible when we approach #4576 (custom tables) since we'll have a better method of storing 'transactional meta' about payments in a way that is easily searched and filtered out. I'm going to tag it for a future version, and see if it's something that we can include in the approach and data management.

sunnyratilal commented 6 years ago

This has been indirectly done with #2721 and the fact that orders are now immutable. We'll do some further testing to ensure it's reported correctly in the export.