Skip to content
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

Merged
merged 2 commits into from
Jan 9, 2018

Conversation

brchristian
Copy link
Contributor

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:

  1. Should we make proper canceled and not_canceled scopes for the Order model, to go along with frequently used scopes like complete?

  2. Should the complete scope by default exclude canceled orders unless explicitly called for complete_including_canceled, the way that Product#variants by default excludes the master variant unless and we specify variants_including_master, or how various scopes exclude deleted objects unless we use with_deleted scopes?

If "yes" to either (1) or (2), chime in on this thread and I’m happy to whip up another easy PR.

@mamhoff
Copy link
Contributor

mamhoff commented Aug 17, 2017

  1. Should we make proper canceled and not_canceled scopes for the Order model, to go along with frequently used scopes like complete?

Yes, that would be nice. You can add those to this PR or open a new one.

  1. Should the complete scope by default exclude canceled orders unless explicitly called for complete_including_canceled, the way that Product#variants by default excludes the master variant unless and we specify variants_including_master, or how various scopes exclude deleted objects unless we use with_deleted scopes?

No, complete just means that the order has, at some point in the past, been completed. In the core team, we were discussing we might be missing a name for a scope that is completed.not_canceled, but we did not come up with one.

@brchristian
Copy link
Contributor Author

brchristian commented Aug 17, 2017

@mamhoff That all sounds good to me. I’ve closed the open issue at #2099 and am including here two additional commits: one to add the canceled and not_canceled scopes, and another to refactor the first commit in this branch to use that new syntax.

@brchristian
Copy link
Contributor Author

@mamhoff I think I’ve addressed your notes here, so let me know if there’s anything else I can add to this!

Copy link
Contributor

@mamhoff mamhoff left a 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.

@mamhoff
Copy link
Contributor

mamhoff commented Oct 4, 2017

@brchristian any news on this? Will you be able to add a request spec?

@brchristian
Copy link
Contributor Author

@mamhoff Yes, happy to add a spec! Will try to get to that before the end of this week.

@brchristian
Copy link
Contributor Author

@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.

@mamhoff
Copy link
Contributor

mamhoff commented Oct 4, 2017

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. :)

@brchristian brchristian force-pushed the patch-2 branch 2 times, most recently from ffacec0 to 42278c9 Compare October 4, 2017 22:52
@brchristian
Copy link
Contributor Author

@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 master to boot.

@brchristian
Copy link
Contributor Author

@mamhoff We good to go with this one?

@brchristian
Copy link
Contributor Author

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 master.

I’ve just rebased again if that’s helpful!

@mamhoff
Copy link
Contributor

mamhoff commented Dec 1, 2017

@brchristian thanks for following up! Yes, in my opinion this is good to go, but needs another pair of eyes from the core team.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thanks

@brchristian
Copy link
Contributor Author

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!

@tvdeyen tvdeyen merged commit fb8c724 into solidusio:master Jan 9, 2018
@brchristian brchristian deleted the patch-2 branch January 9, 2018 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants