csv for worldwide produce

This commit is contained in:
2026-01-07 11:32:49 -08:00
parent 4ef2190570
commit 795189ddd3

View File

@@ -32,6 +32,9 @@
(str/includes? (str header) "Due Date")
:ledyard
(str/includes? (str header) "PARENT CUSTOMER NAME")
:worldwide
:else
nil)]
@@ -185,6 +188,23 @@
[]
(drop 1 rows)))
(defmethod parse-csv :worldwide
[rows]
(transduce
(comp
(map (fn [[_ customer-name _ inv date amount :as row]]
{:vendor-code "Worldwide Produce"
:customer-identifier customer-name
:invoice-number (str/replace inv #"[=\"]" "")
:date (some-> date not-empty (parse-date-fallover ["MM/dd/yy"]))
: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]