marks as paid.
This commit is contained in:
@@ -216,6 +216,8 @@
|
||||
|
||||
(make-pdfs (map second checks))
|
||||
(companies/upsert company-id updated-company)
|
||||
(doseq [{:keys [invoice-id]} invoice-payments]
|
||||
(invoices/mark-finished-if-complete invoice-id))
|
||||
{:invoices (mapcat first checks)
|
||||
:pdf-url (merge-pdfs (map (comp :s3-key second) checks))}))
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[auto-ap.db.vendors :as vendors]
|
||||
[auto-ap.db.invoices :as invoices]
|
||||
[auto-ap.db.utils :refer [query]]
|
||||
[auto-ap.utils :refer [by]]
|
||||
[auto-ap.parse :as parse]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[compojure.core :refer [GET POST context defroutes
|
||||
@@ -107,20 +108,10 @@
|
||||
{{:keys [excel-rows]} :edn-params}
|
||||
(let [columns [:raw-date :vendor-name :check :location :invoice-number :amount :company :bill-entered :bill-rejected :added-on :exported-on]
|
||||
|
||||
all-vendors (reduce
|
||||
(fn [x y]
|
||||
(assoc x (:name y) y))
|
||||
{}
|
||||
(vendors/get-all))
|
||||
all-vendors (by :name (vendors/get-all))
|
||||
|
||||
all-companies (reduce
|
||||
(fn [x y]
|
||||
(-> x
|
||||
(assoc (:code y) y)
|
||||
(assoc (:name y) y)))
|
||||
{}
|
||||
(companies/get-all))
|
||||
|
||||
all-companies (companies/get-all)
|
||||
all-companies (merge (by :code all-companies) (by :name all-companies))
|
||||
|
||||
rows (->> (str/split excel-rows #"\n" )
|
||||
(map #(str/split % #"\t"))
|
||||
|
||||
Reference in New Issue
Block a user