final.
This commit is contained in:
@@ -256,8 +256,10 @@
|
|||||||
(into [["Vendor Name" "Address" "City" "State" "Zip" "Terms" "Account" "Account Code"]]))]
|
(into [["Vendor Name" "Address" "City" "State" "Zip" "Terms" "Account" "Account Code"]]))]
|
||||||
{:body
|
{:body
|
||||||
(with-open [w (java.io.StringWriter.)]
|
(with-open [w (java.io.StringWriter.)]
|
||||||
(csv/write-csv w data)
|
(csv/write-csv w data
|
||||||
(.toString w))})))
|
:quote? (constantly true))
|
||||||
|
(.toString w))
|
||||||
|
:headers {"Content-Type" "application/csv"}})))
|
||||||
(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))
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
[re-frame.core :as re-frame]
|
[re-frame.core :as re-frame]
|
||||||
[reagent.core :as reagent]
|
[reagent.core :as reagent]
|
||||||
[vimsical.re-frame.cofx.inject :as inject]
|
[vimsical.re-frame.cofx.inject :as inject]
|
||||||
[auto-ap.status :as status]))
|
[auto-ap.status :as status]
|
||||||
|
[clojure.string :as str]))
|
||||||
|
|
||||||
(re-frame/reg-event-fx
|
(re-frame/reg-event-fx
|
||||||
::ready
|
::ready
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
[:<>
|
[:<>
|
||||||
[:div
|
[:div
|
||||||
"Ready! Click "
|
"Ready! Click "
|
||||||
[:a {:href (str "data:attachment/csv;charset=utf-8," (js/encodeURI export-result))
|
[:a {:href (str "data:attachment/csv;charset=utf-8,%EF%BB%BF" (js/encodeURI (str/replace export-result "#" "Number ")))
|
||||||
:target "_blank"
|
:target "_blank"
|
||||||
:download (str "vendors-" (:code client) ".csv")}
|
:download (str "vendors-" (:code client) ".csv")}
|
||||||
"here"]
|
"here"]
|
||||||
|
|||||||
Reference in New Issue
Block a user