fixing issue.
This commit is contained in:
@@ -259,7 +259,12 @@
|
|||||||
(defn import-ledger [context args _]
|
(defn import-ledger [context args _]
|
||||||
(assert-admin (:id context))
|
(assert-admin (:id context))
|
||||||
(lc/with-context {:area "import ledger"}
|
(lc/with-context {:area "import ledger"}
|
||||||
(let [all-vendors (by :vendor/name (d-vendors/get-graphql {}))
|
(let [all-vendors (->> (d/q '[:find [?e ...]
|
||||||
|
:in $
|
||||||
|
:where [?e :vendor/name]]
|
||||||
|
(d/db conn))
|
||||||
|
(d/pull-many (d/db conn) d-vendors/default-read)
|
||||||
|
(by :vendor/name))
|
||||||
all-clients (by :client/code (d-clients/get-all ))
|
all-clients (by :client/code (d-clients/get-all ))
|
||||||
all-client-bank-accounts (reduce
|
all-client-bank-accounts (reduce
|
||||||
(fn [acc client]
|
(fn [acc client]
|
||||||
@@ -289,7 +294,12 @@
|
|||||||
{}
|
{}
|
||||||
(:entries args))
|
(:entries args))
|
||||||
_ (audit-transact-batch (vec (vals new-hidden-vendors)) (:id context))
|
_ (audit-transact-batch (vec (vals new-hidden-vendors)) (:id context))
|
||||||
all-vendors (by :vendor/name (d-vendors/get-graphql {}))
|
all-vendors (->> (d/q '[:find [?e ...]
|
||||||
|
:in $
|
||||||
|
:where [?e :vendor/name]]
|
||||||
|
(d/db conn))
|
||||||
|
(d/pull-many (d/db conn) d-vendors/default-read)
|
||||||
|
(by :vendor/name))
|
||||||
all-accounts (transduce (map (comp str :account/numeric-code)) conj #{} (a/get-accounts))
|
all-accounts (transduce (map (comp str :account/numeric-code)) conj #{} (a/get-accounts))
|
||||||
transaction (doall (map
|
transaction (doall (map
|
||||||
(assoc-error (fn [entry]
|
(assoc-error (fn [entry]
|
||||||
|
|||||||
@@ -208,7 +208,11 @@
|
|||||||
(GET "/vendors/export" {:keys [identity]}
|
(GET "/vendors/export" {:keys [identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
(statsd/time! [(str "export.time") {:tags #{"export:vendors"}}]
|
(statsd/time! [(str "export.time") {:tags #{"export:vendors"}}]
|
||||||
(map <-graphql (d-vendors/get-graphql {}))))
|
(map <-graphql (->> (d/q '[:find [?e ...]
|
||||||
|
:in $
|
||||||
|
:where [?e :vendor/name]]
|
||||||
|
(d/db conn))
|
||||||
|
(d/pull-many (d/db conn) d-vendors/default-read)))))
|
||||||
(GET "/ledger/export" {:keys [identity query-params]}
|
(GET "/ledger/export" {:keys [identity query-params]}
|
||||||
(let [start-date (or (some-> (query-params "start-date")
|
(let [start-date (or (some-> (query-params "start-date")
|
||||||
(atime/parse atime/iso-date))
|
(atime/parse atime/iso-date))
|
||||||
|
|||||||
@@ -75,7 +75,12 @@
|
|||||||
|
|
||||||
(defn parse-invoice-rows [excel-rows]
|
(defn parse-invoice-rows [excel-rows]
|
||||||
(let [columns [:raw-date :vendor-name :check :location :invoice-number :amount :client-name :bill-entered :bill-rejected :added-on :exported-on :account-numeric-code]
|
(let [columns [:raw-date :vendor-name :check :location :invoice-number :amount :client-name :bill-entered :bill-rejected :added-on :exported-on :account-numeric-code]
|
||||||
all-vendors (by :vendor/name (d-vendors/get-graphql {}))
|
all-vendors (->> (d/q '[:find [?e ...]
|
||||||
|
:in $
|
||||||
|
:where [?e :vendor/name]]
|
||||||
|
(d/db conn))
|
||||||
|
(d/pull-many (d/db conn) d-vendors/default-read)
|
||||||
|
(by :vendor/name))
|
||||||
all-clients (d-clients/get-all)
|
all-clients (d-clients/get-all)
|
||||||
all-clients (merge (by :client/code all-clients) (by :client/name all-clients))
|
all-clients (merge (by :client/code all-clients) (by :client/name all-clients))
|
||||||
rows (->> (str/split excel-rows #"\n")
|
rows (->> (str/split excel-rows #"\n")
|
||||||
|
|||||||
Reference in New Issue
Block a user