adding most simple balance sheet report.
This commit is contained in:
@@ -761,5 +761,28 @@
|
||||
|
||||
|
||||
|
||||
(defn add-sorter-field [q sort-map args]
|
||||
(merge-query q
|
||||
{:query {:find ['?sorter]
|
||||
:where (sort-map
|
||||
(:sort-by args)
|
||||
(println "Warning, trying to sort by unsupported field" (:sort-by args)))}}))
|
||||
|
||||
(defn apply-sort [args sort-fn results ]
|
||||
(cond->> results
|
||||
sort-fn (sort-by sort-fn)
|
||||
(= (: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)))]
|
||||
(sort comparator results )))
|
||||
|
||||
(defn apply-pagination [args results]
|
||||
|
||||
{:ids (->> results
|
||||
(drop (:start args 0))
|
||||
(take (:count args 100))
|
||||
(map last))
|
||||
:count (count results)})
|
||||
|
||||
Reference in New Issue
Block a user