tons of bug fixes.
This commit is contained in:
@@ -16,6 +16,11 @@
|
||||
(str/includes? (str header) "Closed Date")
|
||||
:sysco-style-1
|
||||
|
||||
(str/includes? (str header) "Business Unit")
|
||||
:mission
|
||||
|
||||
(str/includes? (str header) "Document Number")
|
||||
:philz
|
||||
|
||||
:else
|
||||
nil)
|
||||
@@ -100,6 +105,45 @@
|
||||
[]
|
||||
rows))
|
||||
|
||||
(defmethod parse-csv :mission
|
||||
[rows]
|
||||
(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 (parse-date-fallover invoice-date ["M/d/yyyy HH:ss" "M/d/yyyy HH:mm:ss aa" "M/d/yyyy"])
|
||||
:total (str/replace value #"," "")
|
||||
:text (str/join " " row)
|
||||
:full-text (str/join " " row)})))
|
||||
conj
|
||||
[]
|
||||
rows))
|
||||
|
||||
(defmethod parse-csv :philz
|
||||
[rows]
|
||||
(transduce
|
||||
(comp
|
||||
(filter (fn [[dt _ doc-number name _ status _ _ amount :as row]]
|
||||
(= status "Billed")))
|
||||
|
||||
(map (fn [[dt _ doc-number name _ _ _ _ amount :as row]]
|
||||
(print name)
|
||||
{:vendor-code "PHILZ COFFEE, INC"
|
||||
:customer-identifier name
|
||||
:invoice-number doc-number
|
||||
:date (some-> dt 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)))
|
||||
|
||||
(defmethod parse-csv nil
|
||||
[rows]
|
||||
nil)
|
||||
|
||||
Reference in New Issue
Block a user