diff --git a/src/clj/auto_ap/graphql/ledger.clj b/src/clj/auto_ap/graphql/ledger.clj index f256a449..614d2fe7 100644 --- a/src/clj/auto_ap/graphql/ledger.clj +++ b/src/clj/auto_ap/graphql/ledger.clj @@ -9,7 +9,7 @@ [clj-time.coerce :as coerce] [clojure.string :as str] [clj-time.core :as time] - [auto-ap.parse :as parse] + [auto-ap.parse.util :as parse] [datomic.api :as d] [auto-ap.parse.templates :as t] [auto-ap.datomic.clients :as d-clients])) @@ -211,6 +211,8 @@ (get all-client-locations (:client_code entry)) (:location ea)) (throw (Exception. (str "Location '" (:location ea) "' not found.")))) + (when (< (or (:debit ea) (:credit ea)) 0.0) + (throw (Exception. (str (or (:debit ea) (:credit ea)) "must be greater than 0.")))) (when (and (not (all-accounts (:account_identifier ea))) (not (get (get all-client-bank-accounts (:client_code entry))