a lot of progress on typeaheads, etc.

This commit is contained in:
Bryce Covert
2018-05-23 11:27:31 -07:00
parent 1a72859bd8
commit e445adec02
18 changed files with 214 additions and 85 deletions

View File

@@ -126,15 +126,17 @@
(assoc (base-graphql args) :select [:%count.*])))))
(defn import [parsed-invoices companies vendors]
(insert-multi!
(for [{:keys [total date invoice-number customer-identifier vendor-code] :as row} parsed-invoices]
(do
(dissoc (assoc row
:company-id (:id (parse/best-match companies customer-identifier))
:vendor-id (:id (first (filter #(= (:code %) vendor-code) vendors)))
:imported false
:potential-duplicate false)
:vendor-code)))))
(->> (insert-multi!
(for [{:keys [total date invoice-number customer-identifier vendor-code] :as row} parsed-invoices]
(do
(dissoc (assoc row
:company-id (:id (parse/best-match companies customer-identifier))
:vendor-id (:id (first (filter #(= (:code %) vendor-code) vendors)))
:imported false
:potential-duplicate false)
:vendor-code))))
(map db->clj)))
(defn apply-payment [invoice-id amount]
(j/db-do-prepared (get-conn)