Tons of small fixes

This commit is contained in:
Bryce Covert
2020-07-27 21:28:02 -07:00
parent 3737cfa628
commit fdc1d3e9e4
26 changed files with 428 additions and 178 deletions

View File

@@ -70,24 +70,22 @@
[rows]
(println "Importing Sysco-styled 1")
(let [header (first rows)]
(doto
(transduce
(comp (drop 1)
(map (fn [row]
(into {} (map vector header row))))
(map (fn [row]
{:vendor-code nil
:customer-identifier (str (get row "Ship-To Name") " " (or (get row "Ship-To Number")
(get row "\"Ship-To Number\"")))
:invoice-number (str/trim (get row "Invoice Number"))
:date (parse-date-fallover (get row "Invoice Date") ["yyyy-MM-dd"])
:total (str/replace (get row "Original Amount") #"[,\$]" "")
:text (str/join " " (vals row))
:full-text (str/join " " (vals row))})))
conj
[]
rows)
println)))
(transduce
(comp (drop 1)
(map (fn [row]
(into {} (map vector header row))))
(map (fn [row]
{:vendor-code nil
:customer-identifier (str (get row "Ship-To Name") " " (or (get row "Ship-To Number")
(get row "\"Ship-To Number\"")))
:invoice-number (str/trim (get row "Invoice Number"))
:date (parse-date-fallover (get row "Invoice Date") ["yyyy-MM-dd" "M/d/yyyy"])
:total (str/replace (get row "Original Amount") #"[,\$]" "")
:text (str/join " " (vals row))
:full-text (str/join " " (vals row))})))
conj
[]
rows)))
(defmethod parse-csv :mama-lus
[rows]