-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude canceled orders from sales report #2131
Conversation
Yes, that would be nice. You can add those to this PR or open a new one.
No, |
@mamhoff I think I’ve addressed your notes here, so let me know if there’s anything else I can add to this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding a simple request spec to document this behaviour change? Otherwise, this would be good with me.
@brchristian any news on this? Will you be able to add a request spec? |
@mamhoff Yes, happy to add a spec! Will try to get to that before the end of this week. |
@mamhoff Actually, just added the specs now. That should take care of it. Let me know if you want anything further and I’m happy to add it; otherwise I think we are probably good to merge. |
I actually do. I think the model-level changes (including the spec, which is perfect) should go into one commit, and then we should have another commit that changes the controller to use the new scope. Sorry to be so picky, but we'll all be thankful when we go back to the history of this. :) |
ffacec0
to
42278c9
Compare
@mamhoff No worries, that sounds great. I’ve done a reorganization of those commits as you suggest, and have thrown in a rebase onto the latest |
@mamhoff We good to go with this one? |
Hi @mamhoff just wanted to ping and see if we are good to go, would it be possible to merge this? We have been adding this in our app through a decorator and it’d be nice to remove that and simply be able to use the latest I’ve just rebased again if that’s helpful! |
@brchristian thanks for following up! Yes, in my opinion this is good to go, but needs another pair of eyes from the core team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks
Hi @tvdeyen are we good to merge this? Lmk if there is anything more we need and I am happy to hop on it. Cheers! |
As I mentioned in issue #2099, by default the Sales Total report does not exclude canceled orders from the sales totals. This is the "minimum viable PR" to fix that issue.
I’m open to further discussion from the Solidus community around the following:
Should we make proper
canceled
andnot_canceled
scopes for theOrder
model, to go along with frequently used scopes likecomplete
?Should the
complete
scope by default exclude canceled orders unless explicitly called forcomplete_including_canceled
, the way thatProduct#variants
by default excludes the master variant unless and we specifyvariants_including_master
, or how various scopes exclude deleted objects unless we usewith_deleted
scopes?If "yes" to either (1) or (2), chime in on this thread and I’m happy to whip up another easy PR.