invoice parsing fixes.
This commit is contained in:
@@ -172,8 +172,8 @@
|
||||
(map (fn [[invoice-number date due amount standard :as row]]
|
||||
{:vendor-code "Performance Food Group - LEDYARD"
|
||||
:invoice-number invoice-number
|
||||
:date (some-> date not-empty (parse-date-fallover ["MM/dd/yyyy"]))
|
||||
:due (some-> due not-empty (parse-date-fallover ["MM/dd/yyyy"]))
|
||||
:date (some-> date not-empty (parse-date-fallover ["MM/dd/yy"]))
|
||||
:due (some-> due not-empty (parse-date-fallover ["MM/dd/yy"]))
|
||||
:total (str/replace amount #"[\$,]" "")
|
||||
:text (str/join " " row)
|
||||
:full-text (str/join " " row)}))
|
||||
|
||||
@@ -418,6 +418,16 @@
|
||||
:total #" Total:\s+([\d\.]+)"}
|
||||
:parser {:date [:clj-time "MMM dd, yyyy"]}}
|
||||
|
||||
;; BiRite -- parent company for a&b produce
|
||||
{:vendor "BiRite"
|
||||
:keywords [#"BIRITE"]
|
||||
:extract {:date #"([0-9]+/[0-9]+/[0-9]+)"
|
||||
:customer-identifier #"BILL TO.*\n.*?\s{2,}(.*?)\s{2,}"
|
||||
:invoice-number #"INVOICE#\n.*?(\d+)\n"
|
||||
:total #"INV TOTAL \s+([\d\.\-]+)"}
|
||||
:parser {:date [:clj-time "MM/dd/yyyy"]
|
||||
:total [:trim-commas-and-negate nil]}}
|
||||
|
||||
;; A&B
|
||||
{:vendor "A&B Produce"
|
||||
:keywords [#"ABProduce"]
|
||||
|
||||
Reference in New Issue
Block a user