This commit is contained in:
2021-01-26 08:19:48 -08:00
parent d50f889099
commit c3bea47093
6 changed files with 19 additions and 11 deletions

View File

@@ -316,6 +316,10 @@
invoices-grouped-by-vendor (group-by (comp :db/id :invoice/vendor) invoices)
bank-account (d-bank-accounts/get-by-id bank-account-id)
_ (validate-belonging client-id invoices bank-account)
_ (when (nil? (:bank-account/check-number bank-account))
(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))))