Merge branch 'master' of bitbucket.org:brycecovertoperations/integreat into master
This commit is contained in:
@@ -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.")]
|
(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
|
(throw (ex-info message
|
||||||
{:validation-error message}))))
|
{:validation-error message}))))
|
||||||
_ (if (dollars-0? (reduce + 0.0 (filter
|
|
||||||
#(>= % 0.0)
|
_ (if (->> invoices-grouped-by-vendor
|
||||||
(map :amount invoice-payments))))
|
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."
|
(throw (ex-info "The selected invoices do not have an outstanding balance."
|
||||||
{:validation-error "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))]
|
checks (->> (for [[[vendor-id invoices] index] (map vector invoices-grouped-by-vendor (range))]
|
||||||
|
|||||||
Reference in New Issue
Block a user