Adds ability to link across entities more.
This commit is contained in:
@@ -231,6 +231,7 @@
|
||||
{:fields {:id {:type :id}
|
||||
:source {:type 'String}
|
||||
:external_id {:type 'String}
|
||||
:original_entity {:type :id}
|
||||
:amount {:type 'String}
|
||||
:note {:type 'String}
|
||||
:cleared_against {:type 'String}
|
||||
|
||||
@@ -22,21 +22,21 @@
|
||||
|
||||
(defn get-ledger-page [context args value]
|
||||
(let [args (assoc args :id (:id context))
|
||||
[journal-entries journal-entries-count] (l/get-graphql (assoc (<-graphql (:filters args)
|
||||
)
|
||||
[journal-entries journal-entries-count] (l/get-graphql (assoc (<-graphql (:filters args))
|
||||
:id (:id context)))
|
||||
|
||||
journal-entries (mapv
|
||||
(fn [je]
|
||||
(update je :journal-entry/line-items
|
||||
(fn [jels]
|
||||
(mapv
|
||||
(fn [jel]
|
||||
(assoc jel :running-balance (get-in @running-balance-cache [(:db/id (:journal-entry/client je))
|
||||
(:db/id jel)])))
|
||||
(-> je
|
||||
(update :journal-entry/original-entity :db/id)
|
||||
(update :journal-entry/line-items
|
||||
(fn [jels]
|
||||
(mapv
|
||||
(fn [jel]
|
||||
(assoc jel :running-balance (get-in @running-balance-cache [(:db/id (:journal-entry/client je))
|
||||
(:db/id jel)])))
|
||||
|
||||
jels)
|
||||
))
|
||||
)
|
||||
jels)))))
|
||||
journal-entries)]
|
||||
(result->page journal-entries journal-entries-count :journal_entries (:filters args))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user