diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index deace7e0..463e9951 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -544,15 +544,16 @@ :client_id client-id :location location :account account - :journal_entries (reduce - (fn [[acc last-je] je] - (let [next-je (assoc je :running_balance - (- (+ (or (:running_balance last-je 0.0) 0.0) - (or (:debit je 0.0) 0.0)) - (or (:credit je 0.0) 0.0)))] - [(conj acc next-je) next-je])) - [] - journal-entries)})}) + :journal_entries + (first (reduce + (fn [[acc last-je] je] + (let [next-je (assoc je :running_balance + (- (+ (or (:running_balance last-je 0.0) 0.0) + (or (:debit je 0.0) 0.0)) + (or (:credit je 0.0) 0.0)))] + [(conj acc next-je) next-je])) + [] + journal-entries))})})