now invoices are by vendor and company
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
(ns auto-ap.routes.invoices
|
||||
(:require [auto-ap.db.companies :as companies]
|
||||
[auto-ap.db.vendors :as vendors]
|
||||
[auto-ap.db.invoices :as invoices]
|
||||
[auto-ap.parse :as parse]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
@@ -41,8 +42,9 @@
|
||||
(POST "/upload"
|
||||
{{ files "file"} :params :as params}
|
||||
(let [{:keys [filename tempfile]} files
|
||||
companies (companies/get-all)]
|
||||
(invoices/import (parse/parse-file (.getPath tempfile) filename) companies)
|
||||
companies (companies/get-all)
|
||||
vendors (vendors/get-all)]
|
||||
(invoices/import (parse/parse-file (.getPath tempfile) filename) companies vendors)
|
||||
{:status 200
|
||||
:body (pr-str (invoices/get-pending ((:query-params params ) "company")))
|
||||
:headers {"Content-Type" "application/edn"}}))
|
||||
|
||||
Reference in New Issue
Block a user