lots of improvements.
This commit is contained in:
@@ -20,16 +20,19 @@
|
||||
|
||||
(defmethod parse-csv :mama-lus
|
||||
[rows]
|
||||
(println "MAMA LU")
|
||||
(println "MAMA LU4")
|
||||
(transduce
|
||||
(comp (drop 1)
|
||||
(map (fn [[_ po-number despatch-number invoice-number invoice-date customer value :as row]]
|
||||
{:vendor-code "Mama Lu's Foods"
|
||||
:customer-identifier customer
|
||||
:invoice-number (str po-number "-" invoice-number )
|
||||
:date (u/parse-value :clj-time "MM/dd/yy HH:ss" invoice-date)
|
||||
:total value
|
||||
:text (str/join " " row)})))
|
||||
:date (try (u/parse-value :clj-time "M/d/yyyy HH:ss" invoice-date)
|
||||
(catch Exception _
|
||||
(u/parse-value :clj-time "M/d/yyyy" invoice-date)))
|
||||
:total (str/replace value #"," "")
|
||||
:text (str/join " " row)
|
||||
:full-text (str/join " " row)})))
|
||||
conj
|
||||
[]
|
||||
rows))
|
||||
|
||||
Reference in New Issue
Block a user