From a9a07f380171d496f23a856b7ee8bf957b1a85f9 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 21 Jul 2022 07:12:15 -0700 Subject: [PATCH] fixes for randy etc. --- src/clj/auto_ap/parse/templates.clj | 10 ++++++++++ src/clj/auto_ap/routes/invoices.clj | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/parse/templates.clj b/src/clj/auto_ap/parse/templates.clj index b920df85..f64e3a1a 100644 --- a/src/clj/auto_ap/parse/templates.clj +++ b/src/clj/auto_ap/parse/templates.clj @@ -295,6 +295,16 @@ :parser {:date [:clj-time "MM/dd/yyyy"] :total [:trim-commas-and-negate nil]}} + ;; WINE WAREHOUSE CREDIT 4 + {:vendor "Wine Warehouse" + :keywords [#"WINE WAREHOUSE" #"Credit Memo"] + :extract {:date #"Credit Memo Number/Date\s+\d+\s+([0-9]+/[0-9]+/[0-9]+)" + :customer-identifier #"Ship-To-Party.*\n(.*?)\s{2,}" + :invoice-number #"Credit Memo Number/Date\s+(\d+)" + :total #"Total\s+([0-9]+\.[0-9]{2}-)"} + :parser {:date [:clj-time "MM/dd/yyyy"] + :total [:trim-commas-and-negate nil]}} + ;; WINE WAREHOUSE 2 {:vendor "Wine Warehouse" :keywords [#"WINE WAREHOUSE" #"Bill-to-Party"] diff --git a/src/clj/auto_ap/routes/invoices.clj b/src/clj/auto_ap/routes/invoices.clj index 996ea856..6204d61c 100644 --- a/src/clj/auto_ap/routes/invoices.clj +++ b/src/clj/auto_ap/routes/invoices.clj @@ -427,7 +427,9 @@ _ (s3/put-object (:data-bucket env) s3-location (io/input-stream tempfile) - {:content-type "application/pdf" + {:content-type (if (= "csv" extension) + "text/csv" + "application/pdf") :content-length (.length tempfile)}) imports (->> (parse/parse-file (.getPath tempfile) filename) (map #(assoc %