check for less than 0.

This commit is contained in:
Bryce Covert
2019-10-26 23:06:30 -07:00
parent bf89befbc9
commit f57ae88daa

View File

@@ -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))