csv for worldwide produce
This commit is contained in:
@@ -32,6 +32,9 @@
|
|||||||
|
|
||||||
(str/includes? (str header) "Due Date")
|
(str/includes? (str header) "Due Date")
|
||||||
:ledyard
|
:ledyard
|
||||||
|
|
||||||
|
(str/includes? (str header) "PARENT CUSTOMER NAME")
|
||||||
|
:worldwide
|
||||||
|
|
||||||
:else
|
:else
|
||||||
nil)]
|
nil)]
|
||||||
@@ -185,6 +188,23 @@
|
|||||||
[]
|
[]
|
||||||
(drop 1 rows)))
|
(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]}
|
#_{:clj-kondo/ignore [:unused-binding]}
|
||||||
(defmethod parse-csv nil
|
(defmethod parse-csv nil
|
||||||
[rows]
|
[rows]
|
||||||
|
|||||||
Reference in New Issue
Block a user