From 824a12f4b04f2df1a56eeb412eca199fb7878a3e Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sat, 22 Oct 2022 21:48:53 -0700 Subject: [PATCH] test --- src/clj/auto_ap/graphql/ledger.clj | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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))})})