south bay produce.

This commit is contained in:
Bryce Covert
2019-10-24 20:16:28 -07:00
parent 84e202bab9
commit aa90c1b4c1
4 changed files with 44 additions and 21 deletions

View File

@@ -163,7 +163,7 @@
(let [clients (d-clients/get-all)
_ (println imports)
transactions (reduce (fn [result {:keys [invoice-number customer-identifier total date vendor-code text] :as info}]
transactions (reduce (fn [result {:keys [invoice-number customer-identifier total date vendor-code text full-text] :as info}]
(println "searching for" vendor-code)
(let [[matching-vendor default-expense-account] (->> (d/query
{:query {:find ['?vendor '?default-expense-account]
@@ -175,7 +175,7 @@
_ (println matching-vendor)
matching-client (parse/best-match clients customer-identifier)
_ (println "New invoice matches client" matching-client)
matching-location (parse/best-location-match matching-client text )
matching-location (parse/best-location-match matching-client text full-text)
[existing-id existing-outstanding-balance existing-status import-status] (when (and matching-client matching-location)
(->> (d/query
(cond-> {:query {:find ['?e '?outstanding-balance '?status '?import-status2]