minor fixes.

This commit is contained in:
2022-12-11 07:17:30 -08:00
parent 6620666ca1
commit 51c7bc9bdb
2 changed files with 13 additions and 5 deletions

View File

@@ -518,8 +518,8 @@
{:filters {:client_id client-id
:location location
:date_range (:date_range input)
:from_numeric_code (get-in l-reports/ranges [category 0])
:to_numeric_code (get-in l-reports/ranges [category 1])
:from_numeric_code (l-reports/min-numeric-code category )
:to_numeric_code (l-reports/max-numeric-code category )
:per_page Integer/MAX_VALUE}}
nil)
:journal_entries
@@ -528,9 +528,7 @@
(filter (fn [jel]
(when-let [account (account-lookup (:id (:account jel)))]
(and
(<= (get-in l-reports/ranges [category 0])
(:numeric_code account)
(get-in l-reports/ranges [category 1]))
(l-reports/account-belongs-in-category? (:numeric-code account) category)
(= location (:location jel)))))
)
(map (fn [jel ]

View File

@@ -82,6 +82,16 @@
["35000-40000 Other" 35000 39999]]
:bottom-line [["11000-12000 Bottom Line" 11000 11999]]})
(defn min-numeric-code [category]
(->> (groupings category)
(map second)
(apply min)))
(defn max-numeric-code [category]
(->> (groupings category)
(map second)
(apply max)))
(def flat-categories
(for [[category groups] groupings