1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-02 20:15:22 +02:00

Show budget averages in family currency
Some checks failed
Publish Docker image / ci (push) Has been cancelled
Publish Docker image / Build docker image (push) Has been cancelled

Fixes #1689
This commit is contained in:
Zach Gollwitzer 2025-01-24 20:19:13 -05:00
parent 7e0ec4bd8f
commit e617d791d3
4 changed files with 19 additions and 7 deletions

View file

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