Created
May 4, 2017 04:21
-
-
Save marcoslebron/b0f8b4c353d20082a52dc4d4c2486c2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def outstanding_totals | |
Invoice.with_state(:sent).to_a.sum(&:total_cents) | |
end | |
def drafted_totals | |
Invoice.with_state(:drafted).to_a.sum(&:total_cents) | |
end | |
def paid_totals | |
Invoice.with_state(:paid).to_a.sum(&:total_cents) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment