fixes invoice import issues, fixes issue with too many keys in s3 for general produce.
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
(str/includes? (str header) "DISCOUNT_MESSAGE")
|
||||
:wismettac
|
||||
|
||||
(str/includes? (str header) "Status")
|
||||
:ledyard
|
||||
|
||||
:else
|
||||
nil)]
|
||||
(log/info "csv type was determined to be" csv-type)
|
||||
@@ -162,6 +165,23 @@
|
||||
[]
|
||||
(drop 1 rows)))
|
||||
|
||||
(defmethod parse-csv :ledyard
|
||||
[rows]
|
||||
(transduce
|
||||
(comp
|
||||
(map (fn [[invoice-number date due amount standard :as row]]
|
||||
{:vendor-code "Performance Food Group - LEDYARD"
|
||||
:invoice-number invoice-number
|
||||
:date (some-> date not-empty (parse-date-fallover ["MM/dd/yyyy"]))
|
||||
:due (some-> due not-empty (parse-date-fallover ["MM/dd/yyyy"]))
|
||||
:total (str/replace amount #"[\$,]" "")
|
||||
:text (str/join " " row)
|
||||
:full-text (str/join " " row)}))
|
||||
)
|
||||
conj
|
||||
[]
|
||||
(drop 1 rows)))
|
||||
|
||||
#_{:clj-kondo/ignore [:unused-binding]}
|
||||
(defmethod parse-csv nil
|
||||
[rows]
|
||||
|
||||
Reference in New Issue
Block a user