mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
parent
7e0ec4bd8f
commit
e617d791d3
4 changed files with 19 additions and 7 deletions
|
@ -107,6 +107,18 @@ class Category < ApplicationRecord
|
|||
family.category_stats.month_total_for(self, date: date)
|
||||
end
|
||||
|
||||
def avg_monthly_total_money
|
||||
Money.new(avg_monthly_total, family.currency)
|
||||
end
|
||||
|
||||
def median_monthly_total_money
|
||||
Money.new(median_monthly_total, family.currency)
|
||||
end
|
||||
|
||||
def month_total_money(date: Date.current)
|
||||
Money.new(month_total(date: date), family.currency)
|
||||
end
|
||||
|
||||
private
|
||||
def category_level_limit
|
||||
if subcategory? && parent.subcategory?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue