tons of small fixes.
This commit is contained in:
@@ -512,7 +512,7 @@
|
||||
:date [#"Date" 0 0 #"Date: (.*)"]
|
||||
:invoice-number [#"Invoice #" 0 0 #"Invoice #: (.*)"]
|
||||
:account-number [#"Customer #" 0 0 #"Customer #: (.*)"]}
|
||||
:parser { :total [:trim-commas-and-remove-dollars nil]
|
||||
:parser { :total [:trim-commas-and-remove-dollars-and-invert-parentheses nil]
|
||||
:date [:clj-time "MM/dd/yyyy"]}}
|
||||
{:vendor "Mama Lu's Foods"
|
||||
:keywords [#"Mama Lu's Foods"]
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
[_ _ value]
|
||||
(str/replace (str/replace value #"," "") #"\$" ""))
|
||||
|
||||
(defmethod parse-value :trim-commas-and-remove-dollars-and-invert-parentheses
|
||||
[_ _ value]
|
||||
(let [v (str/replace (str/replace value #"," "") #"\$" "")]
|
||||
(if-let [[_ a ] (re-find #"\((.*)\)" v)]
|
||||
(str "-" a)
|
||||
v)))
|
||||
|
||||
(defmethod parse-value :trim-commas-and-negate
|
||||
[_ _ value]
|
||||
(let [[_ raw-value] (re-find #"([\d\.]+)"
|
||||
|
||||
Reference in New Issue
Block a user