fixes
This commit is contained in:
@@ -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))))
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
_ (assert-can-see-client (:id context) (:transaction/client transaction) )
|
||||
db (d/db conn)
|
||||
invoice-clients (set (map (comp :db/id :invoice/client #(d/entity db %)) unpaid_invoice_ids))
|
||||
invoice-amount (reduce + 0.0 (map (comp :invoice/total #(d/entity db %)) unpaid_invoice_ids))]
|
||||
invoice-amount (reduce + 0.0 (map (comp :invoice/outstanding-balance #(d/entity db %)) unpaid_invoice_ids))]
|
||||
(when (or (> (count invoice-clients) 1)
|
||||
(not= (:db/id (:transaction/client transaction))
|
||||
(first invoice-clients)))
|
||||
|
||||
Reference in New Issue
Block a user