This commit is contained in:
Bryce Covert
2019-04-11 15:13:53 -07:00
parent 5d93e3a5a3
commit e217bad88e

View File

@@ -28,7 +28,6 @@
(= (:asc args) false) (reverse)))
(defn apply-sort-2 [args results ]
(let [comparator (if (= (:asc args) false)
(fn [x y] (compare y x))
(fn [x y] (compare x y)))]
@@ -50,14 +49,13 @@
(:sort-by args) (add-sorter-field {"client" ['[?e :transaction/client ?c]
'[?c :client/name ?sorter]]
"account" #_['[(get-else $ ?e :transaction/account 0) ?sorter]]
['[?e :transaction/date]
'(or-join [?e ?sorter]
(and [?e :transaction/account ?c]
[?c :account/name ?sorter])
(and
(not [?e :transaction/account])
[(ground "") ?sorter]))]
"account" ['[?e :transaction/date]
'(or-join [?e ?sorter]
(and [?e :transaction/account ?c]
[?c :account/name ?sorter])
(and
(not [?e :transaction/account])
[(ground "") ?sorter]))]
"description-original" ['[?e :transaction/description-original ?sorter]]
"date" ['[?e :transaction/date ?sorter]]
"amount" ['[?e :transaction/amount ?sorter]]