a lot of progress on typeaheads, etc.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user