Merge branch 'master' of bitbucket.org:brycecovertoperations/integreat into master

This commit is contained in:
Bryce Covert
2021-04-05 14:14:55 -07:00

View File

@@ -321,9 +321,15 @@
(let [message (str "The bank account " (:bank-account/name bank-account) " does not have a starting check number. Please ask the integreat staff to initialize it.")]
(throw (ex-info message
{:validation-error message}))))
_ (if (dollars-0? (reduce + 0.0 (filter
#(>= % 0.0)
(map :amount invoice-payments))))
_ (if (->> invoices-grouped-by-vendor
vals
(map (fn [payments]
(->> payments
(map (comp invoice-amounts :db/id))
(reduce + 0.0))))
(filter #(<= % 0.0))
seq)
(throw (ex-info "The selected invoices do not have an outstanding balance."
{:validation-error "The selected invoices do not have an outstanding balance."})))
checks (->> (for [[[vendor-id invoices] index] (map vector invoices-grouped-by-vendor (range))]