supporting fixing of check numbers.

This commit is contained in:
BC
2019-02-13 21:55:14 -08:00
parent 8bb998dec1
commit 6c4cfadc0b
3 changed files with 13 additions and 2 deletions

View File

@@ -254,7 +254,6 @@
(-> []
(conj payment)
(conj [:inc (:db/id bank-account) :bank-account/check-number 1])
(into (invoice-payments invoices invoice-amounts)))))
@@ -289,7 +288,10 @@
checks (->> (for [[[vendor-id invoices] index] (map vector invoices-grouped-by-vendor (range))]
(invoices->entities invoices (vendors vendor-id) client bank-account type index invoice-amounts))
(reduce into [])
doall)]
doall)
checks (if (= type :payment-type/check)
(conj checks [:inc (:db/id bank-account) :bank-account/check-number (count invoices-grouped-by-vendor)])
checks)]
(when (= type :payment-type/check)
(make-pdfs (filter #(= :payment-type/check (:payment/type %)) checks)))
@(d/transact (d/connect uri) checks)