This commit is contained in:
2021-01-27 14:01:34 -08:00
parent 8bb286b411
commit d2c79bfe9a

View File

@@ -316,7 +316,8 @@
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))
_ (when (and (nil? (:bank-account/check-number bank-account))
(= type :payment-type/check))
(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}))))