From 3777b19ef1fb70d62a02c87f1bfac7c9636f3b17 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Sat, 22 Oct 2022 21:18:27 -0700 Subject: [PATCH] last attempt. --- src/clj/auto_ap/graphql/ledger.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index e33c47ec..deace7e0 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -547,9 +547,9 @@ :journal_entries (reduce (fn [[acc last-je] je] (let [next-je (assoc je :running_balance - (- (+ (:running_balance last-je 0.0) - (:debit je 0.0)) - (:credit je 0.0)))] + (- (+ (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)})})