Refactored code

This commit is contained in:
Sergei Tsõganov 2022-08-22 10:23:14 +03:00
parent d589aa1681
commit 72022aab8d
4 changed files with 78 additions and 69 deletions

View file

@ -4,6 +4,15 @@ module Registrar::BookKeeping
DOMAIN_TO_PRODUCT = { 'ee': '01EE', 'com.ee': '02COM', 'pri.ee': '03PRI',
'fie.ee': '04FIE', 'med.ee': '05MED' }.freeze
included do
scope :with_cash_accounts, (lambda do
joins(:accounts)
.where('accounts.account_type = ? AND test_registrar != ?',
Account::CASH,
true)
end)
end
def monthly_summary(month:)
activities = monthly_activites(month)
return unless activities.any?