Hopefully makes yodlee less busy.

This commit is contained in:
2022-01-09 08:34:20 -08:00
parent 51e9e6a83b
commit 6c83b40d95
5 changed files with 302 additions and 356 deletions

View File

@@ -174,14 +174,13 @@
(lc/with-context {:area "upload-invoice"}
(log/info "Number of invoices to import is" (count imports) "sample: " (first imports))
(let [clients (d-clients/get-all)
transactions (reduce (fn [result {:keys [invoice-number customer-identifier account-number total date vendor-code text full-text] :as info}]
transactions (reduce (fn [result {:keys [invoice-number customer-identifier account-number total date vendor-code text full-text]}]
(let [
matching-client (or (and account-number
(parse/best-match clients account-number 0.0))
(and customer-identifier
(parse/best-match clients customer-identifier))
(if client
(when client
(first (filter (fn [c]
(= (:db/id c) (Long/parseLong client)))
clients))))